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.
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.
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.
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: