I still got sites running Apache, but all new projects are launched with Nginx. I don't need many of the features that Apache offers, and the speed gain of Nginx is just tremendous. Once you've experienced it, I doubt you'll want to go back.

At our company we have a lot of uses for a solid API. We can use it to distribute config files, have servers report in, let customers edit DNS records using their own interface, etc. Now that I'm converting all of our legacy code to a big CakePHP application, the API needed a revisit as well. I chose to use REST as a standard, read about everything related to Cake & REST, and started hacking on a reusable plugin. The idea is that you can drop it in any application and unlock existing functionality to REST with minimal changes to your code.

The core of our new project runs on Node.js. With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But how do you make it run nicely in the background like a true server?

When migrating projects over to GitHub, I found there were still some passwords inside my SVN repositories. Obviously it's not good practice to store your passwords in a code repository - let alone at a remote location, so I wanted to replace all passwords. Not only in the current version, but in all commits that have been made over the past 3 years. Luckily with Git - you can.

Hi. Have you met KvzHTML? It's a standalone PHP Class for generating HTML. It's been hiding deep inside the caverns of my secret GitHub repo: kvzlib - a collection of code snippets too small or unfinished to deserve their own repository. But I find working with this class so pleasant, I thought I'd share the fun.

Today I've moved all of my SVN repositories over to GitHub. 5 private reps and 4 public ones. Two of which you may know: PHP.JS and System_Daemon.

If you store application data in memcache, you may want to invalidate it once you deploy a new version to avoid corruption or weird results. There are several ways to do this but I recently tried one using nothing but BASH, and I like it.

PHP 5.3 is a big leap forward for PHP and brings of a lot of neat features. However, big leaps can also mean big changes and potentially big breakage when it comes to backwards compatibiltiy. I did some experimenting with running a big legacy application and a CakePHP application on PHP 5.3 and would like to share my findings with you. Here are a couple of tips to prepare your code for PHP 5.3

Looking back at a great CakeFest in Berlin, I learned a lot about CakePHP and met many nice and inspiring people. Here are some conference notes I took that where particularly useful or new to me.

IDs are often numbers. Unfortunately there are only 10 digits to work with, so if you have a lot of records, IDs tend to get very lengthy. For computers that's OK. But human beings like their IDs as short as possible. So how can we make IDs shorter? Well, we could borrow characters from the alphabet as have them pose as additional numbers.... Alphabet to the rescue!

If you are in IT professionally (coding or sysadmin) you will be staring at monospaced fonts for many many hours a day. So it's probably justified to spend 2 minutes picking a very good one. It can make your work (typing ; ) just a little bit more pleasing.

I had some difficulties playing Flash videos lately. Problems ranged from lagging sound, to ugliness, to idling black screens, to strange gray Play buttons that didn't do anything. The following solved my Flash issues on Ubuntu.

Pictures say more than a thousand words. This is true for your data as well. With Google Chart you can now easily generate charts of your data. No expertise required. Just make sure you format your data correctly, add it to the Google Chart URL, and it will return a nice graph.

Sometimes MySQL needs to work hard. I've been working on an import script that fires a lot of INSERTs. Normally our database server handles 1,000 inserts / sec. That wasn't enough. So I went looking for methods to improve the speed of MySQL inserts and was finally able to increase this number to 28,000 inserts per second. Checkout my late night benchmarking adventures.

With all the abstraction layers between code & database, and now with my recent CakePHP adventures: The need for writing SQL statements deminishes. But over the years I've developed my own way of formatting them. And before I'll have to wave queries goodbye forever ;) I just want to put it out there.

If you've written a PEAR package, it's probably a good idea to submit some end user documentation. Here's how to do it.

So I've been learning CakePHP the last few days. Bit by bit I've been trying to port a lecagy admininistration app to Cake. 'Secretly' linking menuitems to finished Cake parts as we go. And I must say: I'm pretty excited. I did run into a disturbing conclusion though. I estimated the legacy app will have over 300 Models & Controllers once finished. That could easily add up to (300 x 4 =) 1200 views. And here I am, creating a maintenance hell while trying to solve one!

