Wednesday, 4 June 2014

rsync including and excluding

rsync -av --include=*/ --include=TransformTree* --exclude=* wavelets/9-cells/ .

Thursday, 8 May 2014

time lapse

http://www.moreno.marzolla.name/software/linux-time-lapse/

Monday, 10 June 2013

Rotate only one screen

check devices

xrandr -q

and rotate accordingly

xrandr --output LVDS-0 --rotate left

Sunday, 7 April 2013

vim screen and the nasty ABCD key-bindings for the arrow keys

This is the solution

set term=xterm

Adding this line to yout .vimrc file or 

:set term=xterm

once you are in vim.



Wednesday, 13 March 2013

How to add supplementary figures to latex documents




% Reset the figure counter; add 'S' as a prefix for figures; avoid @ being a letter
%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{figure}{0}
\makeatletter
\renewcommand{\thefigure}{S\@arabic\c@figure}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%


Friday, 18 January 2013

How to grep a variable in bash?


export var='chr1'
grep -P ^$var'\t' file.to.grep

This will grep the lines that begin with chr1 followed by a tab. This ignores cases as chr11 or chr19


Wednesday, 14 November 2012

How to iterate through an array in bash? one liner


$ export MYARRAY=("one" "two" "three" "four")
$ for i in ${MYARRAY[@]}; do echo $i;done
one
two
three
four

and to reverse the loop



$ for (( idx=${#MYARRAY[@]}-1 ; idx>=0 ; idx-- )) ; do    echo ${MYARRAY[idx]} ; done