BISMG:SarahS/handy stuff

Matlab help
If using pcolor matlab will not print .eps even though the output is called .eps. It will print an .eps that is really a bitmap. It seems to change the default renderer to bmp. To make sure a real eps is printed type print(h, '-depsc', '-painters', 'filename.eps');

Convert 3d shapefile into 2d in arcmap 10

 * Matlab can not read 3d shapefiles so convert to 2d
 * Read in shapefile (e.g. SouthWestAsia.shp)
 * ArcToolbox, conversion tools, to geodatabase, feature class to feature class
 * Input features, (select the current shapefile from the dropdown box e.g. SouthWestAsia.shp)
 * Output location =G:\JULES\Glacier Inventory\Randolf
 * Output feature class (the output file name e.g. SouthWestAsia2d.shp)
 * Environments M and Z (select output has M and Z disabled)

How to setup a Cron job

 * Use holocene as it communitates with the outside world
 * In the home directory open crontab using : crontab -e or (-l to list what is in crontab)
 * Alternatively, crontab file is located in /tmp
 * Specify the editor : export EDITOR=/usr/bin/emacs to get editor for crontab
 * Set the time to run the script by filling in the blocks. For example run send and email at 18:10 everyday
 * 18 10 * * * /home/ggsrs/automat/send_an_email.sh

Handy commands

 * find . -iname '*.xml'
 * list the number words and lines in a file wc -filename
 * killall my program
 * Search for functions with a binary nm simple_glide | grep functionname

Compress and un-compressing using tar (.tgz)

 * find all files with size > 100k and write to a list find: ./tests/*/*/*.nc -size +100 -print > test_filenames


 * Compress all files in the list: tar -cvzf mytarfile.tgz -T test_filenames


 * Un-compress files : tar xvzf mytarfile.tgz

Finding info on machine architecture

 * cat /proc/cpuinfo
 * Return the number of CPU's grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
 * Return the number of nodes cat /proc/cpuinfo | grep processor | wc -l
 * Note cpuinfo is very confusing because nodes are called processors.

Using rsync
To copy files from desktop drive to unix box use rcync
 * cd /cygdrive/e/data changes to the e:\data on local machine
 * rsync --progress -azv tuning ggsrs@dartagnan.ggy.bris.ac.uk:/bluepeta/sarah/backUpPC/ copies drove tuning from e:\ to bluepeta/sarah/backUpPC/ on dartagnan