color based on string
Because an MD5 hash is typically expressed as a hexadecimal number, 32 digits long *, all you need to do is cut 6 characters to get a color value. COLOR=`echo $SVG | md5sum | cut -c 1-6` To convert any string to a color value, just reduce it to the appropriate characters (= a-f and 0–9),...

Find Out My Linux Distribution Name and Version
How do I find out what version of Linux distribution I’m using from the shell prompt? aptitude install lsb-release lsb_release -a Distributor ID: Debian Description: Debian GNU/Linux 6.0.2 (squeeze) Release: 6.0.2 Codename: squeeze Find Out My Linux Distribution Name and Version

words,words,words!
Included in GNU/Linux (and MacOSx as well) is a standard file, which is just delimited list of dictionary words. * /usr/share/dict/words To select a random word: cat /usr/share/dict/words | shuf -n 1 Check also the other files in /usr/share/dict. Very useful! If your operating system is missing the shuf–utility you can use this: perl -MList::Util -e 'print...

Animated gif to pdf sequence
Convert an animated gif to sequence of pdf files. Now you can scale and rotate the images and keep their full pixelized beauty. FILE=$1 BGCOLOR=88FF99 convert -adaptive-resize 300% \ -interpolate integer \ +antialias -coalesce \ $FILE resize.gif mv resize.gif coalesce.gif HSIZE=`identify coalesce.gif | \ cut -d " " -f 3 | \...

QR Code as vector not bitmap
A simple hack to get a QR code as a vector file, supporting transparency and more suitable for scaling and especially rotating. qrencode only outputs png. INFO=$1 FILE=tmp.png qrencode -o $FILE "$INFO" autotrace -background-color=FFFFFF \ -corner-threshold 100 \ -corner-always-threshold 200 \ -corner-surround 1 \ -output-file=${FILE%%.*}.pdf $FILE rm $FILE exit 0;