Open Source



Open Source logo

Anders Vaage og jeg har skrevet en artikkel i 3 deler om Open Source på den nye UiBeta-bloggen på UiB. Første del er ute nå – den handler om historien bak OpenSource og kan leses her:

Følg med for del 2 – der tar vi for oss Open Source på UiB.

Tefal ActiFry 2in1


We had a small accident in our kitchen a while back, where our deep fryer got melted on the stove (pleasures of having small children 🙂 ). Luckily, we have a good insurance, and got all the money back to buy a new one.

However, since we bought the machine a few years ago, it seems deep fryers are not sold any more. Instead the big thing now is a combination of hot air and very little oil (only a spoon) – Tefal seems to be the best on the market with their Actifry series. The top model – the 2in1, can even make the rest of your food in a second pan on top of the one you make the fries in.


Needless to say, I was very sceptical about this whole thing. How could Pommes Frittes be any good with only a spoon of oil??

I used some time to watch videos on Youtube and got convinced that maybe this hot air thing wasn’t just hot air after all. I decided to buy one, and today we got it in the mail.

Our first meal was home-made pommes frittes and chicken breasts. The recipe said to cut up the potatoes into fried (with the included cutting-device), put it in the bottom pan, put on salt/pepper (and I added some paprica) and one spoon of oil. Then set the timer for 50 minutes and choose 2in1 and tell it that the top pan was going to be chicken and be fried for 20 minutes. Then it started, and when it was 20 minutes left it stopped and asked me to insert the top pan. In that pan I had put the chicken breasts, with a lot of salt/pepper/provence spices on. It started again, and after 20 more minutes, the food was ready.

As you can see from the pictures, it was all good. I have never tasted so tender and good chicken before, and the fries were amazing.


And all of it is actually healthy. Instead of bathing it in oil and fat, I only used a spoon of oil and it still tasted fantastic! Also, it was incredibly easy to make the food, it practically made itself 🙂

The frying pan came with a big book of recipes, and I am really looking forward to trying out the rest. This seems almost too good to be true 🙂

The $8 billion iPod


Great talk about Copyright Math 🙂

Your phone company is watching


This TED-video is from back in July 2012, but I thought I would re-post it since it’s 100% relevant today. The Norwegian government has put aside over 200 million NOK (half of the whole budget for Justisdepartementet) next year to implement “Datalagringsdirektivet” which will put all citizens in Norway under surveillance, and the principle of innocent until proven guilty is suddenly put in reverse…

Disappointing TEDx in Croatia


This man was banned from going to all TEDx in Croatia after pointing out pseudo-science in a talk that was going to happen.

This is really not good for the fantastic TED brand…

Prime Numbers


Another fantastic TED-talk about monster prime numbers and why science is cool!



Fantastic TED-talk about why sleep is important. Scary stuff. People need to sleep more.



Fantastic TED-talk about how to be more happy. Change the formula for happiness!

Imported from Posterous


Since Posterous closed down, I just imported all my posts into WordPress.

Official address on wordpress is, but the old addresses and are being redirected here as well.

Hope everything works, please leave me a comment if you notice anything weird.

Fixing drive failure when using mdadm/raid1 on boot device (CentOS 5)



I am using CentOS 5 for one of my servers, and use raid1 and md for
the mirroring between two drives.

Then one of the drives fail (which they eventually will), here is how
you fix it:

I have taken info from these pages for this blog post:…

In this example I have two hard drives, /dev/sda and /dev/sdb, with
the partitions /dev/sda1 and /dev/sda2 as well as /dev/sdb1 and
/dev/sda1 and /dev/sdb1 make up the RAID1 array /dev/md0.
/dev/sda2 and /dev/sdb2 make up the RAID1 array /dev/md1.
/dev/sda1 + /dev/sdb1 = /dev/md0
/dev/sda2 + /dev/sdb2 = /dev/md1
/dev/sdb has failed, and we want to replace it.

First of all: ‘cat /proc/mdstat’ is your friend – it will show you the
status of your raid during the whole process.

In the output from ‘cat /proc/mdstat’ you will see an (F) behind a
failed device, or it will be missing alltogether.

First, fail and remove the failed device(s):
mdadm –manage /dev/md0 –fail /dev/sdb1
mdadm –manage /dev/md0 –remove /dev/sdb1
Repeat for other MD-devices containing sdb-parts.
Now the output from ‘cat /proc/mdstat’ should only contain parts from sda.

Power down, change the drive, and turn it back on.

To make the same partitions on sdb as you have on sda, do this:
sfdisk -d /dev/sda | sfdisk /dev/sdb

‘fdisk -l’ should now show the same partitions on sda and sdb.

Next, add the proper parts from sdb to the relevant md-device. So if
md0 contains sda1, do this:
mdadm –manage /dev/md0 –add /dev/sdb1
Repeat for all md-devices so you have the same parts from sda and sdb
in all of them.
Check with ‘cat /proc/mdstat’.

Let is sync back up (check with ‘watch -n 10 cat /proc/mdstat’ until
it finishes).

Now, fix grub:
grub>root (hd0,0)
grub>setup (hd0)

If you’re unlucky and can’t’ boot because the wrong device is first
(trying to boot from the clean/new hard drive), follow these steps:

First boot into a live cd with your os.
Then activate the RAID:
1) mkdir /etc/mdadm
2) mdadm –examine –scan > /etc/mdadm/mdadm.conf
3) mdadm -A –scan

Then reinstall grub. In this example, you have /boot on md0 and / on md1:
1) mkdir /mnt/sysimage
2) mount /dev/md1 /mnt/sysimage
3) mount -o bind /dev /mnt/sysimage/dev
4) mount -o bind /proc /mnt/sysimage/proc
5) chroot /mnt/sysimage /bin/bash
6) mount /dev/md0 /boot
Then fix grub (same as above):
grub>root (hd0,0)
grub>setup (hd0)

Voila, you have a working raid again with grub managing to boot your system 🙂

%d bloggers like this: