Archive for October, 2005

Abiword Annoyances

Sunday, October 30th, 2005

Has anyone else noticed how middle clicking on recent builds of Debian abiword causes it to decide that it doesn’t want to paste your text but instead will crash randomly and lose your document? If there’s any one single thing which will put people off using Linux then it’s wordprocessors which will crash without warning or without any option to gracefully exit. Please fit it guys.

I’ll fire it up under gdb when I get chance, but I’ll likely have to rebuild the whole damned thing with debugging symbols to get anything useful other than a memory reference.

Jon.

Power to the people

Sunday, October 30th, 2005

I’m speaking at the IBM Linux Migration Seminar in Manchester on Wednesday. The topic will be “Direction of Linux from the opensource community” and I’ll be taking a similar role to that of Jono at a previous event. My interest is more technical but I’m aiming to target this at a wider audience and come down to the technicalities if I’m asked particular questions. Incidentally, IBM’s POWER website is now citing me as recommend reading. I like it when that happens.

Jon.

[PATCH] fix floppy.c to store correct ro/rw status in underlying gendisk

Saturday, October 29th, 2005

I got a little bored earlier while looking for something to write about in this month’s kernel hacking column. I came across a post from Evgeny Stambulchik which amused me because it referred to a bug that’s been present in Linux for donkey’s years and either nobody’s noticed or nobody thought it was worth fixing. The problem is experienced by mounting a floppy that’s been write protected and then doing:

mount -o remount,rw /dev/fd0

(or whatever). This should fail on a write protected disk, but it doesn’t because do_remount_sb thinks everything is ok when it checks the backing block dev to see if it is writeable (it is). Unfortunately, it’s not actually trivial for the aforementioned function to check whether the backing device itself is writeable (something missing in VFS?). So you bodge it by having the floppy_open function hack up the gendisk’s view of it’s read/write policy per this posting…

Evgeny Stambulchik found that doing the following always worked:

# mount /dev/fd0 /mnt/floppy/
mount: block device /dev/fd0 is write-protected, mounting read-only
# mount -o remount,rw /mnt/floppy
# echo $?
0

This is the case because the block device /dev/fd0 is writeable but the
floppy disk is marked protected. A fix is to simply have floppy_open
mark the underlying gendisk policy according to reality (since the VFS
doesn't provide a way for do_remount_sb to inquire as to the current
device status).

Signed-off-by: Jon Masters <jcm@jonmasters.org>

--- linux-2.6.14/drivers/block/floppy.c 2005-10-28 01:02:08.000000000
+0100
+++ linux-2.6.14_new/drivers/block/floppy.c 2005-10-29
18:14:47.000000000 +0100
@@ -3714,6 +3714,13 @@
USETF(FD_VERIFY);
}

+ /* set underlying gendisk policy to reflect real ro/rw status */
+ if (UTESTF(FD_DISK_WRITABLE)) {
+ inode->i_bdev->bd_disk->policy = 0;
+ } else {
+ inode->i_bdev->bd_disk->policy = 1;
+ }
+
if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL)))
goto out2;

Jon.

Calling America

Thursday, October 27th, 2005

I’m planning to spend the festive season in North America. I’ll fly over to New York (JFK) on December 14 and stay until around December 31 or a bit later. During that time, I’ve got to go visit a friend in California and possibly a few other folks too. I’ll also be in Canada for quite a bit of that time (I figure I’ll take the train from Penn station again). My plan is to go to Montreal for a couple of days, possibly take a train out to Halifax, and be in Ottawa on or around Christmas itself.

Jon.

HOWTO: Get broadband internet access in a Mumbai hotel

Tuesday, October 18th, 2005

I’m back in Mumbai for the second time in a week. The wedding was fantastic and I’ll write that up later when I’ve got all the photos uploaded and spent some time documenting the whole experience that has been this visit to India. But in the meantime, here’s an anecdotal story about my efforts to get online.

I’m staying at the Best Western in Mumbai. It’s recently had broadband and ethernet fitted so guests can use their laptops, replacing the older dialup sockets in many other hotels. Last time I was here, I used the business centre for a while, then moved room to get one with broadband ethernet internet access, then used the business centre when the connectivity did not work. This time, I was prepared to spend a few hours with tcpdump, arp and a bunch of other tools figuring out how the networking kit was broken. Here’s how to get broadband in this hotel:

  • Buy a 24 hour access card
  • Connect the laptop, notice it immediately gets a lease via DHCP both in Linux and also using OS X
  • Try accessing the gateway (172.18.1.1) without any luck.
  • Run tcpdump and see arp queries flying around the network, without replies. Figure out they’ve got broken switches.
  • Generate arp traffic to other hosts, find one that will tell you the address of the gateway box (00:D0:09:65:AB:07).
  • Manually add the entry into your arp table (arp -s 172.18.1.1 00:d0:09:65:AB:07).
  • Get online.

So, there you go. Something else they don’t teach you in school.

Jon.

Travel Itinerary

Wednesday, October 12th, 2005

I’ll be in India for a friend’s wedding from tomorrow for a week. I’m flying into Mumbai (Bombay) on Thursday and arriving in the evening. I’ll then have a day in the city before I get on another plane to Ahmedabad to meet Hetal and his family for the ceremony on Sunday. All told, I am excited about my first visit to Asia, but I’m a little apprehensive of using the Internet as a guage of local hotels so I’ve defaulted back to booking with Best Western. Maybe not the best, but at least I know roughly what I’m paying for when I hand over my credit card information. In case of incident (did you wonder why I post this information? that’s the reason folks), here’s my travel itinerary:


