Fixing the backspace key with OS X and Linux Screen

Here’s the problem: You ssh in to a linux system from your Macbook’s terminal and join a shared “screen” session. Instantly your backspace key stops working as a backspace key and becomes a forward delete key, resulting in those annoying “Wuff Wuff” messages at the bottom of your terminal.

Well I found a solution to this tonight. Simple do the following:

  1. Go to Terminal > Preferences > Settings> Advanced
  2. Tick Delete sends CTRL – H

Et voila. It should be fixed.

Changing the Sent Items folder in OS X Mail

We have a linux IMAP server that uses “Sent” as the default name for it’s Sent Items folder. However, at least in my case, the OS X Mail app seemed to expect the folder to be called “Sent Items”.

To set the Sent folder to be pointed at the correct Sent Items folder, you must select that folder from the account tree, and then select Mailbox > Use This Mailbox For > Sent.

It took me a while to work this out, so I have posted here for future reference.

How to show Wireless Network Connection Speed in OS X

It took me a while to find out how to do this on our iMac, so I thought I would blog it for future reference. If you want to find out what speed your wireless network is connected at on a Mac, you can do this with the “Network Utility”.

  1. Go to Finder
  2. Press CMD + SHIFT + U to open the Utilities Folder (or navigate there through Applications)
  3. Open Network Utility
  4. From the info tab, select the network you are interested in.
  5. The link speed will be shown in the interface information window.

The link connection speed is highlighted

Free our data!

The Guardian have been running a campaign for the past 2 years to free public information that tax payers have paid to collect but the government currently charges for. Coincidentally, this is nearly as long as Fubra has been interested in making such data available for free.

Free House Prices

We launched our first free data service back in January 2005 with a house price information service called OurProperty.co.uk. A month earlier, the Land Registry had announced that they were going to be selling all the price paid data that they collect in bulk. I spotted this and gave my business partner Brendan a call. Together we agreed that we would buy all the data, but rather than resell it on (as the Land Registry had expected us to do), we would give it away to users for free, and make a little money from advertising.

We were the first site to commit to giving this data away for free forever, and this decision went down incredibly well with our users. Within a week we had 100,000 nosey neighbours signed up to the site. Seeing it’s success, a host of other sites soon joined in the free data party.

Free Petrol Prices

Later that year we spotted another opportunity to give away some data. The AA’s petrolbusters site had closed down, and there was a gap in the market for a petrol price information site. Brendan made a few calls to find a supplier for the data, and within week or two we had launched PetrolPrices.com.

We linked these 2 sites together with a single login (which we call the Fubra Passport), and in the 3 years we have been running them they have grown to have almost 2.5 million subscribers. People love our regular house and petrol price alerts, so they can see what’s going on near them, but this is just the start.

Free our data

If the government were to make more data available we would literally jump at the chance to build more services for our users. I’ve suggested some of my ideas for re-using Land registry data to Charles Arthur and Michael Cross at the Guardian and they published these today:

  • A property metadata service, calculating building and land area for all UK properties. Would allow people to know the price per sqm that properties were on sale for.
  • A land use timeline, showing building growth through time overlaid on a map.
  • Identifying building plots for self-builders by finding properties with large gardens within a local development plan.

This is just the tip of the iceberg. It took me about 5 minutes to come up with these ideas, but I’m sure if I sat down with the rest of my team for just an hour we could think of hundreds more. The point is that there are an infinite number of innovative uses for our data that are just waiting to be built, but they will only be realised if the data is made free and open. These ideas will create new businesses, new jobs, and therefore boost our economy.

That is why we must commend Charles and Michael (and the Guardian) for pursing this issue. I’m confident that with continued effort, the dream of free data will become a reality.

Encoding mp3 audio with ffmpeg on Ubuntu Hardy

If you already have ffmpeg installed (without mp3 support), then firstly uninstall it.

MP3 support isn’t included with ffmpeg in the default Ubuntu repositories so to get it you have to enable the Medibuntu repos (assuming this is legal in your area).

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O - | sudo apt-key add - && sudo apt-get update

Then you can install ffmpeg and the libmp3lame codec (part of the libavcodec package)

sudo apt-get install ffmpeg
sudo apt-get install libavcodec1d

You can verify the dependencies of ffmpeg with ldd

paul@paul:~/Videos$ ldd /usr/bin/ffmpeg 
	linux-gate.so.1 =>  (0xb7f07000)
	libavformat.so.1d => /usr/lib/libavformat.so.1d (0xb7e72000)
	libavcodec.so.1d => /usr/lib/libavcodec.so.1d (0xb7997000)
	libavutil.so.1d => /usr/lib/libavutil.so.1d (0xb798c000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7967000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb794f000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7800000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb77eb000)
	libogg.so.0 => /usr/lib/libogg.so.0 (0xb77e6000)
	libdc1394_control.so.13 => /usr/lib/libdc1394_control.so.13 (0xb77d6000)
	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb77d2000)
	liba52-0.7.4.so => /usr/lib/liba52-0.7.4.so (0xb77c7000)
	libgsm.so.1 => /usr/lib/libgsm.so.1 (0xb77ba000)
	libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0xb7725000)
	libtheora.so.0 => /usr/lib/libtheora.so.0 (0xb76db000)
	libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb76b3000)
	libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0xb75ba000)
	libxvidcore.so.4 => /usr/lib/libxvidcore.so.4 (0xb74a2000)
	libx264.so.57 => /usr/lib/libx264.so.57 (0xb7417000)
	libfaac.so.0 => /usr/lib/libfaac.so.0 (0xb7406000)
	/lib/ld-linux.so.2 (0xb7f08000)
	libraw1394.so.8 => /usr/lib/libraw1394.so.8 (0xb73ff000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0xb7318000)
	libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb7316000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb72fe000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0xb72fa000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb72f5000)

It should then let you encode videos with mp3 audio…

ffmpeg -i jonathan-davis-news24-2008-01-22.avi -f flv -s 400s220 -acodec mp3 -ar 44100 jd.flv

Fidler’s castle

I have just seen a fantastically creative scheme to get round the restrictive planning laws that we have in the UK.

Fiddlers castle

On New Homes From Hell (on ITV1) a farmer called Robert Fidler described how he built a house in secret, surround by massive haystacks, and then kept it hidden for four years.

He owned some green belt land, but knowing that he wouldn’t get planning permission to build a house on it, he decided to try to exploit a loop whole in the law which states that if a council doesn’t object to a new build property after four years, then planning is not required.

So all Robert needed to do was hide his house for 4 years.

 

 

Then once the time had passed, he pulled down the bales of hay to reveal his very own castle.

 

Fiddlers castle 

Robert has lived there since August 2006, but he is not in the clear yet. The council are trying to have it demolished saying that, since no-one was given a chance to see the house, the 4 year exemption is invalid.

Using Xserve Server Monitor with localhost

Our new XServe arrived today and one of the first things I decided to test out was the Server Monitor application. From the Server > Configure Local Machine I set up a static IP address on Port 1 of Lights Out Management interface, but when I tried to connect to this from Server Monitor, it failed with the following error:

4/10/08 5:49:33 PM: Failed to contact server

The strange thing was that I could connect to it from another mac on our network. So I then tried to connect to localhost instead (127.0.0.1), and this immediately worked!

Keeping Fit = More accurate maps

My fiancée, Aimi, recently persuaded me to run the Bupa London 10K with her and as it’s only about 7 weeks away we are now having to train every other night. I’ve never been a particularly good runner and, if I’m honest, I find running pretty boring. However, using a GPS device I have found a way to motivate myself and give each run a greater sense of purpose.

The Open Street Map is a project that aims to create a free and editable map of the entire planet. They rely on volunteers, such as me, to create GPS tracks, and then for us to add and edit details on the map.

