Loading remote URLs from mutt

My email lives on a virtual server and lately I've been accessing it with mutt on that machine via SSH. I really like mutt, but this makes things tricky when someone emails me a URL and it's either awkward to copy & paste (e.g. PuTTY) or I'd like to look at the web page on another machine--often I have my laptop to one side for email while doing other things on my desktop machine.

Mutt uses the rather nice urlview program to extract URLs out of email messages for easy selection. urlview's handler script can also be hijacked to do whatever you want. I've set mine up to generate an HTML file in the server's webspace. This HTML file has a meta refresh tag to immediately redirect the browser to the URL of interest.

Now when I get a URL in an email I hit ^b to invoke urlview, select the URL I want, load a web browser on the target machine and choose my bookmark for my own URL redirector.

To set this up yourself:

  1. Install the urlview package
    aptitude install urlview
  2. Modify /etc/urlview/url_handler.sh to call your own script. I put the following line under the user-configurable settings but before their own handler:
    /usr/local/bin/sharelink.sh $1
    
  3. (Optional) Disable the http handler so that you don't end up loading elinks or something else on the computer running mutt:
    http_prgs=""
  4. Create a world-writable file in the machine's webspace: (but not world-deletable! The parent directory should only be writable by www-data or root.)
    touch /var/www/link.htm
    chmod 0666 link.htm
  5. Create a script to generate that link.htm. In my case I used this following in /usr/local/bin/sharelink.sh:
    #!/bin/bash
    
    LINKFILE=/var/www/link.htm
    url=$1
    
    cat > $LINKFILE <<EOF
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head><title>Email Link Redirector</title>
    <meta http-equiv="refresh" content="0; URL=$url"></head>
    <body><h1>Redirecting</h1><p><a href="$url">$url</a></body>
    </html>
    EOF

Coming up with a cool way of retrieving attached files is left as an exercise to the reader.

Amarok 1.4 on Squeeze

Some good news: it looks like Amarok 1.4 can run in Debian squeeze with minimal fuss by using some of the packages from lenny. This is nice because Amarok 2 doesn't seem to support CDDB lookups yet.

First, most of the dependencies can be fulfilled using the squeeze repo:

aptitude install libtagc0 libtunepimp5 libkarma0 libnjb5 kdelibs-data libarts1c2a libavahi-qt3-1 kdelibs4c2a libpq5 libifp4

Then, grab packages for your architecture from here:

http://packages.debian.org/lenny/amarok
http://packages.debian.org/lenny/amarok-common
http://packages.debian.org/lenny/amarok-engine-xine

http://packages.debian.org/lenny/libmysqlclient15off

http://packages.debian.org/lenny/libmtp7
http://packages.debian.org/lenny/libgpod3-nogtk

And install them:

dpkg -i amarok_1.4.10-2lenny1_amd64.deb amarok-common_1.4.10-2lenny1_all.deb amarok-engine-xine_1.4.10-2lenny1_amd64.deb libmysqlclient15off_5.0.51a-24+lenny4_amd64.deb libgpod3-nogtk_0.6.0-6_amd64.deb libmtp7_0.2.6.1-3_amd64.deb

Nothing's broken yet...

Hooray!

Thank a developer

"Thank you for you mail. It always gives me a warm feeling in my heart to see someone using my script"

A lot of free software exists because of the work of volunteers -- particularly the smaller projects for more obscure tasks, often with only one developer. They don't do it for money. They do it because they want everybody to be able to benefit from the work and that happens and that's great.

Occasionally I find some oddball program or script particularly useful and it occurs to me that the developer probably doesn't realise that other people are finding it handy. It's too small or insignificant to have a "community". Sometimes I'll take a minute to send a small sincere thank you email. The developer gets a warm fuzzy feeling and in turn I get a little satisfaction for doing so. Who knows, the developer might even be encouraged to spend more time on the project if they know it's being used.

Next time you find yourself thinking "holy cow this thingy is awesome", maybe a friendly thank you email would be a nice way to express it.

Experimenting with BFS

