scan an image: scanimage -d pixma:04A91901 --resolution 75 -l 75 -t 32 -x 25 -y 230 >scan convert an image: convert -crop 50x50+10+10 scan scan.jpg mount a truecrypt volume: truecrypt -k "" --protect-hidden="no" /true/crypt/file.tc /mountpoint make/update a backup: rsync -a --stats /from /to transcode a video: mencoder fromfile.avi -ovc lavc -oac copy -of lavf -lavcopts vcodec=mpeg4:vbitrate=800:acodec=libmp3lame:abitrate=128 -o tofile.mp4 ffmpeg -i fromfile.avi -vcodec mpeg4 -vb 907000 -acodec libmp3lame -ab 128000 tofile.mp4 burn an audio cd: icedax -D/dev/cdrw -B wodim *.wav youtube-dl url -F youtube-dl url -f id download xkcd: for i in {1..1197}; do wget -nH -A jpg,gif,png -R a899e84.jpg,terrible_small_logo.png -p -H -D xkcd.com http://xkcd.com/$i/ -P $i; done perl -e 'for $f (glob("*/comics/*")){ $f=~/(\d+)\/comics\/(\S+)/; system sprintf "mv \"$f\" \"%04s-%s\"\n", $1,$2; }' download some tits: wget -r -A jpg,gif,png -H -D kiinnostaa.org kiinnostaa.org regex substitute on files, keeping modification times: from="from" to="to" files=* for a in `grep -l $from $files`; do mtime=`stat -c%Y $a` sed -e "s/$from/$to/" -i $a touch -d @$mtime $a done remove duplicate lines: | sort | uniq -c | sort -n