Just got my OPO… Some functional testing is in order:
Found myself resizing pictures recently, and guessing dimensions didn’t seem like fun. This article did help with that aspect:
Now I’ve got photos downsized to 5mp:
$ convert foo.jpg -resize 2560×1920 foo_new.jpg
Building ansible playbooks for freebsd setup I came to a roadblock – pkgng demands to be bootstrapped interactively. However looking at it’s source code I’ve found the backdoor:
ASSUME_ALWAYS_YES=yes pkg bootstrap -f
and I’ve got things rolling. Overall “ASSUME_ALWAYS_YES” seems to go further then some “-y” switches.
While setting up my FreeBSD box – I oopsed a bit and pointed
make build world to wrong directory. While trying to clean up I did:
# rm -rf /mnt/foo.oops
and all I got is a bunch of
Operation not permitted for certain files.
I did some digging and found that
# chflags -R noschg /mnt/foo
was the solution
I got bitten more than once with device rooting recently with My Samsung Galaxy S4 and Nexus 7 (2013) and Nexus 10. The latter made me think that something is amiss and my recovery mode was botched. So I went looking just to stumble upon:
fastboot erase recovery fastboot erase system -w fastboot erase boot # Download latest twrp/cwm recovery # Check md5sum fastboot flash recovery nameofrecovery.img
I have decided to try out UniFi AP for my home WiFi setup and either because of my “consumer-grade” switch etc. or some other reason I just couldn’t get it recognized on my “Controller” … so I had to look. Winning combination was:
- write down MAC of UniFi AP
- on my DHCP server track down UniFi AP’s acquired IP
- SSH into UniFi AP unit (factory defaults creds are ubnt/ubnt)
- Issue command
- Adopt on controller (simple drop on the map is what worked for me)
- Reissue command –
- AP is adopted and workable now
As a side-note controller software that runs on Linux required some iptables mashing as well since I was using remote browser:
# firewall-cmd --zone=home --add-port 8080/tcp # firewall-cmd --zone=home --add-port 8443/tcp # firewall-cmd --zone=home --add-port 8880/tcp # firewall-cmd --zone=home --add-port 8843/tcp
This opens up ports only for the current session (runtime), after reboot those changes will be gone and if we need to retain them “–permanent” should be added and commands re-run.
I’m playing a lot with Ansible those days and one of the topics that does come up all the time is how do I set certain values in config files that are not plain-text or .ini style? Special mention goes to Apache configs that are neither plain-text nor XML (ugh) and tomcat (well at least it’s XML…).
Augeas is a swiss-army-knife for a sysadmin as it “understands” multiple configuration formats (lens’) and can deal with them in it’s own way.
So here’s what I needed to do: Setting up ownCloud VM on Fedora 20 I needed to edit /etc/httpd.d/conf.d/owncloud.conf file to override default restriction for localhost, in other words adding
Require all granted to the end of
<Directory "/usr/share/owncloud"> section. Perl and Python are fun but you practically need to build your own parser. Not me. Not today. So here’s how we handle things with augeas:
create command file /tmp/ocloud_aug, like so:
defvar conf /files/etc/httpd/conf.d/owncloud.conf load # Get <Directory "/usr/share/owncloud"> subtree defvar ocloud_dir $conf/Directory[arg="/usr/share/owncloud/"] touch $ocloud_dir/directive[last()+1] defvar last_stmt $ocloud_dir/directive[last()] set $last_stmt Require set $last_stmt/arg all set $last_stmt/arg granted save
Hint: before going around modifying your live system consider one of two testing methods:
- setup $AUGEAS_ROOT to whatever directory you want to play in:
# mkdir /tmp/aug # export AUGEAS_ROOT=/tmp/aug # cp -r /etc $AUGEAS_ROOT
- adding “-n” flag to augtool invocation:
# augtool -n ...
So now from:
... <Directory "/usr/share/owncloud"> ... Require local ... </Directory>
... <Directory "/usr/share/owncloud"> ... Require local ... Require all granted </Directory>
after we run:
# augtool -f /tmp/ocloud_aug
That just about solves our problem of programmatically adding configuration lines. We could also remove offending “Require local”:
After recent crash of my laptop (hardware died) my QCOW2 images suffered minor damage and for the heck I couldn’t convince Fedora VM to auto-fsck itself so I had to go all manual after N-th prompt from dracut shell about problems starting up.
Turns out it’s not so complicated to get to the guts of the QCOW2 after all:
# modprobe nbd max_part=16 # qemu-nbd --connect=/dev/nbd0 /var/lib/libvirt/images/foo.qcow2 # fdisk -l /dev/nbd0 # pvscan # vgchange -a y fedora # fsck.ext4 -y /dev/fedora/rootfs # vgchange -a n fedora # qemu-nbd --disconnect /dev/nbd0
In above snippet “fedora” is my VM’s VG name and rootfs was the offending LV