Remember Remember

jueves, 23 de abril de 2009

Calculate the standard deviation (and average as well) via awk

This nice oneliner is very handy for calculating the standard deviation
gawk '{avg=avg+$2; sd2=sd2+($2*$2)} END{avg=avg/NR;sd2=sd2/NR; print avg" "sqrt(sd2-avg*avg)}'

lunes, 13 de abril de 2009

SSH session without password

For connecting from machine_a to machine_b

ssh-keygen -t rsa
cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'