Jim's Technician Blog

Random things I've stumbled across as sysadmin/dba.

Writing your own Operating System
Fun on a rainy day: Bare Metal Rust: Building kernels in Rust
Disabling hibernate/suspend on Debian Wheezy
Create a file called /etc/pm/sleep.d/0000hard-disable with the following contents:

# Disable all hibernation and resume operations.
echo "hibernate/suspend disabled"
exit 1
and make it executable:
chmod 755 /etc/pm/sleep.d/0000hard-disable
It probably makes sense to remove the options from Gnome - see remove "Suspend" and "Hibernate" from the "Shut Down" applet (basically edit /usr/share/polkit-1/actions/org.freedesktop.upower.policy and change all occurrences of <allow_active>yes</allow_active> to <allow_active>no</allow_active> and then:
# /etc/init.d/gdm3 restart
Ignoring load errors in Emacs for missing packages
On some systems I have a newer test version of emacs installed and I want to use some packages it supports, but older versions don't. A quick way to allow silent failure is to use condition-case:
(condition-case nil
      (require 'package)
      (add-to-list 'package-archives
	     '("somerepo" . "http://...") t))
  (error nil))

Last modified: Mon Nov 16 18:46:29 PST 2015