Day 5 – Datacentre work

Today, I was planning on scanning through NaBlogPoMo’s blogroll and pick out a couple of good ones. However, life always likes to intervene, and at about 1730 a server decided to fail. Wouldn’t boot up, nothing on the console.

As I’m on call this week, it was my turn to head into the datacentre, to have a look and try to fix it. For some reason, whilst it was showing network lights (so the network card was obviously initialized), it wouldn’t show anything, nor would it respond at all to server commands. I was planning to switch the hard-drives into a spare server, but a colleague of mine called to say that I should first reset the BIOS. (Take the battery out, short the contacts).

In the end, doing that cleared the problem, and the server came back online OK. A little confused – it thought it was 1400, rather than 2100, but apart from that it was fine.

I’ve only ever seen that trick work once before, on an old desktop machine. Still, that’s a good thing to try – if the BIOS confuses itself into oblivion, you can reset it by taking the battery out and shorting the contacts. (With a screwdriver is normally easiest – you’ll probably just have used it to open the case.)

Another hardware trick I often use, I’m not sure how relevant this will be if you’re not in the UK – Plug the computer you’re going to work on into a power socket, but make sure the socket is off at the switch. The earth pin is never disconnected – the switch will only ever interrupt the power flow, not the earth. So, if you’re not sure about static electricity in your environment, its a good way of making sure you’re clean – as the earth will be connected to the computer’s case via the PSU 🙂

A quick spelling / grammar question to those reading – is “online” a valid word, or should it be written “on-line”? I’m never certain, but my spell checker seems to think that it should be “on-line”…

Day 4 – Falling back to the meta-referance

Last night I posted on twitter that I was struggling to find stuff to post about. jkblacker (Not bassets, sorry Josh!) suggested that I post about how I’m finding it hard to find stuff to post about… so here it is 😉

Not exactly the most spectacular day 4, especially since I’ve got 26 left to go, but we’ll see what happens.

Parts for my new computer started arriving today. I’d hoped that it would all arrive, but unfortunately not. So, right now I’ve got RAM, the PSU, Motherboard, CPU cooler and a copy of Windows. (Yes, I know, horrible, but I’m building a gaming machine, wine isn’t there yet, and Linux hasn’t reached critical mass 🙁 )

Sporadically over the past week or so, I’ve been trying to use search and replace in vi/vim. Finally got it drummed into my head! Here’s the syntax for single item search and replace:

:%s/OLDSTRING/NEWSTRING/

If you want to replace every item in a document, then add “g” to the very end. “g” in this context means “greedy” – i.e. replace everything. (Thanks JPE – I did learn it after all!)

This is the same sort of syntax as usable in the command line tool “sed”. For example, if you wanted to replace a space in a file with a comma, then you’d do:

sed 's/ /,/g' oldfile > newfile

I’m sure there’s a better way to specify that syntax… please feel free to comment 🙂

Day 3 – Web Comics

Good Evening happy people 🙂 I do so like Mondays 😀

For those of you who are reading this from the Ubuntu-UK planet – I’ve limited my blogs feed, so that I don’t spam you all with rambling on other subjects than Ubuntu (mainly), especially whilst I’m trying to blog once a day this month. I’ve sent this one, as I think it might be interesting to you. If you want to read my full writings, head here: https://kirrus.co.uk/ or get your RSS here: https://kirrus.co.uk/feed/

So, Web Comics. This is going to be a list of the ones I read. If you know of any good ones I’ve missed out, let me know!

http://www.xkcd.com – Nice fun stick men comic, which has a large following amongst geeks. I expect that most people reading this blog will have already seen this. (sudo sandwich!) Updates Monday / Wednesday / Friday.

http://www.cad-comic.com – Gaming / Youth / Odd / Interesting. That about sums it up. Updates Monday / Wednesday / Friday

http://www.crimsondark.com – Sci-Fi comic, another basically CG, but lots more hand-work involved than dreamland. Has got a very catching storyline. Updates Mondays

http://www.freakangels.com/ – Updates Fridays with 5-6 pages, nice one to end the working week with. Created by a professional, and is very good.

http://www.thedreamlandchronicles.com – Basic good v.s evil storyline, graphics are all CG. Updates Monday – Friday.

http://www.jaydenandcrusader.com – Hosted by me (so I’m biased), but still, its very good. Its also quite fun watching as the artist getting better at his work. (And quite amazing – look at the first comic, and the last!) Updates Mondays.

