Howto's and FAQ's

X11 applications over SSH


An easy way to run your Linux X applications on your Windows desktop is to use the SSH X11Forwarding capability. If you enable X11Forwarding on the SSH server you will be able to display GUI applications, running on the server, on your Windows desktop. Edit /etc/ssh/sshd_config and change the line X11Forwarding no into:

X11Forwarding yes

On your Windows desktop you should have an ssh-client and a X-server. A good choice to install on your Windows machine would be CYGWIN. ( Download setup.exe and follow the setup instructions. To be able to use X11 over SSH you need to select openssh from the NET group, and xorg-server, xterm and X-start-menu-icons from the X11 group. After finishing the installation start the X-server on your windows machine. In the CYGWIN shell type:

export DISPLAY=:0.0
followed by
ssh -X yourusername
Now you can display your X applications on your Windows desktop. For example type
and the clock will be displayed on your desktop.

Bash backward compatibility


Although most Linux distrubutions are shipped with BASH as default shell you might experience some machine's don't have the BASH shell installed but the SH shell. If you write shell scripts which will be used on several machines you might start your scripts with the indicator to use sh instead of bash for backward compatibility:


Correct way to disable init-scripts to start at boottime on Debian

In several articles and forums I see people telling the way of removing the init-script on a Debian system would be:
update-rc.d -f init-script-name remove
The more appropriate way is to disable the init-script from running at boottime:
update-rc.d init-script-name stop levels .
In this way you prevent that in case you upgrade the package a new init-script will be created with the defaults.
If the init-script is written with the defaults the init-script might start the process again at boot-up.
If you disabled the init-script from running at boottime the init-script would not be recreated or overwritten with the init-script in the update.

DNS lookups slows down MySql

Access to a MySql database is granted based on username in combination with the hostname and a password. MySql will first try to lookup the hostname in the cache, if not found it tries to resolve the hostname. DNS resolution might become a performance issue. MySql will do a double reverse-DNS lookup, it will first lookup the hostname which belongs to the incoming ip-address, then it will lookup the ip-address belonging to the hostname and matches the incoming ip-address with the found ip-address by the DNS resolution. This all might work well, but it all relies on a good DNS infrastructure. Now what if the DNS server can not be reached? or the reverse DNS mappings do not match? In that case users might not be able to connect to the MySql server. To prevent this you should edit your MySql configuration and set skip_name_resolve in /etc/my.cnf If you already have your MySql server running you should convert the hostnames in the users table before restarting the mysqld daemon. Run the query:

Install yum from internet on Centos 5.4

If you have ever been in the situation where you had to install packages on several CentoS 5.4 machines without having yum pre-installed and not having a local rpm source available you know it is a lot of work to download all dependency packages by hand. I created a simple bash-script to download the necessary packages to install yum by hand. Create a new file for example with the content:

Auto log-out shell after idle time


It is possible to configure BASH to log-out a user automatically after a certain idle-time. This can be done by appending the seconds in TMOUT variable in the bash start-up script.

Append the seconds in your BASH startup script (~/.bashrc)

Page 5 of 9


You are here: Home Howtos and FAQs