Enable Hibernation in Ubuntu 12.04

Before enabling hibernation, please try to test whether it works correctly by running sudo pm-hibernate in a terminal. The system will try to hibernate. If you are able to start the system again then you are more or less safe to add an override.

To do so, start editing

sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla 

Fill it with this

[Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes 

Save by pressing Ctrl-S and exit
Restart and hibernation is back!