http://www.gpf-comics.com – A good comic by a sysadmin. Expect lots of technical computing themes and references. Of late, I’ve been ignoring the updates – the current storyline just doesn’t catch me. Maybe I’ve read Harry Potter too many times 😉 Updates Monday / Wednesday / Friday

A couple of comics, I’ve started reading and dropped. Two examples would be misfile and earthsong.

Day 2: Church

Yay! I’m actually going to get to church this week, for the first time in 4 weeks 🙂

(Yes, for those readers who don’t know, I’m a Christian)

Reasons I haven’t been to church the past 3 weeks:

  • Week 1: Moving servers from old datacentre to new one
  • Week 2: On-call busy weekend. Worked 22 hours in 24, I was asleep Sunday morning. There’s a story in that itself…
  • Week 3: Moving servers again. Yay, 2 down, 1 to go.

So this week I get to go to church, and next weekend I don’t, as we’ve got the last server move. I’ve been trying to find a new church at the moment, which is harder than it sounds in London. At the moment, I’m going to one that my friend (and old youthleader) Roger is working for 🙂

If anyone reading knows Rog and Terry – Roger has picked up Terry’s ‘Bones’ 😉

Week 2’s story… A server failed during the day (partitions went read-only) and so I had to go to the datacentre, to replace the hardware. (That was when I was twittering about a debian install being stubborn about picking up mirrors. In the end, a reboot and reinstall from scratch sorted it – its routing table was stuffed.) Started to go in at 2000 Saturday, arrived back in town at about 0030 Sunday. ish.

Anyway, that’s enough rambling. I need to run to catch the tube 🙂 Hopefully tomorow’s blog will have a bit more content and a little less rambling 🙂

NaBloPoMo – Starting is always good…

Danni blogged about starting NaBloPoMo, or writing a blog post every day in the month of November. This is for those who can’t take part in the “write a book in a month” NaNoWriMo

So, I decided to start as well.. maybe I’ll actually get more active online again 🙂 Not quite sure what I’m actually going to write about over this month, but we’ll see how it goes.

US Election

Erm.. yes. Well, to be honest, I really couldn’t care less about the US election. Yes, I know the guy that gets elected will change the world (probably for the worse. Sorry guys, but your track record isn’t that good.) But I don’t care. Why? What will me worrying, thinking and reading about the US election give me?

Useful knowledge? Only if I’m an American. A sense of inclusion? erm… not an American. Warm fuzzy feeling? Ok, so now I’m just getting silly.

I can’t affect it in any way, so why should I spend my time reading up on it, and worrying on it? However, for those Americans who are reading, I’m not anti-american! (Most of the time 😉 )

Flatmates

Argh! They can be so frustrating! Its in our lease that we shouldn’t smoke. And they do. This morning, I was woken up by a guy from the downstairs flat, livid that again, he had lots of cigarette butts under his bedroom window. Unsurprisingly (in a 2 bed flat), the window just above his is my flatmates.

Then, we had an argument about the electric bill – apparently £40 is too much for 2 months, and she wants to move us to a different provider, which I really don’t want to do, because our provider is Good Energy (100% renewable). Not sure how that one’s going to turn out.

Early last month, I put the central heating on… next argument. Apparently, having the central heating on in October is madness, even though the temperature in the flat at the time was 15 degrees centigrade. Sorry, but that’s too cold for me when I’m sitting still for an hour or 3 next to a computer. (I’m a computer geek, what do you expect!) Finally defused that one, by agreeing to pay 2/3rds of the gas bill. (When she has her boyfriend around, who doesn’t help pay for any bills [apart from sky tv]). I feel like my kindness and “sure, I don’t mind that you have 3 friends round, I don’t mind that your boyfriend stays all the time and doesn’t help pay” attitude is being abused, and I don’t know what to do about it or how to deal with it.

The gas bill thing got brought up this month as well – apparently I have the central heating on FAR too much. Is 2 hours in the morning, before work, and 5 hours in the evening after work too much? Please comment!

Work

Of late I’ve been working a lot. We’re moving Data centres, which is interesting – the new one is quite good, if a bit isolated, but its tiring. Still its fun getting to see every server we have 🙂

