Wednesday, June 16, 2010

Ubuntu | Force switch on screen lock and turn off lcd display


gnome-screensaver-command -l && xset dpms force off


Does the job, unless you, audience, can please suggest me better.

Saturday, June 12, 2010

Calculating time difference for reservations using Python


import datetime
# Since I wish to do reservation on 12 Sept 2010
d = datetime.datetime(2010,09,12)
# I can do reservation 90 days before
b = datetime.timedelta(90)
# The day when I can do reservation is
print d - b