Dec 20

Many editor on Ubuntu such as vim, ed, nano. But default editor is nano. I need to change to vim or anything else. The easiest way is use update-alternatives, which can config anything in /etc/alternatives/. Then can change default editor with

sudo update-alternatives --config editor

Here’s example when you run this command

There are 3 alternatives which provide `editor’.

Selection Alternative
———————————————–
*+ 1 /bin/nano
2 /bin/ed
3 /usr/bin/vim

Press enter to keep the default[*], or type selection number: 3

You can select with type number and then enter to change it.

written by Mr-San \\ tags: , ,

Dec 12

I have fix some problem with my mail server when mail detected with spam in anti-spam gateway, I don’t need to scan again and don’t want to set that ip to RELAYCLIENT in tcp.smtp

With tcp.smtp
x.x.x.x is ip can relay with your mail server and not scan with spamassassin
x.x.x.x:allow,RELAYCLIENT=""

Other case if you want scan with spamassassin you can set with
x.x.x.x:allow,RELAYCLIENT="",QS_SPAMASSASSIN="yes"

But in this case I use
x.x.x.x:allow,BYPASS_SPAMASSASSIN=”on”

And insert this code in /var/qmail/bin/qmail-scanner-queue.pl
if (defined($ENV{'BYPASS_SPAMASSASSIN'})) {
&debug("spamassassin: don't scan as BYPASS_SPAMASSASSIN");
&minidebug("SA: don't scan as BYPASS_SPAMASSASSIN") if (!$scanned);
return;
}

at line 3349 in spamassassin function
and line 3450 in spamassassin_alt function

Don’t forget to rebuid tcp.smtp and make backup with qmail-scanner-queue.pl

written by Mr-San \\ tags: , , ,

Dec 06

I found mysql have binary log and consume a lot of disk space, how to clear that I use log-bin instead of log file?

I search with google and I found RESET command with option MASTER

RESET MASTER

It used for deletes all binary logs listed in the index file, resets the binary log index file to be empty, and creates a new binary log file.

written by Mr-San \\ tags: ,

Dec 04

After upgrade to Dapper, I found some problem with mysql (mysql-4.1.15) with thai language. My webpage display thai font to ???, why and why? When I try to re-import db and test with set names, it cannot solve my problem because my blog is UTF-8.

Then I found some option with skip-character-set-client-handshake in my.cnf (mysqld option) it can solve this problem and bring my web site back. Why?

This option is include in mysql-4.1.15 (Ooh, in Changelog) it used to ignore client information and use the default server character set.

written by Mr-San \\ tags: , ,

Nov 12

วันนี้เจอ วิธีการเช็คระบบของโทรศัพท์มือถือ จากกระดาษที่น้องจดเอาไว้

วิธีการเช็ค IMEI ของโทรศัพท์

*#06#

วิธีการตรวจสอบระบบ และข้อมูลต่างๆ ของระบบ

ขวา*ซ้ายซ้าย*ซ้าย*

written by Mr-San \\ tags: , ,