I was listening to some mp3s in cmus at the same time as compiling gnome with jhbuild when I was experiencing relatively frequent gaps in the music. It shouldn't be my responsibility to juggle nice levels so I decided to try the Brain Fuck Scheduler which is rumoured to be more responsive with small numbers of CPUs than the mainline kernel's Completely Fair Scheduler, which has been used since 2.6.23.

Running off the Linux v2.6.35 tag, here the results of my highly scientific experiment:

Scheduler                           Gap-free playback    jhbuild compilation speed
----------------------------------------------------------------------------------
Completely Fair Scheduler (CFS)     Doesn't work         Fast enough
Brain Fuck Scheduler      (BFS)     Works                Fast enough

Precise? No. Complete coverage of factors which I care about? Yes.

The only notable distribution in which it is used seems to be CyanogenMod for Android phones. While sporadic arguments continue around the complicated political and technical reasons for the lack of BFS in mainline, both of which are free software, some users like me are missing out. Maybe one day I'll understand.

Bored in Networks Class

Sausage Taco

Just a few minutes ago I was laying in bed dozing off and dreaming about eating a taco when I had the most wonderful idea:

Normally when you're constructing a minced beef taco the meat falls out and goes everywhere and you make a mess. Why don't we just cook up some beef sausages instead and put those in the tortillas before adding salads and sauces?

Bam, said the lady.

The Deplorable State of Commercial Gaming

I'm really quite angry right now: half at Blizzard, and half at myself because I knew that I was going to get something like this and gave them my money anyway.

Starcraft II doesn't support LAN play. This is not just a case of needing to be online and authenticated with Battle.net to fire up a server. That would be annoying but could be poorly justified by the improved integration with your online profile.

No, Starcraft II goes out of its way to make playing on a LAN difficult even when everybody has purchased the game and has logged on to Battle.net.

Suppose you're at a LAN with a bunch of other dudes (or gals, let's be optimistic) and you're fortunate enough to have an Internet connection so that you can all get onto Battle.net. As best I can tell, you have two options for getting in a game together:

