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.
Tuesday, April 13, 2010
Zimbra - List all Members in Distribution List
Somebody asked me how to list all members in a distribution list and put it in a text file. Well, you can't do it in web interface of course, but you can do it using command line. Login as root to your zimbra server and issue this command
zmprov gdl youlist@yourdomain.com > yourtextfile.txt
simple isn't it. Transfer the text file you just created using any secure file transfer software (i.e winscp, filezilla). Then import it to your Excel using delimited to seperate email and non-email column, delete unused column and walllahhhhhhhh...
zmprov gdl youlist@yourdomain.com > yourtextfile.txt
simple isn't it. Transfer the text file you just created using any secure file transfer software (i.e winscp, filezilla). Then import it to your Excel using delimited to seperate email and non-email column, delete unused column and walllahhhhhhhh...
Thursday, September 18, 2008
Macross Frontiers Again and Bleach
Dah tengok Macross Frontiers sampai episode 23. Getting better and better.. arrrgghhh .. pe lambat sangat Lunar keluarkan episode 24 (bukan salah Lunar pun, dah cite tu tak tayang lagi kat TV, camna depa nak translate.)
Bleach dah masuk episode 188. Still filler lagi.. Cite filler nie pasal Captain Amagai yang nak balas dendam sebab Yamamoto bunuh bapak dia dulu. Next episode habis la kot. Boleh sambung balik kisah Ichigo pi ke Hueco Mondo.. yeahhhhhhh...
Bleach dah masuk episode 188. Still filler lagi.. Cite filler nie pasal Captain Amagai yang nak balas dendam sebab Yamamoto bunuh bapak dia dulu. Next episode habis la kot. Boleh sambung balik kisah Ichigo pi ke Hueco Mondo.. yeahhhhhhh...
Linux Command - ls
Arahan linux yang selalu diguna pakai ialah ls. ls nie kalau tanya man, ini dia jawab :
ls - list directory contents
so, kerja dia ialah menyenaraikan kandungan direktori. Opsyen juga boleh digunakan:
ls -a -> senarai semua termasuk fail tersembunyi.
ls -l -> senarai file menggunakan format yang panjang.
opsyen ini buleh digabungkan. Contoh:
ls -al -> senarai semua fail menggunakan format yang panjang.
ls - list directory contents
so, kerja dia ialah menyenaraikan kandungan direktori. Opsyen juga boleh digunakan:
ls -a -> senarai semua termasuk fail tersembunyi.
ls -l -> senarai file menggunakan format yang panjang.
opsyen ini buleh digabungkan. Contoh:
ls -al -> senarai semua fail menggunakan format yang panjang.
Wednesday, August 13, 2008
Uncle's Death
AL-FATIHAH to my uncle who passed away yesterday afternoon. I went back to Penang to show my last respect to him.
Sunday, July 20, 2008
WISE Ku
Lupa lak nak cerita, WISE merah kesayangan aku tu masuk bengkel. Memula aku hantar tu sebab ada leaking minyak hitam. Aku hantar kat Bengkel Loy kat Ulu Bernam. Sekali tokey dia, Tan call, cakap piston ring ada problem, minyak itam masuk ke kebuk pembakaran. Sebab tu minyak kereta aku 2 minggu je tahan. Dia tanya mau buat, aku pun ok la.. dah cuci semua, tukaq minyak itam semi sintetik, itu ini. Sekali bila dah siap, Tan call aku, dia cakap cost semua dalam rm1800. Pehhhh.. cam nak pengsan aa... tapi tak pengsan la. Dah ambik, bawak seminggu, ekzos lak bising. Pi tukaq la.. sekali berlubang la tabung ekzos aku tu, patutla bising. So jumlah keseluruhan ialah RM2160. Lepas tu, tayar pun dah botak 4-4. Untuk menjimatkan duit, aku tukaq la tayar Silverstone Evol8 (RM240 sebijik). Dulu aku pakai Bridgestone My01 (rm280 sebijik). Habis duit aku. Waaaaa..... Kalau aku jumpa resit baiki semua nie, aku list down apa aku tukaq.
Macross Frontiers
Waaaaaaaaahhhh.. Best aa tgk anime Macross Frontiers. Although takdak kesinambungan karektor dari Robotech, anime nie memang best. Tapi baru ep 14 aa... tak habis lagi. Tak sure lak sampai berapa ep. Jgn jadi cam Bleach dah la.. dah ep 180.
Subscribe to:
Posts (Atom)