Monday, December 14, 2009

Directory at /var/spool/clientmqueue/ consume a lot space

When a linux server does not allow sendmail port out but the service is running..
it will cause all the mail is in queue at the /var/spool/clientmqueue/..
due the mail cannot send out..
When left it like this all the time..
It will consume a large hard disk space..
what I face at here was, this directory had consume about 6G of the hard disk space..

When I run ls at the path, the server will hang..
nothing is about come out... for about roughly 1 or 2 hour or longer..
But when I df -h, the /var directory still have 2G available..
Although there had space but nothing can be start due to the error "not enough space to run services"..

What I can do is.. I try rm -rf * at the /var/spool/clientmqueue/..
"argument list too long error will appear"
Therefore, have to manually rm -rf one by one of the file with the mask attribute (*) at the send... example rm -rf Qm3w*
But this way consume a lot of energy and time.. and the space not decrease also..
Is totally waste of time..
So I try browse and google... I found out.. some solution.

Due to I not using sendmail at all.. I will disable the sendmail service.
By rename the file /etc/mail/submit.cf to /etc/mail/submit.cf.bak
Then I restart the sendmail service... The service cannot be start due to the
"Starting sm-client: /etc/mail/submit.cf: line 0: cannot open: No such file or directory"

Therefore.. my sendmail will not run anymore... Then I deal with the /var/spool/clientmqueue/ path by deleting all the file inside...
I use this command at /var/spool/clientmqueue/
"find . -type f -exec rm {} \;"

Left it run overnight.. and... the file at the directory is completely deleted...

Sunday, June 28, 2009

Wubi - ubuntu installer

New to ubuntu? not used to ubuntu environment yet?
Dont want use virtual machine for ubuntu?

No need to worry, there is WUBI... an ubuntu installer..
Wubi can help you install the ubuntu in your hard disk and make it dual boot loader.
You can choose either to boot into ubuntu or your current windows..


Wubi is an officially supported Ubuntu installer for Windows users that can bring you to the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!


Very simple step..
get yourself the wubi installer at here and the ubuntu desktop cd at here.

Then.. insert the ubuntu desktop CD to the CD-ROM and run the wubi installer..
It will ask where you wish to install the ubuntu.
Just follow the instruction... It will guide all the process..
Once done.. when you reboot your PC/ Laptop, the boot menu will ask which OS you wish to boot into..

That all.. you can experience ubuntu on your PC.. without touching on the current windows..
If not satisfy or want to uninstall the ubuntu, you can just re-run the wubi installer.

Wubi Website

Wubi installer

Monday, June 22, 2009

Find words in each files..

This is something useful command when you want to scan hundreds of file for 1 specified words..
Such as.. you have thousands of files.. and you want to check which file consists "kame" words inside the files..
This is the commands..

grep -n -r 'kame' *

Sunday, June 21, 2009

NTLDR is missing..

Sometimes.. It is very common to see such missing or file corrupt for windows..
Just dont be panic.. everythings can be solved...
Most serious ma just FORMAT LOL..
That why, at least.. 2 partition will be made whenever I do the formatting..
1st Partition only store the Windows and Software..
No important data will store..
Which mean, My Document folder I wont use at all..
2nd partition will store all the important and personal data..
So.. when the main Windows file system corrupt..
Personal data at 2nd partition still safe..

Therefore.. when say whatever file is missing.. no harm.. just repair the windows whatever you like..
For this problem..

NTLDR is missing
Press Ctrl+Alt+Del to restart

What does NTLDR means and the function.. can be found at here
When this message appear after boot the windows..
What you need to do are:

1. Put OS Cd to the CD-ROM and boot into the CD.
2. Then enter to the repair mode which you need press "R".
3. Then you will require to choose which Windows to repair.. Choose "1" which is the main Windows.
4. It will require your Windows Administrator Passwords.. If you have then keyin, else just press "Enter".

Then you will enter the repair mode.. At here, you needs:

1. Run this 2 command..
copy e:\i386\ntldr c:\
copy e:\i386\ntdetect.com c:\
2. exit the repair mode and reboot.

After reboot, you will able to login to the Windows.. Then do some checking on the boot.ini file is it still at there or deleted. This file is located at:
Control Panel > System > Advanced > Startup and Recovery > Settings > System startup

If still exist, check the file is correct or not.. check the boot sequence is it Windows XP Pro/Home as main boot loader.

If not exist anymore..
Then just Edit and create a new boot.ini file.
Add this value into the file.

For Windows XP Professional:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

For Windows XP Home:
[Boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating system]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect


After do the changes on boot.ini.. Restart the Windows..
To make sure does the problem still exist or not...
For more info on boot.ini and the tuning.. Mayb can refer to here and here

Friday, June 5, 2009

Forget MySQL Root Password

It is normal to forget password when you have to remember so many diff and type password..
For MySQL, there are few way you can reset the root password..
But the main condition is.. you must have access to the physical server..
It can't be reset through mysql connection..

Here I will use 1 simple way which I prefer the most.

