Code visualization with Gource

Writing code has its perks for sure and for me one of these is the satisfaction of being able to think of something and then just write the code to bring it to life.

After all the writing, testing, debugging and adding and removing lines and lines of code it’s nice to be able to look back and visualize all the hard work that you have put into creating your pet project.

Continue reading “Code visualization with Gource”

String manipulation in Go

I find the way that strings have been implemented in Go to be really interesting but also a bit confusing when you are first introduced to them. Go has native UTF8 support, which flows through how the source code is written to how strings and “runes” are represented (runes is the thing that really got me by surprise but more on that later). So what does Go do differently with strings that is worth mentioning?

Continue reading “String manipulation in Go”

PhpUnit and XDebug

If you would like to debug one of your command line scripts using PHPUnit then you need to export one of the XDEBUG_CONFIG values.

I read one post about this (unfortunately lost the link and cannot place it here as a reference) the general idea was to export the configuration for XDEBUG and then run phpunit as you would normally do. So, let’s say that you are using PHPStorm as your IDE then the script would be:

#!/bin/bash

export XDEBUG_CONFIG="idekey=PHPSTORM";
phpunit $@

If you name the script phpunitx then the only thing that you would need to do to run PHPUnit from the command line with XDEBUG enabled would be to invoke phpunitx instead of phpunit.

Postgres clusters and cluster upgrades

Postgres has the ability to create clusters of databases that run on the same machine concurrently. One thing that I did not know about postgres is that you can also run multiple versions of postgres at the same machine concurrently along with the mutliple clusters mentioned earlier. But how can one view information about all these instances and clusters and how can we connect to each of them and how can one upgrade the clusters running on one version to another?

I am running Debian on my personal computer and the rest of this post is going to be a very brief description of how I managed to upgrade and tidy up after my postgres instances running on my local computer. Please note that this is not an in depth post nor I suggest in any way this approach for a live / production upgrade of postgres.

So let’s get started!

First of all let’s see which versions of postgres are running on our box. As a super user execute the following command

Continue reading “Postgres clusters and cluster upgrades”

How to start Chromium with specific user

As you may already know it is possible to create different profiles for Chromium. You can find out more information about that in http://www.chromium.org/user-experience/multi-profiles.

What I was really interested to find out was how can I start Chromium with one of these profiles, instead of using the last one that was loaded. The answer can be found here: http://superuser.com/questions/377186/how-do-i-start-chrome-using-a-specified-user-profile. Unfortunately the man page for chromium does not list the specified option so it was really nice to find this question in superuser.com! But let me just give an example of how to use it under Linux.

Continue reading “How to start Chromium with specific user”