Connect to a WPA/WPA2 Secured Network In Linux

This turned out to be dead easy, although it took a bit of futzing around due to my own slowness. The situation arose during an a failed upgrade of my dad’s machine to Ubuntu 10.04 (aka Lucid Lynx). I’m sensing a pattern here; I don’t think there has been an upgrade that has gone smoothly on that machine. To be fair I think there may be problems with just about every component apart from the hard drive, but you think I would realise that upgrading that machine is a Bad Idea. Anyway, the solution:

A combination of wpa_supplicant and wpa_passphrase will do the trick.

  1. Get a root prompt. Either sudo su, or boot to single user (recovery) mode. Just don’t do that, select netroot, then get bored and hit Alt-F1 for a console 1. For some reason, that makes the machine very unhappy and so your wireless hardware probably will complain about device busy in step 2. So don’t do that.
  2. Run iwlist scanning, and check your card can see the wireless network in question
  3. If it can, run wpa_passphrase [your-wireless-network-name] > wpa.conf
    (eg wpa_passphrase pegasus > wpa.conf). The prompt will wait for you to enter a passphrase. Do this and hit enter.
  4. Run wpa_supplicant. Replace wext with the correct wireless driver (which is probably wext, but run wpa_supplicant --help to check) and wlan0 with your wireless interface
  5. wpa_supplicant -Dwext -iwlan0 -c/root/wpa.conf
  6. If that works, you should see text to the effect of “successfully associated”. If not, try again with a different driver, make sure your passphrase is correct, and make sure your wireless interface is working properly.
  7. Hit Ctrl+c, then the up arrow, then add a -B (for background) onto the end of the last command, thus: wpa_supplicant -Dwext -iwlan0 -c/root/wpa.conf -B
  8. Run dhclient -r to release any DHCP leases you have.
  9. Run dhclient wlan0 to get a new IP address. Substitute wlan0 for your wireless interface, of course.

You should now be connected. This is a handy trick for any Linux user unaccustomed to connecting to wireless networks from the command line – let’s face it, network-manager has spoiled us rotten. But when an upgrade fails and won’t leave you with a functioning graphics driver (grr) and you need some packages, this is the way to do it.

Ubuntu 9.10 Karmic Upgrade Problem Fixed (mountall/init)

(Jump to the bonus section on sorting a removed Gnome panel)

I finally got round to doing the Jaunty->Karmic upgrade on a troublesome machine. Well, re-doing. I made an abortive attempt to install it on this particular exhibit of electronic arthritis back before I left for Barcelona, which ended in me reinstalling 9.04.

Anyway, for one reason or another the upgrade failed or was interrupted and so I was left with a machine that would not boot. Well, it would do a good chunk of the boot process, but fail at an init item (init_bottom, I think). mountall was exiting with code 127, complaining:

process mountall (787) exited with code 127:
undefined symbol: udev_monitor_filter_add_match_subsystem_devtype
*

Quite a mouthful, in other words. Even booting into “recovery mode” didn’t give me a working console. Next step: try a liveCD. The same problem was reported by niroht of the ubutuforums here. However, his explanation is a bit brief, and misses out a couple gotchas.

So, you’ve got a problem with mountall, and you’ve also got a 9.10 liveCD. Here’s how to sort it:

  1. Boot from the livecd
  2. Call up a terminal (gnome-terminal or xterm).
  3. Chroot your usual install partition. GParted, under “Administration” can help you determine what this is. Mine was /dev/sda3. What I did was:
    • sudo su
    • mkdir /newroot
    • mount /newroot /dev/sda3
    • chroot /newroot <- chrooting my install parition
    • mount /proc <- important! not mounting /proc causes all sorts of problems.

    Now you’re chrooted and ready to continue. I have a separate /boot partition as well, but I updated this later to save faffing at this stage.

  4. Sort the botched upgrade! I ran first dpkg --configure -a, then to be sure, apt-get -f install. Finally, I ran apt-get dist-upgrade, which upgraded a *lot* of packages (~700 I think).

