2014-05-14

Install/rescue/restore grub2

To restore grub2 run this commands:
sudo mount /dev/sda1 /mnt
where /dev/sda1 - partition for grub (with installed linux)
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
sudo grub-install /dev/sda
If output has "chroot: cannot run command `/bin/bash': Exec format error" then your live CD architecture doesn't match with restorable.

2014-05-07

SSH host alias

To create ssh alias you have to create the file ~/.ssh/config with similar lines:
Host your-host
 HostName your-server.com
 Port 22
 user your-ssh-username
Then for connecting to server: ssh your-host