Volunteers Needed!

Those lovely people over at Flickr have finally bitten the bullet and are turning off FlickrAuth in the summer, meaning that all applications that use the Flickr API need to use OAuth.

This is something I totally agree with, whilst FlickrAuth works and was clearly an important influence on OAuth, it's a single-service protocol when OAuth has managed to get massive adoption and a huge developer base.

The problem I've got is libsocialweb, which has a Flickr module that allows both fetching of your contact's recent photos and uploading images. This uses FlickrAuth so at the end of July will suddenly stop working. I've got enough on my plate at the moment and would love for more people to understand how the entire social spagetti works, so this is a call for a volunteer to work on this, for which I'll obviously be available to offer any guidance and mentoring required.

There are two ways of approaching this, the easy way and the slightly harder way.

The easy way is to update libsocialweb to use an OAuthProxy instead of a FlickrProxy, and update the module metadata so that Bisho uses the generic OAuth flow instead of a Flickr-specific flow. This should be fairly simple and needs to happen soon so that any distributions that are using libsocialweb don't break in the summer.

The harder way is to add Flickr support to gnome-online-accounts, using the Twitter service as an example, and then port the Flickr service in libsocialweb to use gnome-online-accounts to authenticate. I've a proof of concept for the librest-goa integration which will be a useful starting point. This is more of a proof of concept for libsocialweb, we've been looking at moving away from Bisho but haven't done anything substantial yet.

Ideally both of these happen, so the current code will continue to work in the future and the GOA work demonstrates how GOA and libsocialweb would work together. So, anyone interested?

