Monthly Archives: July 2016

Git: Force reverting to a previous commit

Reverting to a previous commit in git. These commands seem to always get lost on the interwebs.

# Reset the index and working tree to the hash
git reset --hard 23h8f32378

# Move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}

git commit -m "Revert to 23h8f32378"

AWS EC2: Moving /var to EBS

From Tamas at work! not mine! :0)

Moving var to /mnt on aws. Often if you have the default storage size set when you create a new instance it is 8gig. To move your var director to another mount point:

rm -rf /mnt/*
cd /var
cp -ax * /mnt/
cd /
mv var var.old
mkdir var
umount -l /dev/xvdb
mount /dev/xvdb /var
nano /etc/fstab # make sure it will automount after restart
rm -rf /var.old