ajitomatix.com>Notes>Unix/Linux notes. Language: en

A simple bash cmdline to rename all .dat files in a directory to .mpg

for i in `ls *.dat`; do echo $i > tmpname; mv $i `/usr/bin/sed s/dat/mpg/g < tmpname` ; done; rm tmpname

If you have a ide-scsi cdrecorder which you also use as your cdreader and you can’t play VCDs on xine/mplayer; check if /dev/cdrom is pointing to the actual scsi device node and not the ide device node. eg on my system /dev/cdrom was a symbolic link to /dev/hdc, but since for cdrecorders kernel argument hdc=ide-scsi is passed at boot time the symbolic link should point to /dev/scd0 (or whatever you have). Also check if you have permissions on /dev/cdrom, either do chmod 0777 /dev/cdrom or add yourself to proper group.


To play Audio CDs and VCDs ‘mount’ing cd is not required.


Print multiple pages back to back

  1. enscript -G -p outfile.ps
  2. mpage -4 out1.ps > out2.ps
  3. ps2pdf out2.ps (optional)

(Following instructions assuming that your printer cannot automatically print back to back, also called as duplex)

  1. print odd pages first
  2. take the bunch of printed papers printed side up, rotate it by 180 degrees clockwise,insert in the paper tray with printed side up
  3. print even pages

This will print 4 pages per side of a sheet. Lot of dead-tree saving! To print 2 or 3 pages look at mpage options.