Jul 27 2007

Google Reader and IE 7

I’ve started to use Google Reader recently and when doing a bit of lunchtime feedreading at the office noticed that IE 7 on XP doesn’t honour the
<pre> tags in post bodies. FireFox does. I can’t believe that I’m the only person to have noticed this, but a cursory google around the subject didn’t come up with much – a few list and forum posts without much followup. Do so few of the tech-minded feed-reading public use IE 7? Maybe it’s just a reflection of my poor googling skills or lack of patience. And while I’m on IE 7 vs. FF, I’ve also noticed that some of Microsoft’s own websites render far better in FF – parts of the revamped Technet pages for example. Try increaing the font size in IE 7 and watch what happens.

I wouldn’t really care except that we don’t support FF on the office network and as a senior admin I feel that I should follow policy on this. I do have FF installed for testing purposes (sorry, Brian) but I sort of feel I should stick to IE under most circumstances. Also, Google Reader is the only way I can see my own blog from work – we use a fairly fierce filtering system that currently bans personal websites amoung other things and it seems that the whole of .me.uk is unavailable.

Actually this leads me on to the delicate subject of blogging and the workplace. I’m not sure if many people at Renishaw really “get” blogging, so as a rule I’m going to avoid talking about work here. I certainly won’t be blogging from work. Every so often I’ll no doubt touch upon things like today, but I’m going to draw a line for the time being. This still leaves me with plenty to talk about though, as there’s far more to my profession that what I currently do on a day-to-day basis. Plus there’s the interweb, and all the other trivia I like to think and blather on about, so hopefully my self-imposed restrictions won’t grate to much.

Jul 26 2007

Luckily, I have a backup

A brief power cut early this evening seems to have knocked out at least two partitions on a big hard drive on my home server/workstation that holds my entire mp3 collection, photos and MySQL backup dumps. Luckily, I have a backup, and the one partition I’ve added data to since the last backup (my photos) appears to be readable, thank fsck.

It is so worth having a backup strategy for home use, so I thought I’d take this opportunity to outline mine. I have three machines – a house server/workstation, a scratch box, and a laptop. I back up the laptop to the house server, ignore the scratch box, and back up the house server to a Seagate USB hard disk. I’ve been thinking about sorting out a NAS of some kind but right now a couple of big-ish disks are adequate.

The reason I’m comtemplating NAS is because right now my backups rely on self discipline – hence the fact that there are a few photos missing from the most recent one. I have to attach the USB hard disk and run a script manually. It would be better to have a NAS appliance sitting in a cupboard and a cron job. Then all I’d have to worry about would be off-site backups. And you think I’m joking.

As for the script/backup method, well if you’re on any kind of *nixen it’s just got to be rsync. There really is not competition here. If you’re stuck in the world of Windows NT then I suppose that you can use the supplied NT Backup software, not a patch on rysnc but functions well enough if you can be arsed with the clunky GUI. Last time I looked the Win32 port of rsync wasn’t doing much.

Anyway, here’s my current crude-but-effective rsync script. The Seagate drive is labelled SEAGATE and formatted ext3. GNOMEs volume manager widget just detects and mounts it on power up. I like to keep things as simple as possible, so the script doesn’t have as much error handling as I might put in normally, but I run a few checks before kicking it off. Comments and queries more than welcome, and if you use this code then not only do I pity you I also disavow all responsibility for any damage you might end up doing to your data.

#!/bin/bash

# $Id: seagate-backup,v 1.4 2007/07/26 21:33:30 sam Exp $

# Array containing list of directories to back up:
BACKUPDIRS=(\
"/home" \
"/media/music" \
"/media/photos" \
"/var/spool/mail" \
"/var/www" \
"/media/backups/SQL"\
)

# Mount point for the USB hard disk:
SEAGATE=/media/SEAGATE

# check we're running as root:
if [ $UID != 0 ]; then
    echo "Script must be run as root! Aborting."
    exit 1
fi

