January 2012
1 post
4 tags
Fixing the life support
Somehow, this year feels different. Maybe it’s because of the increase in public awareness of the problems with the world at the end of 2011. A greater understanding that governments and people don’t run the world any more, that we have given money too much power, that we are running full tilt at a cliff-edge; it feels like it’s adding up. Charlie Brooker said recently that...
Jan 5th
15 notes
July 2011
1 post
6 tags
Hohm and Powermeter
The last week has been an interesting one for online energy monitoring. Not content with deprecating Powermeter a few weeks ago, Google decided to properly kill it off. And then, as if to say ‘us too!’ (as they did with the initial launch), Microsoft killed Hohm. Both these efforts were unsuccessful because the companies that put them out weren’t serious about them. There is...
Jul 1st
June 2011
1 post
Resolving a method_missing fight
Recently, I was writing tests for a piece of code, and came up against some strange problems. The code talks to an external web service using RestClient (1.6.1), so of course the web service is mocked for the tests, in this case using Mocha (0.9.8). The problem came when I tried to test failure modes; for instance, what happens when the service comes back with a 401 due to bad credentials?...
Jun 8th
April 2011
1 post
6 tags
WatchWatch
Last year, I went to the Rewired State Carbon & Energy hack day (#rscarbon), which was a great event. I went along with an idea, and even better actually got to build it! We got a great team together, and despite initial technical teething problems, had a demo running in time for the show and tell at the end (by the skin of our teeth). I’ve been meaning to write it up for ages, but...
Apr 19th
November 2010
1 post
4 tags
Francis Maude on the LRRA
In 2006, I wrote to my MP about the Legislative and Regulator Reform Bill (now Act). The bill contained extremely dangerous powers for Ministers to change anything they liked, giving them the ability to get away with pretty much anything without a proper vote. I campaigned against it, with many others, through Save Parliament. Anyway, my MP happens to be Francis Maude, who is now Minister for...
Nov 26th
October 2010
1 post
2 tags
Rewired State: A Social Energy Monitor
The Rewired State Carbon & Energy hack weekend is coming up this weekend, and I’ve got a proposal for a hack I’d like to build (by kind permission of AMEE, my employer). I’m after a team to help, so if you’re interested, please get in touch. Energy monitors are useful, but lack a certain something to keep people coming back to them. The web excels at social and...
Oct 25th
2 notes
May 2010
1 post
4 tags
What did you do in the election, Daddy?
One wondeful thing about the 2010 General Election is that so many great projects have happened online; Francis Irving covers them in a post on the OKFN blog. I was personally lucky enough to find the time to use these services to build something. I couldn’t find election hustings in my area, so I decided to make a site to crowdsource and open up that information properly. Enter...
May 6th
15 notes
December 2009
1 post
4 tags
WatchWatch
In early September, Betavine organised a 24-hour hack event called EcoMo09, with an environmental theme. Unfortunately I couldn’t stay the whole time, but I went along as an AMEE representative to support other people using our API during the event. In the quiet periods, I managed to come up with my own hack, which used GreaseMonkey and AMEE to add carbon emissions to Google Maps. You can even...
Dec 17th
4 notes
November 2009
1 post
3 tags
The Activist Geek Philosophy
So, first, let’s have a stab at identifying the community I’m talking about - this in itself is a pretty hard problem. I guess I’m talking about “activist geeks”, in a way. The sort of people who are involved in the work of MySociety, or Social Innovation Camp. The people who go along to events like geeKyoto, or perhaps Interesting. They are the people that go out...
Nov 10th
1 note
October 2009
1 post
4 tags
IBM DeveloperWorks articles
Over the summer, I was asked to write an article for the IBM DeveloperWorks site about energy monitoring and so on. Eventually, that turned into a series of articles centered around AMEE and how you can track energy consumption and calculate carbon emissions with it. So, now that they’re all published, here’s a bit of a linkdump to the various articles and other things that came...
Oct 28th
July 2009
1 post
6 tags
Reboot Britain
I was lucky enough to be invited to talk at the Reboot Britain conference on Monday. It was a fascinating day, with lots of inspiring moments. It left me with a feeling that we can make the world a better place if we all get out there and make things. It’s something I already believed, but it’s great to have a recharge every now and again. My session was on hacking energy data,...
Jul 8th
1 note
May 2009
1 post
3 tags
The Carbon Diet goes open source
Well, I finally got round to it. I started developing The Carbon Diet 2 years ago (had the idea 3 years ago!), and it’s finally spread it’s wings and joined the world of open source. After I’d been developing it for a few months, it became obvious that it was never going to be a commercial proposition, so it’s been my intention to open it up for a very long time now....
May 21st
4 notes
March 2009
1 post
6 tags
Publishing CurrentCost data to the world
A while ago, I started hacking around with a CurrentCost real-time energy monitor. This is a very nice little device that measures your electricity use, but more importantly has a serial output on the bottom so you can get data out of it. Well, eventually I decided that while being able to get data off the meter was nice, it would be better if I could publish it somewhere. So, I wrote a...
Mar 28th
1 note
November 2008
1 post
3 tags
Running Mephisto on Ruby 1.8.7
My server runs Ubuntu, and seeing as 8.10 (Intrepid Ibex) is out, I thought “woo, let’s upgrade”. Bad idea. Well, partly. Most of the upgrade went fine, but there was one problem. Intrepid comes with Ruby 1,8.7, which works fine with Rails >=2.1, but doesn’t work with anything lower. Mephisto, on the other hand, doesn’t work with Rails 2.1 yet, and is only usable...
Nov 4th
1 note
October 2008
1 post
4 tags
Gems, Bookmarks, and Sandwiches
I’ve been crazy busy for a while, but what little spare time I have grabbed here and there has been used investigating some areas of Rails I hadn’t played with before, like route globbing and running without a database. The results are a couple of tools, one useful, one most definitely not. The first (and most useful) is Has My Gem Built Yet?. I have a bunch of ruby gems on...
Oct 13th
August 2008
6 posts
4 tags
Mocking Kernel#require
The other day, I remembered to add coverage analysis to my AMEE-Ruby tests, using rcov. The results were pretty good - most of the code was already tested, except a few failure cases, and I quickly wrote some new tests to make sure those were working properly. One little bit of code stood out though. Because AMEE talks XML and JSON, my gem can use JSON, but only if the JSON gem is available on...
Aug 31st
6 tags
CurrentCost data live on Pachube
So, the other day I got a nice little tray icon working for my CurrentCost power monitor. That’s great, but data is only really gets fun when it’s mashable, so the next step was to get it online somehow. Pachube is a site which aggregates data feeds from real-world (and virtual-world) devices, shows them on a map, makes graphs, things like that, so it seemed like a good first...
Aug 29th
4 tags
Some successful CurrentCost hacking
After a bit of work, I’ve finally got my CurrentCost meter working in Ruby, and I now have a power monitor sitting in my system tray! There were a few stages involved… Serial comms: The ruby-serialport library that already existed for Ruby was no good to me. Firstly, it didn’t seem to be in a working state, but more importantly, the license it is under (GPL) is no good to...
Aug 22nd
6 tags
Twitter support in JabberStatus
JabberStatus was originally inspired by Twitter’s facility to update your status via XMPP/Jabber. Unfortunately, Twitter’s Jabber interface has been down for months now, which is rather sucky. The solution to this? Extend JabberStatus to work for Twitter as well as Facebook. It turned out to be very easy, so it’s online now. Just add twitterstatus@jabber.org to your contact...
Aug 7th
14 notes
4 tags
One Hundred Months
I just saw the One Hundred Months campaign, and decided it was ripe for a bit of automated Twittering. So, 5 minutes hacking and we have One Hundred Months on Twitter. Code (as ever these days) is available from GitHub. I’m amazed by what computers can do sometimes. This one seriously took me longer to publish to the world than to write.
Aug 6th
5 notes
7 tags
Hacking your energy usage with the CurrentCost
The other day, I managed to get hold of a CurrentCost energy monitor (available to buy from here, or maybe from your electricity supplier). Now, the nice thing about this particular monitor (apart from the ton of information on-screen) is the fact that it has a serial output on the bottom, which you can (with a bit of hacking) plug into your PC, and - bingo - lovely XML data! However, once...
Aug 5th
July 2008
2 posts
5 tags
AMEE for Ruby
In a fit of why-the-hell-not, I’ve just started writing my first gem for Ruby, which is going to be a wrapper around the AMEE carbon calculation engine. It’s still in a very early incarnation, but more will be forthcoming soon. At the moment it can authenticate, and parse DataCategory nodes. DataItems and DataItemValues will be following after a short (UK-based) holiday. Source code...
Jul 10th
3 tags
Filtering Twitter with Pipes
I like Twitter. I’m not sure why, but I do. However, I don’t like the fact that I can’t view my friends timeline via RSS without seeing my own updates in there as well. I already know what I’ve written, I just want to see what other people wrote. To scratch that particular itch, over lunchtime I built a Yahoo! Pipe to filter my own updates out of my feed, and you can use...
Jul 10th
May 2008
4 posts
3 tags
Announcing JabberStatus
Twitter, while it has its problems, does one thing very well. The IM interface allows you to update your status via a Jabber account, which just makes it so easy to do. Facebook, on the other hand, has no such facility, which is unfortunate because although I like the Facebook service, I hate using the website itself. Yes, OK, you can update your Facebook status via Twitter, but I write different...
May 30th
6 notes
2 tags
geeKyoto 08
Well, Saturday was geeKyoto 08 in London, and I finally had to get round to writing my presentation. Had to finish it on the train on the way in, hoping I wouldn’t run the laptop battery down too much in case I had to use it during the talk. It was a great day though! The speakers were incredibly varied, from Alex Haw, an architect/artist who has more ideas in a second than I do in...
May 19th
3 tags
Adventures with GitHub
While moving this site over to Mephisto, I had a problem with the asset system, in that while assets have a “title” field in the database, it’s not editable in the admin interface, or accessible in liquid templates. The fix was simple, just a couple of lines (once I found where to put them), but patching my local copy of Mephisto was somehow unsatisfying. Well, Mephisto is...
May 9th
1 note
3 tags
CO2 on Twitter
I read this article last night, about using Twitter to make machines talk, specifically Tower Bridge. “What a fantastic idea”, I thought to myself. “Maybe I can do the same thing for climate change”. Also, it would be a good way to flex my Ruby muscles a little and get some “fun” coding in for the first time since Amelia was born. So, a couple of hours of...
May 7th
February 2008
2 posts
2 tags
What can I use instead of my car?
Since I’ve been tracking my petrol usage on the Carbon Diet, I have realised that in the last 6 months, I have only used 3 tanks of fuel. The car is a 2-seater, basically just for me, no use for the family, and these days I never use it. I spent more on tax, insurance and servicing than fuel in the whole of the last year. It hardly seems worth having it. So, considering I live out in...
Feb 26th
4 tags
Sanitizing :limit and :offset
I have a need in the Green Thing Rails app to pass in limit and offset parameters to a find query, and these parameters come from the URL. For example: @examples = Example.find(:all, :limit => params[:limit], :offset => params[:offset]) This works fine, but is vulnerable to dodgy things making their way in through the parameters. Normally, to defend against SQL injection, you...
Feb 1st
January 2008
1 post
3 tags
Testing in Trac
Hurrah, I’ve just contributed my first code back to the Trac project. I’ve created a workflow for the 0.11 release which adds a simple “testing” state to tickets before they are closed. For the Trac addicts amongst you, it’s available at Trac Hacks. I’m rather proud of it, because it’s actually the first workflow hack on the site!
Jan 8th
10 notes
June 2007
1 post
1 tag
Sky Channel Changer
My MythTV box was changing channels a bit slowly, so with pointers from Wilf, I’ve hacked the Sky Digibox channel change script from The Nexus to send the commands all in one go for (marginally) faster channel changing. It also allows extra options to the irsend command. Download the updated version below.
Jun 1st
1 note
May 2007
1 post
2 tags
Announcing: The Carbon Diet
Well, it’s been quiet here recently, but that’s because I’ve been working on a new project, which is slowly getting closer and closer to being ready. It’s only open to testers at the moment, but there is now a tour which can be seen by anyone, so I thought I’d link it. I present to you: The Carbon Diet! The what now? Well, it’s basically a carbon...
May 28th
February 2007
1 post
3 tags
Problems with Rails and MySQL
I recently reinstalled my laptop with Fedora Core 6, and when I went to fiddle with my prototype Rails project, I found that nothing worked. I had a bunch of problems, and I thought I’d note down the solutions here, in case anyone else had the same problem. So, forgive me, it’s going to be techy for a while. First, the thing wouldn’t connect to the MySQL database at all,...
Feb 8th
14 notes
June 2005
1 post
2 tags
MythRename
Here in the UK, T4 (a weekend morning kids show thing) put a “T4:” prefix on the front of every program they show, so rather than “Futurama”, you get “T4:Futurama”. If you want to record these shows, you need to have two rules, you end up with two different titles in the program list, and you get duplicated episodes. Well, no more. I’ve written a...
Jun 18th