Mikael's blog

A developers seventh time trying to maintain a blog

Group Pressure

In a totally unoriginal move I’m now starting to wean myself off Facebook, starting by deleting the Facebook app from my phone and tablet.

Since almost everyone else in the tech sector seems to have done the same thing at least once, I don’t feel that I have to post any particular reason for doing so other than being tired of it.

Since I’m not going cold turkey right away I will still check in on Facebook from my laptop, but the number of “feed reads” will hopefully be few and far between.

by Mikael Lofjärd

OMG New Certificates

One might wonder where I’ve been or what I’ve been up to these last couple of months. One would be right to wonder why I, so close to the one year anniversary of this blog, suddenly stopped writing.
The truth is kind of embarassing.

What did you do?

I created a bunch of SSL certificates that were set to expire in a year (by not changing the default value).
So here I was, wanting to write to you about building a robot, going to FOSDEM, hacking away at my blog etc, but I just couldn’t. Well not in any easy way anyway.

But isn’t that an easy fix?

My first thought was to generate new client certificates but that was when I realised that my server certificates had expired as well and my CA certificate had been lost in the maintenance work a few months back.

So my next quest was to recreate my CA certificates but that unfortunately turned out to take longer than I expected.
Appearantly I’m a very busy man these days because every time I sat down and got started with the certificates, something else came up and got in the way of things.

So what’s different about today

Well for one, I’m home from work tending to my daughter who has a high fever. After a morning of cartoons and blaming me for “stealing” her toy train, she finally fell asleep and lo’ and behold; I have brand new CA certificates, server certificates and client certificates.

I’m back!

Oh, and dont worry! There will be a few posts about my robot.

by Mikael Lofjärd

The Fabulous Pi

In March this year I took a great leap forward in performance when I built my in-memory cache. It took my blog from a paltry 5 requests per second to a whooping 62 requests per second.

Well, since then I’ve made some changes…

The Replacement

Since you already know The Plan, let’s go ahead and talk a little about what the temp agency sent over; The Raspberry Pi.

The Raspberry Pi is a $35 computer the size of a credit card. It comes with 2 USB ports, HDMI, 100 Mbit ethernet, a SD card reader for storage and it’s powered by a cellphone charger. It’s also quite similiar to the budget smartphone innards of yesteryear.

The Raspberry Pi packs a 700 MHz ARM 11 processor and 256 MBytes of RAM. It also has a pretty powerful GPU but I haven’t used it yet so I’ll leave it at that.

Having no other computer at arms length I grabbed the Raspberry Pi from a shelf and set it up as a temporary blog server.

So how did it fare?

Raspberry Pi with nginx

Requests per second: 44.36 (mean)
Time per request: 22.543 ms (mean)
Transfer rate: 554.02 Kbytes/sec received

Well that’s not too shabby! In fact you might not even have noticed that the blog has been served up by the Raspberry Pi for the last two days.

It’s worth mentioning that a full page render without the in-memory cache (cold start) took about 2-3 seconds to run though.

Starting fresh

Having a (miniscule) replacement up and running allowed me to move IBS from the closet to my desk for some long needed extreme makeover.

This time around I’m running Arch Linux on it (same as on my laptop) and I’m hoping that will make it easier to maintain it, as I’ll only have one distribution to keep up with.

So what good was all this?

Request per second: 163.96 (mean)
Time per request: 6.099 ms (mean)
Transfer rate: 2051.47 Kbytes/sec recieved

Wow, it more than doubled the performance!

Now you might be wondering about the transfer rate being about the same as before (and much lower than it should be on the Raspberry Pi) and that’s because everything now passes through nginx and gets compressed with gzip.

I’ve also rewritten the code so that nginx now takes care of all the static content, SSL configuration and all virtual domains. That’s a huge load off the code base, and even though I liked coding those parts, they weren’t that much fun to maintain and (as proven) weren’t all that efficient either.

Showing off

Just to put some perspective on how bloody fast my fantastic laptop is, here’s the blog running on jackrabbit:

Requests per second: 1204.22 (mean)
Time per request: 0.830 ms (mean)
Transfer rate: 32266.94 Kbytes/sec received

Now that would put some serious strain on my internet connection. =)

by Mikael Lofjärd

Maintenance In Progress

I’ve embarked upon my mission to upgrade my server installation. It’s probably going to take the better part of this week but I hope to be done by this weekend when my parents-in-law are coming to stay with us.