# check mount point:
if [ ! -d $SEAGATE ]; then
    echo "$SEAGATE not found! Check backup medium."
    exit 1
fi

# Set up arguments to use with rsync.
if [ -n "$1" ]; then
    if [ $1 == "--delete" ]; then
	ARGS="-avz --delete"
    else
	echo "bad argument: ${1}, exiting."
	exit 1
    fi
else
    ARGS="-avz"
fi

# locate rsync and basename
RSYNC=`which rsync`
BASENAME=`which basename`

# go through $BACKUPDIRS doing checks and backing up:
for i in "${BACKUPDIRS[@]}"; do
    if [ ! -d $i ]; then
	echo "Skipping ${i}: not found!"
    elif [ `ls -la ${i}/ | wc -l` = 3 ]; then
	echo "Skipping ${i}: appears to be empty!"
    else
	echo "Backing up ${i}, please wait..."
	$RSYNC $ARGS ${i}/ $SEAGATE/`$BASENAME $i`
    fi
done

# bye...
exit 0

Jul 25 2007

Long time no blogging

Well hello world! It’s been a while, and there’s plenty been happening. I’m father again, and now have two lovely daughters. That should go at least some of the way to explaining why there have been no posts for a while. I do still post photos to my Flickr pages and even some bookmarks to my del.icio.us bookmarks. If you know me and have a Flickr account do mark me as a contact and I’ll do likewise, friends and family get to see more family stuff.

Anyway, there’s lots been happening and I struggle to keep up these days, whether it be politics or tech or scifi or any of the other things I’m interested in. I ain’t got a lot of content for this post I’m afraid, it’s more of a placeholder to show I’m still dropping by the site from time to time. In fact, I think that this is my first post of 2007… considering I’ve been blogging on and off in some form since late 2002 that’s the longest gap.

I suppose that after such a long quiet period it’s fairly safe to bet I don’t have much of a readership. Maybe if I start posting some more, set up a commenting system, and participate in some other fora I might get that sorted. I reckon I could contribute a few things to one discussion or another out there.

Now I’ve said that, I bet I don’t post again for months. One last thing, if there’s anyone subscribing to my feeds, please consider taking the time to drop me an email and let me know, the logs are so full of noise it’s difficult to tell if there are people on the end of any of the GETs.

Dec 03 2006

Ubuntu Dapper HAL update DOESN’T break USB mass storage automounting

The recent update to HAL available for Ubuntu Dapper seems to break USB mass storage device automounting. The broken version is 0.5.7-1ubuntu18.2. (Oops – no it doesn’t… see below).

I haven’t figured out why yet (I will post when/if I do) (ahem), but here’s how to downgrade if you’re affected by this and don’t want to wait on a fix. (But this bit might still be useful if you ever need to downgrade apt packages and fix them to a specific version while waiting for a fix that you really need.)

Run the following command as root:

apt-get install hal=0.5.7-1ubuntu18 \
libhal1=0.5.7-1ubuntu18 \
libhal-storage1=0.5.7-1ubuntu18

You’ll need to reboot. You can use an entry in /etc/apt/preferences to keep these packages to this version until new packages that don’t break HAL are available. Create that file if it doesn’t exist and add the following lines:

Package: hal
Pin: version 0.5.7-1ubuntu18
Pin-Priority: 1000

Package: libhal1
Pin: version 0.5.7-1ubuntu18
Pin-Priority: 1000

Package: libhal-storage1
Pin: version 0.5.7-1ubuntu18
Pin-Priority: 1000

You should really read man 5 apt_preferences, and you should monitor what updates to these packages become available. I can’t guarantee that keeping these packages at this version won’t break anything else.

I have to say that this has soured me a little on Ubuntu. One of the reasons I chose this distro was because I don’t have anything like as much time to myself as I once did and I don’t want to spend what time I do have troubleshooting minor conifg issues like this on my machine, and Ubuntu has a reputation as a very stable, well maintained distro. USB drive automounting might not sound like a very important feature, but it’s this kind of thing that will put off non-technical users, or even technical ones with small kids and short tempers. Still, I’ll try and look into this problem and maybe file a bug report if no one else has already.

