Make your own spirit level! (by )

You can easily spent £25 on a large spirit level. Even a cheap 60cm one costs £10.

Since I have some plans to build a wall across uneven ground, a long spirit level to check my footings are level is a requirement. But I didn't want to spend a lot of money.

So I went into B&Q and, for £5 plus a few tens of pence, picked up a two-metre length of extruded steel box section, a square tube about 1cm on a side and strong enough to not flex noticeably under its own weight.

The steel square tube

And for about £2.70 I picked up a small hand-held magnetic spirit level unit.

The magnetic vial unit

Combining the two, voila - for under a tenner, I have a two-metre long spirit level.

A long spirit level for under a tenner

And although there's only two vials in the magnetic level unit, it has the functionality of a level with lots of vials, since I can position those two vials at any point along the level I require. So I can have them in the middle, for traditional "is this rubble-filled trench roughly level" checking. Or, when nailing a series of pegs into the ground and wanting them to all be at the same height, I can bring the vials to one end of the steel tube, balance the other end on an existing peg (ideally with a helper to hold it there!), and easily read the vials as I adjust the peg I'm leaning my end of the tube on.

Vials at the end

And when I'm sick of building walls, I can store the pocket-sized magnetic level away, and think of something useful to make with two metres of steel square tubing, an arc welder, and a brazing set...

Power returns (by )

Power had returned when we came back:

Mar 5 19:18:42 anger upsmon[703]: UPS powermust@localhost on battery
Mar 5 19:22:02 anger upsmon[703]: UPS powermust@localhost battery is low
Mar 5 19:22:02 anger upsd[718]: Client monuser@127.0.0.1 set FSD on UPS [powermust]
Mar 5 19:22:02 anger upsmon[703]: Executing automatic power-fail shutdown
Mar 5 19:22:02 anger upsmon[703]: Auto logout and shutdown proceeding
[...] Mar 6 18:54:33 anger syslogd: restart
Mar 6 18:54:33 anger /netbsd: NetBSD 3.0 (ANGER) #2: Sun Feb 4 19:20:11 GMT 2007

The day's work can now begin... I can run the computers or the ADSL router off of the generator, but due to cabling limitations, not the computers and the Internet connection.

No power! (by )

Bah. Our power failed at 7:30pm last night (the 5th of March) and has yet to resume at the time of writing (11:30am on the 6th of March).

The house is festooned with extension leads, since we're running the fridge and freezers from the generator, with another spur over to the ADSL router zone. I'm typing this on my laptop, hooked up to the router with a patch cord, since I don't have enough extension cables to get the switches going to get Internet access to the office...

About to go out and fill up our fuel cans...

Fuzz testing (by )

Speaking of unearthing bugs, I'm surprised I've not found any mention of anyone fuzz testing NetBSD syscalls. There's a crashme tool which, despite the one-line summary doesn't actually call syscalls explicitly (although it may stumble across them at random) - it just executes arbitrary sequences of random numbers as code, in order to make sure all the CPU trap handlers work correctly...

So I may throw together a tool to do that for syscalls. Needless to say, it ought to be run as an isolated user (so it can only trash its own files), maybe in a chroot, and ideally on a machine without network access (for it could, in theory, open a network socket and do something unneighbourly :-).

This would be a good test of the higher-level inter-process isolation facilities in the OS kernel - namely, it'd help to find security holes such as local denial of service attacks against the kernel!

Also, another fun idea might be a fuzz tester for Xen hypercalls...

Getting the best out of pkgsrc (by )

pkgsrc, the software package installation system that comes with NetBSD, is a lovely and powerful thing, but the default out-of-the-box setup is pretty basic. There's a lot you can do to bring the power of it out that's either hidden in the pkgsrc manual or in extension packages.

So here's my quick guide to getting the best out of pkgsrc.

Read more »

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales