Search This Blog

Thursday, May 25, 2006

Deleting needless pbs files

When PBS queue system's finished your calculation was leaving two info file: [name].o[number] and [name].e[number]. If results were correct you don't need them. To delete all pbs file (and only them*) use this command:
rm -f *.[eo]*
* Of course if you have file with e or o after dot it will be delete too. In this situation you can upgrade command to
rm -f *.[eo][0-9]*
. However, if can fail too if there is number after o or e letter ;). But It's rather unusual situation. You can add this line to your .bashrc file:
 alias pbsdel="rm -f *.[eo][0-9]"
. Now you can use pbsdel to deleting pbs file.

Thursday, May 18, 2006

Massive changes in input files

Imagine, you have to change basis set in 10 files. It is a lot of work. Not really, sed will be your friend. For example, I would like to change 6-31+G(d) into 6-311++G(2d,p) basis set in Gaussian, so I did:
sed -i.bak *.com -e " s/6-31+G(d)/6-311++G(2d,p)/"
. This command created backup of my file. If you would like to change the level of theory in gamess you should write:
sed scf.inp =e "s/scftyp=rhf/scftyp=rhf mplevl=2/" > mp2.inp
Of course you can change much more thinks in any of quantum chemical program.

Friday, May 05, 2006

FujiFilm S5600 digital camera and [not only] Crux

My FujiFilm S5600 (S5200 in US) works out of box with my Crux. The only inconvenience is that the mount point can depend on presences of other usb stuff. I read the udev rules manual and wrote this rule.
BUS=="scsi", KERNEL=="sd*", SYSFS{vendor}=="FUJIFILM",  NAME="%k",SYMLINK="fuji"
It makes the /dev/fuji link, which use as mount point:
/dev/fuji /media/aparat vfat  user,noauto   0    0
To edit pictures from raw format im using UFRaw. It can be GIMP plugin, what is it's big advantage. But when I have more photos I'm using this small bash script to prepare preview in jpg:
#!/bin/sh
dcraw -w *.raf
for i in *.ppm
do
    j=`basename $i .ppm`.jpg
    echo $j
    convert $i $j
    mogrify -resize 800x600 $j
done
rm *.ppm
I found that it is very important to use dcraw with -w option.