Archive for August, 2007

Software Release: battery_status.py

Tuesday, August 21st, 2007

Annoyed that Fedora 7 doesn’t have the same CLI tools to get battery status, I coded up a little python script last night to do just that. It was a pretty straight-forward project that took me about an hour, but I was pretty happy with the end result. It reads the proper files out of the /proc/acpi/battery hierarchy, does some calculations on that data and the gives you what you really want.

You start with this:

thesis|18:46|~% cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         65520 mWh
last full capacity:      69150 mWh
battery technology:      rechargeable
design voltage:          14400 mV
design capacity warning: 3457 mWh
design capacity low:     200 mWh
capacity granularity 1:  1 mWh
capacity granularity 2:  1 mWh
model number:            42T5229
serial number:           35751
battery type:            LION
OEM info:                SANYO
thesis|18:46|~% cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            8595 mW
remaining capacity:      66620 mWh
present voltage:         16690 mV

And you get this:

Battery 0: 96.46% (0:17 until charged)

In the spirit of sharing and trying new things, I thought I would register it as Google Code project and give it away under a BSD License. It was about a ten minutes process, start to finish and now the world can have it:

http://code.google.com/p/batterystatus/

Hurray for non-scarce economics!

Dinner in Palo Alto

Tuesday, August 7th, 2007

Dinner with Todd (a former coworker) in downtown PA. This followed my
first visit to the dev floor at Facebook.

Cover bands at Ireland’s 32

Sunday, August 5th, 2007

Slumming it at Westgate.

Sunday, August 5th, 2007

I visited Westgate doe the first time today. It was surprisingly great
for a mall. I met an Israeli girl hawking Dead Sea skin care products
and had Bear Papa creampuffs.

Unclear on the concept.

Sunday, August 5th, 2007

A little found irony to brighten up your day.

Centadon

Saturday, August 4th, 2007

Don basking in the glow of Mission St. neon.

Self-portrait

Saturday, August 4th, 2007

… A self-portrait.