Option 1: Invitations

  • Go around and find out each other's user names on Battle.net and add each other as "friends".
  • Have the host start a private game and then invite all the relevant people to the game.
  • Other players accept the invitation.
  • Fingers crossed packets will actually get routed over the LAN (this has been hinted at but I haven't tested it.)
    (update: a friend informs me that everything goes through Singapore. Yay.)

Option 2: Public and Pray

  • Have the host start a public game, which allows anyone on Battle.net to join.
  • Tell the players what map it is.
  • Players try to connect and hope they get the right server.
  • Host kicks other players who try to join because they figure it's a public game.
  • Again, fingers crossed regarding routing.

This is seriously crap.

As the people who are reading this probably know, I help run LANs this year where we don't have Internet. I had a glorious plan to allow people to connect to Battle.net through my phone's 3G connection so that we could get some games happening, but nobody's going to want to go through all the above to make it work. Sure, I'd probably do it because I really like Starcraft but I would feel like a deluded fanatic saying "Hey you should play this game! It'll be great! We just have to do all this bullshit to make it work, but you know you want to!"

It's like a fricking iPhone. Sure, I could buy one and jailbreak it to do what I want. Sure, somebody's going to hack SC2 so it can be played on a LAN eventually. But I shouldn't have to do it. Antifeatures are lame. I may not have bought an iPhone but because of my lack of moral conviction Blizzard already has my money and they don't give a toss what I think from here on in.

I should learn to find Battle for Wesnoth exciting or something.

iPhoto to GIMP

When I first started playing photography properly I was content to use iPhoto to do my basic post-processing. Now I'm in a mac-less environment and I like to use GIMP to edit things. Unfortunately I wasn't really sure what iPhoto was doing with my photo: I would just tweak the sliders until I was happy. That left me wondering what the "real" edit is to achieve the effect of the "Shadows" and "Highlights" sliders.

Answer: It's all in the levels editor. Go to "Levels..." in the Colors menu and you're greeted with a level-editing histogram.

  • Moving the middle triangle in Input Levels to the left is the same as increasing the "Shadows" slider in iPhoto.
  • Moving the right triangle in Output Levels to the left is the same as increasing the "Highlights" slider in iPhoto.

And with a bit of tinkering you can work out how to do other things too. Hooray.

Cuckoos and Crackers

On a friend's advice, this week I found at the library and read The Cuckoo's Egg: Tracking a Spy through the Maze of Computer Espionage by Clifford Stoll. Wow. What a read: a true story about an astronomer-programmer who as a beginning system administrator finds evidence of an intruder and ends up spending the better part of a year tracking him down to West Germany where he's involved in selling US military information to the KGB. Wow.

I think I'm a little behind the times. This book was published in 1991 and it feels like everyone involved in computing apart from me knows about it by now. The fact that the story is over 20 years old now makes the book fascinating for a number of reasons apart from the simple tracing of the cracker. Stoll goes into detail about the lifestyle at the Lawrence Berkeley Laboratory and his own thoughts on the political and social responsibilities of computer network users.

The story is from a time when, at least in academia, computer systems were relatively open. Multiple users shared computers generally in order to work collaboratively. One of his conclusions in the book is that we must work hard to maintain trust rather than put energy into abusing that trust, because of the damage it does to the network and how easily we can work together.

I guess we failed. Not that I was old enough to do anything about it but it's a damn shame to see that that's how it went. It's a fact of online life now that everything online needs to be locked down. Even if you want to be share your data, the more mechanisms you make available for that data to be shared the more software you're exposing which could potentially have bugs in it. And inevitably there are people out there who wish to exploit those bugs, for a variety of reasons. Sigh.

The second interesting point was in his epilogue discussion about the transmission of a worm: a conclusion that computer networks have robustness due to the diversity of types of nodes. A virus for a VAX can't run on an IBM system, etc. Though he couldn't possibly have foreseen it at the time, we're seeing a heavy convergence towards web applications right now. What used to be a diversity of operating systems with standard network protocols is now becoming a diversity of web browsers with standard markup and javascript.

I think he has valid point even though it was made quite a while ago now. The ability for us to have operating system/browser diversity derives directly from open standards and open implementations. Look what happens when there's a bug in Adobe's flash implementation. Oops, everyone's vulnerable. And being closed source doesn't help. Let's keep our standards open.

The final point which I found particularly interesting was Cliff's own change of opinion. Initially he took a fairly loose apathetic view that breaking into other systems for fun could be just playful or even a good thing if it exposed problems. By the end of his ordeal he decided that the very act of messing with other people's systems is damaging simply because of the goodwill and trust which is lost, not to mention the amount of time which people like him have to spend working on problems they wish they didn't have.

A great book. Go read it sometime. You wouldn't have to be a computer person to appreciate it either, but it probably helps. :)

Turkey’s Internet Censorship

The political battle of censorship in Australia has been relatively futile so far for those of us against it. By its proponents, issues have been muddled together, sensationalist terms like "child porn" have been bandied about and claims have been made that it's safer for Australian children using the Internet. That last part is supposed to be the official reason for the policy -- or is the one written down, at least. Senator Conroy redefines the purpose of the filter every time he opens his mouth.

Those of us against it are trying to cut through this nonsense and point to the bigger issues. Suppose that they were only out to block child pornography websites. The material is obviously bad. The material is obviously illegal. But it still does not make the filter the right policy because of the level of the trust we put in the Government not to abuse their power now and in the future. (And in reality they want to block "refused classification" material, which is a very fuzzy definition which definitely includes material which is legal to own.)

So can we trust the Government? My instinct says no. However there's nothing like the benefit of hindsight. Gizmodo has recently posted a short article about what's happened in Turkey since the introduction of their filter, including a 3-minute video report [youtube] from Al Jazeera about how badly the situation has devolved. Not only are all kinds of websites being blocked for political or religious reasons, but no progress is being made in the attempt to have the laws appealed.

Could it happen in Australia? You bet. You bet our civil rights on it.

EDIT: Another highly recommended article about the flaws of censorship in general:  The State of trust: it's a one way street