as days pass by, by Stuart Langridge http://www.kryogenix.org/days scratched tallies on the prison wall Thu, 03 Jul 2008 11:59:50 +0000 http://wordpress.org/?v=2.5.1 en Identi.ca, Twitter, and posting between the two http://www.kryogenix.org/days/2008/07/03/identica-twitter-and-posting-between-the-two http://www.kryogenix.org/days/2008/07/03/identica-twitter-and-posting-between-the-two#comments Thu, 03 Jul 2008 10:33:30 +0000 sil http://www.kryogenix.org/days/?p=1522 It’s now the trendy thing to write an essay about why Twitter is doomed, or why it’s not doomed and all its competitors are doomed instead. And god knows I wouldn’t want to break the back of that trend.

I’ve been playing with Identi.ca, a Twitter clone written in PHP. Lots of Twitter people are becoming frustrated with seeing the famous Fail Whale on Twitter’s “we are currently down” page, and people are starting to look elsewhere. There are lots (and lots and lots) of alterni-Twitters (which is a problem I’ll come back to in a moment), but identi.ca is attracting one of the communities I operate in, open source people. This is because identi.ca is entirely open source: the codebase is called Laconica. This is a nice idea.

First things first, though: I don’t want to update two places at once. Identica* doesn’t have an API (yet), but I wanted to post things to Twitter and have them appear on Identica too. So, I present the Twitter Identi.ca Reflector. Download as a tarball or check it out from Subversion or browse the source. The README tells you how to set it up. It uses Jabber to post to Identica, which isn’t ideal, but (as mentioned) there’s no API. So now you can send Twitter posts to Identi.ca, which is helpful.

Now, why Twitter is good, why Identi.ca is good, and why everything else isn’t. If you just wanted to post Twitter comments to Identi.ca then you can stop reading now.

Twitter looks like it ought to be easy to clone, and it isn’t. This is why there are lots of Twitter clones, and why none of them have taken off. The basic principle of microblogging is indeed an easy one, I agree. But all the other Twitter-alikes are missing something. They don’t have SMS sending, or SMS following, or they don’t have an API, or they don’t have lots of desktop clients, or they have one desktop client that doesn’t run on everyone’s machine, or they don’t do IM. What makes Twitter good is two things: the first is that you can get at it in so many ways. And because there are so many ways, people can build lots of things on top of it. For example, if you want to do the reverse of what the above reflector does (post your messages to Identi.ca and have them show up on Twitter) then you don’t need an extra program, because it already exists: Twitterfeed. Simply sign up at Twitterfeed, and use it to send posts from your Identica feed to Twitter, and it’s all done. That’s the power of having an expressive and complete set of APIs. It can’t be underestimated.

The second reason Twitter is good is that everyone’s already there. They got first-mover advantage. There’s no point going to an alternative because none of your friends are there. This is also the reason that Twitter has fifty desktop clients and that things like Twitterfeed exist; it’s worth the investment. It does mean that if people leave Twitter they’ll all leave together and the bottom drops out of their market, but that’s the way the internet cookie crumbles. Photo sharing sites have the same issue — it’s difficult to build a Flickr competitor because everyone’s already at Flickr, so none of the “social” stuff happens elsewhere because you never hit a critical mass of people.

So, what’s good about Identi.ca then? Well, for me, the big things are open-sourceness and federation. The underlying codebase being open source is a huge win, from my perspective. It means people other than the Identi.ca team can work on adding new features, it means that we can see what’s going on, and it means that there are more open source programs in the world. I like this. Other people may not, but what the hell.

The other advantage is federation. This is all about the OpenMicroBlogging specification; it basically blows away the “all my friends are at Twitter so I must be too” point. It means that you can subscribe on one microblogging service to people on other microblogging services. I could be at Identi.ca, you could be at Twitter, someone else could be at Jaiku or Pownce or wherever else, and we all read one another’s messages, happy as Larry. It levels the playing field. I can subscribe Identi.ca to Twitter without problems. This is a great idea which is rather hampered by the fact that basically no-one has implemented it yet. It’s in Laconica, though, so Identica has it. It helps get around the scaling problems that Twitter are having, too: you don’t need one centralised Twitter service any more. There can be lots of little islands, all of which talk to one another. No more scaling problems. No more Fail Whale. People who need the extras that Twitter provides can use Twitter quite happily (as I’m doing; I like SMS!), people who don’t need that but do need other services can use something else that provides those other services.

