Playing around with benchmarks

So I just rebuilt my little home server RAID from LVM+Ext4 to ZFS, changing the layout from RAID5 to RAID1+0, consisting of a pool of two mirrored disk sets.

Since I’m a cheap bugger frugal, I still run a small HP MicroServer Gen7 (N54L) with only 2 GB of RAM, which I’ve filled up with 4 x 3 TB WD RED drives for storage, and a 60 GB SSD for the system.

As everybody knows, the only difference between screwing around and science is writing it down. I was slightly too eager to get started to remember to benchmark my old file system, so I guess any future changes will have to be compared to the current set-up. Continue reading “Playing around with benchmarks”

Apple Smart Keyboard First Impressions

Having just received my Smart Keyboard for my iPad Pro 9,7″, I thought I’d write a little about it.

The first thing I was slightly apprehensive about was naturally how it would feel to type on it. The Apple tables in stores don’t really lend themselves to actually testing that aspect realistically. It turns out I worried unnecessarily: The cupped shape of the keys, along with the relatively large gap between them makes it very comfortable for me to type on the keyboard. Going from my Retina MacBook Pro or Magic Keyboard to the Smart Keyboard is almost completely seamless for me. It’s comfortable enough on a table, but what’s interesting is that thanks to its strong magnets, it actually works in my lap while half-lying in a couch too. At least as long as the iPad itself keeps its center of balance towards the rear support.

The keyboard itself supports almost all shortcuts and key combinations I’m used to from Apple’s computer keyboards except for those that require the use of the Fn key, which on the Smart Keyboard is replaced by a shortcut to switch between keyboard layouts.

As I am used to writing on a Swedish keyboard but often write technical documents in English, I soon encountered a situation that could have turned the Smart Keyboard into a dud for me:
How does it handle typing in one language while using the keyboard layout of another language? The autocorrect dictionary in iOS is tied to the chosen keyboard layout. Turns out Apple thought of that issue long before I did. When I did, I was very happy to see that under General Settings, there’s a button called Hardware keyboard. Thanks to it, it’s possible to turn off text autocorrection while using a physical keyboard while retaining the function when typing on-screen, where special characters are chosen visually anyway. This is one of those small things that makes me fond of Apple. This need of mine probably represents a pretty small percentage of Apple’s customers, but one of their developers thought of it and implemented a solution that makes switching from tablet mode to “almost laptop” mode completely seamless.

So are there any drawbacks to the Smart Keyboard?
Not a lot of them. One thing I noticed quickly is that the edit field on some forums doesn’t capture the cursor keys: Marking text using various combinations of Shift, Option, Command and the cursor keys is somewhat hit-or-miss across different sites on the web. In WordPress it works perfectly, but on the MacRumors forums touching any of the cursor keys while in the edit field scrolls to the bottom of the page. At this point I have no idea where the problem lies, but it’s a bit frustrating since selecting text is a chore using fingers on a touch screen.

All in all, and in my use case, the Smart Keyboard complements the iPad Pro perfectly, and I can definitely see myself leaving for an extended vacation without bringing my computer along largely thanks to it. Time will tell whether I’ll stay happy with this combination or if I’ll rather invest in an ultralight laptop the next time I have to replace my hardware.





Monitoring Keepalived with SNMP on Ubuntu 14.04


Using keepalived in combination with a couple of HAProxy instances is a convenient yet powerful way of ensuring high availability of services.

Network map, Normal
Load balancer pair in normal state

Up until now, I’ve considered it enough to monitor the VMs where the services run, and the general availability of a HAProxy listener on the common address. The drawback is that it’s hard to see if the site is served by the intended master or the backup load balancer at a glance. The image to the right shows the intended – and at the end of this article achieved – result, with the color of the lines between nodes giving contextual information about the state of the running services.

Monitoring state changes could naïvely be achieved by continuously tailing the syslog and searching for “entered the MASTER state”. This would be a pretty resource-intensive way of solving the issue, though. A less amateurish way to go about it would to use keepalived’s built-in capability of running scripts on state changes, but there are a number of situations in which you can’t be sure that the scripts are able to run, so that’s not really what we want to do either.

Fortunately, keepalived supports SNMP, courtesy of the original author of the SNMP patch for keepalived, Vincent Bernat. In addition to tracking state changes, it potentially allows us to pull out all kinds of interesting statistics from keepalived, as long as we have a third machine from which to monitor things. Let’s set it up. Continue reading “Monitoring Keepalived with SNMP on Ubuntu 14.04”

