Search Results: "matthew"

14 January 2008

Matthew Garrett

I've spent the evening poking at the panel display that seemed to ship on some of the Philips Freevent desktops (some sort of abortive rebadging exercise). It's a TriGem part with a USB vendor ID of 0x0aa8 and product ID of 0xa001. It has four 7-segment numbers, a volume display and miscellaneous legend indicators. There's also some bizarre spinning circle thing that seems to be under programmatic control, but I haven't figured that bit out yet. It takes bulk writes of 16 bytes to endpoint 1, and the following format seems to be enough to drive the informational display.

The lack of any real free-form text support means it doesn't really fit into the LCDProc model, so I'm not really sure what to do with this. I'm sure I'll come up with something at some point. All the Windows driver does is cycle between showing hard drive space, memory and cpu frequency, though the hardware's obviously designed for showing the time as well (oddly, there's a separate clock at the top of it that works without a driver - I really don't think I want to know how that works). If anyone's got a similar device with a larger array of functionality, I'd be interested to hear if the remaining bytes do anything.

Bytes 0-7Don't seem to do anything - perhaps on systems with more lights?
Byte 8Bits 0-4: Volume lights 3-7
Byte 9
Bit 0: GHz light
Bit 1: CPU light
Bit 2: HDD light
Bit 3: Mem light
Bit 4: Mute light
Bit 5: "Vol" light
Bit 6-7: Volume lights 1-2
Bytes 10-13
Bit 0: Lower horizontal bar
Bit 1: Left lower vertical bar
Bit 2: Right lower vertical bar
Bit 3: Middle horizontal bar
Bit 4: Left upper vertical bar
Bit 5: Right upper vertical bar
Bit 6: Upper horizontal bar
Bit 7: GB light (byte 10), colon light (byte 11), decimal point (byte 12), MB light (byte 13)
Byte 14Doesn't seem to do anything
Byte 15Must be 0x01

13 January 2008

Ben Hutchings: Separated at birth


L: Bill Gates; R: Matthew Garrett

Matthew Garrett

Neil:

The vast majority of your criticisms are unfounded. Nvidia contribute code to the open driver for their network hardware (see the commits) - you don't mention what version of Debian you're actually running, but if it's etch then it's hardly surprising that new hardware isn't supported terribly well. Try a more recent kernel. It's not clear what you expect HP to have done here - used older hardware to make sure Debian worked?

"the graphics don't work with standard Debian kernels and the standard Debian 'nv' driver" - this seems fairer. No 7000-series IDs have been added to the nv driver for some time, and 7150 is clearly missing. Naughty nvidia. No biscuit. But, again, hard to see what you wanted HP to do here - you bought a machine with an nvidia graphics chipset, and you're surprised that the open support is poor?

"I'll still need some firmware for the bcm43xx wireless card - and it is that firmware that made my previously ultra-reliable iBook into a flaky, power hungry psycho-beast." - no. Given that the firmware runs fine on non-Linux platforms, it's pretty clear that it's the (entirely open) driver that's at fault. Which is hardly surprising, given that it's had to be reverse engineered due to Broadcom providing no specifications whatsoever, but blaming vendors for using proprietary firmware is a bit much. Do you have the source for your CPU microcode? Your BIOS? The firmware that's in flash on your other wireless cards? Your hard drive? As a community, we haven't been sending a strong message to vendors that we want open firmware. Acting shocked that they then don't provide it is alarmingly unreasonable.

"GNOME doesn't yet work because of the proprietary crap" - the only proprietary crap you need is the graphics driver, and it's unlikely (though possible) that it's breaking GNOME. Perhaps you have another bug?

"I didn't think companies were still producing crap of this pitiful standard - HP: you stink" - this might at some level be linked to the fact that you paid 500 pounds, and as a result you got something made from cheap parts. That's not HP's fault. Their consumer hardware isn't designed to work with Linux. It's hardware that's designed to be as cheap and shiny as possible in order to appeal to home users who are then going to use it to download films and porn and animated mouse cursors in order to ensure that all their private data get sent to Russia. If it's supported by Linux then that's a happy coincidence. If not, then who cares?

