Unix Commands
Images
Resize images:
$ mogrify -resize 50% *
Replace/attach image colour profile:
$ mogrify -profile ~/etc/argb.icc *
Lossless jpeg rotation based on EXIF data:
$ exifautotran *
Set the modification date of a photo based on EXIF data:
$ jhead -ft *
Audio
Fix Canon WAV files:
$ ffmpeg -acodec copy -i file.wav file2.wav
Video
Capture from video in (ffmpeg):
$ ffmpeg -ac 2 -ar 48000 -f oss -i /dev/dsp -s 720x576 -r 25 -f video4linux2 -i /dev/video0 -y -ac 1 -ab 192k -qscale 4 out.avi
Capture from video in (mencode):
mencoder tv:// -tv driver=v4l2:width=720:height=576:normid=4:input=0:fps=25:forceaudio:adevice=/dev/dsp:audiorate=48000 -oac mp3lame -lameopts br=224:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=4 -endpos 1:05:00 -o out.avi
Filesystem
Loop over a list of files which contain spaces:
$ ls -1 | while read x; do echo $x; done
Convert absolute symlinks to relative ones (must be run twice):
$ symlinks -c -s . $ symlinks -c -s .
Sync home dir with external hard drive:
$ rsync --delete --exclude ".*" --exclude Bureau --exclude tmp \
-av /home/roger/ /media/disk
Convert DOS text file to UNIX:
$ apt-get install tofrodos
$ dos2unix {file}
Subversion
Edit a log message:
$ svn propedit svn:log svn+ssh://svn.ninthavenue.com.au/blah -r11 --revprop svn:log
Import an upstream release (e.g. fckeditor):
~/fckeditor $ svn import svn+ssh://svn.ninthavenue.com.au/apps/fckeditor/tags/2.6.0
Merge custom changes into new upstream release:
~ $ svn co svn+ssh://svn.ninthavenue.com.au/apps/fckeditor/branches/2.6.0-webcore fckeditor ~ $ cd fckeditor ~/fckeditor $ svn merge svn+ssh://svn.ninthavenue.com.au/apps/fckeditor/tags/2.5.1 svn+ssh://svn.ninthavenue.com.au/apps/fckeditor/branches/2.5.1-ninthavenue
