Category Archives: Linux

Managing changelogs with dch

A quick (and fairly obvious, now I think about it) tip for anyone who doesn’t have time or inclination to manually insert dates and version numbers into changelogs: Debian’s dch command (part of the devscripts package) can be used for more than just Debian package changelogs…

First, create a changelog file and edit it:

dch --create -c /path/to/CHANGELOG

Then, when you have a new release, either increment the version:

dch -i -c /path/to/CHANGELOG

…or give it a new version number:

dch -v 1.0.5 -c /path/to/CHANGELOG

Pidgin: working around the developers

I’ve written a couple of times about a change to the Pidgin IM program, which has proved particularly unpopular with users.

As I suspected might happen, the developers have finally responded to the bug that set this issue off, with a WONTFIX.

The issue is now getting a little wider exposure in the media, along with news of a fork – the rather lamely named funpidgin. While I’m always happy to see a fork – and there was certainly good reason to create this one, given that the change makes Pidgin so utterly annoying to use – I’m not entirely convinced that this one will go all that far.

A simpler way to fix the problem would be to use Artemy Kapitula’s manualsize plugin – except that it had to be compiled as part of the pidgin source code, which was a bit of a pain. I have now created a standalone tarball of it, along with a Debian package. An Ubuntu package will be coming soon, when I’m not stuck using Australia’s pathetic satellite broadband service. Users of Ubuntu Hardy Heron will probably want to use this package, as it is too late for it to be included in the forthcoming Guifications plugin pack, for them.

Combatting telemarketers with Asterisk

One of the few good acts of the previous government was the legislation and subsequent funding of the Do Not Call register, allowing those people who do not want to talk to telemarketers to opt out completely. I registered for it as soon as it went live, and I definitely noticed a reduction in the number of unsolicited calls that I received.

Unfortunately, the legislation simply did not go far enough; political organisations, polling companies and especially charities are exempt from the DNC register. The number of charities calling lately has risen considerably, and it’s starting to drive me insane.

I have a rule: I will not give any money to a charity that asks me for it. That includes phone calls, doorknockers (the Consumer Action Law Centre has a good sticker that deals with them) and that incredibly annoying import from the UK – twenty-somethings with clipboards on city streets.

At this point, I will make a brief aside: if there’s anyone from Amnesty International reading this, could you please screen your clipboarders better? I really don’t appreciate your blow-ins asking me ridiculous questions, such as, “how long do you plan to live here?” as I exit the gates at a city railway station, and then abusing me when I tell them I don’t have time to talk, because I’m rushing off to recover a server that’s crashed in a large telco.

Back to the phone calls, however. Asterisk has a nice little command that will deal with telemarketers with autodialers – Zapateller. When invoked, it will play three tones that cause the telemarketer’s autodialer to think that the number is not valid, and then hang up.

I put the Zapateller command into my dial plan yesterday, and today I’ve received three phone calls, all of which had disconnected by the time I answered them.

  ; Ring both phones
  exten => 2100,1,Answer()
  exten => 2100,n,Zapateller()
  exten => 2100,n,Dial(SIP/snom&SIP/sipura,20)
  exten => 2100,n,Voicemail(u2000)

I will eventually put a couple of seconds delay between the Zapateller command and the line that dials my two telephones, so that I don’t hear any ringing at all.

Obviously, there’s no way I can be sure the callers today were telemarketers, especially since I’m not paying for caller-ID, but given that I haven’t received any personal calls on this line in weeks, I can be fairly confident that my phone system has only been playing tones to an autodialer… and Asterisk

For any Asterisk users out there using sipme as their Voice-over-IP provider who, like me, have been banging their heads against walls trying to figure out why it isn’t working, it turns out that sometime in early February, they made a change to their SIP proxy setup and elected not to mention it on their website.

Their new equipment apparently doesn’t like talking to Asterisk, so to make it work, it’s necessary to mask the user agent string by putting the following in the [general] section of your sip.conf file:


…which I found out only after considerably websearching let me stumble upon this thread in Whirlpool.

Evidentally, I haven’t made any non-Melbourne phone calls for almost two months, or I’d have discovered this earlier.

Fixing pidgin’s UI regression

It doesn’t look like the user interface changes to Pidgin that I detailed here are going to go away any time soon, despite much concern about it. Last thing I read was that the developers had invoked the Gnome Defence, in that having too many useful features results in bloat (of course, no-one ever seems to remember that removing too many useful features results in Epiphany).

So, given that I simply cannot stand using it with the new interface, I’ve thrown together a very simple patch and a Debian package, replacing the chat window interface with that from an older version.

Pidgin: dumb user interface changes

I don’t know why application developers get sudden ideas to make significant user interface changes such as this:

Apparently it is intended behaviour, and there are a number of people who aren’t very happy about it.

I rank this one up there with the one where Galeon had all its options and features removed.

Playing audio streams with xine-lib

Should anyone be interested in writing their own audio player (and surprisingly enough, I’ve found the need to do so on more than one occasion), I’ve started writing a tutorial on using xine-lib. It’s a great little library, but there’s next-to-no documentation out there for it…

Lazyweb: GtkMenu help needed

Whenever I try to do any GUI coding, I seem to be continually tripped up by what appear to be incredibly basic problems. I don’t know whether it’s just that I don’t think the same way as the toolkit designers do, or if the toolkits are just designed in the most complicated way possible.

I’ve read over and over the GtkMenu and GtkMenuItem documentation, but I cannot see any way of getting the index number of a GtkMenuItem that is clicked on within a GtkMenu. It seems to me like this would be a fairly common thing to want to do, in order to create GtkMenus with dynamic items.