* THU13: London Heathrow (LHR) -> Paris Charles De Gaulle (CDG) - Air France AF 2471
* THU13: Paris Charles De Gaulle (CDG) -> Chhatrapati Shivaji (BOM) - Air France AF 134
* THU13: Staying at Best Western Emerald in Bombay (2 nights) - +91-22-26611150
* SAT15: Chhatrapati Shivaji (BOM) -> Ahmedabad (AMD) - Indian Airlines 603
* SAT15: Staying with friends in Ahmedabad (4 nights)
* TUE18: Ahmedabad (AMD) -> Chhatrapati Shivaji (BOM) - Indian Airlines 609
* TUE18: Will book based on the previous Best Western experience.
* FRI21: Chhatrapati Shivaji (BOM) -> Paris Charles De Gaulle (CDG) - Air France AF 135
* FRI21: Paris Charles De Gaulle (CDG) -> London Heathrow (LHR) - Air France AF 1270

I’m still looking into local Linux related events but I’ll mostly be doing touristy stuff. There was a plan to visit some other folks involved with one of the magazines, but that’s not happening since the logistics don’t work. I’m not going to Goa either and will spend some of the time I’m over there catching up on deadlines which are creeping up on me. Should loudly if you want me.

Jon.

The cutter and the clan

Monday, October 10th, 2005

I’ve almost got 100 tracks by Runrig now and growing. I’ve bought most of the albums I care about and have even ventured into iTunes. I’m listening to an eclectic mix from both before and after Donnie Munro left the band – including some rarish live recordings made in 1997 when the band did a tour of Germany to mark the aforementioned departure. They’re very very good live and I think I’m going to have to swing by one of their concerts to see them in person. Incidentally, Sharpemusique looks to be a pretty cool way of paying for digital music on Linux. I don’t mind paying 0.79GBP for a single track (that’s reasonablish) but I don’t want to not be able to play the track on my Linux PC. Using a combination of Sharpemusique, DeDRMS, a CVS build of faad and lame, it’s finally possible to pay for music online and store it onto your ipod from Linux. Not easy, but possible. Reminds me of the old days back in 1999/2000 when I first started playing with nist and css-cat as a way to playback test DVDs on Linux – in glorious 50% framedrop mode (at a push a 400MHz PII managed 50% soft playback). Those were the days.

I swung by the GP surgery (in the UK, we call our general medical practitioner a “GP” and can turn up for prebooked appointments all on the NHS – National Health Service – it’s called a welfare state and it’s something the US government has never understood) for some vaccinations against Typhoid and Hepatitis A. With a racing pulse (I absolutely refuse to visit a doctor unless I’m desperately in need of doing so – something to do with being in hospital for months once and never getting over having two blood tests per day in my arms and hands) I waited until I was called (they’ve got a red LED display now that shows your name when you’re called up, but they’ve stopped announcing the name so I can only assume they have some way of coping with those who need such an announcement made) and then sat for another 5-10 minutes after telling the nurse I needed Typhoid and Hep. A, while she refigured that out. I got a super-combo jab in one arm for those two and she offered to give me flu while I was there. With an offer like that, who could refuse? So if the right strain of flu tries to get me, I’m ok. Still nothing for bird flu and the jabs I had probably won’t be effective by Thursday, but meh. I feel better for going through the motions. I also started the anti-Maleria drugs this evening.

We saw a TV show tonight called “Wife Swap” (I think that this also exists in other countries). Ordinarily, I don’t watch this shite, but I was drawn in by the whole benefits issue. You see, in this country, we have the aforementioned welfare state, which also provides those who cannot work with an income. There’s a slight issue of one or two bazillion people who think it’s a good idea to leech off the state and just not work (because they’ll get benefit) but on the whole it’s a good idea. My view is that I’d rather pay for those people and accept that as a wastage in the system – the government wastes 300 million GBP per year on failed IT projects and lots of other useless things like ID cards, so even a billion wasted on benefits for those amongst the populus who probably could just be forced to get a job isn’t an issue – this contrasts with the views of those who read the Daily Mail and have a warped and twisted view (conversative view) that this country is overrun with such people as well as asylum seekers, etc. etc.

Unfortunately, this show had a stereotypical example of a couple on benefit who claimed they were making the choice to be at home with their kids and not work (wouldn’t that be nice if everyone could do that?). I’m all for the genuine example of one parent not working or of single mothers who need to look after their children, but this wasn’t anything like that. In this case, one of the older kids looked after her siblings while the dad went to the betting shop and the mother did whatever else she did in between smoking a million tonnes of tobacco, eating and uttering the odd “football, innit, wot” type things you might stereotypically expect. I still think it’s better to provide a welfare state for these people too (in addition to those that actually need it) but I understand how some people are annoyed that those who push the system sit at home with nice 40 inch TVs while others pay for them. One solution I propose is that we have government consultants who offer those in such situations financial bribes in return for allowing them to do the equivalent of what happened on this TV show I was watching – go into the family environment and make some useful suggestions, stay for a week and help them get jobs. It’ll never float as an idea because it’s too invasive, but it might work.

Jon.