Update 11th December 2006

I now regret writing that last paragraph. To be honest I had misgivings almost immediately after posting it as I thought it a bit harsh but I decided to leave it. Anyway, I have now found that the upgrade did not break USB automounting at all – it was the device I was using to test it. My fault. PEBKAC. The device in question is my Sony Ericsson mobile phone, a K750i. Quite a nice phone, but it is a little temperamental at times – prone to occasional crashes and lockups. Normally this gets mounted as a mass storage device when I plug it in as it contains a 128MB Memory Stick Duo, but every so often it fails for reasons unknown (syslog just says
Device offlined - not ready after error recovery). Having done some reading up on the way that HAL, D-BUS, udev and gnome-volume-manager work I upgraded HAL again ready to start troubleshooting only to find that everything was working fine, then I encountered the error with my phone and all became clear. My CF card reader and Seagate external hard disk both work exactly as they should. The phone mounts most times, but occasionally fails. I think I’ll have less luck toubleshooting that than I would HAL et al. My apologies to Ubuntu for my unwarranted harsh words above.

Aug 14 2006

External Hard Disk setup

I recently purchased a Seagate 250 GB external USB hard disk to use as a backup medium for my home network. This will be connected to my main Linux box (currently running Kubuntu Breezy) and important personal data and system files will be rsync‘d to it on a regular basis.

Herewith some notes on configuration, somewhat distro-specific although not uselessly so. (At least I hope not, as I plan to rebuild my home server fairly soon and may well switch. I’ve been experimenting with Kubuntu after years as a Slackware user and have not settled on a final decision just yet.) On that note: please bear in mind that this post is not intended as a definitive HOWTO but should be considered as my notes on what I did to get this working for me under a particular set of circumstances, with far less time to research everything involved than I’d really have liked. In other words: Your Milage May Vary.

The disk comes preformatted with the somewhat limited FAT32 filesystem. Given that all files being backed-up will be coming from systems running one flavour or another of Linux and that the disk will probably only need to be accessed directly from Linux systems, I’m going to reformat with ext3 using the following steps:

  1. Plug in the disk. Kubuntu detects it and pops open a window asking what to do. I select “Open in a new Window” initially which mounts the disk at /media/sda1 and opens a Konqueror window at system:/media/sda1 to view the volume.
  2. Looks fine. I close Konqueror, open a Konsole window and type sudo fdisk /dev/sda at the prompt to check the partiton table of the disk (type p at the fdisk prompt), which contains no surprises as the disk is one large FAT32 volume. Type q to quit fdisk.
  3. Unmount the disk manually : sudo umount /dev/sda1. This needs to be done in order to format the disk.
  4. sudo mkfs.ext3 /dev/sda1. Wait a couple of minutes for the format to complete.
  5. Check it mounts ok: sudo mount -t ext3 /dev/sda1 /media/sda1. Great.
  6. Check it still automounts properly on power-on by unmounting manually, turning the disk off, then turning it back on again. All fine.
  7. In the default state, the disk is mounted on a dynamically-created directory under /media named for whichever device node it is assigned when it’s plugged in. This means that the mount point may change, making the task of writing scripts to automate the backup procedure more complicated. The following steps go a long way to ensuring that the disk is always mounted in the same place:
    1. Added the following entry to /etc/udev/rules.d/hal.rules (more information on writing udev rules):
      BUS=="usb", SYSFS{product}=="Seagate External Drive", \
      KERNEL=="sd?1", NAME=="%k", \
      SYMLINK=="seagate", GROUP=="hal"
    2. sudo mkdir /media/seagate
    3. Added the following line to /etc/fstab:
      /dev/seagate    /media/seagate  ext3    noauto,rw,user 0 0

    You need to restart your hald for this to take effect. I ended up rebooting, but I couldn’t see why something like /etc/init.d/dbus restart wouldn’t do the trick.

    It’s worth noting that although this does mount the disk under /media/seagate, it still shows up in Konqueror at system:/media/sda1. Not sure why at time of writing – this feels like a bug.

    Also note that I used e2label to the give the device a label (”SEAGATE”). I was initally looking at using this to mount the volume to the desired mount point with a line in fstab starting LABEL=SEAGATE, but the udev/hal fix turned out to be the simplest option(!)

  8. mkdir some top level folders: music, photos and home. Then do an initial series of rsync runs, starting with a simple rsync -av /media/photos/ /media/sda1/photos/. Everything sysncs fine. Now I’ll be able to backup quickly as and when necessary, and write some scripts to automate everything … eventually.
