Yummy Pi – what to do with a Raspberry Pi

So you’ve got your Raspberry Pi and it’s sitting there, staring at you PCB-ily while you are wondering why you ordered it in the first place.  If you don’t know what to do with your Raspberry Pi, don’t bother plugging it into your TV, booting it up and clicking despondently at a few things before chucking it in the loft.  Use it for something useful and learn a bit about Linux at the same time.  Don’t tie up the TV with your Pi, use it on your home network as your faithful assistant – always on and connected to the internet, ready to do whatever you want at any time.  Use it headless (no monitor, keyboard or mouse) and install a whole load of useful stuff on it: a Bittorrent client, media streamer, network-attached-storage or any of these ideas.  You have a PC that is more powerful than the best computer you could buy 10 years ago and it uses less power than a low power light bulb.  It would be a crime not to use it for something.

A Raspberry Pi in a snazzy Lego case

These series of posts are aimed at someone who knows a bit about computers (above the level of randomly clicking at things in a blind panic, but below reprogramming the BIOS with a 9 volt battery and a hair clip) but not much (or indeed anything at all) about Linux.  You will learn to use your Pi at a fairly intimate level, gently stroking its settings by typing in commands and editing files.  This is not pointing and clicking, as you do with Windows, Macs or Linux distributions like Ubuntu, but typing stuff in is not difficult and it makes you feel like a hardcore hacker.  Embrace your inner geek and learn to love your Pi.

1.  Plugging it in

If you want to, you can plug your Raspberry Pi into your TV, stuff a mouse and keyboard up its USB ports and use its (quite slow by all accounts) GUI, but I don’t do these sorts of shenanigans.  I have a simpler setup where it’s just plugged into the network and accessed remotely, with no keyboard, mouse or anything.  To run it this way, you need three things: a power supply, an SD memory card and a bog standard CAT5 network cable.  Don’t panic if you are running your home network wirelessly – your router will have sockets on it for plugging in network cables.  You won’t need physical access to your Pi after the initial set up, so you can leave it next to your router – in the cupboard, under the sofa, or wherever your router lives.

To power it up, you need a 5V power supply that can provide at least 700mA with a mini-USB connector on the lead.  Have a look in that collection of phone chargers you’ve got rattling around in your crap drawer.  Jen’s Samsung charger worked a treat.  Failing that you can buy one for less than a fiver from Amazon – something like a Nokia AC-10x charger..

2.  Booting it up

You need a SD card of at least 2GB, but 4GB is better if you want to install anything.  There isn’t really an upper limit, so 16, 32 or 64GB cards should work, with faster (class 10) cards giving you a faster system overall.  It used to be the case that some cards worked better than others but later firmware versions fixed the problems that some Pis had with faster cards.  If you find that your Pi is not booting, it is worth trying a different type of card just in case.

There is no software built into the Pi, so it boots and runs off the SD card as if it were a hard drive.  That means you need to install all the software it needs on the card before you plug it into the Pi.  This page shows you how to do it. using a disk image that you copy onto the card using a card reader and software on your PC.  Here is where you download the image fileto copy to the card.  Download Raspbian “wheezy”, which is basically Debian optimised for the Pi.

If you have just finished installing the image, unplug the card from the reader now.  Plug the card back into your card reader and a window with a 59MB partition in it should pop up on your PC.  This contains the files that boot the Pi. If you are using Linux, you will also see a 1.9GB partition in another window – this contains the the rest of the files for the Raspbian system.  Because Windows can’t recognise the type of filesystem (EXT3),  Windows users can’t see this partition, but don’t worry about that.  You might be wondering what has happened to the rest of your SD card – you can only see about 2GB of it.  The file system can be adjusted to use the rest of the card’s memory once the Pi is up and running.

Now safely remove the card, lob it in your Pi, plug it into your router with the CAT5 cable and plug in the power supply.  If it’s all OK, the red LED should come on for a few seconds followed by the other ones, with the green one flashing occasionally.  The LEDs are stupidly bright.  Congratulations!  Your Raspberry Pi is now ready for use.  If only the red light is on then something is wrong.  If you have followed all the instructions and have the correct partitions and files on it, then it is probably the card itself which is the problem.  Try a different card and see if that fixes it.

Continued here…

And another thing…

Sorry, you’ve got me started on the Vectra now. The Vectra’s central locking has 2 “features” I’ve not seen on other cars – one press of the remote unlocks the driver’s door and you need another press to unlock the rest of the doors and the boot and filler cap. The reason for this is … absolutely no idea. It’s like it was put in just to piss me off. 95% of the time I have to press it twice and there’s no actual benefit that I can think of in only unlocking one door. Maybe they think that I occasionally want to lock out the wife and kids and go scooting off on my own? Actually… nah, let’s not continue that line of thought.

The other feature is that if you don’t open the drivers door within 30 seconds of unlocking, it locks all the doors again. I can’t count the number of times when this has been useful because I’ve accidentally unlocked the driver’s door. I can’t count them because it’s 0. This has never happened with any car I’ve ever owned. I unlock the door because I want to get in, not on a passing whim or because I like pressing buttons. Any usefulness of this feature in the remote possibility that I might lose my mind and accidentally unlock the doors for no reason, is somewhat outweighed by the number of very real occurrences when I’ve unlocked the doors, been momentarily distracted by children and found myself and my family locked out again.

Now, put these two features together and you get me, attempting to fill up the car and finding the petrol flap is jammed shut. After a few minutes of trying to pry it open I remember that I went out on my own, so I single clicked to unlock the car and only the driver’s door is unlocked. The flap was secure, and thank god it was – a petrol thief might have been passing while I was getting in, looking to empty my tank in the few seconds before I drove off down the road. So I lock the car up again and double unlock to get the flap open, I fill up (75 QUID!!!) and – buggery arseholes, the poxy thing has jammed open now. It’s banging against the lock and won’t close. A few more minutes of thumping and swearing and I remember that since I only locked and unlocked the doors to open the sodding petrol flap, the car has noticed that I didn’t open the driver’s door and has vigilantly locked itself up again, with the petrol flap open. Sure enough I have to unlock it (double sodding click) again in order to close it.

Thank you Vauxhall, for making my life so much easier with your little helpful details. Sorry, I’m going on again aren’t I?

I’m so popular!

"We must invite Naich. He's so fucking sophisiticated."

Gosh, where do I start.  There are so many people want me to join their exclusive circles.  I had a letter from the Vice Chancellor of Cambridge University (or “Vicey”, as I call him), asking me – actually more like begging me to join him for a swanky reception with canapes and vino.  He used the excuse that it was for my 25 years service working at the uni, but come off it – who wouldn’t want the company of a badly dressed, slightly brain damaged electronics technician, staggering around guzzling wine and belching pastry fumes?

But even more exciting was my email invitation to join the Freemason Illuminati.  I didn’t even realise there was one until I got their mail!  They obviously like the cut of my gib and I was just thinking it was about time I heard from the shadowy evil secret rulers of the world.  If anyone would like any favours once I’ve joined the select elite, let me know.  This is what they sent.  It all seems totally legit.

Date: Sat, 17 Mar 2012 09:30:03 +1200
From: freemason illuminati <noreply@freemason.org>
Reply-To: order@illuminati.umail.net
To: yourorder@fi.org
Subject: we call

You are receiving this mail in regards of the freemason confraternity  of the
whole wide world (FCWWW).

You are moving well in what you are doing but in order to make it easier for
you, we have concluded for you to be a part of us as a member to sign your
life to us and have any thing you need.

Be it any thing in the whole wide world.

You can’t refuse us now for it’s too late.

Get back to us now for your Illuminati membership Order and also for you to
know more about the ancient ILLUMINATI FORUM and also the Orientation and
goals that we pursue.

Get back to acquire your goal now.

I can’t wait to set up some sort of super-villain style base on a Caribbean island.  I’ll need some sidekicks if anyone is interested.  You’ll have to improvise with the sinister weapons until I get set up properly.  I’ll see if I can get some sort of poisoned dart cigarette holder made up, or maybe a miniature gun in a mobile phone, but in the meantime you could use a brick in a sock to bludgeon people to death.

Cat 0 : Linux 1

I went to do some stuff on my PC the other day to find that the cat had been sleeping with her paw on the “Print Screen” button. This button starts up a program that takes a screenshot and brings up a window asking where you want to save it.

Holding down a key keeps repeating the keypress, so as long as the key is held down it’ll keep starting up new copies of the program, again and again and again, as fast as it can.   It is the PC equivalent of sitting stationary in your car with your foot firmly pressed down on the accelerator. The cat had been sitting like that for quite a long time.  Everything had ground to a halt and the status bar was just 1 pixel wide grey stripes. There was a black box on the screen where the last “take a screenshot” window had popped up but the poor PC didn’t have enough CPU left to actually fill it with anything.

The mouse was barely moving so there was no hope of actually using it to close the windows. It was time to use Geek powers and drop to the command line. I hit CTRL-ALT-F2 and waited for a while. Several seconds later the terminal came up and although it took a few seconds for each keypress to register, after a couple of minutes I was actually able to log in. An incantation of “ps -ef |wc -l” showed there were 3,600 processes running. Each screenshot capture takes 3 processes, so there were 1,200 screenshot programs running simultaneously. I gave it some Linux magic – “killall gnome-screenshot” and everything instantly sped up. I did some more killing and everything went back to normal – in fact there were no ill effects whatsoever and the computer worked fine for the rest of the day, with no need for a reboot or anything.

Jimbo once started up 140 text editors which barely slowed the PC down and Luna couldn’t kill it with 1,200 screenshot programs. Linux – impervious to cats and kids.

Update: It’s been pointed out that I should have used “pkill” rather than “killall”.  Killalling, while relatively harmless on a Linux box – a bit like trimming a dog’s claws, is the Unix equivalent of taking it out back and shooting it in the head with a rocket propelled grenade.

The enchanted skip

And lo! did Naich go rummaging in the Cav. skips in search of a bit of metal that would hold his reservoir securely in his chiller box.  Praying to Ceilliau Blewog, the goddess of salvage, he dived head first into the metals skip.  And in her wisdom Ceilliau Blewog did deliver unto his hand the perfect bit of metal, complete with holes already drilled in it.  And there was much rejoicing.  And Naich did praise Ceilliau Blewog and promise to offer up a sacrifice of a small annoying cat on his return home.