Now when we go for a run, I take the GPS with me and record the track we take. When we get back home I can then upload the track to my computer and using the JOSM map editor I can literally draw the roads straight on to the map.

OSM currently has good coverage of the main roads and motorways, but it lacks data for a lot of residential areas. So now, through my running, I am gradually mapping the residential roads of Farnborough.

Before

After

The estate I live on was only built a year or two ago and because of this it doesn’t yet show up correctly on any of the major map providers (which is a pain when getting some delivered!). This means that, thanks to my recent contributions, Open Street Map now has the most accurate map for our particular area.

If you extrapolate this trend a few years in to the future (when all existing roads have been covered) it is easy to conceive a time when OSM will be the most accurate map around. Think about it: residents of a new estate are a lot more motivated to ensure that it appears correctly on the map than the traditional map suppliers, and with OSM this process is easy.

Once this happens, delivery companies will start using it, and possibly even contribute to the project as well (a little investment of time by UPS / Tesco uploading their delivery tracks, could save their drivers a lot of time). So simply put, I think Open Street Map is the future of mapping.

Incidentally, if you would like to sponsor me on my run then you can do so here.

Setting up a PXE install for Linux

Installing Linux via PXE boot over a network can be a really nice way to do it and it is especially useful, if your client machine doesn’t have a CD / DVD drive. However, it can be a bit tricky to understand how it all works, so this post will hopefully explain what is going on, as well as show you how to set it up.

You will need:

  • A DHCP server
  • A TFTP server (tftpd-hpa)
  • vmlinuz and initrd.img from your distribution of choice
  • The PXELINUX.0 boot loader and a suitable config file

Install the TFTP server

Ensure you use the tftpd-hpa package, as PXELINUX requires that the boot server has a TFTP server which supports the “tsize” TFTP option. If you don’t use tftpd-hpa you will most likely see an error such as ‘TFTP server does not support the tsize option’

sudo apt-get install tftpd-hpa tftp-hpa xinetd

Configure xinetd to load TFTP

Create a new file called /etc/xinetd.d/conf/tftp and add the following contents:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = root
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}

Create the /tftpboot folder, and ensure it is world readable. Then restart xinetd, and then test you can connect using tftp.

Set up the DHCP server

Add the following config to your /etc/dhcpd.conf file:

host pxeinstall {
# specify your client's MAC address
hardware ethernet 00:13:21:1F:F1:82; 
# give it an IP
fixed-address 192.168.0.10;
#If the tftp server is on a different host to the DHCP server, specify its IP.
next-server 192.168.0.2;
# path of the bootloader file, with tftpd-hpa it must be the absolute path
filename "/tftpboot/linux-install/pxelinux.0";
}

Then reboot dhcpd.

Setting up PXELINUX

PXELINUX is a SYSLINUX derivative, for booting Linux off a network server. Essentially, it is used to load a linux kernel of your choice on to your machine. You specify which kernel to load in a config file. You can download the latest pxelinux.0 file from kernel.org. You will need to extract it from the syslinux archive .

You are going to be creating a folder structure that will eventually look like this:

/tftpboot/
/tftpboot/linux-install
/tftpboot/linux-install/pxelinux.0
/tftpboot/linux-install/pxelinux.cfg
/tftpboot/linux-install/pxelinux.cfg/default
/tftpboot/linux-install/distros
/tftpboot/linux-install/distros/ubuntu8.04
/tftpboot/linux-install/distros/ubuntu8.04/linux
/tftpboot/linux-install/distros/ubuntu8.04/initrd.gz
/tftpboot/linux-install/distros/centos5.1
/tftpboot/linux-install/distros/centos5.1/vmlinuz
/tftpboot/linux-install/distros/centos5.1/initrd.img
/tftpboot/linux-install/menu.msg

