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