Here’s my todo-list as of now.

  1. Find a temporary server to host the blog on while installing new stuff on IBS.
    1. Grab nearest piece of unused computer tech capable of running Linux.
      (Yay, my RaspberryPi)
    2. Install Raspbian.
      (Since it’s just a temporary server I didn’t bother playing with Arch Linux ARM. Raspbian is what most people are using on their RPis so I figured it would have a decent repository of pre-compiled software.)
    3. Install nginx.
      (This was easy, it was in the repos.)
    4. Install CouchDB.
      (Again, in the repos).
    5. Install Node.js.
      (This is where I’m currently at. It’s a little trickier, requiring compiling from source for version 0.8.x and editing a couple of lines in the V8 configuration to allow ARM v6 compilation. It also takes a LOOOONG time to compile on the RPi)
    6. Setup the blog on the RPi.
  2. Redirect lofjard.se to point to the RaspberryPi.
  3. Install Arch Linux on IBS.
    1. Install nginx.
    2. Install CouchDB.
    3. Install Node.js. (All easy on Arch Linux thanks to fantastic repos.)
    4. Setup the blog on IBS.
  4. Re-redirect lofjard.se back to IBS.
  5. Benchmark
    (The use of nginx for static content instead of node-static should make for a nice performance boost in conjunction with the removal of some now redundant code.)
  6. Keep calm and carry on!
by Mikael Lofjärd

Old But Not Dying

Tuesday the 25th of September 2012 marks my 30th birthday.

Even though I might not be fresh meat anymore, I haven’t forgotten about my blog. I’ve just been busy (raise your hand if you’ve heard that one before).

The Best Laid Plans of Mice and Me…

  • I’ve been planning an article about my success in getting my laptop installed with Arch Linux on UEFI, but I’ve yet to complete it.
  • I’ve also redesigned the blog and it now looks like crap in Firefox.
  • I then fixed the Firefox bugs but have’nt gotten around to uploading them because of my next bullet point.
  • My server operating system/software stack is ooooold. :-)

Planned maintenance

My pretty little server IBS is running Ubuntu Server 10.4 LTS. My original plan was to update it to 12.04 LTS as soon as it was released but, needless to say, that didn’t happen. I’ve since fallen in love with Arch Linux.

As I was fixing my Firefox rendering issues I also happened to update all of my node.js plugins on my workstation. This required some rewriting of my code which in turn is why I haven’t uploaded it yet.

Even though I haven’t updated my blog for the whole of summer, I still hate downtime, and uploading the latest code would require some downtime as it is now depending on newer versions of node.js and a lot of newer plugins.

AND… if I’m going to do maintenance on the server I might as well reinstall the whole machine and run Arch Linux on it.

I’m also planning a major rewrite of my underlying structure to move from a pure node.js server to a nginx/node.js mix.
It’s a move I’ve been contemplating for a while since I’ve been having some problems with my implementation of virtual domains in conjuncture with my speedy in-memory caching.

tl;dr

I’m not dead, just old(er). The blog still lives. Planned maintenance has been keeping me from fixing stuff. Life (vacations/kids/work/barbecuing) has gotten in the way of me writing semi-interesting blog posts this past summer.

by Mikael Lofjärd

Jackrabbit

I’ve finally received my new laptop. It’s not the one I initially wanted (the Lenovo X230) since that on costs a small fortune in the configuration I wanted. Well at least it costs a bit too much here in Sweden with all the taxes and what not. Anyway, I settled for an Asus Zenbook Prime (UX31A) and had money left to take the family on vacation instead.

Crapdev

My old laptop (crapdev) has served me well. I didn’t even pay for it since I just took it home with me when I received it’s replacement at work. Yes, I’ve been using my old work laptop as a private workstation for the last 2-3 years and it’s starting to show.

Hello Jackrabbit

I named my new toy “jackrabbit” as a nod to the restaurant from Pulp Fiction (Jackrabbit Slim’s). With the UX31A measuring only 18 mm at its thickest, and to be fair, 4 mm of those are its rubber feet, I’d say “slim” is the word.

Other specs include an awesome 1920x1080 matte IPS display panel, a blazing fast 120 GB SATA-3 SSD from ADATA, 4 GB of RAM and the Ivy Bridge Core i7 3517U 1.9 GHz CPU with its accompanying Intel HD Graphics 4000 chip.

Needless to say, it runs circles around my old laptop. By the time KMS has switched my tty to native resolution, the laptop is already done booting. The BIOS POST actually takes longer than booting Arch Linux on this machine.

Now getting Arch Linux installed on this EFI-equipped machine however, that’s a story for another day (or week). Stay tuned.

by Mikael Lofjärd

The Tiling Truth

Form, function and flexibility. I find that these three concepts are not always easy to rank. Sometimes I feel that form trumps functionality, sometimes I don’t. When it comes to window managers however, function is king!

The Form Junkie

I have to admit, I’ve been totally ignorant about tiling window managers up until now. I’ve always wanted my desktop to look nice and I’ve sometimes gone to great lengths to customize my desktop to be pixel perfect the way I want it. But lately I’ve come to a realization; mouse pointers suck!