Now, if your /boot prtition resides on the same partition, you’re done here. If not, you have to mount it and copy the new kernel images and updated menu.lst. Strictly speaking, this should be possible to set up when doing the chroot above, but I couldn’t remember how to do it at the time. Make sure if you are merging the menu.lst that the contents are correct – check the UUIDs or partition references are correct!

Bonus! Restore the default gnome-panel if you accidentally delete

So once I was done with the fixed upgrade I booted, and got a slightly messed up top Gnome panel. Two volume icons, and no network icon. In my attempt to sort it, I clicked cack-handedly and removed the entire panel. Rather than repopulate it manually, I followed the advice of another ubuntuforums thread:

gconftool-2 --shutdown
rm -rf ~/.gconf/apps/panel
pkill gnome-panel

And that was the panel restored to default!

* (Previously listed as “undev_mknitor_filter_add_match_sebsystem_devtype”, as it appeared on the screen. Part of the electronic arthritis is (I think) in the graphics card, which causes all sorts of odd things to happen to the pre-boot text. Must photo it sometime.)

Little Rocket Man / Get Some Grub

A6BQXSMBXD9S [for Technorati, please ignore]

If, like me, you are looking to round off your Half Life 2 Episode 2 achievements, you’ll want to have a look at the following two guides:

Get Some Grub

Not tricky, just time consuming. Have a look at Nibbles’ guide on GameFAQs (link), which painstakingly walks you through all 333 of the grubs. My advice is to save regularly on different slots, and if the number you have doesn’t match what the guide says you should have, reload. It just saves on headaches further down the road. Should only take you about 3 hours, and that’s if you’re carriny the gnome with you…

…which brings me nicely to:

Little Rocket Man

This one is time consuming as well, but not particularly difficult. Just set him down when fighting and carry him with you the whole way. The tricky parts are the car segments, as the gnome tends to slide out. I would recommend wedging him in the back window; this way he doesn’t slide out while you are driving (unless you hit something, which releases the ‘wedge’. Or you can put him under the steering column and drive slowly.

This is all fine, until you get to the bit with the gunship. Oh, the gunship. It will fire at you and knock the gnome out your hands, hurt you plenty (even on easy), and if it could sspeak I’m pretty sure it would taunt you all the while. What I ended up doing was driving for say 300 metres, getting out, picking up the gnome, carrying him from behind cover (eg under trains), wedging him in, driving for another short bit, leaping out and getting him again, and so forth. The key is cover.

Have a look at Tommy Gun’s guide at Cracked Rabbit Gaming. It gives more useful info, like where you can safely leave the gnome for certain segments.

One Week

So, as of yesterday evening, I’ve been here for a week. Since my last post I have moved out of the guest house. I’m grateful for this, the room was dark all day around (or light, if you put the single flourescent light on). It was adequate, but no more.

I am currently staying with a friend (who is technically a friend of a friend, but they are so friendly and helpful it would be an insult to call them that now). A big thank you to Sabela for letting me crash here while I find a place, and for translating things from and to Spanish. ‘Big help’ would be an understatement.

Flat hunting is a monumental task, twice ior three times so in a foreign language. I’ve gone through hundreds of listings on loquo.com and culled a (long) shortlist of 30ish places to view. I have organised them by priority, so I (hopefully) won’t have to work my way though them all! I’ve seen a few… more on that later.

I met my contact who I got in contact with thanks to a friend at the amnesty group I’m a part of (thanks David). She was (brutally) honest about my chances of finding employment here. The fact that I’m Scottish will work in my favour in an Irish bar (close enough, apparently), but even still I’ll be very lucky to get a job. I’ll still pursue the teaching Spanish angle, but even that is less hopeful than I had initially hoped. Might have to burn a bit of money unfortunately!

Flats and the hunting thereof

I. Hate. Flathunting. At least, I hate doing it in a language in which I am not competent. More specifically, I hate speaking on the phone in a language which I am not competent and – to a lesser extent – talking to people in person in a language in which I’m not competent.

Perfectionist, or just a craven coward?

As far as I’m concerned, the main thing for me is that I just don’t have all the words to convey what I mean. This in itself isn’t a nice feeling. I now have a much greater empathy for people who suffer this problem. The other problem is, well… I don’t want to say something unless I’m going to say it right. The fact that I might stuff it up or forget words/phrases creates a whole bunch of anxiety for me, which I something I’m not so familiar with any more. It’s a bit of a ridiculous viewpoint, looking at it coldly and logically, but unfortunately cold logic can;t snap me out of it. I’ve tried.

I mean, trying (and perhaps failing) to speak another language is much better than taking refuge in my own language; and people aren’t going to hate me if I sound silly. On paper (or on a blog) it’s all very straightforward, but see when I go to dial a number for a flat, or even get through to someone, the panic is paralysing.

What I’m going to do is try a fun little technique. When I decide I need to phone someone, I’m going to do it as quickly as possible, suppressing all other thought and hopefully I’ll be able to sneak past myself and have the phone call before I realise what’s going on. Either that or have a couple of beers to take the edge off first…

Serendipity

(ramble, feel free to skip!)

I went to view a flat today. It was one from the top of the pile, so it was one I was quite keen on. €310/350 a month (two rooms available).

So anyway I walk there for 2PM in shorts an a t shirt, which I mention only to gloat about how blissfully warm it is here. I get there, check the number, ring tthe buzzer. No response. Again. And a third time. I get a rather irked voice telling me that I had the wrong place, I think. He has speaking fast and I was expecting to be buzzed in, so I was a bit overwhelmed. So anyway I figure I could phone one of the two people I had a number for, but I figured I should check I had the right street first. I did.

When I got back to the place, there was someone with a piece of paper and who was getting the same treatment from the now-presumably-even-more-irked man. I ventured an “Hola” and stuttered my way through asking if we were looking for the same place… which eventually amounted to just pointing to my corresponding piece of paper. She agreed we had the same place. In English, I should add. It turns out she had booked a viewing for the same place at the same time. She phoned the contacts. Y didn’t answer, but A did. We were told to press the buzzer that we had been pressing all along, so we did again just for the sake of the thing. Nada. My fellow-flathunter (M) phoned Y again and we told that the place had been rented. Most curious.

M didn’t have another viewing till 4, so I suggested a coffee over which we could compare notes, so to speak, on flats. M said she was here from Paris to look for flats for January, when she will be coming to start her PhD. No easy task – I think all the flats I have seen on loquo have been entry 1) now 2) a week or 3) December. Anyway, potentially mutually useful came of it – M had seen a flat she liked, but was unable to take it as they wanted her to enter in December, which of course would mean paying for a month unnecessarily; so she offered me the details and so I may have a place to stay till December. While it is lovely of Sabela to continue to let me crash here, I don’t want to wear out my welcome. We shall see! I did my best to be helpful by furnishing M with the details of a place with 2 smokers, which would suit her better than non-smoking places.

As an aside, it is surprising how many places are listed on loquo as ‘non-smokers only’; it seems (seems!) like there are a lot more smokers here than in Glasgow. Even if that isn’t true, there are a lot more pedal bikes, motorbikes, and scooters.

So I have several places to view tomorrow, and many many more to phone. Good luck to me! I have rambled enough, if I think of anything that needs added, I will below.

Second Day

Another after-the-fact post. This is written at about 1420 on the 9th of November.

Right. So after sleeping in this morning (my room has no external light and my phone had no charge) I went down to the nearest movistar shop to get a SIM card. Once again, I found the place mostly through luck (I didn’t even know what it was called). It took me about 2 hours in total to go, go the phone and get back. 2 hours! Also, i seem to have ended up with 2 phones instead of the single SIM card. Why? BEcause they didn’t have any SIMs alone in stock, a single cheapo phone was €26, while *two* cheapo phones were €20. Mine’s not to reason why.

So I’ve gotten in touch with home to let them know I’m alive, etc etc; and contacted my contact to let them know I am here, and I’m still waiting to hear back from them. they themselves may be en-route back here but who knows.

