When setting up passwordless logins I always seem to miss a step. The following link is a useful resource.
When setting up passwordless logins I always seem to miss a step. The following link is a useful resource.
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
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 [...]
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.
-
Calendar
February 2012 S M T W T F S « Nov 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 -
Meta
