วันพฤหัสบดีที่ 24 กุมภาพันธ์ พ.ศ. 2554

วันอังคารที่ 22 กุมภาพันธ์ พ.ศ. 2554

perc H200 hardware raid utility in linux

I just bought server coming with hardware raid PERC H200 (Dell).
By the time of this blog, I understand that it use chipset from LSI here are out put from

#lspci --n
LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] [1000:0072] (rev 03)

Unfortunately, the monitoring software for this h/w raid is not open. You have to download sas2ircu bin code. The program will display raid status.
I've downloaded from this link :

Please visit for usage:
http://hwraid.le-vert.net/wiki/LSIFusionMPTSAS2#a2.Linuxkerneldrivers

วันอังคารที่ 4 มกราคม พ.ศ. 2554

protecting web access with mod_auth

You can limit web access by password. Apache has module mod_auth* for you. It's easy.



1. create password file
# htpasswd -c /usr/local/apache/passwd/passwords rbowen
New password: mypassword
Re-type new password: mypassword
Adding password for user rbowen

for additional user just remove "-c"

2. add directive to apache (.httaccess or )
AuthType Basic
AuthName "Restricted Files"
# (Following line optional)
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
Require user rbowen

3. Restart apache and have fun!
If you have a problem, please investigate the error_log first.


More information :

วันพุธที่ 27 ตุลาคม พ.ศ. 2553

split /var/log/message log

I'm using gentoo and vixie-cron as a system cron. After using it for a while, I found that gentoo store cron log in to /var/log/message. And, I just kind of like to split this for monitoring easily. Here is what I have done.

edit this :
/etc/syslog-ng/syslog-ng.conf

add the following lines :
filter f_cron { facility (cron); };
destination cron { file("/var/log/cron.log"); };
log { source(src); filter(f_cron); destination(cron); };

reload syslog-ng :
/etc/init.d/syslog-ng reload

you may need to setting the logrotate. Please see the example in /etc/logrotate.d/ for example

วันอังคารที่ 19 ตุลาคม พ.ศ. 2553

terminal key map

Some ssh client need config for special button.
You can use this value to map the keyboard button to this value perform function properly.

Home \033[1~
Delete \033[3~
End \033[4~
Page Up \033[5~
Page Down \033[6~

วันพุธที่ 6 ตุลาคม พ.ศ. 2553

find command with -exec options

find command is quite a handy tool for file searching. It can also include an command to execute for matched file with

1) -exec command ;
2) -exec command {} +

Both are different.
Let say you have 3 files, a b c in the directory.

#find . -exec echo '{}' >> tmp1 \;
output in tmp1 will be :
.
./b
./a
./c
./tmp1

#find . -exec echo '{}' >> tmp2 \+;
output in tmp2 will be :
a b c

with + all matched file will be append and execute once.
with ; all matched file will be execute for each matching.