Nginx is an awesome highly customable and super fast (web)server, unfortunately configuring and setting him up is not that easy compared to Apache.

Modules could not be loaded later via a config file like Apache modules, instead they must be compiled into the Nginx binary. This often leads to the necessity to compile Nginx from source for a deployment.

Here how I compiled, installed and deployed Nginx on a Ubuntu 12.04 system:

Lately I discovered LESS and started loving and using it. In combination with Twitter’s Bootstrap it become very easy to generate CSS in a very comfortable way.

At one point I needed to generate roughly 30 css classes to leverage CSS sprites. I’ve been used do this all by hand back when CSS was written without any help, but having such awesome tools like LESS there must be a way to do this more comfortable. After searching for a while various sources (and also the LESS documentation) said that there are no loops in LESS, so I looked through the Bootstrap sources I found some stuff that looked similar to loops (grid.less and mixins.less).

After simplifying what I found here is the shortest version of doing a loop-like construct in LESS: continue reading…

It’s been a while since my last post, so here some relevant updates (shot version): I entirely switched to git for source control and I am quite happy about it. It is flexible, fast and simply amazing.

After using it for a while you sometime discover some shortcomings.
For example: Many of my client do not use git so I need to send them an archive with the current state of development. There are different way to get this done.

Do this in your file manager. Very annoying, because you need to sort out all files that should not be in the archive (.git folder, log, cache, etc.)

I am currently working on a Flash project. Because it has a lot of GUI stuff and it is always a lot of code to make some nice GUI components in pure ActionScript 3 I decided to give Flex a change. Surprisingly I really like it. It’s nice and a little bit sick (for a framework a lot of magic happens during compilation). Like for ActionScript 3 Adobe again did a really good job on writing a nice documentation.

But not everything works flawless. Here is a thing struggled with:

Embedding an image is quite easy (the image will be compiled into the final swf file):

<mx:Image source="@Embed(source=’image.jpg’)"/>

Using HTML to format text shouldn’t be a problem for anyone.

<mx:Text width="100%">

<mx:htmlText>

<![CDATA[<p><img src=’url’/>some text</p>]]>

</mx:htmlText>

</mx:Text>

This will show the image from the given URL and “some text”. The Image is going to be loaded when displayed, it is not embedded into the swf file.

Today I discovered that a while back on a PHP/HTML/MySQL project I made some serious mistakes on my database design. To explain it in short:

I have one a table, lets call it “table1″, and another table, lets call it “table2″. Table1 references a row from table2, but I didn’t used foreign keys in these days. (I don’t if I didn’t know that they are exist or if InnoDB wasn’t available.) The Website has an admin tool which edits all the tables through some HTML forms. My mistake was that it is possible to delete a row from table2 which leaves all the rows in table1 referencing this row in table2 somehow broken. Today someone discovered this mistake I needed to clean this up. My idea was to create a simple query which cleans table1 and the alter the PHP which deleting rows from table2 to also clean up table1.

I started which the following query:

DELETEFROM table1 WHERE id IN(

SELECT t1.id

FROM table1 AS t1

LEFTJOIN table2 AS t2 ON t1.key = t2.key

WHERE t2.key ISNULL

)

Which leads to the following error:

#1093 - You can't specify target table 'table1' for update in FROM clause

I was some kind of shocked because I had no idea whats wrong with this query. After searching the web for a while I found out that it is some kind of bug in MySQL but there is a weird looking workaround: continue reading…

I’m a big fan of the Linux operating system, but sometimes you really need a Windows to run software that isn’t available for Linux or where isn’t any related program.
Therefore you could try WINE (which emulates the Windows API within you Linux system), you could install a virtual windows using a virtual machine like Virtual Box (which emulates a whole PC within you Linux system) or you could install a native Windows operating system side by side to you Linux. If you need the whole performance you hardware could give you, you need to install Windows on your hard drive next to you Linux installation.
Since the Windows boot loader is very restrictive regarding to having multiple operating systems the easiest way is to first install Windows and then later install your Linux system, which brings GRUB (or something similar) as a boot loader.
I first installed Ubuntu on my PC and wanted to install Windows later, so I hard to do it the hardest way:continue reading…

Sometimes you run a task from the console which takes a while. (E.g.: compiling some programs, downloading something from the internet or installing updates.) Often you do not wait until this task finishes and just toggle to the next window. Would it be nice if you would get some kind of notification, when the task has finished? I found the following solution, which uses the Ubuntu notification system:

Edit the .bashrc file from you home directory and append the following lines:

A while ago I used VMware server to running a few virtual instances for testing purposes. Everything worked really flawless. Yesterday I wanted to have some virtual server on my home computer again and encountered many problem with the current version of VMware Server on my Ubuntu 10.04 LTS.
There where some problems with the installation, some to get the VMware console running and also a few the keyboard input on the console.

It took a while to get everything running and I pulled all the information I needed from many different sites. So pulled them all together in this blog entry: continue reading…

I am developing with JavaScript for a while and I am used to a lot of it quirks. But even after years of using this language you still find new curiosities. Today a struggled a while with this one.
Considering this piece of JavaScript code: