Sunday, June 16, 2013

Setting SSH public-key login in 5 seconds

Local (the computer to log in from):
ssh-keygen -t dsa

Remote (the computer to log in):
cat ~/.ssh/id_dsa.pub | ssh -l REMOTE_USER REMOTE_SERVER 'cat >> ~/.ssh/authorized_keys'


That's it!

Sunday, April 21, 2013

Wired behavior of NaN in Java...

float x = Float.NaN
Float X = new Float(x)
System.out.println(x == x)      // false
System.out.println(X.equals(X)) // true

....WTF?