Saturday, March 15, 2014

some printing formats..

for i in {0..10};do printf "%02d\n" $i; done

for i in {000..100};do echo $i; done

Wednesday, March 12, 2014

putty windows ssh using GUI option

http://www.ece.unm.edu/csg/email/XServer_Putty_Windows7-ECE.pdf

Monday, February 10, 2014

unix command to remove everything after a character in a string

suppose you want to remove everything in a string after the character  '_'
The command you would use would be:
i=<your string>
j=${i%%_*}


something i have used in the past.
for i in $(ls); do cd ../$i|cut -d '_' -f1; echo pwd; cd ../geo_color/;  done

Using visual bloc to paste chunks of data

I was having trouble pasting text selected using vim's visual block into a new file.
The copy command is 'y'
The paste command is 'p'
the delete command is 'd' or 'x'
However, the delete command seems to leave behind empty lines. use ':g/^$/d' to remove empty lines from a file
 

Thursday, February 6, 2014

Setting Environment variables

<variable> = value
export <variable>

Creating an AMI using starcluster

These instructions are pretty straightforward to follow. I found it very difficult to create one directly from amazon's documentation.

http://star.mit.edu/cluster/docs/0.93.3/manual/create_new_ami.html

Tuesday, January 28, 2014

Things to remember when using parfor

This website from matlab:
http://www.mathworks.com/help/distcomp/programming-considerations.html

-- cannot use clear inside the loop


specifically:

=========
Similarly, you cannot clear variables from a worker's workspace by executing clear inside a parfor statement:
parfor ii= 1:4
    <statements...>
    clear('X')  % cannot clear: transparency violation
    <statements...>
end
As a workaround, you can free up most of the memory used by a variable by setting its value to empty, presumably when it is no longer needed in your parfor statement:
parfor ii= 1:4
    <statements...>
    X = [];
    <statements...>
end
 =============