Running Tomb Raider 1 on modern hardware

The original

I found this old CD with Tomb Raider on it – you know, the old 3D puzzle/maze/action game from 1996 or something?

I don’t know how many hours I spent on it, and when I bought myself a 3Dfx Voodoo graphics accelerator, there was actually a patch to make this game use that lovely piece of hardware for real 640×480 action. Back then, it was so cool, I really don’t know what to compare it to.

But I digress. Okay, so I found this CD. Now what? I googled around a bit and found Tomb Raider Chronicles, who seem to have dedicated a lot of time to get these old games running on modern hardware. Unfortunately, they hadn’t done anything with TR1 since about 2007, so I was afraid things wouldn’t work really flawlessly anyway. And sure enough, their Advanced Installer software did it’s magic, but unfortunately the magic fizzled in the end. The game got installed, it seemed to start, but crashed right back to the desktop.

Now, I was determined to get things going, though, so I spent some more time with google and found a howto, using another piece of code on Tomb Raider Forums. It’s meant to solve the problem in Vista, but obviously it works just as well for XP SP3.

User Gidierre pointed me in the right way, to use SSDH in place of MSCDEX – actually I don’t even know if that’s required yet it seems to need to be done this way to work. However, user Chug a Bug gave me the required tips that made the game start:

1) Download and install VDMsound 2.10. Reboot.

2) Download and install the Advanced TR Installer (TR1setup.exe). Choose dgVoodoo 1.40 as the version. Do not choose the option to create an desktop shortcut.

3) Download Unzip the files.

4) Drag and drop ssdh.exe to C:\Tombraid and ssdh.dll to C:\windows\system32

5) Drag and drop glide2x.dll from C:\Tombraid to C:\windows\system32

6) Copy (not move) vddloader.dll from c:\program files\vdmsound to c:\windows\system32 (so theres a copy in both folders)

7) Open dgVoodooSetup if you havn’t opened it already (C:\tombraid\dgVoodooSetup > click it) – on the right hand side click the “search” button – point it towards c:\windows\system32\glide2x.dll. Buttons are now no longer greyed out? Good, you’ve found it. Click the “DOS” platform > click the “VESA” tab> tick “Use built in VESA support”. Click “ok”.

8) Make a batch file in the folder C:\Tombraid –


And I can tell you that the game has aged. No doubt about that. But still: I’m actually re-living Tomb Raider 1 in a full 1920×1080 resolution in 2010. That’s pretty amazing if you ask me.

Respect to all the guys who were involved in making this possible!

A new toy


My old Nokia N95 8GB drowned when I rode the SaddleSore a month or so ago, so I figured I’d upgrade. And since I was dead tired of the entire Symbian concept, the serious contenders were, of course, Apple and HTC.

Since the release of the original iPhone just about an eternity ago, Apple’s phones have pretty much been the benchmark against which all other phones have had to compare – and until very recently none have even approached the snappy feeling of the iPhone.
Enter HTC.

Since I’m, perhaps uselessly, a bit concerned about how my expenses look from a company point of view, the iPhone 4 was way out of the question: We buy most of our laptops at about the price they charge for a phone. Alright, it’s supposedly a very good phone, but come on!

That left me effectively with a choice between an effectively last-gen iPhone 3Gs, the HTC Legend – which is pretty but has an “old” processor, or the HTC Desire, which lacks the Legend’s looks, but has a state of the art Snapdragon processor – which tipped the scales to it’s favor.

The queue for it was huge – I got it after a little more than a month.

Comments after the first day

The Desire is fast. No question about it. As just about everybody has said, the speed comes at the price of battery life. Coming from the oldschool Nokia world, it feels a bit weird to see the battery level go down a notch within an hour of normal use.

My gripes, however, are mostly superficial, and you’ll find just about the same comments on every proper review:

Unlocking the device from power save mode should be more configurable. It requires that you reach up around the top of the phone and press the power button, followed by a swipe (and, if you’re paranoid, passing a security test in the form of a password/PIN/shape to be acknowledged). There’s no reason the same function couldn’t be initialized with one of the keys on the front panel, except it might look too “Applish”.

The switch from portrait to landscape orientation takes a moment too long, in my opinion. Half a second is OK. One-and-a-half to two is way too much. I’m fully aware that re-aligning the screen contents is an expensive task, from a processing power point of view, but on the other hand, there’s no reason why the interface part of the phone shouldn’t be prioritized, and the alignment of text in edit fields be corrected “as soon as there’s time for it”.