The basic concept of microblogging has been commoditised thanks to OpenMicroBlogging — it’s become a simple thing to implement anywhere. Microblogging services can now compete on which extras they offer.

That’s why I like Identi.ca. Oh, and they let you create your account with OpenID, which I did. It’s a win all round. Development’s going on at a fast pace on the Laconica codebase, so expect to see more and more appear over there. Blizzard’s already added identi.ca support to Whoisi, so things are moving quickly. I don’t know whether the trickle of Twitterites in Identi.ca’s direction will continue, but thanks to the reflector code above, I’m now on Identi.ca without putting in any extra effort. That’s identi.ca/sil for those of you who want to track it.

]]>
http://www.kryogenix.org/days/2008/07/03/identica-twitter-and-posting-between-the-two/feed
Controlling Banshee over D-Bus http://www.kryogenix.org/days/2008/07/02/controlling-banshee-over-d-bus http://www.kryogenix.org/days/2008/07/02/controlling-banshee-over-d-bus#comments Tue, 01 Jul 2008 23:51:52 +0000 sil http://www.kryogenix.org/days/?p=1521 I needed to be able to control Banshee from another application, and it turns out it has a lovely D-Bus API.

Skip to the next song*:

import dbus
bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee",
  "/org/bansheeproject/Banshee/PlaybackController")
banshee.Next(False) # use banshee.Previous(False) to skip back one song

Start Banshee playing (this works even if Banshee isn’t running; D-Bus starts it up!):

import dbus
bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee",
  "/org/bansheeproject/Banshee/PlayerEngine") # note PlayerEngine, not PlaybackController
banshee.Play() # use banshee.Pause() to pause playback

I found these commands using D-Feet*, J5’s D-Bus browser thing, which is great. The program I’m using to call this stuff is open source Enso from the Humanized team, which is also pretty darn useful.

]]>
http://www.kryogenix.org/days/2008/07/02/controlling-banshee-over-d-bus/feed
The end of LugRadio http://www.kryogenix.org/days/2008/06/30/the-end-of-lugradio http://www.kryogenix.org/days/2008/06/30/the-end-of-lugradio#comments Mon, 30 Jun 2008 11:23:21 +0000 sil http://www.kryogenix.org/days/?p=1520 LugRadio is ending.

Yep. After 106 shows, two million downloads, five thousand emails, 134 hours of recorded material, five conferences, and fourteen presenters*, LugRadio is coming to an end. I’ve just released “More on that later”, episode 21 of season 5, which is the antepenultimate (!) episode. We’ve got one more “ordinary” episode after this, and then the live show at LugRadio Live UK on the 19th and 20th July in Wolverhampton, and that’s it.

There’ll be a certain amount of reminiscence at LRL in a couple of weeks, but this might be a good place for me to talk a bit about everything that’s gone on. It’s been a pretty cool ride, I have to say. We talked to loads of people, shone a spotlight on loads of projects, won an award for marketing and been elected best podcast in a magazine, done LRL in America and four times in the UK, and basically had a great laugh doing it. I’m really proud of what we’ve done. And now it’s ending. A sad moment.

I probably ought to say: it isn’t because we’ve had a row or anything. We want the show to go out on a high — always leave ‘em wanting more, isn’t that the showbiz mantra? — and everyone can name programmes that have outstayed their welcome by stringing it out for just one more season. I would like to keep those people who don’t think that we jumped the shark 104 shows ago to be still thinking that the show was good even after it’s over.

So, this is it, kids. This show, one more show, and then the live show at LugRadio Live. That’s our chance to say thankyou to all the people who’ve made the show what it is, and your chance to see the last ever LugRadio recording live on stage. Drop us an email or post to the forums to tell us what you’ve liked and disliked about the last four years and what you want to see us talk about at LRL, and come and celebrate the end of an era with us. There’s going to be rather a few drinks that weekend: make sure some of them are yours. I’ll see you there.

