Archive for the ‘Systems’ Category

Disable Vulnerabilities Check in FreeBSD Portupgrade

Tuesday, July 19th, 2011

After perform FreeBSD portsnap, there are updates for PHP52 packages, but when I run portupgrade -vr php52*, it stopped and displayed portaudit error messages regarding php52 has vulnerabilities.

Which is weird to me because isn’t that the updates are suppose to fix the vulnerabilities?

To overcome the error building/upgrade the port, invoke the make argument by allowing the portupgrade


# portupgrade -vr -m DISABLE_VULNERABILITIES=yes php52*

This will ignore the vulnerabilities error message and continue with portupgrade of php52 packages. It can be use for other ports upgrade when you see the vulnerability error messages.

Convert EDT timezone to GMT timezone

Monday, July 11th, 2011

I am confused with several different timezones in the world. Planning to attend an online seminar but the date/time is stated in EDT, how do I convert into GMT+8, which is my country timezone?

I usually refer to the timezone conversion table at Eastern Time to GMT

For example let say the online seminar is happening at EDT 21:00, it will be 01:00, +8 which is 09:00 (the next day) in my country.

How to Change MySQL Data Directory in Linux Centos

Saturday, July 2nd, 2011

By default Linux CentOS or other Linux Distro installation, MySQL data directory is stored in /var/db/mysql, how can I change it to other directory in example /db/mysql?

It is always better to have MySQL Data Directory store in a specific partition/drive. It will help on performance and better management and scalability. You change change the data store directory in Linux by editing /etc/my.cnf file.

Edit /etc/my.cnf file


# vi /etc/my.cnf

Change the data directory structure


datadir=/db/mysql
socket=/db/mysql/mysql.sock

After the file has been updated, restart MySQL service.

How to Find Out Public IP Address via Command Line in Unix/Linux Machine

Tuesday, March 8th, 2011

If you have more than 100 servers in your network; behind a firewall; lazy to access to documentation. Here is the alternative option to find out your machine’s public IP Address via command line


$ wget -q -O - http://ipchicken.com |  grep -o -E '(^|[[:space:]])[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*([[:space:]]|$)'
# By default, FreeBSD doesn't have wget, you can use fetch instead
$ fetch -q -o - http://www.ipchicken.com | grep -o -E '(^|[[:space:]])[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*([[:space:]]|$)'

You need port 80 external/WAN access to perform the task.

How to Enable check_dns on Nagios Monitoring System

Friday, February 25th, 2011

Most user who are new to Nagios doesn’t know there is a hidden plug-in called check_dns in Nagios Monitoring system. On FreeBSD server, the binary can be found at /usr/local/libexec/nagios. List the directory and you should see check_dns.

check_dns usage is as below


$ ./check_dns -H host [-s server] [-a expected-address] [-A] [-t timeout] [-w warn] [-c crit]

Try to run the command as below and you will get the query result


$ ./check_dns -H systems.takizo.com -s 8.8.8.8
DNS OK: 0.012 seconds response time. systems.takizo.com returns 70.32.103.130|time=0.011703s;;;0.000000

(more…)