1. Check which mysql daemon need to reset. At here.. I want to reset mysql port 3306 which using the /etc/my5.cnf config file. Use command "netstat -ntulp" to check the running process and port.


2. Check the mysql /etc/my5.cnf daemon PID. Use command "ps aux | grep mysqld".


3. After identify the pid. Kill the process with "kill -9 db_pid".


4. Double check the mysql port 3306 had been killed or not.


5. Start the mysql with additional parameter "--skip-grant-tables".. which the command will be "mysqld_safe --defaults-file=/etc/my5.cnf --skip-grant-tables --user=root &".


6. Enter the mysql port 3306. It can be access without any password.


7. Now update the root password with new password with command "UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';".
Then flush the privileges with "flush privileges".

8. Shutdown the mysql with "mysqladmin -uroot -h127.0.0.1 -P3306 shutdown". At here.. since the grant-tables privileges not open yet, shutdown also does not require password.


9. Start back the mysql without the "--skip-grant-tables" parameter.



That all. The MySQL root password had been reset. Here is some reminder.. After reset, remember to restart the mysql without the skip-grant-tables.

Do not let anyone have access to the physical DB server, to avoid DB daemon is restart without knowledge.

Tuesday, May 26, 2009

Kernel Panic

One of the important server, frequently kernel panic.
Every few hours, after restart..
Will not responding and kernel panic again..
This server CD-ROM already defected..
I hardly can linux repair the kernel..

Things I can do also limited.. due to the not functioning CD-ROM..
But sometimes when i reboot this server..
It will have 1-3-2 beep sound which indicate the memory are not installed properly..
refer to here..
Another symptom on this server Dell Poweredge 1650..
was the BIOS screen is hang hang..

What I suspect:
1. Board defect.. which cause the BIOS hang..
2. Hard Disk defect.. due to the irq timeout..

What I had try to fixed this problem:
1. Remove the RAM.. and test the RAM pair at Bank 1.. This one can know which RAM is defected. And found out one of the 512MB RAM is defected which cause the BIOS screen hang hang.

2. Change the CD-ROM from other server. Try do linux repair.. Found out the message indicate the hda irq is timeout before change the CD-ROM.








In the end, after all the test.. Found out the main cause for the Kernel Panic was
1. 1 of the RAM is defect..
2. CD-ROM (hda) is defect..

After i remove the RAM and change the CD-ROM.. Everything is working fine..

Tuesday, April 28, 2009

Boot into Single-User Mode

There may have lots of source how to boot to single mode when Google. But my bad, my memory not good enough.. SO have to make a post to remind myself in future.

Boot in single mode in linux is almost equally with boot into safe mode in Windows. This step will be useful if using the GRUB boot loader. Single mode is useful when forget the root password or the server access.

1. When boot into linux, Press Enter when see the screen as below.


Press Enter when see this screen

2. Then choose which kernel version did you wish to boot as shown below. Press e to edit the kernel parameter.

Press e after choose the kernel version

3. When you see the screen as attachment, select the selection start with words kernel. Then press e to edit the line.

Press e to start edit the kernel parameter

4. Then go to the end of the line, and add the words single. This will indicate the kernel to boot into single mode. Once done, press Enter.

Type single at the end of the line

5. Now, press b to start boot with the new kernel parameter.

Press b to boot into single mode

That all.. you will be in single mode once the boot complete.

Monday, April 27, 2009

Network Address Translation

As I promised Poh Meng in a very boring Sunday, I will post this basic cisco commands for NAT as co-author for this blog, I appreciate Poh Meng for given me the chance to share my semi professional knowledge here, and hope you all find it useful for you.

Normally these IPs are given by ISP, and all these IP are:
WAN IP: 207.123.123.122 (Customer), 207.123.123.121 (ISP) <--- you have 207.123.123.120/30 here, normally first usable IP of this subnet - 207.123.123.121 is reside to ISP end, and second usable IP of this subnet will allocated to CPE
LAN IP: 62.14.139.132/29 <--- these IPs are given to customer by ISP as Internet IP address (registered IP)

OK, now we start the Cisco router part:
First we start with assign IP to each interface, both LAN and WAN.
=====Cisco Command=====
interface e0 or interface f0/0 (LAN interface)
ip address 192.168.0.1 255.255.255.0 <--- assign IP to interface
ip nat inside <--- define boundary of NAT
no shut

interface s0 (WAN interface)
ip address 207.123.123.122 255.255.255.252 <--- assign IP to interface
ip nat outside <--- define boundary of NAT
no shut

*Sorry for I may confuse you if you don't even know what is IP subnet or subnet mask, 255.255.255.252 behind IP address just a subnet mask for /30 subnet

ip route 0.0.0.0 0.0.0.0 207.123.123.121 <--- this is command for default route
access-list 10 permit 192.168.0.0 0.0.0.255 <---ACL to allow translation from LAN IP to WAN IP
ip nat pool WANIP 62.14.139.133 62.14.139.133 netmask 255.255.255.248 <--- IP nat pool, Start IP and End IP
ip nat inside source list 10 pool WANIP overload <--- to apply internal IP translation, overload to allow multiple LAN IPs translate to single WAN IP

DONE