Can any GTK experts out there give me some suggestions as to how I can get the index number of the GtkMenuItem clicked on, in the handler() function below? (Aside from supplying menu_item[i] in g_signal_connect_swapped and then looping through all of menu_items[] and comparing them, that is). Surely the GTK designers can’t assume that every menu item is going to be connected to a different handler function?

    /* ...  */

    GtkWidget *menu;
    GtkWidget **menu_items;

    /* ... set menu item labels in LABEL[NUM_ITEMS] ...   */

    menu = gtk_menu_new();

    for(i=0;i<NUM_ITEMS;i++) {
        menu_item[i] = gtk_menu_item_new_with_label( LABEL[i] );


        g_signal_connect_swapped(menu, "button_press_event",
                G_CALLBACK(handler), ??? );

        /* Alternatively: 
        g_signal_connect_swapped(menu_item[i], "button_press_event",
                G_CALLBACK(handler), ??? );


    /* ...  */

static gint handler (GtkWidget *widget, GdkEvent *event) {

        /* ... want to find out which menu_item (n) was clicked on ...  */

        printf("You clicked item number %25d
", n );

Combatting trolls on Usenet

Despite its bad reputation, I still read Usenet regularly. It’s far more convenient to use than web-based forums (and their invariably over-zealous moderators – we can’t possibly have two threads on the same subject!), and it’s much easier to subscribe to and unsubscribe from newsgroups than to sign up and remove oneself from individual mailing lists.

Usenet has gained much notoriety as being a haven for spammers. This is a tad unfair; while newsgroups certainly do get a little bit of spam, I believe that my email spam-filters catch more spam to my own personal email address each day than I would see on all 30 newsgroups that I read, combined.

No, Usenet’s biggest problem isn’t spammers; it’s trolls and children (often one and the same). Most Usenet readers tend to ignore spam – or report it, occasionally getting the spammer shut down. Trolls create a problem because otherwise sensible people cannot seem to stop themselves responding, and after a short period, you have newsgroups filled with off-topic rubbish. is a prime example. This was once an interesting newsgroup, but as the internet became mainstream, and the death-by-one-thousand-cuts of children was inflicted upon Usenet, has become a wasteland, inhabited by what one regular poster has described as “sockpuppet armies”, one or two people posting nonsense, under a variety of different names. The problem becomes noticeably worse around school-holidays. Add to that cross-posted political arguments from aus.politics, and it becomes rather difficult to see the signal amongst the noise – and yet, despite all of this, the signal is still there. Other newsgroups have similar issues; for example, American nationalists seem unable to keep themselves from crossposting anti-European material to

The biggest problem with trolls is that they cannot simply be killfiled; other people respond to their posts, so all that killfiling achieves is to remove the first post from a trolling thread. Killfiling the entire subject line of a post by a troll doesn’t work either, as sometimes they will respond to an on-topic thread, and this would have the effect of killfiling legitimate posts, too.

The best way to clean up trolling posts in a newsgroup is to killfile any thread that is started by a troll. I haven’t seen any newsreader with this feature yet, so I threw together a quick, kludgy method for doing it, although it is fairly specific to my newsreading setup, which uses Leafnode to spool newsgroups on my laptop and nn to read them.

The killfiler program consists of a perl script called threadkiller, which reads through the spool, searching for posts from people listed in a blacklist and then checking them to see if they are the first post in a new thread. Currently this is determined by looking for the absense of “Re: ” at the start of a subject line, but obviously a better test would be to check for the presence of a References header. Once completed, the script spits out a list of subject lines in nn’s killfile format, onto stdout, which can be appended onto $HOME/.nn/kill. The script keeps track of which newsgroup posts it has already read, so that it isn’t continually rereading hundreds of posts each time it runs.

A future enhancement that I plan to add is one to automatically killfile any thread that is crossposted to newsgroups that are completely off-topic; nn already has a method for doing this, but its operation is quite cumbersome and doesn’t always work. That, in itself, would probably remove around 30%25 of the rubbish in

Introducing ARMbuntu – Ubuntu for ARM processors.

Well, holed up in bed, as I am, with the flu, I finally had time to finish this off, after almost a year. ARMbuntu is an attempt to port Ubuntu (Dapper Drake) to the ARM architecture.

I built it by running a copy of Debian/ARM (Sarge) under QEMU (instructions here), and then slowly building Ubuntu’s source packages until I had enough to run a very minimal system. Usually they built cleanly, but in a few cases I had to apply some patches (glibc is one that springs to mind), and for some other packages I’ve done really dodgy things like skipping all the testing, because it was just too slow and for others. Most of the time was taken up figuring out whether Debian sarge/etch packages would work as build-dependencies, and if not, compiling up build-deps from Ubuntu’s sources.

There’s no kernel packages, currently I’m using a kernel image that I found on the QEMU website; basically, all that is available at this stage is enough to satisfy the dependencies for the ubuntu-minimal package, and build-essential.

I didn’t have any real reason for working on this… just too much spare time, last year, and too many spare cpu cycles. I know I could probably have done it faster with a cross-compiler or Scratchbox, but as I already had the QEMU/arm system working, it seemed like less effort this way.

I don’t have enough bandwidth to handle lots of people potentially trying to suck it down at once, so I’ve set up a bittorrent tracker instead. If anyone really wants a copy quickly, drop me an email and I’ll point you to a url where you can get it.

Not sure what I should do next, with it. Maybe some Ubuntu people out there have some suggestions.