Running a backup script on a server system as a webhosting server can produce high load and longer latencys for other processes  or php pages load slow during backup because the backup script takes too much  CPU resources.

On Linux systems there are many utilities available for the programming to set the CPU for a appliaction or a script.

In this tutorial we will use nice.

To reduce the CPU priority, use the following command:

/usr/bin/nice -n 19 /location/of/your/script/

The -n parameter can be in the range from -20 to 19.  Lower numbers means higher priority.


In the following tutorial  i will explain the installation of the apache2 module “mod_evasive“.
Mod_evasive tracks the number of requests for files on the Apache2  server and blocks the delivery in case a certain limit is reached.

Step1. Install mod_evasive module:

apt-get install libapache2-mod-evasive

Step2. Create the log directory for mod_evasive:

mkdir -p /var/log/apache2/evasive

NOTE: Make sure the www-data user will have access to create logs:

chown -R www-data:root /var/log/apache2/evasive

Step3. Now edit the configuration file for the module 0 located in /etc/apache2/mods-available/mod-evasive.load like this:

vim /etc/apache2/mods-available/mod-evasive.load

After edit the file will look  like this:

LoadModule evasive20_module /usr/lib/apache2/modules/
 <IfModule  mod_evasive20.c>
 DOSHashTableSize 3097
 DOSPageCount 5
 DOSSiteCount 120
 DOSPageInterval 1.5
 DOSSiteInterval 1.5
 DOSBlockingPeriod 10
 DOSLogDir "/var/log/apache2/evasive"

This config seems to be optimal for me.

Step4. Enable the module and restart apache:

a2enmod mod-evasive
 /etc/init.d/apache2 restart


In the following tutorial i will describe the steps to optimize the performance of a MySQL database with the mysqltuner script:

Step1. Download the mysqltuner script:

cd /usr/bin
 chmod +x

Step2.  Run mysqltuner:

[email protected]:~# /usr/bin/

Enter the root as username and the  password and you will get a output like this:

[email protected]:~# /usr/bin/

>>  MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>>  Bug reports, feature requests, and downloads at
>>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.58-1~dotdeb.1
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM

Continue Reading…

Wine 1.3.31 Released

Valic —  October 22, 2011 — Leave a comment
The Wine development release 1.3.31 is now available.

What's new in this release (see below for details):
  - BiDi text support in the single-line edit control.
  - Support for StretchDIBits and AlphaBlend in the DIB engine.
  - A number of audio fixes.
  - VBScript improvements.
  - Various bug fixes.

The source is available from the following locations:

Binary packages for various distributions will be available from:

You will find documentation on

You can also get the current source directly from the git
repository. Check for details.

Wine is available thanks to the work of many people. See the file
AUTHORS in the distribution for the complete list.

For more info see:

Bash: Check if you are root

Valic —  October 20, 2011 — 1 Comment

Using the following you can check if you are root or not when you run bash scripts.

Exmaple 1:

if [ $(whoami) != 'root' ]; then
echo "Must be root to run $0"
exit 1;

Example 2:

ROOT_UID=0 # Only users with $UID 0 have root privileges.
E_NOTROOT=87 # Non-root exit error.

if [ "$UID" -ne "$ROOT_UID" ]
echo "Must be root to run this script!"
echo "You are root!"

You can also use this in your bash scripts.

Page 1 of 3123