Google Chrome OS on Dell D600

So unless you have been hiding under a rock (in the online world) you’ve heard of Chrome OS, Google’s lightweight netbook operating system. Yesterday it was released as open source and I decided to give it ago. (The steps below are for Ubuntu Karmic, but you should be able to translate to other linux platforms.)

  1. The first thing you need to do is get a precompiled image of the OS.
  2. Extract the vmdk file from the download and then use “qemu-img convert -f vmdk <vmdk-file> -O raw ide.img
  3. Then run “sudo dd if=ide.img of=/dev/sdX” where /dev/sdX is the name of your usb stick you want to flash. BE CAREFUL to get this exactly right otherwise you might delete your entire hard drive.
  4. Then down this file and extract it using “dpkg –extract linux-firmware_1.24_all.deb /tmp/firmware/” and then run “cp /tmp/firmware/lib/firmware/ipw2100-1.3.fw /media/C-ROOT/lib/firmware/
  5. Then unmount the USB stick and plug it into your D600.

Should be all set. If you have questions leave them below.

VNC to OSX in Ubuntu

So I’ve had a Mac Mini for a while and I prefer to access it over VNC so I had been using xtightvncviewer. However it would occasionally not update parts of the screen or lose the mouse and I would have to login again. For the most part it worked.

Well today I had enough and decided to fix it. It turns out all you have to do is use gvncviewer. I hope this saves someone else some frustation.

Smartermeter – Read your SmartMeter

So I have to admit that I  was excited when I found out that the house that we would be renting had a PG&E SmartMeter installed. For whatever reason I happen to think its cool if you can find out just how much power you use.

However in order for this to be useful you need a fairly real time display of the data so that you can determine what actions cause what amount of power to be used. So once I got my first bill from PG&E I logged into their website in hopes of finding a nice real time interface like Google PowerMeter . Not so.

Well okay maybe they expose the data through an API. Nope.

The Challenge

At this point it had become a challenge, how can I get the data out of the system. I did a little handy work with firebug and spied what was going on (ASP.net applications are ugly!). Once I got the request parameters copied down I tried making requests through curl and kept hitting roadblocks .  After spending several hours late one night last week I gave up in frustration.

Today I thought I would give it another shot. First let me give a shout out to mechanize I will never use another screenscraping library again. It’s uses nokogiri (so it parses all the html into a nice xpath accessible form), it handles all the cookie session legwork and it reads out the values saved in the forms, so you don’t have to. So awesome.

The Result

Power Usage Graph

Well it’s done. It takes no less than 6 requests across 2 websites (apparently PG&E outsources the data display to http://www.energyguide.com/) to get the data with 10’s of post parameters along the way. I happen to think this is rather absurd, it should just be 1 request with about 4 parameters.

So to benefit the world I have made it into a small library hosted on github. Now I want to see some interesting uses of the data.

Sample Code:

api = SmartMeterService.new
api.login(USERNAME, PASSWORD)
samples = api.fetch_day(Date.today - 1)
puts samples.inspect

Code: git://github.com/MattColyer/smartermeter.git