Aug 03 2006

War

This is about the best commentary I’ve read or heard anywhere so far on the death and destruction in Lebanon and Israel.

Apr 23 2006

Reclaim the Buses demo and rally

(Hey, it’s amazing what gets you posting to a neglected weblog again after a few months – and in the end it wasn’t until well after the Spring Equinox. Oh well, on to the matter in hand, and this time I’m not even going to suggest when I next expect to post.)

Polly and I went along to the demo with Uma and a couple of friends; since we all sit around bitching about the terrible bus service in the city it seemed right to support a group that aims to improve matters. I was curious, too, as I’ve never been to a demo or rally in Bristol and was interested to see who and how many would turn up. I was a bit concerned that there’d only be a handful of us and that the event would get hijacked by the usual suspects, the ones that turn up to any and every protest event with an agenda of their own and a load of branded publicity materials, and for a while it seemed my fears might be realised: we arrived at Castle Park to be greeted by a line of comrades thrusting newspapers and petitions at anyone who looked even slightly interested in the motley gang of activists preparing their banners and placards in the background. At this stage the gathering looked less like a protest at the state of the bus service in Bristol and more like a recruitment drive for any number of local left-wing political factions.

For a while this annoyed me so I’m going to indulge in a minor rant. At larger, better attended events the presence of these guys peddling their papers and ideas has less impact as they tend to fade into the background and help bulk up the numbers, but at smaller event like saturday’s demo they can end up dominating proceedings. This is a real problem for a group that wants to build up a broad base of support as they tend to warp the agenda and put people off. Pretty much every sane person in Bristol would agree that First provide an unreliable and massively overpriced bus service that falls way short of meeting the needs of the population, but this does not mean that they want to sign SWP petitions tenuously linking the war in Iraq to the issue of the day, call for more general re-nationalisation programs, abandon capitalism altogether for some unlikely socialist utopia or even become associated with these views by attending events where they appear to be the dominant ideology.

Anyway, I digress. Having successfully avoided paying money for party political propaganda from the paper sellers we made it over to the gathering crowd where eventually a Marshall gave us a bunch of leaflets and a hand-made placard to carry. As time went on the crowd grew until there were around a hundred or so people armed with Reclaim the Buses banners headed-up by two large cardboard buses parodying First’s livery. As this was Uma’s first demo, we thought she might appreciate the chance to join in so we gave her the placard to carry. (I’m not sure whether she approved – for all I know she might wholeheartedly support privatisation – but being only one year old and unable to speak she was left with little choice.)

[Uma in pushchair with placard]

She didn’t follow the march all the way round the city centre anyway, as despite having been told by one of the marshalls that we were going to go along the river on a quieter, more pedestrianised route we ended up wandering down the middle of the road through central Bristol while the traffic piled up behind us (including, amusingly, a line of First buses that looked for all the world like part of the procession). Mark and I took Uma and left the march after a while when it became obvious that some of the drivers were becoming annoyed with the protest and getting aggressive towards the demonstrators. We watched from the sidelines as the parade moved through the city centre and up and down Park Street before gathering on College Green for a rally. At this point we decided we’d done our bit and went to a nearby cafe for tea and sandwiches.

[The protestors marching through the city centre]

