Screen brightness reset in Ubuntu

My Ubuntu laptop’s screen brightness resets everytime after reboot. I have found a way to make the brightness adjustment ‘stay permantly’:

1) Adjust the brightness to the level that I like, then run ‘cat /sys/class/backlight/acpi_video0/brightness ‘. The command will return the brightness level in a integer value. Mine is 12.
2) Add the line ‘echo 12 > /sys/class/backlight/acpi_video0/brightness‘ into the /etc/rc.local file.

Fortinet SSL VPN Client in Ubuntu

It is intereting that the Fortinet SSL VPN client works fine in my Windows machine, but does not work in my Ubuntu laptop. I have found the reason is that a few routes are missed in the routing table. To make it work, I wrote a script to manually add those routes after VPN is connected.

Create an executable file named VPN under /usr/local/bin. Next time just run the command VPN to connect vpn and add routes.


# Start VPN

# Check if ppp0 is ready
while ! ifconfig  | grep ppp0 >/dev/null 2>&1
echo VPN is connecting…
sleep 3

# Add routes
IP=`ifconfig ppp0 | grep ‘inet addr’ | awk ‘{print $2}’ | cut -d’:’ -f2`
sudo route add -net gw $IP dev ppp0
sudo route add -net gw $IP dev ppp0

Auto Configure Proxy in Ubuntu

It is painful to turn the proxy on and off in my Ubuntu laptop between office and home.  As a lazy guy, I would like to make it automatic. Easy life now :)
1) Create 3 scripts named proxy_on, proxy_off and check_proxy under /usr/local/bin.
gsettings set org.gnome.system.proxy.socks host ‘’
gsettings set org.gnome.system.proxy.socks port 80
gsettings set org.gnome.system.proxy mode ‘manual’
gsettings set org.gnome.system.proxy mode ‘none’

ping_test=`ping -c 2 | grep bytes | wc -l`
if [ "$ping_test" -gt 1 ]; then

2) Add check_proxy to the auto startup programes by creating the file ~/.config/autostart/check_proxy.desktop
[Desktop Entry]

Check ESX Plugin for Nagios

Check ESX is a plugin developed by op5 to primarily be used with op5 Monitor, but can also be used in Nagios installations, to monitor VMware ESX and vSphere servers. You can monitor either a single ESX(i)/vSphere server or a VMware VirtualCenter/vCenter Server and individual virtual machines. If you have a VMware cluster you should monitor the data center (VMware VirtualCenter/vCenter Server) and not the ESX/vSphere servers by them self.


Check ESX Plugin
Monitor VMware ESXi with your existing Nagios application

Install WordPress on CentOS 6.3

Steps of installing WordPress on CentOS 6.3 minimal installation.

1) Install prerequisite packages.

[root@CentOS ~]# yum -y install php php-mysql mysql* wget unzip


2) Download the latest version of WordPress.

[root@CentOS ~]# wget
[root@CentOS ~]# unzip
[root@CentOS ~]# mv wordpress/ /var/www/html/

3) Configure mysql database server.

[root@CentOS ~]# service mysqld start
[root@CentOS ~]# mysql -u root –p

mysql>  CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “wordpress”;
mysql> exit

Test the newly created wordpress user
[root@CentOS ~]# mysql -u wordpress -p


4) Configure the mysql DB connection info in wordpress configuration file.

[root@CentOS html]# cd /var/www/html/wordpress/
[root@CentOS wordpress]# cp wp-config-sample.php wp-config.php

Edit wp-config.php file, the secret key be obtained from


5) Configure the WordPress virtual directory in Apache.

[root@CentOS html]# vi /etc/httpd/conf/httpd.conf

# WordPress home folder
Alias /wp/ “/var/www/html/wordpress/”
<Directory “/var/www/html/wordpress”>
Order allow,deny
Allow from all

[root@CentOS wordpress]# service httpd restart

6) Go to the WordPress configuration page – http://centos/wp/wp-admin/install.php