Well most mouse pointers do anyway. I’m a trackball user so I think all regular mice sucks anyway, but now I’ve started hating trackpads. I’ve been planning on picking up a new laptop soon (well as soon as the X230 gets released) but I want to be able to use it on the couch without having to rely on a mouse/trackpad/trackball. The Lenovos “nipple-mouse” is about as far as I want to go since it sits smack in the middle of the keyboard.

I need a keyboard centric desktop environment.

Enter xmonad

Tiling window managers to the rescue! More specifically; xmonad to the rescue!

xmonad is an awesome (no pun intended*) tiling window manager written in haskell. It’s fast, easy to use, easy to configure and it runs entirely of the keyboard. There are many great guides to configuring xmonad, and it’s incredibly stable (well duh, it’s written in haskell).

* Not really a “pun”, but “awesome” is the name of another tiling window manager.

by Mikael Lofjärd

Screw You Ubuntu - I'm Going Home

Ignoring a short play date with Red Hat around ‘95, my first Linux love was Slackware.

Slackware was fast and awesome but it somewhat lacked in the package discovery department. I installed most things from source and after learning about all the bad things that can happen when you install new versions of software on top of the old, I setup a package manager, but Slackware still lacked a central package repository.

All Your Source Are Belong To Us

The central source repository led me to switch to Gentoo. Being able to just install things without having to find the source code online first was great, but again I grew tired. The long compile times eventually wore me out and this time the switch was made to Ubuntu.

Out of The Box Experience

Ubuntu was nice in a everything-just-works sort of way, but now, some 6 years later, it doesn’t do what I want and I don’t know how to fix it with all the magic going on. I need to get back to my beloved manual tweaking.

The Arch of Truth

Arch Linux is my new pal. I’ve installed a bare core system that boots to the terminal (retro style), I’ve installed X and am about to configure it to my hearts content. If this doesn’t work out then; LFS, here I come!

by Mikael Lofjärd

The Development Environment Enigma

As you might have noticed, there hasn’t been much work done on the blog these last few months. It kind of boils down to complexity.

The Old Setup

When I started building this blog my main workstation was running Windows 7. Everything ran as well on Node.js on Windows as it did on my Linux server. It was a nice and simple setup; develop locally, test locally, deploy on server.

Enter CouchDB

Then I added a database. Specifically CouchDB that only worked on Linux. This meant a new, more complex development routine; develop locally, deploy on server, test on server, rince and repeat in case of error.

This worked for a while but lately as the code has gotten more complex and it does a lot of pre-caching on startup, I’ve been longing for a locally deployed test version again.

The Switch

So I decided to switch my main workstation over to Linux again. I’ve been away from the Linux desktop for a few years (having only server installations at home), but I felt that it was time for me to get back to my roots.

WTF!?

I have very fond memories of Linux from the late 1990’s, early 2000s. It was fast, lightweight, fast, beautiful and fast. I think you can see where I’m going with this.

What is up with the Linux desktop of today? I’ve been looking at screenshots of the the latest Ubuntu with Unity and it looks like crap, so I installed Linux Mint hoping that Gnome would at least have a more polished look. Boy was I wrong. Gnome 3 also looks like crap. There are these little ugly inconsistencies showing up all over the place; scroll bars, menu placement, font-sizes, you name it.

And it is soooo painfully slow. I mean, when I click on a f-ing menu, I don’t want to wait for half a second before it pops up. If my menus could feel fast 10 years ago, why can’tit do the same now?

Now, I know there’s a lot more going on with all these modern composition managers and what-not, but I just want a clean, fast, two-dimensional development environment.

Let’s Do The Time Warp Again

So I figured I’d install some old school (fast) window manager and spend some hours configuring its quirky text config files like back in the old days. Fluxbox (fka Openbox, fka Blackbox and so on) was probably the fastest one I could remember so that’s what I installed. Awesome!

Damn You Linux Mint

For some weird reason that I can’t figure out I can’t compile the “latest” CouchDB and Couchbase Single Server has been discontinued so I can’t use Linux Mint anyway.

So now I’m going to bite the bullet, install Ubuntu and then kick Unity in the teeth and install Fluxbox again.

TL;DR

  • The new WMs in Linux sucks, looks ugly, are to slow.
  • Couchbase annoys me.
  • Things will never be as fast as when Slackware still used libc (3.6 FTW!).
by Mikael Lofjärd

The Month of No Content

If not for this year being a leap year, there would have been no posts made this month.

I plan on doing better. I also hope on getting ill a lot less in the months to come.

by Mikael Lofjärd

Sorry, sharing is not available as a feature in your browser.

You can share the link to the page if you want!

URL