Enhancing VIM
Shell Mistakes
Essential Vim
Unix Guru Universe
Bash History
Bash Reference Manual

Installing new e1000e driver
PulseAudio + Wine

Removing PulseAudio

AD connection in RHEL6

Double tunnel:

ssh -L 7777:<IP of target machine>:22 -p <port to gateway machine> <account name on gateway machine>@<IP of gateway machine> -N
ssh -p 7777 <account name on remote machine>localhost -X

Last argument:

In bash, pressing Esc + . produces the last argument of the previous command.

Ignore case on tab completion:

echo "set completion-ignore-case on" > ~/.inputrc

Get the second last column with awk:

cat file | awk '{ print $(NF-1)}'

diff with a file on a remote host:

ssh {remote_host} cat {remote_file} | diff {local_file} -

Increasing entropy

Install rng-tools. Edit the conf file (/etc/default/rng-tools in Debian) and set HRNGDEVICE=/dev/urandom. Start the rng-tools service.

Clear SPM status in the RHEV engine database

psql -h localhost -U engine engine -c "update storage_pool set spm_vds_id = NULL where name = 'Default';"

Replace md disk

Copy partition table:
sgdisk -R /dev/sdNEW /dev/sdOLD

Create unique uuid's:
sgdisk -G /dev/sdNEW

Add partitions to md's:
mdadm --manage /dev/md0 --add /dev/sdNEWX

Install GRUB:
grub-install /dev/sdNEW

Set modes:
parted /dev/sdNEW set 1 bios_grub on
parted /dev/sdNEW set 5 boot on

Remove all containers and images in docker:

docker rm $(docker ps -aq)
docker rmi $(docker images -a --quiet)