I also discovered that my Wifi switch was off and there is in fact a LOT of wireless acess points in range. Sadly, all are encrypted. Even *more* sadly, the strongest wignal is WEP encrypted which means if I hbad been able to install Linux before I left I could have had a shot at, ah, decrypting the signal. For funsies, of course. Sadly my drives are in a RAID that I couldn’t get the standard or alternate Ubuntu 9.10 installer to like, so it was not to be. the alt. installer did see the RAID, to be fair, but it only would let me partition the whole disk when I had already partitioned the space. Sigh. I didn’t want to risk it and install anyway as I’ve had bad experiences with that recently.

(For those that are interested: I decided to upgrade my dad’s machine from 9.04 to 9.10. It seemed to work okay at first, in fact I went away while it was downloading the packages and came back and it was sitting at a 9.10 desktop. Sadly, after a cold boot things went bad. It refused to mount /tmp for some reason (I think) and I couldn;t see a quick way of fixing it (this was on Saturday morning when I had to leave in a couple of hours). So I decided to reinstall 9.10. Still no luck. So I decided to go back to 9.04. it then decided there was a problem reading form the CD or hard drive (it wasn’t specific) and refused to install. It did this three times, before a firm reboot got it to co-operate. This was with literally about 15 minutes to go before my train arrived. Needless to say, it added to my stress somewhat.)

Anyway, time for me to have a wander around this place to see if there is a notice up regarding wifi passwords in here. If not, I’ll pop round to the (do doubt extortionate) internet cafe a couple blocks away.

ADDENDUM: No, not that I can see. No-one to ask either. Oh well, time to start contacting people about flats…

Arrival

This post is retroactively posted as there’s no wifi at the place I’m staying. It’s 2242 local time (so 2142 UK time), and by now I’ve arrived, checked in (kinda, more on that later) and eaten. Getting here was, well, interesting.

Firstly, I saw Eddie Izzard at the MEN arena last night. He was pretty damn funny from where I was sitting anyway – and I was in a pretty good seat. Some good jokes, although a lot of callbacks to his old material. Not too much I suppose, but a couple of them felt more for the audience’s sake than because it was funny in and of itself. Anyway, I hold Eddie to impeccably high standards, so it’s natural that I find a small fault which probably only existed in my mind. If you can, go and see him.

Getting to Manchester Airport was a dawdle, thanks to the airport rail link. I really do hope Glasgow does get it’s airport link, it makes so much sense.

Checking in, etc, was fine. Although I think airports generate ‘stupid fields’ as my IQ definitely slipped a few points going through there. The flight itself was fine, at a short 1 hr 40 min. I fall asleep so easily on flights. Like, there’s something about the engine droning that just sends my brain straight into delta waves. Or something. i’m going to try to recreate that when I go to sleep at the end of this post.

The temperature was 12°C on touchdown, which is a very pleasant temperature. Once I got off the plane, things started to get interesting.

Barcelona airport is member of the “Brotherhood of Airports that Generate ‘stupid fields’”. I say this as I went and stood in the non-EU citizen line at first, and wondered why it wasn’t moving. D’oh. Sorted myself in the right line, got trhough and started looking for baggage claim. Well, it wasn’t by the place we came out of. Apparently we had to go out of the exit and get it from another part of the airport. Another terminal, in fact. So, confused me went a-wandering through the airport, through more security (where the ‘stupid field’ intensifies and is compounded by the language barrier), and eventually found the correct baggage claim, partly through luck. Got my bag whchi by now had a broken strap – thankfully non-critical.

So I went to find some transport. My initial plan had been to find a taxi, but having looked at a map, I found that the place I was staying in was pretty central, probably a 5 or 10 minute walk from where the bus terminated. What’s more, the bus probably costs about a tenth of what the taxi does. So, getting a bus was now my plan. Then I met an Irishman with a Scouse accent.

Yes, an Irish man with an accent that wouldn’t sound a bit out of place in an episode of Brookside. He was ranting and raving about Ryanair buggering him about (i’ll spare you the grisly details) but he recommended I get the train into the city, reasoning that a T10 card works on both the train and the metro and is fairly cheap. Fair enough said I. So I wandered back through the airport to find the train station, which I did eventually. The trains left every half hour, so of course I arrived 5 minutes after one had left. Sigh.