So, create a linux-install folder inside the /tftpboot folder. Inside this directory you should copy in pxelinux.0 (the PXE network boot loader) and create another folder called pxelinux.cfg. Inside pxelinux.cfg, create a file called default and copy in something like the following code:

pxelinux.cfg/default

Make a folder called pxelinux.cfg inside /tftboot/linux-install and then inside that create a file called default, with the following contents:

PROMPT 1
TIMEOUT 200
DISPLAY menu.msg

DEFAULT linux

LABEL linux
        localboot 0

LABEL centos5.1
        KERNEL distros/centos5.1/vmlinuz
        APPEND initrd=distros/centos5.1/initrd.img ramdisk_size=6454 ip=dhcp

LABEL ubuntu8.04
        KERNEL distros/ubuntu8.04/linux
        APPEND initrd=distros/ubuntu8.04/initrd.gz ramdisk_size=6454 ip=dhcp

What this does is set up a boot prompt where you can choose to load any of the specified labels (kernels). In my example, I have used centos 5.1 and Ubuntu 8.04.

There is a 20 second timeout (200=20 seconds) and after this, it will load the default label.

The options we specify after each label direct the boot loader to the location of the kernel and the initrd files for that particular distro. NB: You must specify the path relative to the PXELINUX.0 file.

We have also specified menu.msg file – this just shows an ASCI menu to let people know what options they have. Unfortunately we could find a way to auto-generate a boot menu, so you need to edit the menu.msg manually every time you change the pxe config.

Linux Kernel and Initial Ram Disk

The only two files that are really needed to begin installing a distribution after PXELINUX loads are the compressed linux kernel and initial ram disk of your choice. You can define these as shown above in the pxelinux config. For ubuntu 8.04 they are called linux and initrd.gz, and can be found in the netboot folder of the ubuntu archive. For centos 5.1 they are called initrd.img and vmlinuz and can be found in the pxeboot images folder on any Centos Mirror. Once you have downloaded whichever ones you want to use, put them into your linux-install folder as shown in the directory structure above.

menu.msg

This is a really simple ASCII file that will be displayed as the boot menu. The one we use is as follows:

0a
                          .-=-.          .--.
              __        .'     '.       /  " )
      _     .'  '.     /   .-.   \     /  .-'0c\0a
     ( \   / .-.  \   /   /   \   \   /  /    0c^0a
      \ `-` /   \  `-'   /     \   `-`  /
       `-.-`     '.____.'       `.____.'
07
                                       _       
  __ _ _ __   __ _  ___ ___  _ __   __| | __ _ 
 / _` | '_ \ / _` |/ __/ _ \| '_ \ / _` |/ _` |
| (_| | | | | (_| | (_| (_) | | | | (_| | (_| |
 \__,_|_| |_|\__,_|\___\___/|_| |_|\__,_|\__,_|


07


Choose one of the following labels in order to boot:
- linux (localboot)
- centos5.1
- ubuntu8.04

Replacement bed slats

I have a bad habit of diving on to my bed, and unfortunately, most times I do this I end up snapping one of the wooden slats that supports the mattress. After I had snapped about 4 of them I thought I should order some replacements, but that turned out to be more difficult than I would have expected.

First I wrote to my bed’s manufacturer, Limelight beds. They completely ignored me! So then, I phoned Bedstar, which is the website where I ordered the bed from. They promised to send some replacement slats out free of charge, but they must have forgotten as none ever arrived.

So in the end, after a bit of searching around the web, I found a forum post where a lady called Wendy from Bishop Beds, had said that she could supply replacement wooden sprung slats. A quick call to them (Wendy even answered on a Sunday) and I found out that they sold the slats for £3 each, and if you order 10 you get free delivery.

I think this is a great example of how companies can use the Internet to get leads. Wendy has been pro-active with helping people answer their bed related queries on a forum, and now her company is going to get another sale as a reward for her efforts. OK so it’s only £30 this time, but I will definitely consider them next time I need a bed!

Great work Bishops Beds.