Other comments around the place: Jono’s writeup, digg the end of the show

]]>
http://www.kryogenix.org/days/2008/06/30/the-end-of-lugradio/feed
labelify: a jQuery plugin to add labels to your textboxes http://www.kryogenix.org/days/2008/06/25/labelify-add-labels-to-textboxes-with-jquery http://www.kryogenix.org/days/2008/06/25/labelify-add-labels-to-textboxes-with-jquery#comments Wed, 25 Jun 2008 14:01:38 +0000 sil http://www.kryogenix.org/days/?p=1519 A fairly common design pattern in web forms is to have some explanatory help text for a textfield appear inside the text field, and then remove it when the user clicks into that field. It has the benefit of putting the help precisely where the user’s looking.

Labelify is a jQuery plugin that does this for you, as simply as possible. It handles a number of corner cases, and it’s quite customisable if you need it to be, while still working as simply as possible out of the box.

Enjoy.

]]>
http://www.kryogenix.org/days/2008/06/25/labelify-add-labels-to-textboxes-with-jquery/feed
Browser version icons http://www.kryogenix.org/days/2008/06/21/browser-version-icons http://www.kryogenix.org/days/2008/06/21/browser-version-icons#comments Sat, 21 Jun 2008 19:58:23 +0000 sil http://www.kryogenix.org/days/?p=1518 Ian Lloyd’s released browserversionicons.com, a set of icons for popular web browsers branded with the version number. This is useful for those of us who have fifteen web browsers installed at different versions for web testing.

It’s a resource for Mac people — the icons are in .icns format, which is some Mac-specific thing — but I thought it’d be useful for Linux people too. So, I converted all the icns icons to PNG, using icns2png* and Ian kindly added those icons to the download pages. I’ve also done a brief screencast of how to change your browser icons to use different ones — be gentle with me, it’s my first screencast.

Good work, Ian. Let’s see more of that. (Oh, and if you get a chance to produce icons for versions of IE greater than 5.2, that’d be handy too.)

(oh, strangely, there is an open bug for Gtk support for .icns format, and apparently Bastien committed the fix to trunk last November (so it should be there in my Gnome 2.22.2, right?), but you can’t set a .icns file as an icon for a .desktop file/launcher. Not sure whether that’s because I don’t have the patch or because the patch doesn’t do that; if someone can tell me, I’ll file another bug.)

]]>
http://www.kryogenix.org/days/2008/06/21/browser-version-icons/feed
YeahConsole: a dropdown Linux terminal that’s better than Tilda http://www.kryogenix.org/days/2008/06/18/yeahconsole-a-dropdown-linux-terminal-thats-better-than-tilda http://www.kryogenix.org/days/2008/06/18/yeahconsole-a-dropdown-linux-terminal-thats-better-than-tilda#comments Tue, 17 Jun 2008 23:57:50 +0000 sil http://www.kryogenix.org/days/?p=1517 I’ve been a big fan of Tilda, the dropdown terminal window for Linux, for a long while; pressing F2 to grab a terminal is hardwired into my fingers now, and I’m crippled without it. However, Tilda’s been getting steadily shitter as time’s gone on; more crashy, more unresponsive. Recently, it stopped taking keyboard focus when you brought it up, which has led more than once to me pressing F2 and then typing half the shell command I wanted into my (still focused) Firefox window. Not only is this incredibly annoying, but at some point I’m going to type my password into an IRC channel. It’s gotta stop.

The obvious replacement is yakuake, the KDE dropdown terminal. However, I hate it. I don’t even know why, to be honest; it just feels weird to me in a way that Tilda doesn’t. So I looked around for alternatives, and found two: Guake, which is supposedly a better Tilda and Yakuake for the Gnome desktop, and yeahconsole. Sadly for the Guake team, I found yeahconsole first, so that’s what I’m using. Actually, I rather like the out-and-out simplicity and bare-bones nature of yeahconsole, which is why I’m sticking with it; when I need to do shell things, I don’t want flashy features, I want a shell. I don’t use tabbed terminal windows, for example. Just simplicity, that’s what I want.

