PHP: Check if PID is running

I needed to write a small function, that can check if a specific PID is running an linux/unix system.

Check it out on Gist:

CentOS 6.2: Make eth0 work with DHCP

I recently installed CentOS 6.2 in a VirtualBox and was pretty astonished, because it did not have networking or a eth0 working.

You need to change this file:
to this:

More info about that problem:

Configure eth0:

Linux: Use Git to backup/store /etc directory

If more than one person has to manage a server, it might come in handy to have some kind of versioning of the config files.
But also having the possibility to keep track of local configuration changes in your system could be very usefull.

I found 2 tools that can help you:

1. etckepper

etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository. It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades. It tracks file metadata that revison control systems do not normally support, but that is important for /etc, such as the permissions of /etc/shadow. It’s quite modular and configurable, while also being simple to use if you understand the basics of working with revision control.

2. Changetrack:

Changetrack logs modifications of a set of files, and allows recovery of the tracked files from any stage of development. The changes are presented in a powerful web-based form, a text file, or an email message. A handful of options allow situation-specific configuration, but the code is readily available for more complex modifications.

Apache2: apr_sockaddr_info_get() failed for HOSTNAME

If your apache2 outputs this warning when starting, read along how to fix it:

Problem is that Apache2 is told to use a hostname that the system can not resolve.
Simple solution is to put HOSTNAME to the /etc/hosts file, like this:

If you have the problem that your /etc/hosts is ignored, check this article:
Linux: /etc/hosts gets ignored

Linux: /etc/hosts gets ignored

I had the problem that my /etc/hosts wasn’t read by the system.

First: Use ping to test local Hostname lookups, because dig calls the nameservers directly.

There are two files that can configure in which order the lookup system are tried.
The two systems are the local hosts file and the normal DNS system.


“order hosts,bind” tells the system to use the hosts file first, and then try bind == DNS system.


“hosts: files dns” tells the system to use the hosts files first, and then try DNS system.

Try which file has to be edited, because it is not clear which is used.

Symfony2: Doctrine github Repos moved from symfony to doctrine

Today i tried to run php bin/vendors install and got this output:

and this:

You have to change dour deps file like this to resolve the problem:



Official change:

Linux: Using apt-get behind a http/ftp proxy

You need to create a file /etc/apt/apt.conf with the following content:


For FTP:

You need root permissions to create/edit that file, but for using apt-get you already do so.

Bash: Set HTTP / FTP Proxy with Username and Password

You can set a HTTP Proxy for the CURRENT BASH with this command:

A FTP Proxy can be set like this:

With username and password it looks like this:

You can unset it with this commands:

Maybe use telnet to check if your proxy is reachable:

Press CTRL-C to abort if necessary.