Updated History Flow Subversion plugin

Back in 2006, I wrote a Subversion plugin for History Flow, a visualisation tool that lets you examine graphically the history of a text file. (I also wrote about the API that History Flow uses.)

Unfortunately the plugin had stopped working, and JavaSVN (which I used to access Subversion repositories from Java) had been renamed to SVNKit.

I originally provided a ready-to-run plugin JAR, plus a ZIP containing the source code. Today I found the old Subversion repository that I used when originally writing the plugin.

So I’ve converted the Subversion repository to a git repository, and you can find all the code – with fixes to get it using SVNKit instead of JavaSVN – in the historyflow-subversion repository on GitHub.

In doing this I’ve learnt a few things about writing good commit messages and converting from Subversion to git.


Posted in Uncategorized | Tagged , , | 2 Comments

Chainloading from one grub to another

If you install two (or more) Linux distributions on one machine, then by default they both install grub to the master boot record (MBR). The second distribution’s grub menu therefore overwrites the first.

For example, on my laptop, I have Windows on /dev/sda2, Fedora 8 on /dev/sda5 and Debian 4.0 (etch) on /dev/sda7. Having installed them in that order, I ended up with Debian’s grub menu, allowing me to boot into Debian or Windows.

It’s tempting to copy all the Fedora grub entries into Debian’s grub menu file to regain access to Fedora, but if the Fedora kernel gets updated, you have to manually update the Debian grub menu file to include the new Fedora entries. Fortunately, there is a better way: have two grub installations, and allow them to chainload each other.

Continue reading

Posted in Uncategorized | Tagged | 3 Comments

Booting the Fedora installer with PXE

Launching the Fedora installer over the network, as well as having a local mirror of the Fedora repository, means you don’t need to burn a CD or DVD. It’s a convenient way of trying out a new distro.

I’ve done this for Fedora 8. I have a local Fedora repository on my Fedora 7 gateway. You need a working DHCP server, which I won’t cover here. To get the network boot working I did this:

  1. install tftp-server. Ensure it’s enabled (chkconfig tftp-server on).
  2. install syslinux. Copy /usr/lib/syslinux/pxelinux.0 into /tftpboot.
  3. create the directory /tftpboot/fedora8 and copy the contents of Fedora/i386/os/images/pxeboot into it.
  4. create the directory /tftpboot/pxelinux.cfg and put this default file in that directory.
  5. add the following options to your dhcpd.conf (change 111.222.333.444 to your server’s IP address):
    next-server 111.222.333.444;
    filename "pxelinux.0";

If you boot the client machine, it should automatically boot the Fedora installer.

Posted in Uncategorized | Tagged , | Leave a comment

Building pssh using Cygwin

This is how I build pssh on Windows XP, using Cygwin and prc-tools.

Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Pre-queue content-filter connection overload

Ever since updating my gateway to Fedora 7, I’ve been getting messages like this in my daily Logwatch:

84   *Warning: Pre-queue content-filter connection overload

Worrying that I might be losing mail, I looked at the logwatch script for postfix in /usr/share/logwatch/scripts/services/postfix, and discovered that this message refers to lost connections from clients whose IP addresses are unknown – in other words, entries in the postfix log that look like this:

Aug 24 19:44:17 gateway postfix/smtpd[29089]: lost connection after CONNECT from unknown[unknown]

This happens when postfix doesn’t know the IP address of the client, probably because the client is “disconnecting” before the connection to postfix is properly established.

Posted in Uncategorized | Tagged , , | 7 Comments

Making the brightness keys work on a VAIO VGN-FE31H

After installing Windows XP on the VGN-FE31H, the screen brightness keys (Fn-F5 and Fn-F6) no longer work. To make them work again you need to install some of the utilities that ship with the laptop, which are also available in the FE3_Utilities.zip download from the Sony web site.

Continue reading

Posted in Uncategorized | Tagged , | 2 Comments

Passing reference data to the success view

When using Spring’s SimpleFormController, the default behaviour is to pass reference data to the form view, but not to the success view. However it’s very easy to override this behaviour, and access the reference data from the success view as well.

To do this, override the 4-argument onSubmit method like this:

protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
    ModelAndView mav = onSubmit(command, errors);
    Map refData = referenceData(request, command, errors);
    return mav;

If you’ve only implemented the 1-argument referenceData method, don’t worry; the default 3-argument referenceData just delegates to the 1-argument method, so your implementation will be called.

If you’re interested, you can see the code for SimpleFormController.

Posted in Uncategorized | Tagged , | 2 Comments

Case insensitive constraint names in MySQL

By default, MySQL takes advantage of case-sensitive filenames on Linux, with lower_case_file_system = OFF and lower_case_table_names = 0 (i.e. the filesystem is case-sensitive, therefore database names are case sensitive; and table names aren’t forced to lower case). In this situation it’s possible to have two different databases whose names differ only in case – for example, Photos and photos – although this should probably be avoided wherever possible!

The FOREIGN KEY Constraints” section of the MySQL manual has this to say about constraint names:

If the CONSTRAINT symbol clause is given, the symbol value must be unique in the database. If the clause is not given, InnoDB creates the name automatically.

This isn’t completely accurate. Internally, InnoDB stores foreign key constraint names as case-insensitive, with the database name prepended. So although onedatabase.b_ibfk_1 is treated as different to anotherdatabase.b_ibfk_1, Photos.b_ibfk_1 and photos.b_ibfk_1 are treated as the same.

So if database names that only differ in case are to be avoided, why might this be a problem? Well, if you want to follow the advice in the MySQL manual, and use lower_case_table_names = 1, you need to change all database names to lower case before using the new setting.

Continue reading

Posted in Uncategorized | Tagged | 1 Comment

Building MySQL from source

After the introduction of the MySQL Enterprise Server, and the subsequent source-only release of Community Server 5.0.33, there was concern that MySQL would no longer provide official binary builds of the free Community Server. Fortunately, these concerns have now been addressed, but we will have to wait longer for binary releases.

In the meantime, you can either find an unofficial build, or build MySQL yourself. I decided to try and build it myself using the free edition of Visual C++.

Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Read only and read/write NFS mounts on Fedora

I share several directories from my Debian server to other machines on the network using NFS. On one of these machines, which runs Fedora Core, some of the directories are mounted read-only, whereas others are mounted read/write. After upgrading to FC6 recently, I noticed that they’d all become read-only.

After looking into this I discovered that starting with 2.6.19, NFS groups directories from the same filesystem on the server, and treats them as the same filesystem on the client. Trond Myklebust, the maintainer of the NFS client, explained in this post to the Linux Kernel Mailing List:

“The new NFS mount code will put those in the same superblock, and whichever directory gets mounted first will determine whether or not the superblock is marked as read-only.”

Continue reading

Posted in Uncategorized | Tagged , | Leave a comment