The blog of PEPrasetya

Here is my journal, I'm just to use this as journal of my work, to keep remember what i found in doing my day to day work. So i'm not really mean to make a nice blog, but hope this may help some people too.

Monday, December 29, 2008

Linux Cache

Linux have feature cache that should make everything runs better for multiple process call. But in some condition the cache could not been flushed as more application need it.

You can run this command, to clear the caches, so freeing up much memory:

sync; echo 3 > /proc/sys/vm/drop_caches

Friday, December 05, 2008

Moving Mac OS X Data and OS to new HardDrive

Today i'm just have a new expereience in replacing Powerbook G4 Harddrive with a new one.
At first, you can use USB Harddrive adapter for the new harddrive then boot normally to the Mac OS X. The Powerbook that I use is still on version 1.5.4 (Tiger).

Then according to some tutorial you can use Carbon Copy Cloner or SuperDuper!.
Just copy all the entire Harddrive contetnt of the OS to a new one that connected via USB.

Some tricky part, as I was using Carbon Copy Cloner, it tell that the Powerbook G4 could not boot via USB, thus it may not setting up the Boot media on the target Harddrive.

To enable the target harddrive as boot media, you have to bless it. (BSD derivative, bless is to Set volume bootability and startup disk) The command is:
sudo bless -folder /Volumes/TARGET VOLUME NAME/System/Library/CoreServices
Now the target harddrive is bootable from your powerbook, and you can continue to exchange the harddrive.

Additional note:
Instead of using Carbon Copy Cloner or SuperDuper!, you can copy all the content of your harddrive with command:
sudo asr -source /Volumes/OSX BOOT VOLUME NAME/ -target /Volumes/TARGET VOLUME NAME/
The command will resulted:
asr: did not copy blessed information to target, which may have missing or out-of-date blessed folder information.
And it's normal, just continue with blessing the target harddrive with previous command.

Thursday, October 16, 2008

Force send queue mail in qmail (used in smeserver)

I'm just need to force the qmail that used in smeserver to process all the queue email.
This is usefull when you have internet connection problem or any problem that make the mail server pending all outgoing mail. After there is ix to the problem, you need to force send all the pending mail

cd /var/qmail/bin
./qmail-qstat
./qmail-qread
./qmail-tcpok
ps axl|grep qmail-send
kill -s ALRM nnn

replace the nnn with value you see on ps axl command

Friday, October 10, 2008

Importing CSV to mysql

I'm just trying to import csv file to mysql table database. 
Here is the command:

load data local infile 'csv file
into table target table 
fields terminated by ','
ignore 1 lines;

The basic command to import data is "load data"
To read your file you can use the "local infile 'your.csv'"
Then you need to specify what delimeter of each file in your file by "fields terminated by ','"
To ignore header field, use "ignore 1 lines"