I reckon the organisers can count the event a success. The props were eye-catching and the volunteers handing out leaflets friendly and enthusiastic. Apart from a handful of idiots in their cars most people treated us all with good humour. The city was busy so a lot of people will have seen the demo and been given a leaflet, boosting the profile of the campaign. Despite the relatively low numbers and my initial fears I don’t think the event suffered too much from hijacking by opportunistic political activists as most of the banners and leaflets distributed during the actual march were fairly non-partisan.

As I mention above, I don’t think that anyone in Bristol is going to seriously argue against the proposition that the bus service is very poor. There may be some debate over how to deal with this and not everyone might agree with public ownership, but the presence of a campaign trying to focus some attention on the problem has to be a good thing if it inspires more people to actually do something rather than glumly accept the status quo. Even if that’s just giving a local councillor an earful on the issue over the coming weeks as they campaign for votes in the upcoming election it’ll be worthwhile.

Personally, I think that Bristol is too small for a free-market solution, although my objections are based on practical rather than ideological grounds. The market in Bristol just isn’t big enough to support the kind of competition necessary for this approach to work, so there has to be some level of public control or regulation to ensure the service meets the needs of the city. This isn’t really my field so I don’t have any detailed suggestions about what kind of model we should adopt, but if other cities can find a decent balance then I can’t believe that it’s not possible here – it just needs some political will. Nor do I believe that anyone can seriously argue that this isn’t desirable – Bristol is clogged with traffic but to get people out of their cars there must be a viable alternative, and at the moment there just isn’t.

Apr 19 2006

Reclaim The Buses…

…is a grassroots campaign in Bristol aimed at sorting out the terrible bus service the city’s cursed with. Check out the Reclaim the Buses website, and get along to the public demonstration on Saturday 22nd April 2006 at 12pm in Castle Park.

Dec 19 2005

Still alive, but tired

Bloody hell, I’m knackered. This is the first chance I’ve had since last week to even sit down in front of my computer, let alone actually use it to do anything, such as read email or surf the interweb. This is due in part to getting a few days work at short notice – as I’d left all my seasonal chores until the last minute based on the pessimistic assumption that nothing would come up this side of Christmas, this has resulted in a rather manic weekend getting everything sorted.

Still, life has generally been pretty full recently despite being out of work – having a small child around leaves you with very little scope for much else. Most of my other projects are on indefinite hold right now, and will probably remain so for some time. That includes posting here and to Uma’s website – although I’m just taking advantage of a small lull to write this and put up a new baby photo, so if you want to see pics of Uma and you don’t have the password, send me an email and I’ll let you know.

What else what else… well, I’m still looking for permanent work. If you’re in the Bristol area and you need a geek, particularly one who speaks Linux, please think of me. Also – Polly and I marked our ninth annniversary last weekend. Wow. Here’s to us, Pol, especially now there’s three of us!

That’s all I’ve got time for right now. Maybe I’ll post again on Wednesay to mark the Winter Solstice. Or maybe it’ll be nearer the Spring Equinox before I get around to it again…

Nov 25 2005

Bristol No2ID

[Bristol No2ID Logo]The Bristol branch of the national campaign against ID cards and the hideously Orwellian National Identity Register have stepped up a gear lately and are making news locally and nationally. This week Bristol City Council voted unanimously to oppose the ID card scheme as Bristol No2ID members demonstrated outside the council buildings.

Previously Dave Gould gave Home Office Minister Andy Burnham a fantastic grilling in front of the TV cameras during an ID card propaganda roadshow in the Galleries shopping centre. Dave’s been particularly active in the local group and deserves a lot of credit for his persistance – he certainly puts me to shame, as I’ve recently missed both a meeting and the Demo last Tuesday :-(

Anyway, here’s a token contribution as I lend what little Google Juice I can muster towards the new Bristol No2ID website. There’s a mailing list, too, so get yourselves signed up if you live in the area and care about your civil liberties – they’re being reomved faster than you might think.

WordPress Themes