Monday, March 26, 2012

git diff ignore line ending

Different line ending is really annoying, here is the command to ignore line ending when diff:
$ git config --global core.autocrlf true

Thursday, March 1, 2012

SSH without manually input password

On client side generate the ssh key:


client$ cd ~/.ssh
client$ ssh-keygen -q -f id_rsa -t rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Copy the public key to the server:


# Step 1:
client$ scp ~/.ssh/id_rsa.pub user@your.ssh.server:~/.ssh/tmpfile

# Step 2:
server$ chmod 700 ~/.ssh
server$ cat ~/.ssh/tmpfile >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/.ssh/tmpfile