useful git aliases

Thought I’d share some useful git aliases with people. These can go in your ~/.gitconfig.

[alias]
    branch-name = !git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \\(.*\\)/\\1/'
    export-branch = !git format-patch --stdout $1 > ~/Desktop/`git branch-name`.diff

git branch-name (based on an idea from Jon Maddox) will print the name of your current working branch. For example:

[danni@adelie empathy]$ git branch-name 
ft-warning-644062

This can then be used to create another alias, git export-branch which will export the current branch from the named branchpoint to a format-patch called ~/Desktop/branchname.diff. For example:

[danni@adelie empathy]$ git export-branch gnome-2-34
[danni@adelie empathy]$ ls ~/Desktop/*.diff
/home/danni/Desktop/ft-warning-644062.diff

Update: thanks to David in the comments for a much more reliable approach to get the branch-name:

branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`

Trying out Chromium (Google Chrome)

Due to tiredness with Firefox eating all my memory, getting out-of-memory killed for eating all of my memory, getting kind of slow (probably because it ate all of my memory) and an annoying layout bug in one website (which strangely didn’t appear on any other machine using Firefox except mine); I have decided to give Chromium a go (also, Melbourne is currently full of Google Chrome ads, this may have contributed to my decision).

Initial niggle was that it doesn’t seem to have a concept of minimum font size exposed in the UI. You can edit a config file to solve this, which is significantly less annoying than the extension that resizes your page 5 seconds after it loads.

Most of the extensions I use are available for Chrome, except I haven’t found an analogue for the very useful highlighter extension.

linux.conf.au roundup

Got back from linux.conf.au on Saturday afternoon. Sore and tired. Here is a brief roundup of my conference.

Monday

Spent the day at the Haecksen mini-conference. Gave my talk on the GNOME Outreach Programme for Women (yes, I will upload either my notes, or link to the video when it appears). Favourite talks for the day were Noírín’s on open source disaster and emergency management software and Donna’s. [You can learn about and contribute to Donna’s campaign to Digitise the Dawn here.]

Went to the Geek Girl Dinner in the evening. There was a paper plane competition. My plane performed woefully poorly.

Tuesday

I didn’t actually make it to the conference on Tuesday, because I spent the entire morning in a brainstorming meeting, which didn’t finish until after lunch. I decided to use the rest of the day to visit a friend.

I would have liked to have heard about Publican, the publishing tool Redhat use for their documentation. I wonder if it could be adapted to publish the Telepathy book.

Wednesday

The keynote talked about the IPv4 address exhaustion. Very doom and gloom. I can’t help but feel in the immediate term this will mostly affect people in the developing world. Maybe the take-away point is buy your iPhone now, while it can still be allocated an IP address.

Learnt about Intel’s new GLSL compiler, multi-core scalability in ext4 (interesting take away points for multithreaded userspace programming too), and how technical documentation is written at Redhat. Also attended two X/graphics talks. These mostly seemed focused on history, not really a clear vision of what happens next.

The Professional Delegates Networking Session (at the Maritime Museum) was enjoyable. Giant woks for cooking noodles. Surprise Australia Day fireworks. I didn’t go on any of the boats.

Thursday

Keynote was on the history of sendmail. I have to admit, I don’t really know if the history of projects is that interesting for a keynote address. I’d rather know what the future was going to look like. Learned that the keynote speaker and I are going to appear in the same book.

Advanced C Coding was actually just a show off of CCAN and I didn’t actually learn any new coding tricks. I went to Dave Airlie’s talk, but due to tiredness (did I mention I was staying with a one-year-old?), I can’t tell you what it actually contained.

Made a last minute decision to go to the LBGT lunch, this turned out to be a planning disaster that involved a 20 minute, uphill walk in the sun. It ran over, cutting into the next sessions. Between this, existing tiredness and now exhaustion, ended up writing the rest of the afternoon off and going back to the flat to nap prior to the dinner.

The Penguin Dinner was quite enjoyable. The vegan option was really tasty (entrée, main, dessert). I want to try and recreate the entrée.

Friday

Friday’s keynote was the disappointing one I mentioned earlier. Take away point is that Facebook is evil because it keeps your data locked up and they know all about your social network. Not sure how using an open system to store your social network would somehow prevent people who run servers from mining information from it.

Wanted to see Carol Smith’s talk, but the room had packed out by the time we got there. Sarah Sharp’s talk on open source gardening was probably a highlight of the conference for me. Part of me wants to replicate her garden watering system, although I think first I might still try my low-tech solution. The part of Tridge’s talk on reverse engineering USB device drivers was quite interesting.

~

Flew home Saturday morning, so I didn’t see any of the open day.

Was amused to learn that next year’s conference is in Ballarat. I wonder how some people are going to feel about landing in Melbourne, then having to take a bus to Southern Cross train station and then a train to Ballarat (Metlink informs me the total trip takes 2-2.5h).

Overall I had an enjoyable week, but an exhausting one. I enjoyed the company of the people I was staying with. I met some new people, who were pretty cool. I talked about rollerderby and the queerness of different shoes. Was really impressed by the Brisbane busway system. Helped someone debug telepathy-gabble.

Thanks as always to Collabora (my employer) for letting me go :)

Disappointing linux.conf.au keynote

The linux.conf.au anti-harassment policy states:

Harassment includes:

  • sexual images in public spaces

Yet Friday morning’s keynote, Mark Pesce, progressively violated this policy, starting with comic sexual images and culminating with a soft-core, lesbian bondage photograph.

Sorry, a “PG-13” rating does not excuse this behaviour. Yes they were wearing lingerie, it’s still pornographic. And for those who are going to continue to insist it wasn’t: the porny presso bingo card (via Skud).

Update: the chief linux.conf.au organiser made an apology for this morning’s keynote during the closing ceremony.

Virgin Mobile internet sporadicness

Perhaps someone can help me out here.

In January I switched from Optus to Virgin Mobile on my mobile phone. Optus 3G on my phone tended to work quite reliably, but on Virgin it tends to get backed up or just drop my packets from time to time. Tracerouting (via mtr) seems to suggest it’s a problem with Optus’ IP network1, where it will begin to drop packets between two routers on that network.

Googling comes up with other people complaining about this on Whirlpool, but nothing that looks like a solution. Has anyone else run into this? If so, how did you resolve it?

[1] Even though Virgin Mobile is carried on Optus’ phone network, I was surprised to see IP addresses from Optus’ IP network.

Collabora @ GUADEC 2010

You might have seen the t-shirts around, there are quite a few (twenty!) Collaborans at GUADEC this year.

IMG_8997m

Like a game of bingo, see if you can spot them all: Gustavo Noronha, Travis Reitter, Youness Alaoui, Felix Kaser, Guillaume Desmottes, Nicolas Dufresne, Jonathon Jongsma, Olivier Le Thanh Duong, Eitan Isaacson, Marco Barisione, Tomeu Vizoso, Cosimo Cecchi, Olivier Crête, Danielle Madeley, Sjoerd Simons, Rodrigo Novo, Senko Rašić, Thomas Thurman, Philip Withnall and Louis-Francis Ratté-Boulianne.

There are also all twelve members of Collabora Multimedia here.

Collabora is hosting a beach party on Thursday, starting from 7pm. Word on the street says there will also be ninja t-shirts available at some point.

streaming to Airtunes (Airport Express) with PulseAudio

So, being back in Australia, the sun is shining, I'm sat on my sofa and I can't help but feel like I'm on summer holidays. So I want to crank some Uh Huh Her on the stereo.

We have an Airport Express, but using would normally require using Steph's computer, or the computer downstairs. So instead I thought I'd give the support in PulseAudio a go.

It's pretty easy to set up. Install the (Debian/Ubuntu) packages paprefs pavucontrol pulseaudio-module-raop pulseaudio-module-zeroconf (Fedora packages might have different names). Run paprefs and tick the option to discover Airtunes devices.

paprefs
Then using pavucontrol you can set the output device for an application.

pavucontrol
It's not perfect yet, it can sometimes get stuck skipping, and you have to move the stream to your local computer and back to the Airport (apparently the buffering is just implemented using windowing, but maybe needs to be smarter?), but it's working pretty good. Still, it's insanely neat, and because it's in PulseAudio, you can redirect any stream you like (not just from your music player).

It's not just Airtunes either. You can stream to other PulseAudio servers (discovered over mDNS) as well as UPnP media renderers.

Upgrading to Ubuntu Karmic

Upgraded to Ubuntu Karmic pre-release today on my Thinkpad X200s. Had two issues:

  1. machine wouldn't prompt for the key to unencrypt the hard disk so it didn't boot. This seems to be Launchpad bug 446591. I followed this fix.
  2. forgot that I had downgraded my Intel graphics driver to v2.4, causing my consoles to break, suspend to RAM to break and only support a broken version of EXA. apt-get install xserver-xorg-video-intel fixed this.

Things seem much better now than the mess I had this morning.

improving your code by fixing warnings

I don't know why, but there is a class of software programmer who seem to believe that compiler and runtime warnings are somehow optional, or something that can be cleaned up at a later date. This class of programmer is very common in the commercial software world.

I've never really been sure why people think these warnings can be ignored. Compilers are pretty smart these days, and if a the compiler says you have a type-mismatch for your pointer assignment… there's a good chance you did something silly.

Library developers don't just add all of those pesky assertions to their methods for fun. If your code is outputting critical warnings, you probably shouldn't be surprised that it's crashing shortly afterwards. Something clearly went wrong.

So what can you do? Compiling your code with warnings-as-errors when developing it is a very good step (-Werror in gcc). For runtime warnings, you can probably set an environment variable to make the program abort when reached (e.g. for GLib you can export G_DEBUG=fatal-warnings or fatal-criticals) — this allows you to attach a debugger when the warning is reached.

Simple steps for much better code.