Yeahconsole is available in the Ubuntu repositories (click to install on Ubuntu). Here’s how I set it up.

First, it needs to run every time I log in. So, go to System > Preferences > Session, select Startup Programs, click Add, and add a new command, name “YeahConsole”, command “yeahconsole”.

Next, it looks a bit rubbish when you start it up. Here’s how bare-bones yeahconsole is: you configure it with X resources. Party like it’s 1989! I had to go look up how to do this; for the more tender in years among us, X resources were a sort of central configuration for all your apps, round about the same time that humanity was fighting off sabre-toothed tigers and wondering whether that hot flamey thing in the corner could actually be useful. On Ubuntu, you need to edit (actually, you probably need to create) a file called .Xresources in your home folder*. In that file, you put the configuration for yeahconsole, like this:

yeahconsole*toggleKey: None+F2
yeahconsole*consoleHeight: 20
yeahconsole*aniDelay: 0
yeahconsole*stepSize: 10
yeahconsole*faceName: ProFontWindows:style=Regular
yeahconsole*faceSize: 9

The toggleKey one is the important one: it sets which key you use to summon the terminal. I like F2, myself, but pick whatever. What all this stuff means is documented in the man page (man yeahconsole), apart from which font to use. This is the faceName and faceSize options above, and here you have to delve a bit (I told you this was old-fashioned; I started writing a yeahconsole-properties configuration utility that did all this for you, but couldn’t be bothered). In a terminal, run fc-list. This lists all the TrueType fonts that you can use in an xterm. Choose one, and put it in faceName above.

Now, simply start yeahconsole for the first time (press Alt+F2, type yeahconsole), and then press F2 (or your key of choice). Pow, a dropdown terminal, like Tilda, but one that won’t keep crashing and make you cry.

One other thing: if you hit Ctrl-D to log out by mistake, it’ll close yeahconsole (tilda did this too), and that’s really irritating. To fix this, put the following in a file called bashloop in your home folder:

#!/bin/bash
while true; do bash; done

and change your Startup Programs command above to be yeahconsole -e /home/username/bashloop. Now Ctrl-D won’t close yeahconsole. Win.

]]>
http://www.kryogenix.org/days/2008/06/18/yeahconsole-a-dropdown-linux-terminal-thats-better-than-tilda/feed
LugRadio Live UK 2008 is coming http://www.kryogenix.org/days/2008/06/17/lugradio-live-uk-2008-is-coming http://www.kryogenix.org/days/2008/06/17/lugradio-live-uk-2008-is-coming#comments Tue, 17 Jun 2008 19:47:01 +0000 sil http://www.kryogenix.org/days/?p=1516 I’ve just released episode 20 of season 5 of LugRadio, which is always a fun process (remind me to write about the actual release process for these things at some point; after over a hundred shows I’m starting to nail down precisely how to publish a show in four formats and to ten mirrors with the minimum of effort!). It was a pretty fun show to record, and recording it reminded me that I haven’t written much about this year’s LugRadio Live UK. Now, there are going to be some of you reading this who already listen to LugRadio and who therefore know about it: this post is for the rest of you (well, mainly those of you in the UK or in close-ish parts of Europe). If you do know about LugRadio Live UK already, then you should go and digg it and post one of the LRL UK buttons to your blog. If not…read on!

Basically, it’s gonna be brilliant. This is the fourth year of LugRadio Live in the UK — we did the live event in the US as well for the first time in April this year, and it was pretty damned cool — and we’re really looking forward to it. It’s always a jolly good laugh putting together LRL; looking through people’s speaker submissions (if you submitted a paper, I’ll be sending you details of when you’re speaking or whether you weren’t accepted in the next few days, I promise), thinking up cool stuff to do, and planning the live show.

This year, I’m really looking forward to seeing the speaker lineup — we’ve got some ultra-cool people talking about technology and culture and open source, and we’ve got some ultra-cool people exhibiting their projects and their products and their companies as well. The thing that really gets me about LRL every year is the vibe — we got described as a “rock conference” a couple of years ago, and it really summed up the feel of the whole event for me. It’s about having a laugh. We originally set up LugRadio Live because the fun bit at all the other conferences was the evening when you hung out with a bunch of cool people and had a beer and chatted about everything — our thought was, why can’t we just take that feeling, that experience, and make a whole weekend out of it? And lo and behold, that’s what we’ve done for four years now, which I’m really quite proud of!

