Compressed RAMdisks on the Raspberry Pi

When setting up my RaspberryPi for some actual ‘production’ work (as a low-volume NAS server and VPN endpoint to live at my parent’s house), I wanted to keep writes to the SD card as low as possible. To this end, I thought I’d keep things like /var/log and swap on a compressed RAM disk.

Unfortunately I’ve got one of the first RPi’s, so I only have 256MB to play with. I’ve set the RPi to allocate the minimum amount of memory to the GPU (16MB), leaving me with 232MB for the system. I have a 512MB swap partition on the SD card already. I need to set up a 32MB compressed RAMdisk for /var/log, and a 64MB one for swap.

Since I want to make sure the compressed swap area is used before writing to flash, I need to explicitly set the priority of the existing flash swap area to a low priority. This can be done by adding pri=1 to the fstab line:

On boot, I want all of this configured for me. The usual way of doing this would be to write an init script to take care of the setup and teardown. I’m too lazy for that! I don’t care about keeping the data either, so there is no need for a shutdown script to take care of writing the contents back to flash. /etc/rc.local here I come.

So far, so good! The RAM allocated to the zram devices doesn’t count towards total memory usage unless it’s being used, either. After booting, memory usage on the RPi is a mere 16MB even with the zram disks configured!

Shocking blast from the past…

The guys at GoG recently released System Shock 2 to the world.

Now, considering that my desktops have always been called ‘Xerxes’, my home server is called ‘Shodan’ and my laptop ‘discord’, it’s fair to say that I was very happy about this development!

SS2 start, at the tram station.

At the very beginning…

I’ve never managed to get the original version working on anything past Windows XP, and my adventures under Wine were equally fruitless. Luckily, the GoG version worked perfectly on Windows 7 after I’d installed DX9, so I was ready to go. I wanted to update the graphics by using some of the excellent mods out there, so after a good search I came across this thread at the GoG forums. It details how to configure the mods to work with the GoG version of System Shock 2, and more importantly provides a full set of mods for the game in a single download!

The first ghost encountered on the Von Braun

I forgot about this first ghost!

I’ve mirrored the mod pack here in case anyone wants it. Download it, extract the contents, run SS2Tool on your installation, then dump any mods you want into the DataPermMods directory. The mods should have their contents placed into the DataPermMods directory, rather than be stored in their original directories. Some files may be overwritten as you continually copy the mods across, but this is okay (just watch your order if you prefer one mod to another).

Xerxes, the Von Braun computer.

Xerxes, the Von Braun ship computer, makes progressively more bizarre announcements as you play through the game.

All the screenshots in this post were taken from the game using all the mods in the above pack. They’re also in PNG, because that’s how the game captures images and quite frankly I couldn’t be bothered converting them to jpeg.

If you’ve never played System Shock 2, I urge you to go buy it and play through it with some of the graphical enhancement mods. Hopefully it’ll stick with you as a defining moment in PC gaming history like it did with me.

I’m not looking forward to the Engineering deck…

As a little side project with absolutely no use or point whatsoever, that will probably be abandoned within a week, I started working on a URL shortening Ruby gem.

Since I’m trying to get to grips with Ruby due to my continued pushing of Chef at work, I thought this was an interesting little thing to work on. It’ll expand out as I create a web interface for it, probably using Sinatra. Looking through my code I can see I’ve still got a lot of Python to unlearn!

It works at the minute, anyway. How reliable or trustworthy it is, I can’t answer. Being massively over-engineered, it requires Postgres and Redis, although my use of Redis at the time of writing is fairly pointless.

Code here, if you dare.

Notes on installing Chef Server 11

Just a few quick notes about setting up the open source Chef 11 server, as these don’t appear to be documented anywhere, although I’m known for missing stuff when I skim read!

Firstly, ensure that your Chef server hostname is resolvable and hostname -f returns the FQDN of your server. If this isn’t the case, Solr won’t start and chef-server-ctl reconfigure will fail with a fairly non-specific error (curl -sf http://localhost:8000 will return error 22). This should be fairly obvious to everyone setting up Chef, but I missed this! If you’re testing just bung all this in /etc/hosts and it’ll work.

Secondly, the new documentation for setting up the Chef workstation doesn’t tell you where to get validation.pem or the admin.pem requested when running knife configure -i on the workstation. That is unless you’re one of their paying customers! These can be collected from /etc/chef-server on the Chef server. Following the older documentation for setting up a workstation still works fine and is better written for those of us using the open source server!

Migration complete

Finally got around to moving this site onto a different server. Ended up on Gentoo, the most stable of Linux distributions and renowned the world over as a prime server operating system!

In fairness I’m pretty much talking to myself anyway, and I use this server for lots of other things (like remote development), so stability isn’t as important as things being up to date.

Just need to finish migrating my email and I can get my OVH server decommissioned and save myself some money each month!

So… Postfix, Postgres, Dovecot, virtual users and Procmail. How do?

Musings on server reinstallation

The server that this site runs on was first installed about 14 months ago, back before I started serious Linux system administration. I’ve learnt so much since then I feel it’s time to reinstall the server using this new-found knowledge.

Read more