Software

You are currently browsing the archive for the Software category.

I wanted an easy way of using images from a Zenphoto gallery in MediaWiki pages, and it turned out there wasn’t one. In fact, I had trouble finding a hard way of doing it with satisfactory results. It’s easy enough to embed external images in a MediaWiki page, if you have your MediaWiki config set to allow it, but I wanted thumbnails that clicked through to the real image. Not so easy. Hence MWZenphoto – a very basic MediaWiki extension that lets you do just that by including a simple <zenphoto> tag in the wiki markup.

Read the rest of this entry »

It’s less than a year since I wrote about how much I like Gallery. That’s still true, and I’m still running a couple of instances of it, but it’s now gone from this site. In the last year, Gallery has undergone a complete rewrite, with the new 3.0 in beta at the time of writing. In some ways, the rewrite seems like a good thing. It’s fair to say that 2.x was pretty bloated, and definitely ‘legacy code’. The new version is stripped down in many ways, PHP5 only, and built on top of the Kahona framework, making for a much cleaner codebase.

Read the rest of this entry »

I inadvertently created a feedback loop where every blog post subscribed to via Planet Ciaran got an instant trackback/pingback as soon as it was posted. Here’s how:

Feedback loop

  1. Blog post is made and picked up via RSS/Atom by my Planet Venus (Sam Ruby’s reworking of Planet) installation
  2. Excerpt of post gets added to Planet Ciaran
  3. Feed2omb picks up the new post via Atom and posts it to the @planetciaran account on my StatusNet installation.
  4. The StatusNet (formerly called Laconica, how long do I keep saying that?) Linkback plugin sends a trackback/pingback notification to the original blog
  5. The blog adds an irritating and pointless trackback link to the original post.

Needless to say I’ve turned off the Linkback plugin until I can hack in a way to exclude that particular account. (Currently the plugin applies linkback logic globally, across the entire StatusNet installation.)

As a side issue, before anyone else asks why I bother with all the above anyway, there are two answers. One – because it’s there. Two, it provides useful ways of reading stuff. Planet Ciaran is subscribed to most of the stuff I read on a regular basis. The above setup gets me a) XMPP notifications, b) a web page to browse if I want to read it that way, and c) an aggregated sanitised Atom feed to subscribe to. If that doesn’t answer your question, and I suspect it probably doesn’t, then nothing will.

I wrote briefly about code_swarm last year – a tool to generate visualisations of a project’s commit history. Today, via Brenda Wallace, I found out about a new variation on the same theme – so new it hasn’t been released or even named yet. Apparently though the author, Andrew Caudwell, is planning to release the source in the very near future.

The following video, also courtesy of Brenda Wallace, shows the output generated from the StatusNet (formerly Laconica) git repository:

Get the Flash Player to see this content.

I think this is really impressive stuff, and not just because I’m in it. There’s a better quality version on YouTube.

Something that’s becoming obvious to me lately is the unintended suitability of a microblog to act as an information hub. To clarify the term microblog here, many may understand that as Twitter, but that would be a bad example because a) it’s both a single public instance of a microblog, and b) it doesn’t have all the capabilities that make this so interesting.

Therefore a good example of what I’m talking about would be a private instance of Laconica running on a local network, or perhaps in a private setup on the public internet. I say private because some of the examples I’m going to give are most appropriate for a private setup.

Read the rest of this entry »

Here’s an interesting side effect of the way git cleverly and silently handles identical changes during a merge, combined with the way history is stored and searched. I’ll demonstrate by setting up the simplest possible scenario. In an empty directory:

git init
echo -e "line 1\nline two\nline 3" >test.txt
git add test.txt
git commit -m "Initial file"
git checkout -b fred
sed -i -e 's/two/2/' test.txt
echo -e "line 4" >>test.txt
git commit -a -m "Fixed line 2 and added line 4"
git checkout master
sed -i -e 's/two/2/' test.txt
git commit -a -m "Fix line 2"
git merge fred

So just to recap what we’ve done in English – we start out with a test.txt that looks like this:

line 1
line two
line 3

Then Fred creates a new branch to add some new functionality (a fourth line) and at the same time notices the error in line two and changes ‘two’ to ’2′. Fred’s commit results in this, which git sees as two changes (hunks) one for line 2 and one for line 4:

line 1
line 2
line 3
line 4

Meanwhile, back on the master branch, Eric has noticed the same error, and changes ‘two’ to ’2′ too. So the commit on the master branch results in this, a single change:

line 1
line 2
line 3

Finally, the changes from Fred’s branch are merged back into master. Note that despite both branches not only having changed the same file, but even the same line of the same file, the merge is completely straightforward and automatic – no user intervention is required.

So here’s the gotcha (or at least, it got me). To see why, you probably have to imagine lots more unrelated commits on both branches, and lots of time passing. Eric sees Fred’s commit and thinks “Weird, didn’t I make that change already? I’ll ask git:”

git log test.txt

To his surprise, searching the log for commits that changed test.txt produces no mention of the commit labelled “Fix line 2″. In fact, it shows all the commits EXCEPT that one. So he finds his commit in a more specific way and has a look at what it changed:

git log --name-only --grep="Fix line 2"

The commit is there, and it says it changes test.txt, so there is an apparent inconsistency between what the two forms of git log are reporting here.

In fact, git log is deliberately simplifying the history here. In the default mode, commits from side branches that don’t contribute anything to the final state of the tree are pruned from the output. The way to get the full output is:

git log --full-history test.txt

With the –full-history option added, the output contains all the commits. Worth remembering.

If you don’t know, you probably don’t care, but in any case: stopwords are words you CAN’T search for in a full-text search of the database. They’re filtered out for performance/space reasons, because they’re ‘noisy’.  You know, words like “the” or “and” – things you wouldn’t search for anyway. Or “novel”? “welcome”!?! Anyway, it’s annoyed me so many times that I wrote the following poem composed entirely of them:

Thanx, whoever they may be
For specifying many useful ones
Amongst the others ignored

C’mon, it just isn’t sensible
Consequently I wonder why
But regardless
Somebody somewhere should be sorry

Lacon-iCal is a plugin for the Laconica microblogging platform that provides an iCalendar (RFC 2445) feed for each user’s notices. This initial release makes use of the new plugin system, and therefore requires Laconica version 0.7.2 or higher.

The project repository is hosted at Gitorious and currently consists of a single file. Installation is simple – first, place that file in Laconica’s plugins directory, and then add the following to the end of config.php:

addPlugin('ICal', array('limit' => 20));

The 20 is the maximum number of notices that will be present in a feed – set this to a value that suits your installation.

Once the above is done, the plugin is installed, and you can access a user’s iCalendar feed by appending /ical to their profile url, so http://example.com/bob/ical would be bob’s iCalendar feed, assuming that example.com was running Laconica, and bob was a user there, neither of which is true.

I decided to hack my ‘hacked together Amiga dev kit‘ into something more useful. The main downside to the previous setup was that your binary code had to be transferred to the Amiga via a serial link and written to a disk, and then the Amiga could be booted from that disk.

Read the rest of this entry »

SNASM 68k Manual

Next up on my list of old hardware to put to some kind of use is a Commodore Amiga. This means I need to have some kind of usable development setup. Back in the day, the development kit of choice for the Amiga was SNASM, a PC-based cross-assembler with custom hardware allowing the assembled code to be ‘squirted’ straight into the Amiga’s memory to be executed and debugged. Unfortunately, although I still have a copy SNASM 68k manual (exhibit A, right), I don’t have the hardware or software, so something needed hacking together.

Read the rest of this entry »

« Older entries § Newer entries »