When setting up passwordless logins I always seem to miss a step. The following link is a useful resource.

SSH with Keys HOWTO: SSH with Keys in a console window.

 

This little script will remove all SVN dirs from a directory tree:

find . -name “.svn” -type d -exec rm -rf {} \;

Credit to http://snippets.dzone.com/posts/show/2486

 

Converting and resizing from source files to web-ready files is easy with ImageMagick. Searching the web, I was able to put together this little script that saves a lot of time over the alternative (using photoshop batch processing).


#!/bin/sh

IMAGE_TYPE=jpg
SRC=src-images

for file in $SRC/*
do
        filename=${file%.tif}
        filename=${filename/src-images\//}
        echo "converting $file to $filename"
        convert $file -resize 500 covers/products_lg/$filename.$IMAGE_TYPE
        convert $file -resize 200 covers/products_med/$filename.$IMAGE_TYPE
        convert $file -resize 72 covers/products_sm/$filename.$IMAGE_TYPE
done

Anyone know how I can simplify that nasty regex: filename=${filename/src-images\//}

I don’t want to hard-code in the dir name. Unfortunately, I don’t have time to master bash now. I’ll live, and even be quite happy, which this current solution.

Tagged with: