Archive for the ‘Application’ Category

Building PHP Web App in 15 minutes with Symfony Framework

Monday, August 23rd, 2010

Last year, I gave a talk at Coscup 2009, an Open Source Conference in Taipei on PHP web development with Symfony Framework.

You might interested to know what Symfony can help on rapid development on PHP, and here are the videos. Thanks to Coscup fellow and they are really helpful. Sadly can’t be there this year for Coscup 2010.

How to Install Cacti Plugin Architecture

Tuesday, August 17th, 2010

Cacti Plugin Architecture allow you to run useful monitoring plugins on Cacti. There are several good plugins like Thold, Aggregator and Weathermap which give you comprehensive network device monitoring.

There are a few steps involve In order to install Cacti Plugin Architecture. First we will need to backup current cacti files, and overwrite the files for Cacti Plugin Architecture and lastly to make some changes on configuration files in order to activate Cacti Plugin Architecture.

Installing Cacti Plugin Architecture

Cacti Plugin Architecture can be downloaded at Cacti Users website. The demo I am going to show is to download Cacti Plugin Architecture version 2.8 on Cacti version 0.8.7g.

Before installing Cacti Plugin Architecture, lets make a backup copy of your cacti files, in case something goes wrong, you can roll back to the original files. During the backup, we are going to exclude rra and log directory.

First change directory to the directory which located Cacti files, in FreeBSD would be /usr/local/share


shell> cd /usr/local/share
shell> tar -zcf cacti.backup.tar.gz --exclude=rra --exclude=log cacti

After backup, it’s now safe to replace your cacti files with cacti architecture files. First untar Cacti Plugin Architecture which you have downloaded earlier.


shell> tar -zxf cacti-plugin-0.8.7g-PA-v2.8.tar.gz

After untar-ed cd to plugin architecture folder and edit config.php.dist file with your mysql database credentials. Follow with rename the file to config.php


shell> tar -zxf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
shell> cd cacti-plugin-arch
shell> vi include/config.php.dist
shell> mv include/config.php.dist include/config.php

In include/global.php, edit MySQL database credentials as well.


shell> vi include/global.php

Next, create the database table which required by Plugin Architecture. The file is located at cacti-plugin-arch directory with file name pa.sql.


shell> mysql -u username -p cacti < pa.sql

Now, it's all good, copy all the files into cacti directory. You cacti directory might be different from mine directory path.


shell> cp -rf * /usr/local/share/cacti/

The installation for Cacti Plugin Architecture is done. In order to access to Plugin Setting. Log on to Cacti, go to User Management, click on Admin, check Plugin Management on realm management and Save.

You should see Plugin Management on your left menu bar. On the next post we will go through the plugins for Cacti Plugin Architecture.

SSH Client on Blackberry

Friday, April 2nd, 2010

Is there any SSH client for Blackberry phone? Definitely yes, I am using BBSSH as SSH client on Blackberry. BBSSH is free and it runs on latest Blackberry OS, I do remote SSH to server to do some health check. BBSSH supports both SSH1 and SSH2.

BBSSH Features

Some of the features on BBSSH

  • Adding Multiple Connection – You can add multiple connection on BBSSH and the connection will be saved for convenience access.
  • Multiple Session at one time – You can access to multiple server at the same time, and you are also able to switch over to other session from time to time.
  • Support shortcut keys like Ctrl + D – You can invoke normal Ctrl + D key with Sym + D as a shortcut to log out or Sym + Up to scroll back history and etc.

Connection Error

When I first setup a new connection, I was having difficulty to connect to the server, getting error message like “Notice: APN is not specified”. You need to enable APN at Options > Advance Options >TCP/IP > and check APN Settings Enabled. You can leave the authentication username and password empty.

Connect on Custom SSH port

There is no option to configure custom SSH port. You can set the hostname as yourhostname.com:customport, for example example.com:8383

I hope you enjoy SSH on Blackberry with BBSSH as much as I do!

Chinese Simplified PinYin Input Doesn’t Work on Blackberry OS 5.0.0.x

Tuesday, March 30th, 2010

Recently I have upgraded to Blackberry OS version 5.0. Everything works except for Chinese Pin Yin input where it supposes can be swap between English and Chinese. Chinese Simplified PinYin input is installed and I am able to read Chinese Characters but the language switching options cannot be seen at Options > Language and Text Input.

My model is Blackberry Bold 9000, running on latest OS v5.0.0.454 (Platform 5.2.0.41). Suspect that Application Center is crash with Chinese PinYin Input. If you have the similar problem, try to make it works by following the steps below with Blackberry Desktop Manager.

  • First, remove Application Center from your Blackberry.
  • After Application Center has been removed, install East Asian Characters and Font Support > Simplified Chinese Characters and Font Support
  • Try to do Alt + Enter, you should able to switch between English and Chinese Simplified Pin Yin

Please do share if you have others workaround.

Configure Smarthost SMTP Authentication on Postfix

Friday, March 26th, 2010

My machine at home cannot send email using port 25, end up I got to do smart host SMTP authentication on Port 587 means your machine will connect to your public mail server, and from your public mail server deliver the email to recipient. Let’s do some simple Smarthost SMTP authenication on Postfix. The example is Postfix on Linux Ubuntu server.

Create Authentication Password File For Postfix

Create a password file which require authentication on your mail server.


shell> vi /etc/postfix/smarthosts.conf

#mailserver username password
mail.example.com test 123123

Save the file and perform some simple permission settings.


shell> cd /etc/postfix
shell> chown root:root smarthosts.conf
shell> chmod 0600 smarthosts.conf
shell> postmap hash:$P

Now you have done with SMTP server authentication configuration file.

Configure Smart Relay on Postfix

Fire up Postfix’s main.cf config file


vi /etc/postfix/main.cf

Paste the config below on the bottom of the configuration


relayhost = mail.example.com:587
# smtp_sasl_auth_enable = yes
smtp_auth_enable = yes
# smtp_sasl_password_maps = hash:/etc/postfix/smarthosts.conf
smtp_password_maps = hash:/etc/postfix/smarthosts.conf

relayhost is the your server address and with port 587, in case your ISP is blocking port 25. You can use either plain password authentication or SASL authentication, depend on what type of authentication does your server support.

Save it and reload Postfix Service


shell> /etc/init.d/postfix reload

Perform the testing on your newly configured SMTP Smart Host Authentication


shell> echo 'Hello World' > /tmp/hello
shell> mail -s 'Hello World' test@example.com < /tmp/hello
shell> rm -f /tmp/hello

Check on the mail server log on delivery status.


shell> tail -F /var/log/mail.log
Mar 25 22:42:43 dummyserver postfix/pickup[6747]: 755A441202: uid=0 from=
Mar 25 22:42:43 dummyserver postfix/cleanup[6772]: 755A441202: message-id=<20100325144243.755A441202@dummyserver.WAG160N>
Mar 25 22:42:43 dummyserver postfix/qmgr[6748]: 755A441202: from=, size=305, nrcpt=1 (queue active)
Mar 25 22:42:54 dummyserver postfix/smtp[6775]: 755A441202: to=, relay=mail.example.com[203.222.222.222]:587, delay=11, delays=0.12/0.01/10/0.99, dsn=2.0.0, status=sent (250 OK id=1NuoGu-000PGq-6l)
Mar 25 22:42:54 dummyserver postfix/qmgr[6748]: 755A441202: removed

If the status is sent, it means your smart host is working well.