Saturday 17 December 2011

Resize images on the command line

I've recently been buying allot of digital downloads and it seems a waste that the album art encoded into the track is often 1500x1500 and taking up valuable disk space.

A quick blast with Graphics Magick solves all

gm mogrify -scale 25% Artwork.jpg

Saturday 10 December 2011

Rsync happiness

I recently got around to setting up a backup of my data. I decided rather than using something like Drop Box (which i'm sure is great) I'd keep things simple and set up a new EBS volume on my EC2 box and rsync my data there.

Here was the initial command I used to get the first sync in place manually.

rsync -arvzh --progress -e 'ssh -i path to pub key' /dir/to/backup user@host:/backup/dir/here

A quick review of the flags

-a archive mode (preserve timestamps)
-r recurse into directories
-v verbose
-z compress data during transfer
-h output in human readable format
--progress show a nice progress meter (won't want this in script)

-e specify remote shell and put any further args in quotes