I have a couple of things I want to get done (like upgrading our internal wiki), but getting round to it is proving difficult due to the move increasing our workload. (Thankyou hardware raid array for deciding to wipe your partition table instead of rebuilding with your nice shiny new hard-drive, causing one of our sysadmin genius’s to have to rebuild it.)

Firefox undo close window/recover closed window

[Kirrus: Say hello to my brother, Garreth, who wrote this post. He’ll be posting every now and then :))

I am in the habit of keeping a million tabs open and having Firefox automatically restore them when I reopen

([main]\{startup}\when Firefox starts – show my windows and tabs from last time).

Unfortunately this time I left open a popup window and clicked the X close button, thereby killing all my precious tabs!

I have seen on a forum that this can be avoided by clicking File\Exit, but I’m already in the habit of Xing everything, and besides I needed my tabs back!

I found on another forum the name of the file sessionstore.bak, so I did a search and lo and behold it found a couple of session files in my Firefox profile directory. I cracked open the .bak one in notepad and there amidst loads of junk was the urls/tabs I had open.

How to

  1. I Searched for sessionstore.bak, and opened containing folder
  2. used ‘taskkill /im firefox.exe’ (yes windows xp does have a handy kill command :P),
  3. deleted sessionstore.js to the recycle bin,
  4. renamed sessionstore.bak to .js and
  5. started firefox again.

Firefox of course falls for my fake ‘crash’ and prompts me to recover my precious tabs. A swift click later and Lo and behold my tabs were restored!

I’ve now installed session manager add in again and set the ‘undo close window’ feature. Apparently Mozilla are going to integrate the feature in 3.1. (That is 3.1 not 3.01, so not just yet :'( ).

Enable Undo close window and set that number of tabs to high!

Enable Undo close window and set that number of tabs to high!

What OS does the universe run on?

A friend of mine writes and draws his own comic, Jayden and Crusader. He’s drawn a “Computers of the Gods strip” page, which of course ends with Ubuntu

Find it here: http://www.jaydenandcrusader.com/2008/08/15/the-computers-of-the-gods/

He always appreciates contructive comments, though make sure you read his comments after the strip 🙂

Firefox won’t upgrade!

Firstly, apologies about the lateness of writing a new post. I’ve been struggling with my server, trying to work out why apache2 is eating RAM. I’ve made a really nasty hack to sort it out for the moment though, which will give me more time to find out what is going wrong.

One of my old friends from Church sent me an email, asking me what was wrong with his firefox. Every time he launched it, what appeared was firefox 2. Very strange, since the version of firefox he has installed is:

3.0.1+build1+nobinonly-0ubuntu0.8.04.3 - meta package for the popular mozilla web browser

Well,  that looks like the normal browser to me. At one point, he has had the “ubuntuzilla” browser installed for a little while. (But not anymore).

A couple of questions on the Ubuntu-uk mailing list didn’t turn up anything. So, I asked “how do you find what binary a command runs”? The answer came back from Matthew Wild (thanks!):

ls -l $(which firefox)

I cheated a little. I’ve not come across $(command), but I have come across `command`. So, I asked my friend to run “ls -l `which firefox`”. He replied with:

lrwxrwxrwx 1 root root 20 2008-02-09 17:16 /usr/bin/firefox -> /opt/firefox/firefox

Er.. that looks wrong to me. The packaged firefox binary for version 3 is in /usr/bin/firefox-3.0. Looks like the uninstall of ubuntuzilla didn’t go so well. I asked him to run:

"rm /usr/bin/firefox && ln -s /usr/bin/firefox-3.0 /usr/bin/firefox"

Which removed the old link, and added the correct one. (I should have asked him to run those commands through sudo thinking about it..)

That solved his issue and he’s now happily running firefox 3. Anyone have a better way to implement this fix, if we ever need it again?

Matthew kindly explained the difference between “$(command)” and “`command`” in earlier today. No difference 🙂

$(command) is easier to send to people so they don’t have to find the backtick key. (UK keyboards, above the tab key)

Hello

Sorry for the large gap in my posting. I’ve just moved to London and whilst my work is internet-related, did not feel it right for me to use the office PCs & net connection to blog, whilst I await a broadband service to be connected at home 🙂

I do like to keep some separation between home and work.

Anyway, I finally signed out the office 3G USB stick, so that I can have internet access at home. (To check it works, when I go on-call this weekend and get woken up at stupid hours in the morning when servers go down, because trust me. They will. Of course. That is the only reason. Being able to blog again is only a happy side effect. *ahem* 😉 )

So far, it seems to work ok. I’ve not had any problems really, apart from having to add a new section in my firewall configuration so that the relevant holes will be opened in my laptop’s defence. If you’re interested (comment) I’ll post the version of the stick we’ve got, and how to make it work in Hardy.

Also, this connection is of course, compressed like nothing by Vodaphone. So much so that images coming down look… well very bad. Anyway, as most of what I do online is text based, I’m not crying too much. Just one question, for those of you with 3G compressed data-sticks: Is the upstream also compressed to corruption? I’m asking, as I have a set of images from my camera, that I really should look at uploading, but I don’t want them to be compressed on the way to flikr, or this site.

Right. Its late, and I want to go to bed. Night all 🙂

Linux command line tips & Stuff

I’ve been taught a couple of command line tips at work, and thought it wouldn’t be fair if I didn’t pass them on. So, we begin.

CTRL-R

This insanely useful trick, in a terminal or a console, will allow you to search your bash history for any command you’ve previously run and re-run it. For example, quite often on my laptop, type “CTRL-R upg” in a terminal window, which runs the following command:

sudo apt-get update && sudo apt-get upgrade -y

If you don’t know, that command updates your package repository listing (what programs have been updated), and then goes and upgrades all of the packages that have been upgraded, with the only exception of the more significant upgrades, like to the kernel. (A human has to activate those particular upgrades – and the -y tag doesn’t signify human, as that command can be cron jobbed very easily…)

CTRL-O

This one I was taught in my interview for Positive Internet. (So, I’d better not get this wrong! ;))

