0atman’s Second Rule

Line comments are apologies to your future self.

It’s partly pragmatism:

Whenever you feel the need to comment a block of code, which could even be as little as a single line and make the total code longer then the code it replaces, you should encapsulate it into another ...

more ...



Fabric’s behaviour for booleans is non-obvious

def get_latest(no_download=False):
    return bool(no_download)
##################################
$ fab get_latest                 
False
$ fab get_latest:no_download     
True
$ fab get_latest:no_download=False     
True

Everything passed in to fabric is a string, so be aware that bool("0") == True and bool("False") == True.

Bools are a special case, make sure they default to false and ...

more ...

Getting the trackpoint working in ubuntu on the Thinkpad X240

TrackPoint scrolling doesn’t work out of box, but you can easily fix it by yourself.

1) Add psmouse.proto=bare option to you kernel during boot

2) Modify /etc/default/grub with the GRUB_CMDLINE_LINUX option (GRUB_CMDLINE_LINUX="psmouse.proto=bare quiet splash)

3) As root run sudo update-grub

4) Create ...

more ...

Pi Portable

My plan is to connect this monitor:

USB Monitor

To the Pi, and then both to a large battery pack via this power meter for calibration.

Based on the Pi’s draw of about 2W, and the monitor’s draw of about 1W, I think (at 5V) that an 11Ah battery could ...

more ...