I love Linux

How many times have you been at work and found yourself wanting a file from your computer at home? What? Never? Well, it’s happened to me once or twice and being the sort of person who will happily spend hours bodging something up to fix a problem that doesn’t really need fixing, I had to do something about it.

The first problem is that my PC at home is turned off. I would dearly love to say that I’ve come up with an internet-connected poking stick that prods the button on my home PC to turn it on, but most modern PCs already have the electronic equivalent of this – something called “wake on LAN“. This is a magic signal that is sent over the network to tell a computer to turn itself on.  I’ll leave out the technical details, but wake-on-lanning is not possible from the outside-world side of the router at home, so an always-on PC inside the home network is needed to send out the signal.  This is where the laptop comes in. It’s an old shitter (AMD K6) with Debian Linux installed on it, that is left on 24/7, sitting under the sofa and spending most of it’s life in low power mode with the fans and hard drive turned off. It’s this one, in fact but with a boring internal hard drive. As well as being a virtual poking stick to turn on our PCs, it also serves as a DNS and network storage. It runs a web server and acts as a gateway to the files on our PCs. This is what it looks like when you log on (yes, you do actually have to log on) to happy from work:

Both PCs turned off
Both PCs turned off

By the way, our PCs have a Mr. Man naming scheme. The laptop is “happy”, Jen’s PC is “splendid” and my PC is “rude”. The router is “tickle”. As you can see, both PCs are turned off. Let’s click the on/off button on rude. Cor! It gets all AJAXy and web 2.0ey with an animated loading doobrey:

Sparkly moving lights!
Sparkly moving lights!

Meanwhile, behind the scenes, happy is prodding rude to boot up. After about 30 seconds, rude is available, happy notices this and the page automatically changes to:

rude turned on, with the music folder mounted
rude turned on, with the music folder mounted

The folders on our PCs aren’t directly accessible from the outside world, so they are attached to happy (which is) by clicking on the icon. Once a folder has got a green tick (as “Music” has here) you can click on the magnifying glass to go to the file browser (which is so AJAXy you could use it to clean the bath) to get at the contents. I didn’t write the file browser, by the way.

The file browser.  Nice.
The file browser. Nice.

You can view pictures, edit text files and play mp3s, as well as selecting a bunch of files to be automatically zipped up and downloaded. It really is lovely to use.

Then, when you’ve finished, just click on the on/off button again…

Rude turning off
Rude turning off

… and rude turns itself off. Sheer geeky fun.

While I’m writing this in praise of Linux (we have no Windows PCs or Macs), I’m well aware that this is possible to do with Windows machines too. It’s just not fun though. Linux allows hacking without restrictions; if you can think of it, you can do it in about 10 minutes with a script file. The original scripts to turn on the PCs and browse the file systems took literally 15 minutes to cobble together. And I’ve programmed in Windows environments; when you do this sort of hackery pokery on Windows machines, you feel guilty. You feel like you should be getting a permission slip from Bill Gates first because you are never really fully in charge of Windows. Error messages? You don’t need to know if something is going wrong because error messages aren’t pretty. We’ll just reboot, shall we?

It’s not easy to hack around with Windows PCs and it’s just not fun. This link is a page showing which program to download, and how to jump through the hoops to turn off a Windows PC remotely. For comparison, Linux requires no extra software and only one command in a script.

I’ll stop gushing now. Next step is to replace the happy laptop with one of these:

This is a PC!
This is a PC!

Guess what operating system this runs? I wouldn’t want anything else.


I’ve got a hankering for some network attached storage, but no money, so it’s time for a home-made job. Jen’s laptop is a creaky old AMD K6-2 which isn’t used for anything any more, but it’s powerful enough for a router with NAS, DHCP, DNS and any other TLA I can think of. Plus, it would be handy to have an always-on computer inside the local network for a spot of WOL or as a torrent client that can slurrp stuff off the net while we kip.

The main problem with this scheme is that the hard drive is a paltry 6GB, which isn’t much storage. As luck would have it, a mate of mine recently gave me a 40GB one. Sorted. Now the problem is one of size – the 40GB one is 3.5 inches, but the laptop takes a 2.5 inch one. The easy way to do do this would be to get a USB box for it and plug it into a USB hole in the laptop. Easy, but slow (it’s USB 1) and cowardly. The macho thing to do is connect it as god intended, with a ribbon cable.

Which leads to other problems. The 2.5″ hard drive has a smaller connector than the 3.5″ one and the 2.5″ drive only uses a 5V power supply, whereas the 3.5″ needs a 12V supply too.

Right. First things first. I need a box for the hard drive. Jumping into the skip, I surfaced with a (presumably broken) CD reader. I took it to bits. With the innards removed, it was the perfect size for a hard drive. I made a plate to sit it on from a die-cast box lid and chopped up the plastic so I could almost close up the box.

Next problem is the power supply. I need to get 12 Volts from somewhere. The Laptop’s power supply is 19.5V, which was close enough to knock a few volts off the top with a regulator. While I’m mucking around with regulators, I figured I might as well put one in for the network switch (which I found recently in a box at home) too, to get rid of a wall wart.

As luck would have it I had a couple of regulators in my junk box, so I bolted them firmly down – they will be dissipating a few watts.

To connect it to the lappy, I needed a cable. A quick skip dive later and I had a nice ribbon cable with the right connector one end, but the wrong one the other. As luck would have it, I had a header the right size in my junk box (I bought it by mistake years ago), so I lopped off the connector and soldered it on to the header, with a couple of extra pins wired up for the 5V supply to the drive.

The sheer beauty of my work has to be seen to be believed. So here it is. Behold.

It just fits nice and snugly where the hard drive used to go, under the keyboard. The problem now is that the keyboard doesn’t quite fit any more and the mouse isn’t totally accessible. Oh well. Never mind. It’s going to be sitting under the sofa.

Time to fire it up. Fingers crossed, deep breath, push the button and… whir click beep. “Operating system not found”. This is actually quite promising because it’s not saying “Wrong sized hard drive attached badly by a moron”. Going into the BIOS shows that – good lord! – it can see it. Look! Well, it’s such a bad picture that you’ll have to take my word for it.

So, how does it all look with everything screwed down and the cases closed up? Cor! Are you sure that’s been modified?

This is my NAS. Lovely, isn’t it? Does it work? Difficult to tell – I have no network card for it. I have had to buy – yes, buy – two PCMCIA network wibblers from Ebay. £7.14!!!! Of real money! Anyway, hopefully I’ll be chucking Debian at it during the weekend and then the swearing can start in earnest. Keep an ear out, you’ll probably be able to hear me from where you are.

Update: It seems to be working and I’m installing Linux on it as I type this.

Update update: After it’s been on for a while I’m getting errors coming from the hard drive. Either Chez has lobbed me a duffer or my regulator is overheating and shutting down. I suspect it’s the latter, so on Monday, I plan to hit the skip for a nice big heatsink.

Update update update: The 12V line was wibbling around by 4V when the drive started up from its powered-down state. A big-arse (that’s a technical term meaning “large”) heatsink and an electrolytic cap cooled it down a bit and I haven’t had any errors since. Sadly though, last night a friend gave me an 80GB 2.5″ HDD that fits inside the case, so for the moment I’ll not be using my wonderful external HDD.