If you have run a series of commands in a terminal or console repeatedly, say editing a file, doing a config check and then restarting apache (as I have done whilst I’ve been playing with my Apache2 config file for this blog), then this little switch is priceless. Basically, once you hit the up arrow to find the command you wish to use, hitting CTRL-O instead of Enter, will execute the command, and then once you’re back at the shell prompt list the next command in the series. So for the first set of commands:

vi /etc/apache2/sites-available/kirrus  [ENTER and edit the config]
apache2ctl configtest [ENTER]
apache2ctl graceful [ENTER]

Ooops, I’ve just killed my blog by way of a looping redirect! Quick, undo!

[UP ARROW, UP ARROW, UP ARROW]
vi /etc/apache2/sites-available/kirrus [CTRL-O and fix the config]
apache2ctl configtest [CTRL-O]
apache2ctl graceful [ENTER]

The benefit? The second time round, once I found and initiated the series of commands, I didn’t need to type anything, other than the changes to the config file, and the initiating control sequences. Annoyingly, you can’t just hit CTRL-O once, and then expect to be in the chain next time you hit enter – hitting enter won’t provide you with the next command in the chain once you’re finished. Although, this of course can be a good thing, if you want to return to a clean command prompt.

Hopefully one of those will be useful to you.

Ubuntu-UK Planet, Caffeine and Rambling.

For some strange reason, the Ubuntu UK planet didn’t pick up my last post as a new post. Possibly because it got a little confused with the server move and IP address change? Anyway, for those of you reading this on the planet, I have a post about a couple of the tools that come with apache2 on my blog. Not much, but hopefully interesting.

Caffeine: I’ve pretty much overdosed this evening. Head’s swimming right now, and the screen appears to be filling my vision (hence the more than normal ramblingness [yes I invented a word :)] going on in this post). Stayed on at work for an hour and a half, pushing me closer to the tiredness limit. So, on the way home I drank a bottle of Coca Cola, (the tube section) and a small americano coffee (the train section). It kept me awake (yay!) at the cost of me being a little… jumpy at the moment. Still, it’ll wear down shortly, especially since I finished my food about 20 minutes ago. That always helps clear the caffeine effect. So, shortly I’m going to crash from my caffeine high, and be a Zombie. Hopefully won’t be that way tomorrow morning, but at least I can sleep on the train in and if I’m lucky and get a next-to-the-door seat on the tube quickly, on the tube in. (The glass to your left or right acts as a good, if a little hard, pillow. The glass behind you, unfortunately, moves too much, and gets painful quite quickly.)

Right. I can feel myself starting to slow down, so I’d better sign off before the Zombieness (Yay for creating random useless words!) comes into play.

Stay safe 🙂