Never mind. It's likely that your laptop is one of the machines that has some debugging hardware on io port 0x80, and as a result Linux's use of that as a delay port (despite the hardware's acpi tables claiming it as a motherboard resource) is likely to cause the machine to deadlock randomly if you do things like try to read the hardware clock or nvram. That's likely to cause you more problems than HP's use of Nvidia graphics.

11 January 2008

Matthew Garrett: The weather

Friday's predominant weather is forecast to be heavy rain
Saturday's predominant weather is forecast to be sunny
Sunday's predominant weather is forecast to be light rain
Monday's predominant weather is forecast to be heavy showers
Tuesday's predominant weather is forecast to be heavy rain

Oh well. In a fortnight I'll be heading to Linux.conf.au to discuss why suspend to disk doesn't work, can't be made to work in its current form and that everyone who thinks it currently does is under some form of mass delusion. Friday, 11:30. Be there or be listening to one of the other fine presentations that day. If it rains there, I may be upset.

31 December 2007

Matthew Palmer: Go Wide or Go Deep

This blog post, Wide vs. Deep, provides a different viewpoint on the same topic I was going on about a few weeks ago in Strategists and Tacticians. It's well worth a read if you found my post at all interesting.

Matthew Palmer: Cowboys

I am very saddened by the state of the IT industry. It seems like nearly everyone who works in or around IT is, to put it bluntly, a cowboy. There appears to be very little desire for actually helping people; instead all I see is a very large number of people circling around looking for the next person they can make a quick buck off. In short, most of the IT industry is composed of people who are little better than shysters and conmen. As a case in point, I recently had contact with someone who is trying to get an online store running. They've been trying, unsuccessfully so far, for several months. They've been screwed over by basically every IT-related person they've had contact with so far. Now, after all of their suffering, they've finally gotten in contact with me. Most of their money is gone, and they're deeply behind schedule. So I'm left trying to pull a miracle job in little time and with little money. Yes, I could shoo them away, because they're asking for more than they can afford, but there's a little spark of helpfulness left in me, and I'll try to get them going as best they can with what they've got. If they'd found someone competent right at the beginning, they'd have been fine. They started with sufficient cash and time to produce a good end result. But chancing upon someone decent doesn't have good odds in IT; it's a bit like winning the lottery. This story isn't unique in my personal experience, by any stretch. There seems to be a near-endless procession of non-technical people who come out of their encounters with the IT industry battered and bruised, whether it be on the web, in their business infrastructure, or their personal computing needs. While it's easy to blame the customer for not managing themselves and their computing properly, I don't think it's fair to lay the blame on them -- to me, that's like blaming the patient for dying on the operating table, when the responsibility must lie, prima facie, with the surgeon. It's the surgeon, after all, who is the (presumably) trained and experienced professional in the relationship, and it is his responsibility, primarily, to ensure that everything goes smoothly[1]. Depressingly, I don't see much of a way around this problem. The few IT people who did care could try and group together, build some sort of a rating or "membership implies quality" system, educate the consumer, and try and drive the cowboys out, but guilds and trade associations are frowned upon these days, smacking (as they do) of restraint of trade and collusion. Government regulation never seems to produce anywhere near the desired result, while hoping that the consumer will either rise up and demand quality, or will gain sufficient knowledge to be able to pick a cowboy is a complete non-starter, for the same reason as teaching everyone basic surgical techniques isn't going to improve the quality of hospitals.
There's an ad that used to be on Australian TV for a certain bank, where a guy is at a party and he's asked by another of the partygoers what he does for a living. As he replies, "I work in banking", the entire party goes silent and stares at him in horror. It's only when he says, "It's OK, I'm with $BANK_BEING_ADVERTISED" that everyone looks happy again and continues on with their party. Although I've never had that particular experience, I'm almost getting to the point where I'm not happy telling people what I do for a living. This is because in any non-trivial collection of people, there's almost certainly going to be at least one person who has had such a poor experience with the IT industry that they're either going to take it out on me, ask me interminable questions about computers, or will just hate me on principle. It's unfortunate that brothels don't have pianos any more; if I were to say "I play piano in a whorehouse" I'm pretty sure the response would be "lawyer or sysadmin?". As Edsger Dijkstra said back in 2001, "The average customer of the computing industry has been served so poorly that he expects his system to crash all the time, and we witness a massive worldwide distribution of bug-ridden software for which we should be deeply ashamed." Are you?
1. That isn't to say that the patient (or client) has no responsibility in ensuring a positive outcome -- if you go bungee jumping the day after open heart surgery, or never send your web developer any content, you're very unlikely to have a positive outcome. However, it seems to me as though the only customer consultation done by most IT "professionals" on taking on a project is a Homeresque "I only have two questions. 'How much?' and 'give it to me'".

21 December 2007

Matthew Garrett

I submitted my PhD thesis today, which means that (other than a viva some time next year and whatever corrections that may bring) I'm done with the past four years of work. Consequently, I'm looking for a job - long term I'm looking at moving to the US, with a marked preference for San Francisco (with Boston and Portland as backup options, but fairly significant preference for being in the city rather than some outlying village), but I'm also up for short term stuff.

Even shorter term, I expect that I'll be spending the evening at home and working through the excessively large number of bottles of wine that have piled up. Do feel free to drop in.

16 December 2007

Matthew Palmer: Camping: CGIs on steroids

There's no way around it: I'm a bit of a Rails fanboy. While it's got it's glitches, it's certainly made the part of my life that involves writing web applications a hell of a lot easier, and introduced me to the wonder that is the Ruby programming language. However, there are plenty of times when Rails just isn't a good fit. It's not particularly simple to deploy, it's quite heavy, and it does have a definite learning curve. So, when I need to write something simple, I've just used Ruby's built-in CGI support. But I will do so no longer. For I have found Camping. The name doesn't make a whole lot of sense, and until you come to grips with Why The Lucky Stiff's weird sense of humour, the docs will probably make you think that acid trip you took several years ago has just kicked in again. However, the purpose of Camping is pretty easy to understand: it allows you to make simple (CGI level) web "applications" using Rails-like (or more properly, MVC) concepts, which are fairly easy to write and deploy. If you're familiar with Rails (or probably most of the other Rails-clones that have sprung up in other languages) then Camping will probably smell at least faintly familiar. You have routes, which map URLs to controller actions, which retrieve models and feed them to a view which sends results back as HTML. From that perspective, Camping is easy to learn -- it's core concepts can piggyback on existing knowledge, and you can get started very quickly. Using your Rails-fu, however, will only get you so far. For one thing, the API is similar-but-different enough that while your first couple of simple experiments will probably Just Work, getting more complex things done will either fall under the "different" or "difficult" headings. That isn't meant to be a slight on Camping, though -- if you want to do horribly complex things, then you're heading into territory best served by Rails anyway. But there is a bit of a middle ground where the utter simplicity of Camping is stretched a little, but it's still more appropriate to write a Camping app than a Rails app, and it's important to remember that you're not using full-blown framework when you thump up against something that's beyond-trivial in Rails, but is not quite so simple in Camping. Camping is a microframework -- it says so right there on the front page. Why's intention is that Camping will always be provided in less than 4kB of code. So you're never going to get, for instance, the broad range of HTML helpers that Rails' ActionView provides to make writing HTML templates so easy, or the Prototype JavaScript framework shipped with the main code. If you don't want to blow a steam pipe, then, when starting out with Camping, you need to think "this is a lot easier than hand-writing CGIs" instead of "this is a lot harder than writing a Rails app". There are a few things that are undeniably a pest in Camping, though. The docs are a little incomplete and hard to follow (even when you account for Why's "unique" style of writing), and some of the coding tricks that are employed in making the framework can make debugging a bit tricky. They're not showstoppers, but it's worth knowing about them in advance so you don't go nuts when you're first using the framework. If you're not the sort of person who needs small, self-contained web scripts, then I'd say you'll probably never get much benefit out of Camping. On the other hand, if you're still writing your CGIs against the "bare(ish) metal", then I would strongly encourage you to take a look at Camping, to make your life just that little bit more delightful.

12 December 2007

Matthew Palmer: E-Commerce, thy name is mud

So much for the idea that you can buy anything you like online, whenever you want. My laptop's screen has been acting dicky lately, and research suggests the most likely candidate is the backlight inverter. Luckily, there's online guides that show me (with pictures!) how to get at that and get the FRU number off it. Easy so far. Now I just need to find a new one. $SEARCH_ENGINE to the rescue. Plug in the FRU number and up come pages and pages of results. Oh goody, I should have no trouble here. Except that, when I visit this myriad of sites, there's a lot of similarity in pricing and content (not the look of the sites -- no, they're all completely different -- just the prices and textual descriptions). I've only managed to identify four separate stores, from visiting a good couple of dozen search results: My choices, then, are: extortion, impossibility, slow extortion, or probable scam artist. What a set of choices. So, I've come to the conclusion that e-commerce is a complete and utter joke unless you're in the US. So much for the global market and all that bollocks. Back to shopping the old-fashioned way for me.

7 December 2007

Matthew Garrett

When faced with having to give a presentation on genetic disease, what's the best antidote to the depressing facts?



Comic Sans. Of course.

Matthew Garrett

Further to Iain's discussion of clocks on the desktop, I present to you:

Clocks.



(Note: Not actually KDE)

5 December 2007

Matthew Garrett

Seth Oster, executive VP and chief communications officer of the MPAA, told Ars that the notice came over the Thanksgiving holiday when their offices were closed. "As soon as we came back and discovered that there had been someone who had raised some concerns, we removed the software," Oster said. "Anytime anyone raises any reasonable concern we look at it because we take copyright very seriously at the MPAA." He also denied Garret's assertions that the ISP was involved in the takedown, saying that the MPAA chose to take the toolkit offline.

(from Ars)

The bit about Thanksgiving is basically accurate - I contacted them at 15:52 Pacific time (23:52 GMT) on Friday the 23rd of November, saying that I'd take further action if things hadn't been fixed by close of business on the following Friday (the 30th). While I'm happy to accept that this might have cost them Friday and Monday (if the MPAA are the sort to offer a 5 day long weekend), that's still 4 business days of response time. I telephoned them on Friday morning (around 10AM Pacific time) and was told I'd get a call back shortly. By Saturday it seemed likely that this wasn't going to happen, so emailed the ISP. At 19:13 Pacific time on Saturday, I received an email from the ISP informing me that they were going to contact Paul Egge at the MPAA. There was an ISO available from the MPAA site until at least 09:22 Pacific time (17:22 GMT) on Monday the 3rd of December, which had been removed by 23:00 or so GMT (the next time I checked).

So, to summarise. The infringing material was still available the best part of 9 days after the original notification was sent. At least 4 of those 9 were business days. The material was not removed until after I had contacted the ISP and they had informed me they were going to contact the MPAA. Further interpretation is left to the reader.

Matthew Palmer: Strategists and Tacticians

Like most things, the scale of decisions that have to be made by a person or organisation fall across a wide spectrum. At one end, you've got the fine-detail work: lines of code, individual config settings, IP addresses, that sort of thing. This is crucial work, because it's this detail that ultimately produces saleable results. Travelling all the way to the other end, there's the "big picture" decisions: the "visionary" stuff. What market segment will we target? What will we do (in large-scale terms) to get there? I am convinced that individuals naturally gravitate towards one end of this spectrum or the other, depending on their psychology. While people usually can work at all scales, they have a "most comfortable" point where they work the most naturally. The further away from this point they are pushed, the less comfortable and effective they are. No level of thinking is better or worse than the other; they're just different. While "large scale thinker" and "small scale thinker" could be taken as being insulting, I certainly don't mean it that way. I should point out that "Strategy" isn't (just) about setting goals. A strategist isn't someone who comes out with grand pronouncements like "By the end of next year this company should be providing telecommunications services to 20% of the Fortune 500" without knowing how to get there. That's not a strategist, that's a poor-quality management consultant. People whose only skill is making vague pronouncements should just be taken out and shot. They're not doing anything useful for anyone. A strategist is someone who is good at planning the goal of "20% of the Fortune 500". They're thinking about the big picture issues, without getting bogged down in the minutiae. A tactician, given the job of planning something at the macro scale, will chase some good idea down an intricately detailed rabbit hole, and miss the other dozen or so large issues that need to be considered. The strategist's planning needs to stop at a certain level and let other people take on the detail work. Conversely, a good tactician can focus on the individual details without getting distracted by the big picture. A strategist put into a tactical role will miss all the important minutiae because they're working out how their little part fits into the big picture, instead of working out how to make their little part work, in and of itself. It's important, for individual happiness, to try and work out what level you're most comfortable thinking at, and then trying to find a job that puts you there. It's almost as important to make sure that the people who are working at the more and less detail levels around you are equally comfortable. Take, for example, the micromanager. We've all either been there ourselves or have heard multiple stories on the subject. I think the micromanager is nothing more than a person who wants to work at a smaller scale than they're being forced to by their organisational rank. Since they can't do the detail work any more, their only outlet is working vicariously through their subordinates. Voila! Instant micromanagement. An even more painful case of micromanagement would be when the subordinate wants to think at a larger scale than the superior. In that case, the subordinate will naturally be thinking large scale, and will miss the details. To the small scale thinking superior, that is incompetence, and will naturally be dealt with by more micromanagement. In reality, both parties are incompetent at their jobs, and they should really swap roles, so that everyone is in their element. It would be nice if companies stopped thinking hierarchically in this way -- that a more "senior" person has to think at larger levels. Just because you've been somewhere longer (or have been working in an industry longer, or got higher marks, or whatever), it doesn't mean that you're more of a strategist. This is probably the Peter Principle restated: people get promoted to a level where they just can't comfortably think at the necessary scale any more. If instead people were put into a planning hierarchy based on their natural scale of thinking, we'd all be a lot better off. There'd be a lot less power games, though, which makes me think it's not going to happen any time soon. A business, at whatever size it might be, needs an appropriate mix of strategists and tacticians. A really small business (1-10 people) can get away without needing large scale thinkers, in the same way that a really small boat can get away without needing a rudder or pilot. If a really small boat gets itself into trouble, everyone on board can grab an oar or bucket and help get the boat out it's predicament -- it's small and nimble enough to be able to do that. As the company expands, though, it's important to make sure you've got some strategists around. If you don't have anyone to keep an eye out for problems and plan around them, your small-to-medium sized boat is likely to have a hole punched in it by a submerged rock. Even if somebody on board happens to notice the rock before you actually hit it, once you get to a certain size you can't physically stop or turn the boat in time. If you don't understand the growth issues in the company, you might not even realise that you're no longer the nimble and low-inertia dinghy until you're up to your knees in sea water. Although an obvious solution to this problem might be to say that all businesses should be small and nimble ones, it's as impractical as saying that all boats should be dinghies. A fleet of dinghies isn't going to be able to support the worldwide sea freight market, and a fleet of small companies doesn't have the necessary resources on hand to take on the big projects that are so often needed. Also, a dinghy is at risk of being swamped by one freak wave, while a larger ship can weather significant storms without going under. Regardless of the size of the business, there always needs to be a good supply of tacticians. A boat (of whatever size) full of people who are all looking out for rocks isn't going to go anywhere, because nobody's making the thing move. Similarly, a company full of strategists isn't going to be doing any of the day-to-day work that actually earns money, and no money means no company. The single most important thing, though, is be self-aware enough to know what sort of person you are, and try to find something that lets you work at the level you're most comfortable at. Otherwise you're just setting yourself up for unhappiness.
(I'm not really sure why I'm suddenly writing management blog posts; this idea of "levels of thinking" just came to me and I figured I'd put it out there. If it makes you feel more comfortable, there's a fairly transparent mapping of these ideas to the practice of software development, although I'll leave the execution of that mapping to the reader. Comments are welcome.)

3 December 2007

Matthew Garrett: Spot the difference

Before takedown request:


After takedown request:


MPAA don't fuck with my shit.

(And yes, I did attempt to contact them by email and phone before resorting to the more obnoxious behaviour of contacting the ISP. No reply to my email, and the series of friendly receptionists I got bounced between had no idea who would be responsible but promised me someone would call back. No joy there, either.)

(Context)

2 December 2007

Matthew Johnson: Passwordless Encrypted Root in Debian

If, like me, you wanted both an encrypted root filesystem and some form of bootsplash you may have discovered that this is tricky. You need to enter the decryption passphrase on the terminal which means exiting the bootsplash. I decided it must be possible to use a USB token with the key on it rather than a passphrase to decrypt the drive and while this seems supported upstream, it is not supported out of the box on Debian. This is a short howto explaining my solution. Pre-requisites You will need a USB hard disk and a computer using Debian with an encrypted root filesystem. I am assuming that you are using a stock kernel with an initramfs image and have a luks encrypted LVM containing the root filesystem. You will have to change some of the details below to match your specific system. In the examples below /dev/hda5 is the encrypted partition and /dev/sda2 is the partition on the USB disk holding the key. Setting up the key First we need to generate a random key and put it on the disk. To save having to mount things in the initramfs, I chose to use a partition at the end of the USB flash disk. This means repartitioning and reformatting your USB disk. I recommend allocating the last cylinder in fdisk to primary partition 2. Once you have the second, small partition (you are only going to use 1k, so as small a partition as possible) you can put a key on it. This is as simple as dd if=/dev/urandom of=/dev/sda2 bs=1M . Adding the key to the luks partition Next, you need to add your new key as able to decrypt the partition. Luks allows several keys to be able to unlock the partition. The real key is decrypted under each of the user keys or passphrases and stored in a key slot' in the partition. To add your key type:
touch /tmp/keyfile
chmod 600 /tmp/keyfile 
dd if=/dev/sda2 bs=1k count=1 of=/tmp/keyfile
cryptsetup luksAddKey /dev/hda5 /tmp/keyfile
wipe /tmp/keyfile
Note the careful handling of the temporary key file (luksKeyAdd won't read from stdin, whereas luksOpen will), I recommend storing it on a ramdisk and you should certainly use wipe rather than rm if you don't. Once you have added your USB key you could remove the passphrase from the key list with luksDelKey, but if for any reason you lose the USB hdd you will be unable to decrypt the partition; I recommend leaving both keys available. Booting automatically In order to boot using the USB key we need to provide a couple of helper scripts in order for the initramfs to work. We also need to set some parameters on the kernel command line. In Debian these scripts can be added to the initramfs by putting them in /etc/initramfs-tools/. The first script is a helper script used when building the initramfs. This writes a second script into the initramfs itself which takes the partition as a parameter and prints the key on stdout. This should be written to /etc/initramfs-tools/hooks/cryptkey (executable) and contain:
#!/bin/sh --
PREREQ=""
prereqs()
 
   echo "$PREREQ"
 
case $1 in
prereqs)
   prereqs
   exit 0
   ;;
esac
. /usr/share/initramfs-tools/hook-functions
cat > $ DESTDIR /bin/loadkey 
The second script runs immediately before the cryptsetup script in the initramfs and ensures that the USB disk is available. This will cause the boot sequence to block until the USB disk is inserted and the device nodes created by udev. It can be provided directly in /etc/initramfs-tools/scripts/local-top/00ensureusb (executable) and should contain:
#!/bin/sh --
PREREQ=""
prereqs()
 
   echo "$PREREQ"
 
case $1 in
   prereqs)
      prereqs
      exit 0
   ;;
esac
if ! grep cryptopts /proc/cmdline >/dev/null; then return; fi
. /scripts/functions
log_begin_msg "Waiting for USB to become available..."
modprobe usbcore
modprobe uhci_hcd
modprobe ehci_hcd
modprobe usb_storage
while [ ! -b /dev/sda2 ]; do
   sleep 1
done
log_end_msg
exit 0
The cryptsetup script itself reads configuration from the kernel command line. Here you can give it a script which will read the key and the source for the key to read. Edit your grub or lilo config and append the following to the kernel command line: cryptopts=keyscript=/bin/loadkey,key=/dev/sda2,source=/dev/hda5,target=hda5_crypt,lvm=hecate-root You will obviously have to change the name of your lvm root partition (volumegroup-logicalvolume). I recommend having two entries in the boot menu, one with the cryptopts and one without to allow easy decryption using the passphrase instead. Conclusion That should be everything. Boot your computer and inset the usb hdd. When the boot process passes decryption you can remove it again. You may have to replug it if you boot with it inserted to start with.

30 November 2007

Matthew Garrett

Fathi: While Splashy still requires a framebuffer, it's going to break suspend/resume on various systems. In the bright shiny future of kernel modesetting this ought to stop being an issue, but that's going to take several years. Having the kernel try to write to video memory before you've had an opportunity to do anything to reinitialise it is just asking for trouble, and the kernel can't usefully do that itself right now.

29 November 2007

Matthew Palmer: Stupid

I think these log messages really speak for themselves:
2007-11-29 13:17:10,6,smsd: I have to send 2 messages for /var/spool/sms/checked/smsgw.out.CWlda8
[...]
2007-11-29 13:18:54,4,smsd: Sending SMS to 0421XXXYYY on GSM1 failed
2007-11-29 13:18:54,6,smsd: Deleted file /var/spool/sms/checked/smsgw.out.CWlda8
"Retries? We don't need no stinkin' retries!"

13 November 2007

Adrian von Bidder: Layer Cake

Recently spent three days playing poker, watching movies and drinking beer (we call that military service in Switzerland.) Layer Cake: Fun, somewhere in the vicinity of Betelgeuse^W Pulp Fiction or Lock, Stock and Two Smoking Barrels (Hmm. Why am I not surprised that Matthew Vaughn was also involved in the latter? I need to pay more attention to the names of directors and producers.) Also watched Meaning of Life one more time, no comment needed, I guess. Started watching Man on Fire (2004, by Tony Scott) but went to bed before the action really started, so I can't comment on it. Discussed modern (fast-paced, nervous etc.) moviemaking which reminded me that I should mention (Russian Ark) as a counter-example: the whole movie is one single 90 min long steadicam shot.

8 November 2007

Matthew Garrett

As often seems to be the case, my internet at home vanished shortly after I arrived in Portland. Remote debugging (hurrah for flatmates) revealed that the modem would come up, start a PPP session and then OOM around 30-40 seconds later. This was kind of odd, since running ps in a tight loop showed that it wasn't the PPP daemon that was taking up all the extra RAM. Once we'd pretty much ruled out userland, that left the kernel. Limiting the value in /proc/sys/net/ipv4/ip_conntrack_entries brought stability back, but left us wondering why it had suddenly broken (and, of course, made it difficult to actually route anything...). /proc/net/ip_conntrack showed a bunch of ssh connections. Lots of ssh connections. All coming from one machine inside the network, but targeted at a large number of machines with roughly consecutive IP addresses.

At this point, I remembered a party a month or so ago. One where I'd created an account on the TV machine to let people upload stuff to play. An account I'd cunningly called "media", giving it the highly secure password of "media". I blame vodka from Ikea.

You can guess where this is going.

Unplugging the TV machine resulted in everything rapidly returning to its normal state. I'm sure there's some sort of important lesson here, but I'm sure I don't know what.

25 October 2007

Matthew Garrett

Linux-hero wrote about how Ubuntu kills your hard drive. The situation is somewhat less clear than you might think from the article, but the basic takeaway message is that Ubuntu doesn't touch your hard drive power management settings by default. In almost all cases, it's more likely to be your BIOS or the firmware on your hard drive.

The script that's executed when you plug or unplug your laptop is /etc/acpi/power.sh. The relevant sections are:
function laptop_mode_enable  
...
    $HDPARM -S $SPINDOWN_TIME /dev/$drive 2>/dev/null
    $HDPARM -B 1 /dev/$drive 2>/dev/null
 
That is, when the laptop_mode_enable function is called, we set the drive power parameters. Now, by default laptop_mode_enable isn't called:
if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
    (sleep 5 && laptop_mode_enable)&
fi
because ENABLE_LAPTOP_MODE is false in the default install (check /etc/default/acpi-support). This means that, by default, we do not alter the hard drive power settings. In other words, the APM settings that your drive is using in Ubuntu are the ones that your BIOS programmed into it when the computer started. This is supported by the fact that people see this issue after resuming from suspend. We don't touch the hard drive settings at that point, so the only way it can occur is if your BIOS or drive default to this behaviour.

If you enable laptop mode, then we will enable aggressive power management on the drive and that may lead to some reduction in hard drive lifespan. That's a fairly inevitable consequence of laptop mode, since it only makes sense if the laptop enages in aggressive power management. But, as I said, that's not the default behaviour of Ubuntu.

There's certainly an argument that we should work around BIOSes, but in general our assumption has been that your hardware manufacturer has a better idea what your computer is capable of than we do. If a laptop manufacturer configures your drive to save power at the cost of life expectancy, then that's probably something you should ask your laptop manufacturer about.

Next.

Previous.