Everyone knows PHP can be used to create websites. But it can also be used to create desktop applications and commandline tools. And now with a class called System_Daemon, you can even create daemons using nothing but PHP. And did I mention it was easy?

Following Alan Pope and Christer Edwards, I too felt the need to log everything I that I setup right after an Ubuntu Desktop install. It ranges from customizing the user interface to setting up a programmers IDE. It's mainly for future reference by myself, but may bring you on a couple of ideas as well.

Writing code requires two important things: creativity & discipline. The creativity to create the unknown, unexplored, exciting parts of software. And the discipline to create the dull & all-too-well-known parts of software / documentation.
You may come up with new ways (or use frameworks) to reduce repetitive work. Effectively beating discipline with creativity. But boring stuff will still always be there in some form. And on days when creativity is low, you may need to tap into that jar of discipline so you can still be productive, by doing things you never feel like.
But every now & then, there is a day when bot...


Recently I needed ogg123 on an Ubuntu server to convert some media. Naturally, I wanted to use aptitude to install it, but I didn't know what package it was in. Now, you can always google of course, but you can also use system commands to find the package you need.

Hi there. I'm making use of RSS feeds more than I did before. This has to do with Google Reader - which is very neat - and a lack of time. Having sites keep ME up to date, is way more relaxed than scouring the web myself. So I figured I might want to return the favor and make my blog a bit more accessible by introducing two new feeds.

One error that has bugged my Eclipse PDT for a long time, was org.eclipse.emf.ecore.util.EcoreEMap $DelegateEObjectContainmentEList. A vague error, not much to go on, not many hits on google either. Turned out it had to do with the version of my Java Runtime Environment I was using.

Hi folks. As you may or may not know, I have a love/hate relationship with my IDE: Eclipse PDT. For times and times we get along well. But once every while it gets messed up, and it's a pain to straighten it out again. Or at least, it was.

Good testing will result in better code. If you have to wait endlessly for on SVN commits, uploads or compile steps, you will simply produce less inventive code. This has to do with: patience, creativity flow, will, and of course time. Constantly being interrupted breaks concentration. If there's one thing I've really learned, it's invest in a good testing environment. Rapid review of code results will pay off (I promise).
So it's OK to spend some time on learning a good IDE, and another trick to improve the speed & quality of development, is to virtualize your production pl...


In another article I've told you about how I would like to see one rule removed from the PEAR Coding Standards. This rule would allow developers a bit more flexibility, while staying true to the convention.

Recently I've been experimenting with Virtual machines for my development environment. The goal was to create a Virtual Machine that resembles our main production server, and have that Virtual Machine mount my workspace project directory as it's DocumenRoot. This way, my code could be served & tested after every save in my IDE. So no more building / committing delays. And all I could mess up was a Virtual Machine. I didn't know what software to start with and just tried the bunch. Here's my ever so subjective comparison 'chart' on Virtual Machine software.

Working with trees When working with tree data structures you often need to craft them in different ways. PHP offers a lot of functions to change the shape of arrays, but often they only go 1 level deep. Trees can count an almost infinite number of levels. Hence we need recursive replacements for our beloved array & string functions.

Working with trees When working with tree data structures you often need to craft them in different ways. PHP offers a lot of functions to change the shape of arrays, but often they only go 1 level deep. Trees can count an almost infinite number of levels. Hence we need recursive replacements for our beloved array functions.

Since a couple of months now, I've been involved with PEAR as a contributor. Contributing to PEAR means adhering to the PEAR Coding Standards. Their standards have actually been thought over, and using them for projects (also outside of PEAR), leads to consistency, and makes it easier for many developers to understand each other's code.

Code can be scanned and checked for conformity using the PHP CodeSniffer package.

It took me a while to get rid...