This article summarizes how to set up xdebug for Apache 2.

Use apt-get to install xdebug from the package repositories. This will also enable xdebug for command line php.

Additionally, I had to manually configure the time zone (sudo vim /etc/php5/apache2/php.ini):

By default, xdebug is not set for remote debugging. You need to activate it (run sudo vim /etc/php5/apache2/conf.d/20-xdebug.ini):

After you’re done with the configuration, restart Apache server:

Testing in shell

In order to test your installation run the following command:

Afterwards, search for xdebug by typing “/xdebug”.

Testing in browser

Place a file phpinfo.php in your web server’s directory and add the following content (set appropriate rights to execute it!):

Open up the corresponding URL (e.g. http://localhost/phpinfo.php) and search for xdebug.


For use with Netbeans, you need to correct the debugging session ID. Open the xdebug.ini file:

Then, add the following line. Make sure, the ID is literally the same as in the Netbeans preferencese:


  • [1] Installing xdebug for PHP5 on Ubuntu
  • [2] Wizard that generates installation instructions for xdebug (not specific to Ubuntu)

The update from Ubuntu 13.04 to 13.10 failed for me with the error message:

Your python install is corrupted. Please fix the /usr/bin/python symlink.

The reason was that I used update-alternatives to manage my two Python versions (2.7 and 3.3). The following solved the issue for me:

(The expected version can be found out via: python /usr/share/python/ -i)


  • [1] One of many forum entries that describes this solution

When we encounter strange, unexplainable problems with text files, hidden characters may be reason. This article describes several possibilities to tackle line-ending and whitespace problems.

Correcting mixed line endings

If a file has mixed line endings, the standard tool flip may help you:

A check with file reveals that the file test.txt has mixed line endings. Flip unifies the line endings to Unix (-u) or Windows (-m) standard:

Examining files

vim can show whitespace characters, if you enable the option list. In command mode, execute the following to show whitespaces like tabs or line endings. Unfortunately, the editor does not differentiate between different types of line endings.

Use :set nolist to return to normal view. With :set ff the program identifies the line ending standard.

If you need to get a detailed picture of the whitespace characters in your document, the octal file viewer od may be helpful, it displays the file as octal values and (interpreted) ASCII characters:

The results looks as follows:

Using cat -v text.txt, you can see bogus (non-Unix) line endings  being marked with a special symbol: ^M

Show one’s own/other’s groups

Show all groups on the system (with group id):

Create new group

Add user to group

Assign a specific home directory and shell to a user

If the user shall only be allowed to do SCP/SFTP transfers, then an appropriate login shell is scponly.




Some image processing programs expect the file extension to be in lower case. Many digital cameras, however, tend to use an uppercase extension (JPG in case of the Panasonic TZ-31).

The following Bash one-liner renames all JPG files in the current folder to have the lowercase jpg extension afterwards. The ${…} expression is called parameter expansion, which is quite a powerful mechanism:


  • [1] Manpage of the Bash (see Section on Parameter Expansion)
  • [2] Parameter Expansion explained on

If you ever wondered, what the rc in all the startup files for Unix application means, here is the answer:

The rc stands for run commands.

This conventional pattern in file names is believed to originate in the 1960s from the runcom facility at MIT. See also this quote coming from Brian Kernighan and Dennis Ritchie:

“There was a facility that would execute a bunch of commands stored in a file; it was called runcom for “run commands”, and the file began to be called “a runcom”. rc in Unix is a fossil from that usage.”


  • [1] Wikipedia (EN): Run commands

When being at my workplace at home, I like to use an external monitor instead of the laptop display (Acer TravelMate 5730G). I did not always want to open up the display control in Kubuntu in order to change between between primary (laptop) and secondary (external monitor) device. I came up with two small scripts which perform the switching in both directions. One is shown below, the other one is analogous.

This effectively switches on both displays and then disables VGA-0. You can find out about your connectors’ names by running xrandr without arguments or xrandr –verbose which also gives you the CRTC number (supported controllers) which needs to be set manually sometimes (see line CRTCS in the verbose output).

However, recently I noticed there is a more reliable tool called disper which has been developped for facilitating the monitor management with Nvidia graphics cards. Yet, it also works perfectly for my ATI mobile Radeon HD 3650 graphics chip.

The package can be installed from the regular Ubuntu repositories:

Afterwards you may easily switch monitors with one short command as the help (disper –help)  suggests:

The primary (secondary) display is the first (second) display returned by –list. On my machine, neither cloning (–clone) nor extending the display (–extend) work properly, unfortunately.


  • [1] Short intro on disper in the ubuntuusers Wiki (German)