Subscribe to RSS feed

splitbrain.org - electronic brain surgery since 2001

Weblog

Venice

We just returned from a few days in Venice. The weather was fantastic and the city is as beautiful as everyone says. As usual, a selection of our photos can be found below:

Tags:
venice, italy, vacation, photos
Similar posts:
Last updated: 2014/03/13 20:31 · Permalink · Comments

Cat Content

Today was a wonderful sunny spring day and my friend Anne asked us to join her for a Tierpark1) visit. And that we did. So here are just a few impressions and some (big) cat content.

Tags:
tierpark, zoo, spring, photos
Similar posts:
1) the other zoo in Berlin
Last updated: 2014/03/09 19:20 · Permalink · Comments

Lenovo Thinkpad X240 & Xubuntu

I just bought a new laptop. After years with netbooks (first the EeePC 4G and then the EeePC 1015PE) this is my first full powered laptop since my Fujitsu Lifebook. I wanted something powerful with good screen resolution and battery life.

I finally decided for the Thinkpad X240. More specifically model 20AMS21B00, which is a university edition and not available in this exact configuration to the general public. Luckily I have connections ;-).

This post features a short review and some hints on configuring the X240 with Xubuntu.

Last updated: 2014/03/08 15:01 · Permalink · Comments

File Icon Generator

Consistent file icons are a bit of a pet peeve for me. Icons make download links or web based file managers (like in DokuWiki) much nicer to use. But where to get them? Whatever iconset you use, there is always the one type missing you currently need. A long while ago I even started to compile my own icon set but that suffers from the same problem.

What I needed was some icon set that would cover any possible file extension, would look nice in different sizes and is free to use. So I built one. Or more specifically, I created a tool to build such an icon set.

It's creatively named File Icon Generator and is a PHP script utilizing libGD to build the icons.

Icons are created based on a basic template (I decided for the document metapher) and a colored label. The label itself is just the file extension, the color specifies what kind of file it is (based on its mimetype). Eg. image files are blue, audio files green and so on.

The templates are configurable based on mime types as well, so for the bigger sizes some graphics can be added. Eg. a musical note for audio files.

For now it creates 16×16 and 32×32 icons for 1072 known extensions. And this is what it looks like:

The source code is available at Github and pull requests are welcome.

Tags:
icons, mime, filetype, php
Similar posts:
Last updated: 2014/02/16 17:34 · Permalink · Comments

Docker PHP Farm

Yesterday I tried to fix a bug a user had reported in one of my DokuWiki plugins. Apparently it only occurred on PHP 5.2. Well, the last PHP 5.2 version was released in 2011 and no modern distribution has it anymore. So how do I test this easily?

After a few failed attempts with finding a virtual machine image that would give me the needed PHP version I decided to come up with my own solution. And because I was curious - I decided to build it on docker.

Docker is an open-source project to easily create lightweight, portable, self-sufficient containers from any application. The same container that a developer builds and tests on a laptop can run at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more.

Basically docker provides something that is between a full fledged virtual machine like VirtualBox or VMWare and an application running directly on your system. A docker container will run on your current Linux kernel but will bring its own environment and libraries. A better chroot if you want.

My idea was simple: use the very cool PHPfarm script to compile multiple versions of PHP and provide an Apache server that serves these different versions on different ports.

I'll spare you the details of pain involved in getting a 4 year old PHP version to compile on a modern Debian system but in the end I got it working.

The resulting docker image can be checked out and run like this:

docker pull splitbrain/phpfarm
docker run -rm -t -i -e APACHE_UID=$UID -v $PWD:/var/www:rw -p 8052:8052 -p 8053:8053 -p 8054:8054 -p 8055:8055 splitbrain/phpfarm

It will make your current directory accessible via the Ports 8052 to 8055 with different PHP releases respectively.

The Dockerfile and supporting configs I used to build this can be seen at Github.

There were a few things I learned during this project:

  • each line in a docker file creates a new docker layer
  • a file created in one layer can be deleted in another layer but will not free any space
  • having a real VM to try your commands while building the Docker file was quite helpful
  • docker uses a shit load of space when you not clean up unused images and containers from time to time
  • the docker documentation could use some improvement (eg. is there a reference for Dockerfile commands beyond the basic tutorial?)
  • once you have a docker image, running it is super easy and convenient
Tags:
docker, vm, php
Similar posts:
Last updated: 2014/02/02 11:59 · Permalink · Comments

Older Posts are available in the Archive. Keep up to date with the RSS Feed.

Blog

Older Articles are available in the Archive, subscribe to the
Full Content RSS Feed to stay tuned.

← Flattr me ;-)

Currently reading

Barbara Kingsolver

Currently playing

inXile entertainment