Archive

Archive for December, 2008

Make hgweb link to mantis

December 30th, 2008

Another tech post for the good of humanity and in lieu of starting a real hackers blog. This one modifies the mercurial hgweb interface so that it converts any text that matches #<issue number> with a link to the bug tracker issue identified by the issue number. E.g. When you commit a changeset and put the text #123 in the log message, the hgweb interface changeset page will have a link to issue 123 in the bug tracker.

Edit /usr/share/python-support/mercurial-common/mercurial/templatefilters.py

add these lines:

def makemantislink(text):
    p = re.compile(r"(#(d+))")
    return p.sub(r'<a href="http://somebugserver.com.au/mantis/view.php?id=2">1</a>', text)

and add the filter to the list at the end of the same file:

filters = {
    "addbreaks": nl2br,
    "basename": os.path.basename,
...
    "makemantislink": makemantislink,
...
    }

Then add the filter into the template which is /usr/share/python-support/mercurial-common/mercurial/templates/gitweb/changeset.tmpl by adding it to the list of filters as per the following line:

<div class="page_body">
#desc|strip|escape|addbreaks|makemantislink#
</div>

[tags]bug tracking, hgweb, mantis, mercurial, programming, python[/tags]

Uncategorized

Secret Christmas

December 24th, 2008

I’m pretty sure that when the angels appeared to the shepherds with the choir and trumpets, it was a bit of a bureaucratic stuff-up in heaven’s Department of Spectacles and Apparitions. They had planned a world-wide celebration but then God called it all off having cooked up a plan where by Jesus would be born in relative secret. The choir had been prepped already and due to internal politics, they couldn’t cancel but instead managed to divert from down-town Jerusalem to an out-of-town appearance where only some crazy shepherds would witness it. Meanwhile the star had been setup millions of years in advance and couldn’t be called off. Luckily only a couple of wacko eastern mystics noticed it so no harm done. Except the mishandling of it all just kept snowballing: crazy prophets, lepers and blind men spilling the beans, then the messiah movement got on board and started with the palm branches. The original plans had been so big that they just didn’t manage to call it all off in time.

So Christians need not lament about Jesus being forgotten amidst all the Christmas fanfare, being a subversive kind of chap, it’s just the way he would have liked it. I’m pretty sure he’ll manage to get through to the people who matter to him without our carrying on.

I think there’s something in that for all of us. Merry Christmas to all my loyal readers.

Uncategorized ,

Pinky Update

December 11th, 2008

I recently tried playing guitar again on the acoustic and I’m finding I can still play despite my damaged pinky finger if I’m careful to keep it perpendicular to the fret board which is probably good technique anyway. Yesterday I belted out “Begin the Begin” (R.E.M.), “Purple Sneakers” (You Am I), “Daylight Fading” (Counting Crows) and “Cold Blooded Old Times” (Smog) after which Sol told me I was too loud so I had to also play the theme to Dora the Explorer and “Play Your Guitar With Murray” (The Wiggles) to placate him (but he still thinks I’m too loud)

Anyway, here’s R.E.M. “Begin the Begin” which is a fun song to play but requires pinky action to emulate the descending bass line at the end of the bridge:

[tags]music, guitar, pinky finger[/tags]

Uncategorized

BSG Season 2: Pegasus and Resurrection Ship I and II

December 8th, 2008

Last night I slotted disk 3 of BSG season 2 in the old JVC VCR MacBook for my nightly dose of sci-fi and then couldn’t stop watching. Without wanting to spoil it for everyone else who is four years behind on their TV, the character of Admiral Helena Cain was so strong that I couldn’t stop watching to see what would happen. Incredible that the greatest threat to the fleet after all their encounters with Cylons should be meeting back up with the human mothership. Spoilerific summary is here on wikipedia. I also realised something a bit dark about myself: from the second Admiral Cain’s Battlestar entered the story, I wanted her to die and really that was the motivating force that kept me watching for three episodes way past my bed-time. Aside: staying up past bed-time is not lightly done for me because sleep is a precious commodity when you live with a toddler and a baby.

[tags]bsg, tv[/tags]

