Game of the Month: The Orange Box

A few years ago I played Half-Life 2 on my PC. To this day it is one of the best 1st person shooters I have ever played. It features excellent graphics, elaborate level designs, a good story and so much more. Winning this game requires both fast reflexes and clever tactics.

Over the next few years two extra episodes which continue the story of Half-Life 2 were released on Steam. But my initial experience with Steam was very bad. I spent hours to find out why I got a network error when I tried to login. A few days later I learned that Steam suffered from a massive outage and there hadn’t been anything wrong with my setup in the first place. I never bothered to try Steam again after that incident and therefore missed out on the extra Half-Life 2 episodes and Portal, another popular video game released by the same company. When the release of Portal 2 reminded me of this loss I bought The Orange Box for my PlayStation 3.

The Orange Box turned out to be really good value for money. You don’t only get the original Half-Life 2 (which I played through once again) but also its two sequels. They feature more excellent levels from a dark underground labyrinth full of zombies to urban warfare and finally peak it the fulminant Half-Live 2 homage to the Battle of Hoth.

But let’s not forget about Portal. It is a first person puzzle game where you have to teleport your character via portals that you create with a portal gun. The levels are simple at the beginning but get more and more difficult as the game progresses. You e.g. have to use portals to gain velocity or to dispose of your enemies. Who would have thought that bending the laws of physics could be so much fun?

Overall The Orange Box is hours and hours of excellent game play for not much money and I can highly recommend it.

Posted in Video Games | Comments Off on Game of the Month: The Orange Box

My Keyboard is shouting

When I came home from work on monday I couldn’t login into my computer because all the letters i typed came out in uppercase. I pressed the caps lock and all the shift keys multiple times which had no effect. I removed and reinserted the USB dongle but the problem remained. I rebooted my computer but that didn’t help either. I finally power cycled the keyboard by removing the battery which also didn’t solve the problem. I was really annoyed at this point and had to get out my old keyboard as a temporary replacement. To be sure I also tried the broken keyboard on our laptop where I got exactly the same problem.

Silke and I tried to disassemble my keyboard, a Logitech diNovo Mac Edition Keyboard, but failed to open the case. Silke managed to remove the key caps of both shift keys but we couldn’t spot any defects. We finally had to give up and declare the keyboard a loss. This is quite disappointing considering that I bought that keyboard less than two years ago.

As Logitech are not selling any Mac keyboards at the moment and I wasn’t sure whether I wanted another one anyway I decided to buy an original Apple keyboard. I use the same keyboard at work and get along with it quite well. Fortunately you can just order keyboard in US layout (and not only in International English) in Apple’s UK online store these days.

I was quite pleased when the Apple Store promised to deliver the keyboard within two days using the standard delivery method. I was even more pleased when the keyboard really turned up today. I really wish that Amazon UK’s delivery service was anyway near as quick as that.

Anyway, I’m happily typing along on the keyboard and now all is good.

Posted in Hardware | Comments Off on My Keyboard is shouting

Using S.M.A.R.T. under NetBSD

NetBSD has supported S.M.A.R.T. for a long time. But this functionality is well hidden. You can enable S.M.A.R.T. and check a single disk like this:

# atactl wd0 smart enable
SMART supported, SMART enabled
# atactl wd0 smart status
SMART supported, SMART enabled
id value thresh crit collect reliability description                     raw
1 200   51     yes online   positive     Raw read error rate             0
3 151   21     yes online   positive     Spin-up time                   9441
4 100     0     no   online   positive     Start/stop count               16
5 200   140     yes online   positive     Reallocated sector count       0
7 200     0     no   online   positive     Seek error rate                 0
9   89     0     no   online   positive     Power-on hours count           8477
10 100     0     no   online   positive     Spin retry count               0
11 100     0     no   online   positive     Calibration retry count         0
12 100     0     no   online   positive     Device power cycle count       15
192 200     0     no   online   positive     Power-off retract count         4
193 134     0     no   online   positive     Load cycle count               199998
194 114     0     no   online   positive     Temperature                     38
196 200     0     no   online   positive     Reallocated event count         0
197 200     0     no   online   positive     Current pending sector         0
198 100     0     no   offline positive     Offline uncorrectable           0
199 200     0     no   online   positive     Ultra DMA CRC error count       0
200 100     0     no   offline positive     Write error rate               0

While this is very useful for manual checks it doesn’t provide automatic health reporting. And the recent abrupt failure of the backup hard disk in a friend’s machine reminded me of the importance of such monitoring. I therefore decided to implement an automated solution on top of NetBSD’s S.M.A.R.T. support.

The first step was to enable S.M.A.R.T. at system startup. I added the following lines to /etc/rc.local to make that happen:

echo "Turning on S.M.A.R.T.:"
for disk in $(sysctl -n hw.disknames | tr " " \\n | grep ^wd)
do
        echo -n "${disk}: "
        atactl $disk smart enable
done

Now I only needed something that checks the reported metrics every night. I therefore added the following snippet to /etc/daily.local:

found=
for disk in $(sysctl -n hw.disknames | tr " " \\n | grep ^wd)
do
        relocated=$(atactl $disk smart status |
          sed -n -e 's/.* Reallocated sector count[^0-9]*//p')
        if [ $relocated -gt 0 ]; then
                if [ -z "$found" ]; then
                        found=true
                        echo ""
                        echo "SMART checks:"
                fi
                echo "Disk $disk has $relocated relocated sectors."
        fi
done
unset disk found relocated

The above shell code reports any IDE and SATA hard disks with relocated sectors. If a hard disk reports a lot of relocated sectors or their number is growing quickly in a short time frame the disk will probably fail very soon.

Let’s hope that this way I will get an advance warning before the next major catastrophe.

Posted in NetBSD | Comments Off on Using S.M.A.R.T. under NetBSD