Autolinking URLs

I use ecto for posting, which is pretty cool. I’d like to be able to have it so that it creates links automatically from URLs that I happen to write in. Thus http://www.google.com automatically becomes http://www.google.com enabling me to just enter a URL in a post. The best method for doing this would have to be regex:

((?<!(<a href="))(?<!(>))((https?|ftp://)|((mailto|aim|svn):)|(file:///)|((?<!://)www\.))[a-zA-Z0-9_$!&%?,#@'/.*+;:=~-]+\w)\.{0}

This will match a URL that isn’t already in an href link. Took me ages to work out. This will also match www.google.com. And not the dot at the end. I’m still working on code that will create links. I think a seperate regex for each type of URL might be useful.

Hamoa Beach • Gomez • How We Operate

which python?

I came across a strange issue today. I have written a script that adds acronym tags to a post created in ecto, and another that adds the currently playing iTunes track, as nice links to iTMS. However, the problem that arose is that the script wouldn’t run. I had the shebang line, and everything, but no joy. Then I noticed that I have upgraded my python installation to 2.5, but for some reason the /usr/bin/python was still pointed at 2.3 - but my interpreter run from the bash shell, or from Komodo was 2.5. This itself wouldn’t be too much of an issue, except I was using appscript, and I had only installed appscript into the 2.5 Python installation library. So, it was failing (way too silently, for my liking), and I couldn’t tell why. All fixed now, though.

Fly Me Away • Supernature • Goldfrapp

Git vs. svn

I’d love to move to Git, even though I’ve really only just started using svn. There’s only one thing holding me back: the fact that all of the tools I use support Subversion, but not Git. I’d probably settle for just one non-CLI tool, like SCPlugin. I’ve even downloaded the source code, and I will have a bit of a look at how that works, and if it is possible to translate that into Git-speak. I really like how Komodo and Xcode will also display the SCM status of a file - it’s just those little extra features that make it kinda easy to remember to commit changes from time to time.

Kernel Panic not fixed

I mentioned in my blog a while ago that the latest update seems to have fixed some wireless networking issues; it appears I was a little too hasty. The Kernel Panic issue is still present, as is the inability to actually force a certificate to be trusted. The third issue, that the machine doesn’t reconnect to a network properly, can be fixed by using unlockupd, which will relaunch lookupd, apparently fixing the problem. Bugger.

appscript: Is application running?

This is the best way I can find to test if an application is running under appscript:

1
2
3
4
    try:
        app('System Events').processes['AppName']()
    except:
        print 'Application AppName is not running'

I think it’s kinda neat. I’d like to know of a better method, but I looked pretty hard!

Burn Down The Mission (Live) • Elton John • Live In Australia ★

rwhod OS X weirdness

I like using rwhod on my home network. It means I can see how long the various machines have been on for, but there is one issue. On my Ubuntu box, everything is hunky dory. rwhod starts at boot, and tells me the uptime of that machine, and who is logged in. However, on the Macs, rwhod, while started, doesn’t seem to work. If I kill the process, and restart it (both as superuser), then it picks up the data fine. I wonder if it has something to do with starting too early in the boot sequence. I’ve got it set up as a LaunchDaemon, and it ran last boot as process 58. Perhaps something else needs to have started before it will work.

Flyin’ High • Baja Marimba Band • Espresso Espresso

Unpacking stuff

Well, after living in our new house for more than two years, we have finally unpacked all of the crockery and glassware into the kitchen. I mean, there was a rationale: we were renovating. Initially, we had thought it would take us a couple of months to get the house to a liveable state. We were at least an order of magnitude wrong. We have put enough of the kitchen in (including the microwave and dishwasher, but not the benchtops, stove and sink) to allow us to use it effectively. In particular, the dishwasher was the main reason we were able to even consider moving more than just two each of plates, cups, spoons, etc. Actually, living with just two of everything was very liberating. Granted, you have to wash everything before you cook every meal (or after, I suppose, but that’s not really my style). But never having more than a couple of dishes means that washing up isn’t such a chore. Entertaining wasn’t really an option. Other than that big party we had for our 30th birthdays, but that didn’t really require much crockery. So now, we have stuff again. We got rid of a heap of stuff we aren’t going to use. I’m still hanging on to some of the stubby holders and Star Trek mugs from my younger days, but we have really consolidated what we have. After all, if we didn’t use stuff for the last two or so years, we can’t need it too badly, can we?

Desperado • Eagles • Eagles Live ★

Safari 3 beta not displaying characters correctly

I’ve changed my default browser to Safari 3 beta, and I’m liking it a lot. It’s nice to use a Keychain aware application again (it makes it easier to find out what password I used for a site), but there is one issue with this browser on my site. I use a special character in CSS to get the stars in the top menu. The best way to do this is to use something like:

1
2
    #topnav li:before { content: "\2729  "; }
    #topnav li:first-child:before { content: ""; }

Which works great in most browsers. Sometimes I come across a browser on a machine that doesn’t seem to have the right font installed, and I see a box there instead. And then, last night I noticed the same behaviour in Safari 3: Safari3Characters Now, this does not appear like this in either Firefox, or WebKit on the same machine: firefoxcharacters imageswebkitcharacters So, the big question is, why is Safari 3 beta not able to display the font correctly?

netatalk seteuid issue

I’m having one small issue with netatalk. Every now and then I can no longer connect to the server, and I am seeing the following in /var/log/syslog:

Jul 21 21:25:49 localhost afpd[3345]: server_child[1] 19040 exited 1
Jul 21 21:25:49 localhost afpd[19041]: ASIP session:548(5) from 192.168.1.76:50047(7)
Jul 21 21:25:49 localhost afpd[3345]: server_child[1] 19041 done
Jul 21 21:25:51 localhost afpd[3686]: Warning: No CNID scheme for volume /home/installers. Using default.
Jul 21 21:25:51 localhost afpd[3686]: seteuid failed Operation not permitted
Jul 21 21:25:51 localhost afpd[3686]: Fatal error: cannot open CNID or invalid CNID backend for /home/installers: cdb

Restarting netatalk fixes the issue immediately. I have no idea what this problem means. It seems to happen after the server has been up for a while. The log from a successful connect looks more like:

Jul 21 21:46:54 localhost afpd[19109]: server_child[1] 19889 exited 1
Jul 21 21:46:54 localhost afpd[19890]: ASIP session:548(5) from 192.168.1.76:50066(7)
Jul 21 21:46:54 localhost afpd[19109]: server_child[1] 19890 done
Jul 21 21:46:56 localhost afpd[19120]: Warning: No CNID scheme for volume /home/media/music. Using default.
Jul 21 21:46:56 localhost afpd[19120]: Setting uid/gid to 1001/1001
Jul 21 21:46:56 localhost afpd[19120]: ipc_write: command: 2, pid: 19120, msglen: 24
Jul 21 21:46:56 localhost afpd[19109]: ipc_read: command: 2, pid: 19120, len: 24
Jul 21 21:46:56 localhost afpd[19109]: Setting clientid (len 16) for 19120, boottime 46A193BC
Jul 21 21:46:56 localhost afpd[19109]: ipc_get_session: len: 24, idlen 16, time 46a193bc

But the uid/gid isn’t always the same. It appears to depend on the permissions of the share. I wonder if I need to change a setting in the netatalk settings so it doesn’t require the seteuid.

BBC Radio 4 - Comedy - Hut 33

BBC Radio 4 - Comedy - Hut 33:
Hut 33 is a new sitcom from the award winning creators of Think the Unthinkable
And, I don’t seem to be able to get realdump to work properly to grab it. Not that I’d have the first few episodes, anyway. I have to just hope that the ABC decide to play it, and I remember to listen…