Thursday, 22 March 2007


I've been using TiddlyWiki for a couple of months now, and it's brilliant. It's a wiki-style notebook, but entirely self-contained as a single web page, so it doesn't need a server to set it up -- or a network connection to use it -- and it's easy to copy it around and take it with you when travelling.

The interface is a little quirky to start with, but you quickly get used to it. It might be easiest to imagine that each tiddler (most other wikis would call this a page, but since TiddlyWiki is a single page, that doesn't quite work) is a tab in a browser. Clicking on a link to another tiddler opens that tiddler at the bottom of the page, if it is not already open, and scrolls the browser window to it; imagine that it's opened a new tab for the tiddler if necessary, and brought that tab to the front.

I'm currently using a TiddlyWiki for my to-do list, which allows me to create richer hyperlinked structures around tasks, so things like meeting minutes and design notes tend to end up in it too. I started with a structure based on that of GTDTiddlyWiki, with top-level lists starting with an @ character etc. Don't use GTDTiddlyWiki directly though, it's based on an older version of TiddlyWiki, and you're better off going with the newer version. (This way of tracking tasks is based on Dave Allen's book "Getting Things Done," which I have bought but have yet to read. I found the scheme originally via a post on Kathy Sierra's blog, which linked to an introduction to GTD at PigPog. So far it's working well.)

I've also used it for other note-taking style things, such as for keeping notes from my weekly Salsa dancing classes.

Internally, the HTML that it stores is relatively good for use with line-based diff programs, such as that used by Subversion: each tiddler is stored on a different line, but with the characters '\n' between each line of tiddler text.  I've been storing one wiki in svn for a few weeks, and it's relatively usable, although it would be nicer if the body text of a tiddler was expanded so the details of the changes showed up in the diffs.

The default settings work very well, but whenever I start a new tiddlywiki, I make the following changes to have it working as I like:

  • Open the options from the menu on the left, and make sure the author name is set

  • Tick 'SaveBackups' and 'AutoSave'. This saves the wiki every time you make a change, leaving the previous version around as a dated backup. It would be nice if it could auto-clean these somehow, but for now, I just delete them all manually every now and then.

  • Open the AdvancedOptions, and set a folder for the backup files. A relative path works fine.

  • If the wiki is going to last for a while, I like to change the colour scheme to make it a little distinct. Open the tiddler 'ColorPalette', and edit it to set the colours as you want them. (The ColorPalette tiddler isn't linked anywhere by default, so far as I can tell. You can add a link to it from wherever you like, or just add '#ColorPalette' to the URLin the address bar and reload the page. If you don't have autosave enabled make sure you save your changes before reloading. Having done this once, it will appear in the TimeLine.)

There is lots of good information on the main TiddlyWiki site, but sometimes it's hard to find what you want, and I often use this quick-reference page for checking formatting syntax etc.

Thursday, 11 January 2007

This year I will ...

1. Only use exclamation marks where they add meaning to a sentence.

2. Refrain from starting posts, comments, emails or other pieces of text with the word 'So'.

And, of course, eat better and drink less. But I always say that.

Monday, 8 January 2007

Pass the Alt key to the shell in gnome-terminal

This turns out to be very easy: Edit > Keyboard Shortcuts > Disable all menu access keys. (from)

This has been bugging me for ages, I wish I'd looked earlier. It is useful because the bash shell supports lots of nice (emacs-derived) shortcuts for moving the cursor, such as Alt-F and Alt-B to move forward and backward by a word; since I'm used to these working, whenever I go back to gnome-terminal it confuses the nubbins out of me. I shall be confused no more!

Sunday, 7 January 2007

Adding a new WordPress blog to a Debian install

The Debian WordPress package is set up to allow multiple blogs to be hosted on the same server, using Apache's virtual hosts. However, when I looked, I couldn't find any documentation on how to enable this.

This is how I did it, using wordpress and apache2.

Before you start, you must have control over your DNS, and the ability to create CNAME aliases. Add an alias for your web server, giving it the name of the blog that you want to host. In my case, the site is
Firstly, set up the WordPress database and configuration using the supplied example sript:
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n mortiablog

Then we need to configure apache2 to serve WordPress, rather than the site's default index page, for the host I can't remember where this information came from (it was a while ago when I first did this); I think it's a modified version of the example apache configuration from the Debian examples directory.

Start by going to /etc/apache2/sites-available, and copy your default site file 'default' to another name. I used 'blog.mortia'. Then you need to edit it to trigger only for the new hostname that you've set up, and for the root to point to the standard WordPress installation:

  • Remove the outer 'NameVirtualHost *' directive

  • Add a 'ServerName' directive inside the VirtualHost section.

  • Change the DocumentRoot from /var/www/ to /usr/share/wordpress/, not forgetting to modify the section too.

  • Change the names of the log files so they don't conflict with your main site.

  • Remove any other aliases etc that you don't want on the blog site.

To get apache2 to pick up this new site, you need to symlink the new config file into /etc/apache2/sites-enabled, and restart the server.

cd ../sites-enabled
sudo ln -s ../sites-available/drup.mortia .
sudo /etc/init.d/apache2 restart

Now you're ready to point your browser to the new URL, and start configuring WordPress as normal. You may need to shift-reload to see the WordPress page.

Update 2007/06/09: added the -n flag, supported by newer versions, to get a reasonable database name.

Friday, 5 January 2007

Side-by-side computers with one keyboard and mouse

Do you have two machines sat next to each other, but no space for two keyboards? Even if you do have space, it's really annoying having to swap between them: here's a way to avoid that, without using a KVM or any other hardware except the network.

At work I use dual monitors, which after a little adjustment, I'm getting on very well with. I also have a laptop, which gets used intermittently before and after I travel, and as a scratch box for trying out new systems and so on. Previously, when it was running Windows, I would use Remote Desktop to access it via my desktop's keyboard, mouse and monitor, and leave it closed on the desk.

Recently, however, I've set it up to dual-boot into Linux. Rather than using VNC, I wanted to use the monitor on the laptop as well, but with the keyboard and mouse from the desktop -- in the same way as my existing dual monitor setup works, except that now there are two different hosts involved.

This turns out to be remarkably easy. On the Windows desktop side, there is a cool piece of software called Win2VNC, which sets up your machine so that you can move the mouse cursor off one side of the screen, and it will start accessing a remote machine via VNC. Unlike most VNC viewers it doesn't display anything, it only handles the input side.

(The link above is to a modified version of Win2VNC. The original version is here, but that version has difficulty with multiple-monitor setups, and gets confused about which window you are going off the side of).

On the Linux side, I used VNC version 4 (Debian package vnc4server). The Win2VNC page suggests x0rfbserver, but that appears no longer to exist, and has been removed from Debian now. The vnc 4 package has subsumed it in the form of the x0vnc4server command, which runs (like WinVNC) on the existing display, rather than starting a new one.

So far, it's working pretty well. There is still the occasional problem with losing the mouse cursor, but usually slowing down, and carefully swapping between screens and back will resurrect it.

And it's a great way to show off.

Thursday, 4 January 2007

Hang on installing the Google toolbar in Firefox 2.0.1

When you install the google toolbar in later versions of Firefox (at least -- I haven't tried it in any other versions) on XP64 (again, probably other OSes too), it brings up a popup dialog. Unfortunately, combined (I think) with the session restore capability, this dialog hangs the whole app, and you have to kill it from the task manager.

Because it happens on startup, repeating the process just hangs again.

If you get in this state, you can fix it by throwing away your saved session. To do this, delete (or rename) the file

C:\Documents and Settings\Application Data\Mozilla\Firefox\Profiles\sessionstore.js

and start Firefox again. Then it will come up, you can make your setting in the dialog box, and at least start browsing the internets again.

I haven't yet figured out how to get the saved session back again.