Tuesday, January 12, 2010

Disabling lock on Suspend

(for laptop users)

Just read about it at: Disabling Password When Waking a Laptop

For many it may be considered a security risk, blah, blah, but I still vote for commodity.

This one goes to my linscripts:

# execute these commands from terminal
gconftool -s -t bool /apps/gnome-power-manager/lock/hibernate false
gconftool -s -t bool /apps/gnome-power-manager/lock/suspend false
# Done! :-)

Sunday, January 10, 2010

StdError Description in scripts

I never actually went that deep into the C code to understand the stderror codes that are returned in common bash scripts.

Recently, on a discussion thread from CoreUtils group, a simple implementation of error code translation caught my attention. Instead of relying on the errno.h file (which contains the list of errors with their respective brief description), you can incorporate secondary scripts (Perl, or Python) to do this job for you.

Thanks to Pádraig Brady for this:

$ test || python -c "import os; print $?, os.strerror($?);"
(you could just wrap this in a function).