17:45 Wednesday, 18 Jan 2012 [#] [computers] (9 comments)

iPhoneApMon in Shell

This really isn't how it should look, but it's a 15 minute hack in Javascript to give me something that doesn't involve a terminal.

One day I'll find the time to integrate this properly into the network menu...

18:24 Thursday, 17 Nov 2011 [#] [computers] (7 comments)

iPhone Connection Status

Just a little Python hack...

$ ./iphonemon.py 
Found Ross Burton’s iPhone
3 3G
1 3_75G
2 3_75G
3 3_75G
2 3_75G
3 3_75G
2 3G

Next step: a visual interface.

09:51 Wednesday, 06 Jul 2011 [#] [computers] (2 comments)

System Defaults in GSettings

Note: Florian in the comments points me at the documentation (albeit rather concise) for this in the API documentation under Vendor Overrides.

GSettings, like GConf before it, allows the administrator of a system to override the default settings or lock down keys to particular settings. This is well documented in the GNOME wiki.

However GConf didn't really have the concept of vendor patches. Traditionally if a Vendor wanted to change a default (say, the wallpaper) they'd have to patch the GConf schemas directly. Luckily for people who maintain distributions, GSettings provides a way of installing vendor overrides directly. It's not documented as far as I can tell so consider this a first draft at the manual...

First, find the setting you want to override, dconf-editor is useful for this. Say you're making a work-orientated custom distribution so you want the shell's popup calendar to show the week number by default. Some digging in dconf-editor leads us to the org.gnome.shell.calendar folder (the "schema") with a boolean key show-weekdate that defaults to false. By changing the default of this to true, all users will have work week shown unless they explicitly set it to false.

Now we've found the information we need we can write the override file. Create a new file with the extension .gschema.override, such as mydistro-tweaks.gschema.override. This file is a .ini-style keyfile, logically mapping schemas to groups and key/value pairs to (predicable) key/value pairs. The value needs to be in the GVariant serialisation format, but for things like booleans, numbers and strings these are fairly obvious. So we'd have a file that looks a little something like this:

[org.gnome.shell.calendar]
  show-weekdate=true

Note that you can set multiple keys in multiple schemas in the same override file, so if we also wanted to show the date in the panel we'd have this:

[org.gnome.shell.calendar]
show-weekdate=true

[org.gnome.shell.clock]
show-date=true

Now the file is ready to be installed. Put it in a package, install to $prefix/share/glib-2.0/schemas and finally run glib-compile-schemas $prefix/share/glib-2.0/schemas in the post-install/post-remove hooks. Done!

(many thanks to Ryan Lortie for telling me how vendor patches work)

15:45 Monday, 04 Jul 2011 [#] [computers] (11 comments)

AirPlay/UPnP Synergy

You know, it would be really good if someone could take ShairPort, glue that to gst-rtsp-server, and then implement the Rygel MediaServer specification, letting me play music from my iPhone on my Raumfeld UPnP speakers.

I'd actually like this so much that I'm willing to put up some of my own hard cash to see it happen. Are there sites that will let people pledge money towards projects like this?

NP: Central Reservation, Beth Orton

12:00 Tuesday, 19 Apr 2011 [#] [computers] (4 comments)

Contributions to libsocialweb

Thanks to those nice people at Novell and Collabora, libsocialweb now supports Facebook, Flickr, Last.fm, Plurk, Sina, SmugMug, Twitter, Vimeo and YouTube. As if that isn't enough, there are patches queued to bring back MySpace. Thanks Novell and Collabora!

16:45 Tuesday, 22 Feb 2011 [#] [computers] (6 comments)

Tasks 0.19

Shock news: a Tasks release! Announcing 0.19:

Yeah, it's all go on the Tasks front... Tarballs on the Pimlico site, or gnome.org.

NP: Yanqui U.X.O. - Godspeed You! Black Emperor

13:20 Friday, 18 Feb 2011 [#] [computers] (5 comments)

Welcome

Say hello to Isla Daisy Burton.

Isla Daisy Burton

Born at home (planned) on Thursday 4th November 2010 at 19:08, weighing 6 pounds 14.5 ounces. Both mother and baby are well. I'm now on leave until the end of December, so expect delayed responses to my personal email and vacation autoreplies to my Intel email.

08:00 Saturday, 13 Nov 2010 [#] [life] (6 comments)

Code Dump

I finally got around to clearing out my ~/Programming and publishing a number of the silly toy projects I've built up over the years that might be useful to someone, somewhere. A brief overview of what I've basically thrown over the wall to GitHub:

flickrest
A Python/Twisted library for the Flickr API. This was written for use in Postr, although I suspect now that I don't maintain Postr any more they have forked. Maybe now this is in Git we can merge any changes.
evo-known-contact
A small tool I wrote for someone years ago that takes an RFC2822-formatted email on stdin, extracts the sender, and sets the exit code depending on whether that email address is in the address book.
feednotify
Display notifications when a RSS feed is updated.
Zebu
A tool to manage Debian chroots using cowbuilder.
Tumblrss
Screen-scrape your Tumblr dashboard and generate a RSS feed. This has bitrotted but was very useful.
gupnp-scrobbler
Listen to announcements over UPnP of music being played and submit the tracks to Last.fm.
ephy-gupnp
Dynamically generate bookmarks from UPnP devices that expose a web interface. Probably doesn't work with recent Epiphany releases because I've switched to Chrome.
ephydeli
An action to add the current page to Delicious.com. Probably doesn't work with recent Epiphany releases because I've switched to Chrome and Pinboard.
eds-tools
Some tools I wrote when working on EDS such as a dummy addressbook backend and command-line access to the libebook API.
cdscrobbler
Submit the current CD (or an arbitrary MusicBrainz album ID) to Last.fm as if you'd just finished playing it.

Out of all of these hacks I only actively use flickrest and Zebu now, so I wouldn't be surprised if there is some serious bitrot in the others. Hopefully something here is useful to someone, somewhere though!

07:59 Saturday, 13 Nov 2010 [#] [computers] (2 comments)

Tasks 0.18 (and 0.17)

Whilst Tasks isn't exactly under active development, I'm still maintaining it because I actually use it (unlike certain other projects, ahem). So, Tasks 0.18 is released.

Tarballs and more information as usual are available at the Pimlico Project web site.

In related news, we're slowly migrating over to the GNOME infrastructure. We've migrated the source code, next up is the tarballs and bugzilla.

20:00 Monday, 12 Jul 2010 [#] [computers] (1 comments)

Gypsy 0.8 Released

As acting release engineer of the Gypsy project (a GPS mux, if you didn't know) I'm proud to announce the release of Gypsy 0.8. So, what's new?

Many thanks to Jussi Kukkonen for patch review, and Bastien Nocera for patch review and new features.

The big question of course is what of the future? So far we've got some rough ideas. An overhaul of the device interaction layer is definitely required as actaully getting NMEA is becoming more complex: for integrated 3G/GPS chips you need to talk to oFono/ModemManager to get a socket, for some embedded GPS devices you need a proprietary binary that writes to a pipe, and so on. There are some new features we're considering too: server-side proximity detection and update rate limiting.

17:05 Wednesday, 09 Jun 2010 [#] [computers] (7 comments)

Sound Juicer "I Got Nobody On My Side And Surely That Ain't Right" 2.28.1

Sound Juicer "I Got Nobody On My Side And Surely That Ain't Right" 2.28.1 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Props to Bastien for doing most of the work here.

Bastien originally called this release Not the maintainer, lalala, plug ears but we all know he is, right?

15:43 Wednesday, 25 Nov 2009 [#] [computers/sound-juicer] (17 comments)

New Maintainer for Postr!

After months of neglect by myself, Postr has a new maintainer! Step forward Germán Póo-Caamaño, everyone's favourite Chilean, who has been hard at work migrating to git.gnome.org, merging patches and fixing bugs (the Upload button works!), and creating a new project page.

Now all I need is for someone to adopt Sound Juicer...

10:49 Thursday, 12 Nov 2009 [#] [computers/postr] (7 comments)

London Transport Stab Stab Die Die

Sometimes I really, really hate London. A trip to London on Saturday, in theory: Leave Ely 16:26, arrive Kings Cross 17:34, change to Piccadilly line and arrive Covent Garden at 17:54. Dinner then the 21:52 train back home, arriving 23:10.

A trip to London on Saturday, in practise. Leave Ely 16:26, arrive Kings Cross 10 minutes late. Change to Piccadilly line and stand outside the closed barriers for 15 minutes because of overcrowding. Give up on the tube, catch a number 59 bus to Aldwych: 10 minutes to reach Euston (faster to walk) and gave up after sitting in gridlock on Russel Square for 15 minutes. Eventually get rather empty Piccadilly line from Russel Square to Covent Garden, arriving 18:50. Oh, and then the restaurant said it would be a two hour wait for a table for four.

That said, the return journey wasn't exactly a barrel of laughs. The tube was behaving so that took the expected ten minutes, but then we just missed the train back home and the next train wasn't for over an hour. Jump into a taxi to Liverpool Street to catch the 22:26... to discover there are engineering works and we'd have to get a bus for two hours. Attempt to get the tube back to Kings Cross... more engineering works so that was out. Another taxi back to Kings Cross and we finally get on the last train home, arriving at 00:35.

Just for extra fun I'm in London for the Moblin 2.0 Release Party on Monday and there are yet more engineering works, so if I miss the 22:15 I'll be on a bus for half the journey. Stab stab stab.

15:51 Sunday, 27 Sep 2009 [#] [life] (12 comments)

Sound Juicer "And It Ain't Even 9 In The Morning, Sorry I'm Late" 2.28.0

Sound Juicer "And It Ain't Even 9 In The Morning, Sorry I'm Late" 2.28.0 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Very little in the 2.27 cycle...

Did I mention that SJ could really do with a dedicated (co)maintainer?

20:54 Tuesday, 22 Sep 2009 [#] [computers/sound-juicer] (4 comments)

Facebook in ¡Mojito!

Thanks to those nice people at Novell, Mojito (everyone's favourite social aggregator, as used in Moblin) now has Facebook support. We now support Facebook, Flickr, Last.fm, MySpace and Twitter — any requests for the next service?

NP: Cold Water Music, AiM

10:04 Monday, 14 Sep 2009 [#] [computers] (44 comments)

ORBit--; DBus++

Today I finally merged the dbus-hybrid branch of Evolution Data Server into master, which ported the addressbook part of EDS to use DBus instead of Bonobo. There are bound to be some bugs in this so if you are running EDS from master and find a bug, please file it in GNOME Bugzilla.

Now to finish reviewing the calendar port and merge that too...

NP: Session 2 - The Herbaliser Band

20:47 Monday, 17 Aug 2009 [#] [computers] (3 comments)

Dear Interweb: Travel Mug Suggestions

I'm looking for a travel mug for when I go to the office and need some recommendations. So far every one I've found is sealable enough so that it won't splash around when it is upright (say in a car mug holder), but as this has to survive a cycle ride across town in my bag it has to have a perfect seal. Does anyone know of a mug like this, or should I resign myself to being forced to grab a coffee from Taylor Street Baristas when I get to London?

21:37 Monday, 10 Aug 2009 [#] [life] (14 comments)

Gypsy 0.7

Earlier in the week someone pointed out over email that considering the entire geolocalisation thing is starting to come together, it's not great that Gypsy (the modern GPS daemon for the modern desktop) appears dead. Well, it's not quite dead, and to prove it I fixed the bugs that were stopping me from uploading it into Debian. Specifically, the hard requirement to run it as root and the lack of DBus auto-starting (to be fair, when it was written this wasn't supported on the system bus). These are now fixed at last and Gypsy 0.7 is available to download from freedesktop.org.

Packages for Debian are in the upload queue now, and I believe everyones favourite frockney is working on updating Fedora now.

NP: Oneric, Boxcutter

15:52 Thursday, 06 Aug 2009 [#] [computers] (7 comments)

OAuth 1.0a in librest

Because the world is rapidly moving to OAuth 1.0a exclusively after a rather painful attack was discovered against 1.0, I've recently been updating our bling HTTP/REST/XML IPC library librest to support it. In particular Twitter only supports 1.0a, and Fire Eagle shows the user a very scary message unless 1.0a is used. Now that the code is finished I thought I'd give a example of the new API when used with Twitter.

#include <rest/oauth-proxy.h>

Including the OAuthProxy headers is a good start.

int
main (int argc, char **argv)
{
  GError *error = NULL;
  RestProxy *proxy;

  g_thread_init (NULL);
  g_type_init ();

  proxy = oauth_proxy_new ("UfXFxDbUjk41scg0kmkFwA",
                           "pYQlfI2ZQ1zVK0f01dnfhFTWzizBGDnhNJIw6xwto",
                           "https://twitter.com/", FALSE);

First, initalise the GLib threading and type system. Threading is required by libsoup at the moment because it will use threads to lookup names in the background, I imagine this requirement will disappear with the next GLib release.

Next, an OAuthProxy is created. The two strings of garbage are our OAuth Consumer Key and Consumer Secret, then the URL endpoint to access and FALSE to say that this URL is complete and doesn't require expansion. Yes, that was Consumer Secret. Not very secret, is it.

  if (!oauth_proxy_request_token (OAUTH_PROXY (proxy), "oauth/request_token", "oob", &error))
    g_error ("Cannot get request token: %s", error->message);

Here we ask for a Request Token. The function to call is oauth/request_token, and because this is a basic test application which doesn't support URI callbacks we're setting the callback URI to oob (out-of-band). It is the callback URI argument that tells the server that we're using OAuth 1.0a, in 1.0 this parameter (oauth_callback at the HTTP leve) doesn't exist.

The callback is used to pass from the server to the client a verifier which is then required to obtain the Access Token. In the case of Twitter, this is a seven digit number. If a URI was specified then it would be invoked with the verifier as a query argument, but because we're getting it out-of-band Twitter will show it to the user and ask them to enter it into the application.

  g_print ("Go to http://twitter.com/oauth/authorize?oauth_token=%s then enter the PIN\n",
           oauth_proxy_get_token (OAUTH_PROXY (proxy)));
  fgets (pin, sizeof (pin), stdin);
  g_strchomp (pin);

Here we tell the user to go to the authorisation URL (to which we add the request token we have so far), and then enter the PIN that Twitter gives them.

  if (!oauth_proxy_access_token (OAUTH_PROXY (proxy), "oauth/access_token", pin, &error))
    g_error ("Cannot get access token: %s", error->message);

Now we ask for an Accesss Token. The function to call is oauth/access_token, and we're passing the PIN the user entered as the validator. If we were using OAuth 1.0 then the validator would be NULL.

If this method succeeds then we have an Access Token, and are authenticated. To avoid the authentication dance the Access Token and Token Secret should be saved somewhere secure (gnome-keyring would be a good idea) for future use.

  RestProxyCall *call;
  call = rest_proxy_new_call (proxy);
  rest_proxy_call_set_function (call, "statuses/update.xml");
  rest_proxy_call_set_method (call, "POST");
  rest_proxy_call_add_param (call, "status", "Hello from librest!");
  if (!rest_proxy_call_sync (call, &error))
    g_error ("Cannot make call: %s", error->message);
  return 0;
}

First a Call object is created, which encapsulates all of the data required to make a REST call. The function is set to status/update.xml, the HTTP method set to POST (the default is, logically, GET), and a status message is set as a parameter. We make a synchronous call, and we're done. The bonus of using OAuth to authorise with Twitter is that you get the nice "from whatever" annotations on the tweets, to promote your application.

The full source of this example is available in git, along with other examples for Flickr and Fire Eagle. If you want to understand the differences between OAuth 1.0 and 1.0a but don't fancy reading both specifications in full, I can heartily endorse An Idiots Guide To OAuth 1.0a.

NP: Simple Things, Zero 7

11:34 Tuesday, 04 Aug 2009 [#] [computers] (0 comments)

GList Anti-patterns

g_list_length(children);
for (int i = 0; i < (int)num; i++) {
  GList * child = g_list_nth(children, num - i - 1);

FAIL

if (g_list_length(nb_pages) != 0) {

FAIL

for( i=0; i < g_list_length( GTK_CLIST(clist)->selection; i++ ){
  gint row = (gint)g_list_nth_data( GTK_CLIST(clist)->selection, i);

TURBOFAIL

16:11 Thursday, 16 Jul 2009 [#] [computers] (10 comments)

Tasks 0.16

Some stability fixes, translation updates, and small new features in Tasks 0.16.

As usual, download from the Pimlico Project.

08:27 Monday, 13 Jul 2009 [#] [computers] (1 comments)

Myzone on Eee Keyboard

Asus had previously announced the Eee Keyboard, which isn't a keyboard but more a netbook with a full sized keyboard and wireless HDMI. The end result being that this is the ideal companion to your huge 1080p LCD television in the front room for light browsing and so on.

Now the Eee Keyboard also has a small touchscreen by the side of the keyboard, which had generally been shown displaing a calendar and the time. Fairly useful but nothing that interesting. However, they have recently demonstrated Moblin 2 running on the Eee, including the Myzone social desktop update thingy.

Myzone on Eee Keyboard

Now this is pretty neat. I don't know how the touchscreen is related to the main display, but a custom Moblin 2 panel and Myzone tailored to fill the touchscreen would be really cool. Now, where can I get an Eee Keyboard from...

NP: Arecibo Message, Boxcutter

18:00 Monday, 15 Jun 2009 [#] [computers] (2 comments)

Emacs Command of the Weekday

When Thomas talks about "us all" learning a new Vim command, he meant "us heretics". We pure and just people on the path of truth are far more interested in ecotd, Emacs Command of the Day, by our very own Neil.

Okay, I admit at times it looks like a parody, but honestly it isn't!

16:00 Thursday, 23 Apr 2009 [#] [computers] (3 comments)

Sound Juicer "Bonnie and Clyde" 2.26.1

Sound Juicer "Bonnie and Clyde" 2.26.1 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Some crashes have been fixes:

Finally, a call for someone with deep LAME knowledge. The GStreamer LAME element is, well, lame because it sets a number of properties to default values that make it very difficult for LAME to work well. Someone who understands how all of the LAME settings operate needs to sit down, vet the settings and remove the pointless ones, unset most of the rest, leaving the 'preset' setting as the only one which has a default value. At the moment there are many contradictory default settings which mean LAME produces rather badly encoded files. Any takers?

11:04 Friday, 10 Apr 2009 [#] [computers/sound-juicer] (10 comments)

Tasks 0.15

Just a small few fixes, translation updates, and little features in Tasks 0.15.

As usual, download from the Pimlico Project.

12:00 Monday, 30 Mar 2009 [#] [computers] (0 comments)

Sound Juicer "Don't Go Back To Dalston" 2.26.0

Sound Juicer "Don't Go Back To Dalston" 2.26.0 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Only translation updates this time, sorry.

15:55 Tuesday, 17 Mar 2009 [#] [computers/sound-juicer] (3 comments)

Sound Juicer "I Call Out To You And You Don't Save Me?" 2.25.3

Sound Juicer "I Call Out To You And You Don't Save Me?" 2.25.3 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. I actually did some coding this time!

16:48 Friday, 13 Feb 2009 [#] [computers/sound-juicer] (4 comments)

Sound Juicer "I Should Be Crying, But I Just Can't Let It Show" 2.25.2

Sound Juicer "I Should Be Crying, But I Just Can't Let It Show" 2.25.2 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers.

13:22 Tuesday, 03 Feb 2009 [#] [computers/sound-juicer] (4 comments)

3G Woes

Has anyone out there used a recent Nokia phone (E65 to be precise) as a modem with Network Manager 0.7? I can't seem to get the magic right, and get one of two failures:

NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
an 15 10:50:04 blackadder NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
  NetworkManager: <WARN>  dial_done(): Dialing timed out </WARN>

Or:

NetworkManager: <info>  Activation (ttyACM0) Stage 1 of 5 (Device Prepare) complete. 
NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
NetworkManager: <info>  Connected, Woo! 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) scheduled..
. 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) starting...
 
NetworkManager: <info>  (ttyACM0): device state change: 4 -> 5 
NetworkManager: <info>  Starting pppd connection 
NetworkManager: <debug> [1232015456.962700] nm_ppp_manager_start(): Command line: /usr/s
bin/pppd nodetach lock nodefaultroute user web ttyACM0 noipdefault usepeerdns lcp-echo-failure 0 lcp-echo-interval 
0 ipparam /org/freedesktop/NetworkManager/PPP/4 plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so 
NetworkManager: <debug> [1232015456.964964] nm_ppp_manager_start(): ppp started with pid
 29590 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) complete. 
pppd[29590]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
pppd[29590]: pppd 2.4.4 started by root, uid 0
NetworkManager: <WARN>  pppd_timed_out(): Looks like pppd didn't initialize our dbus mod
ule

Anyone know what the problem could be?

11:15 Thursday, 15 Jan 2009 [#] [computers] (7 comments)

GUPnP Repositories

Zeeshan created a clone of the GUPnP repository at Gitorious today, so to any contributors to GUPnP: feel free to clone the repository there so that we can all benefit from a distributed version control system being used as it should be.

NP: Rendez-Vous (Mexico), Erik Truffaz featuring Murcof

17:45 Tuesday, 13 Jan 2009 [#] [computers] (1 comments)

Postr 0.12.3

A small point release to fix some small bugs before it's 2009...

The tarball is here, and Debian packages are building now.

NP: Live at the Royal Albert Hall, The Cinematic Orchestra

15:00 Friday, 19 Dec 2008 [#] [computers/postr] (12 comments)

SSH Tip Of The Day

Do you regularly ssh into machines which have dynamic IP addresses, and get really annoyed with OpenSSH warning that the IP's key doesn't match the host key? I certainly do, with machines announce their names using mDNS and a DHCP server in my router. Today I finally checked the documentation and found out how to skip this check.

The magic option is CheckHostIP, which you can set in .ssh/config on a per-host level. I've got this in my config:

Host *.local
  CheckHostIP no

Now all machines I ssh into using a .local domain won't have their IP's key checked against the host key, because the IP is dynamic. Sorted!

NP: Music Like Amon Tobin, Last.fm

12:00 Thursday, 11 Dec 2008 [#] [computers] (1 comments)

All Hail Our Glorious New Maintainer

Or, Contact Lookup Applet 0.17 is now released. Some bug fixes and features thanks to the core widget being used in Nautilus Send-To:

The tarball is here: contact-lookup-applet-0.17.tar.gz.

16:55 Wednesday, 10 Dec 2008 [#] [computers] (5 comments)

Old Farts Club

Well I'm now a member of the Old Farts Club. Who do I contact to get my membership badge and newsletter?

NP: Repercussions, DJ Distance

15:00 Wednesday, 26 Nov 2008 [#] [life] (19 comments)

Asynchronous Flickr Library, version 0.3

Finally, Flickrpc 0.3 is released. Some nice features that we all know and love from Postr here:

Grab a tarball here or the Bazaar tree here.

21:50 Tuesday, 11 Nov 2008 [#] [computers/postr] (0 comments)

Sound Juicer "Old Man Take A Look At My Life" 2.25.1

Sound Juicer "Old Man Take A Look At My Life" 2.25.1 has been released. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Everyone's favourite Frockney did a huge amount of work on this, and I'm still talking to him after he admitted that the master plan is to replace Sound Juicer with Rhythmbox in Fedora!

21:33 Tuesday, 04 Nov 2008 [#] [computers/sound-juicer] (2 comments)

OfflineIMAP, ConsoleKit, GNOME Keyring

Over the weekend I finally got fed up with Evolution struggling to connect to work's "IMAP" server (Exchange 2007), and switched to using OfflineIMAP to sync the mail to a local Maildir. This as expected worked pretty well, and I'm now hidden from the nasty lag on the server. However, I've had to write my top secret Intel password into .offlineimaprc, which sucks. Then I had a cunning plan...

GNOME Keyring will store passwords in a pretty secure manner, so somehow I need to fetch the password from there. A quick look at the OfflineIMAP manual revealed that I can write Python functions which return the password, so I should be abe to hook into the keyring from OfflineIMAP. This should be fairly simple:

import gobject, gnomekeyring

# The keyring needs to know the application name
if gobject.get_application_name() is None:
  gobject.set_application_name("offlineimap")

def keyring(user, host):
  keys = gnomekeyring.find_network_password_sync(user=user, server=host, protocol="imap")
  # First one will do nicely thanks
  return keys[0]["password"]
...
remotepasseval = keyring("rburton", "imapmail.intel.com")

After writing a small tool to add the key to the keyring, to my surprise this worked first time. I bounced with glee, but ten minutes later I had error messages from OfflineIMAP running from cron in my inbox...

GNOME Keyring uses an environment variable to find the daemon, which isn't set in a cron environment. GNOME Keyring will fall back to using DBus to find the daemon, but the DBus session bus environment variable isn't set. DBus will fall back to reading the session bus address from the X root window, but DISPLAY isn't set so that doesn't work either... EPIC FAIL.

But, I thought, I upgraded to Network Manager 0.7 last week which bought in ConsoleKit. If I ask ConsoleKit for my sessions I should be able to find a session with has an X connection, then I can set DISPLAY appropriately and then the chain described above will work, and I'll have my password. Shockingly, this worked first time too:

import dbus, os
if not os.getenv("DISPLAY"):
  # Get the ConsoleKit manager
  bus = dbus.SystemBus()
  manager_obj = bus.get_object('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Manager')
  manager = dbus.Interface(manager_obj, 'org.freedesktop.ConsoleKit.Manager')
  
  # For each of my sessions..
  for ssid in manager.GetSessionsForUnixUser(os.getuid()):
    obj = bus.get_object('org.freedesktop.ConsoleKit', ssid)
    session = dbus.Interface(obj, 'org.freedesktop.ConsoleKit.Session')
    # Get the X11 display name
    dpy = session.GetX11Display()
    if dpy:
      # If we have a display, set the environment variable
      os.putenv("DISPLAY", dpy);
      break

(man, I really with python-dbus had a better syntax for getting objects with a specific interface)

So there you go, integrating OfflineIMAP with the GNOME Keyring via ConsoleKit and DBus. Surprisingly this was pretty easy to do, thanks to DBus and the magic provided by ConsoleKit it is 100% hack free.

20:00 Tuesday, 04 Nov 2008 [#] [computers] (7 comments)