Monday, April 11, 2011

Wireless Captive Portal

Thinking of setting up a wireless network using Aruba Controller with captive portal. Yes, Aruba Controller has captive portal system but not to my liking. So I decided to use pfsense firewall again. I'll sketch the diagram and post it here later.

Monday, April 4, 2011

IPv6

I succeeded in making a tunnel to enable IPv6 connectivity from my test site. I'm using HE.net tunnel (http://tunnelbroker.net/) and pfsense firewall as the router/firewall. Here is the guide I used to configure the tunnel from pfsense.

Tuesday, March 29, 2011

Centos Yum

Yum can be use to install packages in Centos. Default repository will be pointing to the nearest repository servers. You can add additional repository like this. First search for repository. Here is one of repository for RH and Centos : http://www.jasonlitka.com/yum-repository/

After adding new repository, just issue

yum list

This will update yum cache and will list all packages available to all repositories.

Then, you can just install the packages. For example :

yum install ntp

Will install ntp package.

To update all packages,

yum update

Bare in mind that to use yum command on RH, you must have a valid subscription to Redhat Network.

Tail Command

What if you want to view just last 100 lines of a log file? You can use tail command. Tail command is a pretty handy command to view text file.

Example :
tail -n 100 /var/log/messages

You can also use this command to view text file and it will display last line plus incoming log as it is written.

Example :
tail -f /var/log/messages

Try these examples yourself and see what is the output.

Sunday, March 27, 2011

Mysql - flush-hosts

My organization's mysql server always needed to execute mysqladmin -flush-hosts command (1 week interval). I don't want to do that everytime our web server could't contact its database server. So what am I to do? Well, I tried using cron but the mysql server need to be authenticate to run mysqladmin command. At last, I found one solution. EXPECT! How?

Make sure you install expect in your mysql server (Centos Linux). Just issue command

yum install expect

Then, make a script file like this:

#!/usr/bin/expect
set timeout 20
spawn /usr/bin/mysqladmin -p flush-hosts

expect "Enter password: "
send "yourmysqlrootpasswd\r\n"

save this script and add this script to run in cronjob.

That's it. Done. You might want to chmod this script to 700 first.