I eventually got on the train, and as it pulled away at the station at high speed (Spanish trains don’t run on electricity, they run on pure WIN) I realised I hadn’t the foggiest idea which station I was meant to get off at. Oh dear. So I sat on my seat, alternating between vaguely terrified and a Twoflower-esque calmness as I reasoned that I could sort it out eventually, even if I did end up in Valencia. This was a real worry, as there are trains to Manchester airport from Glasgow, so there was a real possibility I’d end up in another city hundreds of miles away.

I got off at a station that had metro signs up (phew). I wandered upstairs and found a map and realised that the place where I wanted to be was only 4 or 5 (or somewhere up to 8, the map was imprecise) blocks away. Did I decide to walk it? For a change I was sensible and decided not to, reasoning I had nealy 17kg on my bag and another bag that was around 10 kilos. So I got a metro train instead. The Barcelona metro is a wondderful thing. I’ve always supported the simple Glasgow circle, but seriously we could learna thing or two from these guys. Oddly enough, it was curiously reminiscent of the Newcastle metro, and I mean no disrespect by that.

I got off at Place Catalunya, which seems to be the Barcelona equivalent of Times Square. On reaching ground level the first person I encountered tried to sell me drugs (told you it was like Times Square). Anyway, after a quick look around I realised that although this place was undoubtedly close to where I wanted to be, I didn’t actually know where that was. Bugger. I set off in what seemed like an appropriate direction until I came to a map. I would say that it wasn’t a very clear or helpful map, but it did get me going in the general direction I wanted to go, although I claim some of the credit. I walked up the big road which I forget the name of (big, wide, apparently famous street), and after a block or two another realisation hit me. I was on the right road (hurray), but I had no idea if I was going in the right direction. I decided to hedge my bets and kept going in the direction I was already heading in, hoping I’d find the street that crossed it soonish.

After a couple of crossroads of not recognising street names I must confess my hope was dwindling (and my back and shoulders were killing me) and I stopped and asked for directions in a smallish hotel. The rather nice chap informed me that iwas indeed going the right way and had only another block to go till I hit the correct street! So I found the street (hurrah!), and then promptly failed to find the guest house (horroo.). I found the correct number, but there was no facade, and no sign to indicate there was a guest house there. In fact it just looked like a residential block.

It is hard to convey the sinking feeling I had at that moment, without involving the Titanic or quicksand or other things of that nature. I could see things unravelling, spiralling out of control… But wait! First I decided to get a damn good grip on myself and make a quick enquiry in the restaurant beside the place. The buy at the bar knew what I wanted to ask before I had asked it, bless him. Apparently the guest house was where I was trying, I just had to puch the right buzzer. Hmm. I got it on the second try and after some strainedshoew conversation I was buzzed in.

I showed the nice-if-rather-confused lad my booking confirmation. You see, the proprietor (Vincent, if memory serves) was not there and so they didn’t know I was meant to be staying there. He and the person helping him out (who seems to be English, but hasn’t said “God bless the Queen” yet to confirm) agreed that I had thew right place, and I should probably come in. I was shown to a rather small room and asked if I wanted it. I answered yes, of course, as I figured my alternative was to say no and leave, and my neck and shoulders would just not have put up with that by then.

I gave myself a rinse and a change of t-shirt (walking while burdened is hot work) and went out to get some food. I must confess that I opted for a Burger King that I espied on Placa Catalunya> I was not in the mood for adventure. Also, I figured if language was a problem I could grunt and point at the pictures. I wasn’t lowering myself to McDonalds though (I passed two on the way to BK). I do have *some* standards. After a BK Doble Cheese Bacon (with chips and water) I felt a lot better and headed back to the guest house. I had to buzz twice to be let in (they had no spare keys to furnish me with). I was on my way in when the buzzer was answered (the street door was ajar and I figured I could hammer on the internal door) which was momentarily confusing.