There’s an obvious bug where, if you put the phone down and it locks itself while writing a mail, the keyboard disappears until you select another edit field and re-aquire the main one.


I have nothing special to add that other reviews haven’t already said, except that unlike many other reviewers, I’m still not entirely content with the speed of the interface even at 1 GHz, a fact which either says that people still don’t put down enough effort into the optimization of GUIs, or that I’m a whiny little bitch.

Over all, the Desire is a hugely capable phone, though, and I’m sure I’ll return to it in future posts.

Update after another day:
One thing I really enjoy with the desire is that it isn’t obnoxious. Set an alarm, and you can decide specifically for that alarm if the phone should vibrate or not. Also, the volume rocker seems to actually change the sound level of the phone even when not in a call. Add to that the feature that the volume of the ringer drops if you lift the phone when somebody calls, and you have a very, very well-behaved and, actually, “smart” phone.

I’m still not entirely used to the keyboard and its word recognition, but I can see that we’ll be friends in another few days.

Mac Mail and fonts

It’s time for a little mac-related rant, for one of the few things that disturb me when using my computer at work.

I immediately fell in love with Mac Mail: Lightweight and nimble, but at the same time offering a much more powerful experience than Outlook/Entourage, very much thanks to the speed and ease of use of the search function, which plays in a completely different league than the “Advanced Search” in Outlook 2007.

The only problem I have with it is so trivial that I was really surprised to see that it’s been a regularly re-occurring question on forums for several years, namely the little question of fonts.

My gut feeling is that a modern mail software should be more or less WYSIWYG. Most of today’s mail programs solve this by encoding the contents of mail using regular HTML tags. Mac Mail uses Rich Text Format instead, but that’s just a technicality – it should do the exact same thing as ThunderBird or Outlook, which is to have some kind of a header containing information for the reader’s rendering software to use font (or font family) x, in size n, etc, so that the reader gets a similar experience as the writer probably intended her to have.

In a corporate environment, this is even more important, since PR departments often define a graphical policy for the company to use, so that customers get a homogeneous impression of the company even if they have to deal with different employees.

Now, consider the following screendump and try to find the problem:

A mail sent from Mac Mail, received by Outlook and replied back to Mac Mail

Sorry for the size, but I really want the horribleness to stand out in all it’s gory.

If you’re slow on the uptake, don’t worry: I’ve described the problem in the actual screenshot, but to recap:

  • The mail was written in Mac Mail, using a font set by me according to company standards: Arial, 12pt.
  • The signature was explicitly set to “Always match my default message font” in Mail Preferences.
  • Upon reception in Outlook 2007, the recipient’s software obviously does not receive any kind of information about what font to use when rendering the email, but instead defaults to Times New Roman. This time the size is right, at 12 pt. I haven’t experimented enough to see if that’s just a coincidence, but judging from the character of the rest of this problem, it probably is.
  • The signature, however, is a different font, namely the font I chose when I created it: Calibri.  But the size is wrong. When I created the signature, I wanted it to be size 11; slightly smaller than the other text in my mail. But as stated above, I checked the box to make Mail adjust the font properties of the signature to match the rest of the mail.
  • It’s obviously not a general problem with Mac Mail’s ability to handle different fonts, though, since it obviously shows the message exactly as it was received by Outlook, and the replied text is rendered exactly as it was displayed in Outlook when I wrote it.

I’ve seen a number of different workaround tips, and these are my comments for them:

  • Write the entire mail, then select the entire text and manually set the font properties for it before sending it
    Yes, that’s a completely serious response on a Mac forum, along with a fanboi rant about how it’s really Outlook’s fault that Mac Mail doesn’t define fonts properly when creating the RTF information for the message, and that Microsoft should choose another default font in Word.
    The problem with this workaround is of course that it’s a lot of time down the drain if you write more than a couple of mails a day.
  • Create a custom signature using the font you want your message to use. Start the signature with an almost empty header, so that you can write your message inside the font definition tags for the signature.
    I understand this one. Also, it’s not a lot of work. But this is something I might have accepted from an obscure, non-supported, free (as in beer) software package for a Linux based system in 1996. Having the same kind of “solution” for the main communications package bundled with an Apple operating system in 2010? Yeah, right. And by the way, I’m still not sure if the font size is correctly transmitted with the message.
  • Use plain text for the messages
    This is actually the best solution of them all. Except for the little fact that plain text will be rendered as Courier New by Outlook, and where does that look professional in a corporate environment?
    Also, 1982 called and wants it’s ASCII table back – it’s needed on another BBS. What’s the next big thing in email? ANSI “graphics”? Don’t get me wrong, these de facto standards were great, but when there is a working way of solving the problem in a way that looks good regardless of the viewing software (yes, a text-only software might strip formatting tags it can’t render), then why oh why not simply fix such a simple thing that does so much (relatively speaking) for the credibility of a system in the corporate world?