Enough of why you should come and of back-slapping. How can you be part of LRL? It’s in Wolverhampton on Saturday the 19th and Sunday 20th July (see the travel info for how to get to the venue). We’ve got deals with local hotels, too — LRL is a true grassroots event (that’s why it’s five quid for a two day conference), so we don’t want to make it expensive, because people pay themselves. Your company probably won’t send you to LugRadio Live…but they should. You’ll find out more there than in a month of listening to people in suits. :)

Anyway, come to LRL and be part of it. You can digg it, but more importantly tell your friends that you’re coming and get them to come too! You can pick one of the I’m coming to LugRadio Live buttons to put on your site, or design your own custom button if you don’t like ours! So…get involved! See you in July!

]]>
http://www.kryogenix.org/days/2008/06/17/lugradio-live-uk-2008-is-coming/feed
Non-capturing groups in a regexp http://www.kryogenix.org/days/2008/06/17/non-capturing-groups-in-a-regexp http://www.kryogenix.org/days/2008/06/17/non-capturing-groups-in-a-regexp#comments Tue, 17 Jun 2008 15:26:21 +0000 sil http://www.kryogenix.org/days/?p=1515 Bridge to engine room, geek factor nine. Those of you who read this for musings about the world, stop reading now.

Alex at work has just alerted me to the existence of non-capturing groups in regular expressions. I had no idea these existed, and they’re pretty useful if you’re doing RE matching. If you’re trying to match a string which might be “fish, chips and ketchup”, might be “fish, chips and peas”, and might not contain the “and chips” at all, and what you care about is what’s last on the list (the “peas” or “ketchup”) then I’d have used a regexp like /fish(, chips)? and (.*)$/. Matching that against “fish, chips and peas” will give you back a three-item tuple, ("fish, chips and peas", ", chips", "peas"). (Test with JavaScript) You need the brackets around “, chips” in the regexp because you want to treat it as a group. However, it ends up in the results, and that’s really irritating.

Now I know about non-capturing groups, I’d do this: /fish(?:, chips)? and (.*)$/. The ?: after the opening bracket of the group means “don’t capture this group”. So now the results you get back are ("fish, chips and peas", "peas") — the chips, which we don’t care about, are not mentioned! (Test with JavaScript)

Another useful little trick to add to my toolbox. Cheers, Alex. Everyone who is reading this and thinking “I knew about this ages ago”, why didn’t you tell me?

]]>
http://www.kryogenix.org/days/2008/06/17/non-capturing-groups-in-a-regexp/feed
Immaturity http://www.kryogenix.org/days/2008/06/08/microformats-are-shi http://www.kryogenix.org/days/2008/06/08/microformats-are-shi#comments Sun, 08 Jun 2008 20:06:19 +0000 sil http://www.kryogenix.org/days/?p=1512 Jeremy Keith</a> ]]> I probably shouldn’t be laughing as much as I am about having just created this, because it’s not the most mature thing I’ve ever done. Hey, what can I tell you; it’s been a long week.

<a href="http://adactio.com” rel=”enemy“>Jeremy Keith</a>
]]>
http://www.kryogenix.org/days/2008/06/08/microformats-are-shi/feed
Not going to Guadec http://www.kryogenix.org/days/2008/06/05/not-going-to-guadec http://www.kryogenix.org/days/2008/06/05/not-going-to-guadec#comments Thu, 05 Jun 2008 13:13:29 +0000 sil http://www.kryogenix.org/days/?p=1511 This year, for the first time in a few years, I’m not going to be able to make it to Guadec. I’m pretty sad about this — it’s always a fantastic time — but I’m not going to be there. It looks like it’s going to be insanely great, though, as ever, so have a laugh, all. I shall try and write up the things I was going to talk about into a guide to cool things that you can do in gedit (which I was planning to do anyway, before deciding to turn it into a Guadec talk!)

]]>
http://www.kryogenix.org/days/2008/06/05/not-going-to-guadec/feed