So anyway I went for a wash of the face and to put some aqueous cream on my face. My skin has been quite dry and itchy lately; I have removed part of one of my eyebrows with scratching. It’ll regrow. I know this from experience, sadly. All I’m saying is don’t eat a LOT of vodka jelly in the company of some poeople you do not know. My aqueous cream seemed to have been opened by inspectors (joy). I don’t know what they did, but it seems to have been diluted. It’s now a proper sloshing liquid instead of a viscous cream. Most peculiar.

Right. Bedtime. First I must go ask for some water (I’m hilariously thirsty… no, deliriously thirsty) from one of the other residents. I know they’re awake as I can hear music playing. So goes my first night.

ADDENDUM: I’m told the tap water in this place isn’t good to drink. It has cement in it (?!). Fuckery.

Leaving Today…

Well, I’m actually leaving tomorrow… which is technically today. Actually, Sunday if you mean the country. But still the strains of the Divine Comedy’s mournful leaving song echo in my ears. My work got me a going away card + cake(s) + present, which was jolly nice of them. The card was especially lovely:
Going Away Card

Aww.

Anyway, as I travel tomorrow I should round off my packing. I’ll leaving you with a short joke I came up with while writing this. The idea’s been done before in different forms, but I think my version’s timing works best:

I suggested to my swimmer friend that he should shave all over. He looked surprised.

Thank you, and goodnight.

Finally, A Real Pin

Blood Donor Bronze

The title of this post conveniently ignores all the other pins I’ve earned, which must be at least…. for certain… that I know of… to be sure… 1 other. If not more. Maybe. Anyway, having earned pins in games such as the Battlefield series, it was interesting to actually get one. What’s more fun is it’s in the same style: “Do X, Y times, get pin”. In this case instead of “revive 8 people in a round” it was “have your blood drained 10 times”. I thought it had been more, but obviously I’ll need to visit the vampires more.

In other semi-interesting news, I bought a laptop. It’s a Dell M1730 and it’s big, beefy, weighs about the same as a 2 year old and draws enough power to dim the lights when I turn it on. In the neighbourhood, that is. Also, while we’re on ridiculous things, the display has the same resolution as my 28-inch monitor and they keyboard has a numpad.

I’d give you a picture of the laptop too, but my camera has electric arthritis and just grinds and whinges in a manner reminiscent of a small child in an antique shop. Still, that at least gives me ANOTHER thing to buy for going away, which is happening this Sunday by the way. Yay! Or rather, I’m going broke like I have a terminal disease.

PS Twitpic doesn’t like it if you link to files from outside of it, which should be obvious except to me.

(If my writing seems out of sorts it’s because in my head it’s the rapid sardonic babble of Ben Croshaw, or Yahtzee of Zero Punctuation to give him his Sunday name)

iPod Classic Volume Cap FTL

Edit: Forgot to include noise-cancelling / in-ear / tin can headphones as an option. Thanks George! Jump to the choices if you want to skip the blah.


Another update: I really must strongly recommend noise-blocking earbuds or similar. I bought a pair which have rounded soft material on the bud – essentially a cross between an earplug and an earbud. They were relatively cheap (about £8 from Argos), and the difference is substantial. They claim 30dB reduction or such, I don’t know whether that is true, but I can say that for many situations 40% volume is now sufficient. They do take a little getting used to, but once you use them you won’t go back – and your ears will thank you. Happy listening!


Continue reading →

The Glasgow Apple Store

…or as I like to call it “the place of Temptation, so tempting it requires a capital ‘t’”.

So I moseyed into the Apple Store, like I said I would. Pricing of the iPod Classic is in-line with the online Apple Store – £189. I wasn’t able to talk them down from that price as such; instead they let me know that they offer a 10% trade in, bringing the total to £170 ish. The guy in the store said the final price would be £161, and if they want to change me that that’s fine. I have student discount through my uni for the online store, but it no longer applies to music players, just Apple’s line of computers. Actually, the new MacBook is very steeply discounted (just over £110 off) which really, REALLY tests my willpower.

Now, the Geniuses upstairs in the store may be able to do something with my hard drive. I don’t know what they would charge for data recovery, and so I’m not sure if I’d be willing to pay; especially when I’m not sure of everything that’s on there. I think I’ll do my best puppy dog eyes when I go, and see if they at least offer to tell me what is on there for free.