I really want to continue using Mail. It’s a great program with great features, which does what I want to do as fast as I want it to. I’ve filed a bug report to Apple regarding this problem, as have, seemingly many others.

Follow this link to join the movement and file your own report on this bug – Mail is a good program, it just needs some fixing to be usable in a professional environment. With enough people complaining, we can become a bunch of complaining people.

MacBook Pro as a sysadmin tool

A MacBook ProSo, I got one of the new Arrandale MacBook Pros a few weeks ago, and I just realized I haven’t commented it yet.

I went with the base model; a 2.4 GHz Core i5 with the normal resolution glossy screen. This allowed me to get an Apple Wireless Keyboard, a Mighty Mouse, a Mini DisplayPort to DVI converter and Parallels Desktop 5 and still stay within the same budget as I would have used on a Lenovo T510 with a docking station, which was my plan B.

My work mostly consists of administrating our server farms, which means that most of my time is spent remote controlling machines anyway, using RDP, ssh and a Citrix connection in that order right now. I use the opensource Cord remote desktop tool, which provides me with functions Microsoft’s own MSTSC application doesn’t: an alphabetical list of servers, non-standard resolution to connect to servers without the dock or menu bar getting in the way, instant switching from full-screen to windowed mode, including scaling so the resolution is kept when going back to windowed mode, etc.

For my mail and productivity needs, I’m actually using Apple’s own tools; Mail and the iWork suite. The Snow Leopard version of Mail has no problem at all connecting to our Exchange 2007 server, and from what I’ve read, it should keep working just fine when we upgrade to Exchange 2010. It also is lightweight and lightning fast in all operations.

Parallels hasn’t actually seen much use on my computer yet. I’ve installed a Win7 and an XP client as a security measure, if I would encounter anything that needs the Microsoft environment, but I simply get everything done from OS X, and so I’ve had no real use for these virtual machines yet.

The glossy screen hasn’t been any problem in real life either. I’ve seen a lot of complaints on it, but I don’t know, maybe I’m simply not a gamut nazi. Everything looks good, and if I should get glares, I can simply change the angle of the screen, or move the computer a bit. It’s portable, you know. And for the first time for me, the laptop screen is brighter than my main screen at work, which means I can turn the brightness on the MBP down about three notches and use it comfortably as a secondary screen. Trying something similar with my old Lenovo T60 was extremely uncomfortable.

I’ve had three gripes with the machine as yet:
One drawback compared to a Microsoft based workstation has been using our SharePoint based Intranet system: It’s not possible to click-to-open and then automatically save documents to the SharePoint server even from Microsoft’s own programs, but instead the procedure is to check out, download, edit, save, upload and check in the document, which gets tedious after a while, so for this kind of work, I’ve started using Citrix.

The second drawback (which might just be a configuration problem), is that the default for a Citrix desktop connection seems to be to use all available desktop space and still not show the Start menu bar, so you have to resize the window before you can access it with the mouse, and also, I need to start it running the computer in single screen mode, or it will drag itself out on both screens no matter what.
UPDATE: This seems to be related to starting the Citrix client via Safari. It doesn’t do this when running Firefox.

The third problem was something I managed to solve: The Juniper SSL/VPN client we use at work isn’t compatible with Snow Leopard, and has to be hacked to work properly.
UPDATE: The version 6.5 client seems to fix this problem. Update your SSL/VPN server if you’re having this problem.

So to sum it all up, I’m a happy Mac-wielding camper. I won’t ever become a fanboi – I’m way too pragmatic for that (2016-10-17: OK, I admit, dammit, I did become one) – but for my laptop needs, the MacBook Pro is very close to being the ultimate solution. It’s snappy in a way that no Microsoft-based machine has ever felt to me since I moved away from DOS, and it’s instantly useful in a way that no GNU/Linux or Free-/Net-/OpenBSD distribution has managed yet.