Uncategorized

SCC: It’s a metaphor of rationalism vs the human soul

December 3rd, 2008

You know the drill: spoilers and all that.

So last night’s SCC Self Made Man was a stand-out episode. It was one of those stand-alone episodes that doesn’t really advance the season ‘arc’ but does something a bit different and a bit experimental. In this case we had a bit of time travel gone wrong and a cold-case historical mystery solving problem that Cameron discovers on her own during her apparent regular late-night library expeditions (and I thought she just stood awake in the centre of the house with a gun all night – continuity? phah!)

The episode had lots of 1920’s action with an authentic “old movie” feel to it with a kind of Citizen Kane voice over in parts and one or two tommy gun action scenes.

But I was more interested in Cameron’s relationship with the librarian / archivist Eric (Billy Lush) on the night shift. You really want this to work for Cameron: she is providing companionship for a lonely guy in a wheelchair who works the night-shift at the library and is clearly really happy to be expounding his historical knowledge to a mysterious hot babe who brings him donuts. But as is the nature of terminators, Cameron works her magic on him, busting a lock on the archive door to get some footage, freaking him out with her gun and finally giving him too much information about his bone cancer condition.

Probably the most sinister part is where Cameron asks Eric if he’s considered suicide. At that point, Cameron knows that Eric’s cancer is back but he doesn’t know. As far as Cameron is concerned, suicide is a perfectly logical response for Eric who is going to have to suffer being both “the Titantic and the Iceberg” in his own words. When Cameron tells Eric that he has cancer, she tells him that it might be treatable since it is still small and Eric naturally gets quite angry at her (not believing her either). When she returns the next night, he is gone and the new girl tells Cameron that she got an urgent call to fill the shift but doesn’t know anything more. Cameron being Cameron of course just asks if she can come in and look at some books, apparently not giving Eric another thought. Yet what happened to poor Eric? I think the implication is that he committed suicide on learning that his cancer was back just as Cameron suggested.

Which leads me to me to my reading of SCC as a show as a metaphor of philosophical critique of rationalism. In this show, the terminators represent rationalism: cold hard logic and the Connors represent our society trying to come to terms with it. In a way, the terminators are the philosophical argumentum absurdum of rationalism: ie. rationalism is taken to its logical conclusion and shown to be absurd. Yet we see this same kind of rationalism playing out today in economic and bureaucratic systems that we create. Another way to look at it is using Hobbes’ idea of society as the Leviathan. Hobbes believed that society was a giant monster constructed of our social systems and culture. SCC is at its best when it’s rolling with these big ideas and playing them out with the characters.

Eric’s (very loosely and vaguely) implied suicide in Self Made Man works in the context of the high male suicide rate today where I believe rationalism is at its strongest. Our work environments today are the products of economic rationalism that shapes it’s employees into a rationalist mindset. In my opinion, it is rationalism that strips away hope, that strips away meaning and relationship from people’s lives, isolates them and hangs them out to dry.

UPDATE: Another reading I saw of the episode is that Cameron is contemplating suicide and Eric talks her out of it. Cameron knows she is damaged, she wonders about her future – she seems to be affected at times when she seems to realise things about herself. She is amazed at how happy Eric is. He is just happy to be alive, to be able to keep on experiencing life despite his condition.

[tags]rationalism, sarah connor chronicles, self made man, suicide, terminator[/tags]

Uncategorized ,

CTRL-C stops working and busybox

December 2nd, 2008

Ignore this if you aren’t a programmer working on embedded linux.

If you are doing anything special on the serial port that was/is being used by busybox as the controlling terminal at boot time, then be aware that init/init.c in busybox has function called set_sane_term() which might not be sane for your particular use of the serial port later on. The function is called if you have any processes that are set to respawn in inittab and when one of those processes dies. In our case we run a serial handler process that directs serial traffic to a shell on a pty but if init has to respawn any processes, it will cause weirdness with things like your ctrl-c (like telling the serial port to process control characters instead of the pty).

[tags]boring programmer crap, tty, linux, busybox, init, ctrl-c, termios, pty[/tags]

Uncategorized