Archive for the ‘CentOS’ Category.

Migrating GPG keys

As I am storing backup remotely, I used GPG to encrypt my stuff on-the-fly using duplicity.

Due to the upgrading of the current machine to a more powerful machine, I need to move my GPG keys too.

Here is how I do it.

List the available GPG key in the store.

 
[root@svr ~]# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub   1024D/A1FC0247 2011-01-07
uid                  tanfwc <tanfwc @happylife.sg>
sub   2048g/F96387B6 2011-01-07
</tanfwc>

Let’s export the keys accordingly.
Continue reading ‘Migrating GPG keys’ »

Cluster Glue

As I am installing Cluster Glue, I bump into the following error. I was looking around the Internet and unable to find a answer thus I have to look into what package CentOS build libuuid into :)

Problem:

./.libs/libplumb.so: undefined reference to `uuid_parse'
./.libs/libplumb.so: undefined reference to `uuid_generate'
./.libs/libplumb.so: undefined reference to `uuid_copy'
./.libs/libplumb.so: undefined reference to `uuid_is_null'
./.libs/libplumb.so: undefined reference to `uuid_unparse'
./.libs/libplumb.so: undefined reference to `uuid_clear'

Solution:

yum install -y e2fsprogs-devel

Hope the above helps someone out there.

Changing Linux Network Interface Bonding

WARNING: The following steps will stop your network interface, please ensure that you have KVM-Over-IP before attempting to do it remotely.

If you ever had to change the bonding type while the server is live, follow the steps:

[db2:/root]# ifdown bond0
[db2:/root]# modprobe -r bonding
[db2:/root]# modprobe bonding mode=1 miimon=100
[db2:/root]# ifup bond0
[db2:/root]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
 
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
 
Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 
 
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr:

Hope this helps someone out there.

Detecting Creative Sound Card in Linux

As I am working on a project where I need to play external audio into a application, as you are aware that dealing with audio in Linux can be challenging.

As such, here is a simple solution to it =)

My test environment:
CentOS 5.5 64bit
Creative Blaster S80490 (USB)

yum install -y alsa-utils

Once I installed Advanced Linux Sound Architecture (known as ALSA), I can run the following command to see whether my audio is detected by the system.

[root@localhost src]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: External [SB Live! 24-bit External], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I got my audio devices detected by the Linux system. So now, I can move on to the next stage of integrating into my applications now. :)

Hope this helps someone out there…

Windows 7 cause “mount: Cannot allocate memory”

Had a friend who want to backup all his files (300GB+) from a Linux server to a laptop harddisk, we hit with a error message that cause Linux unable to mount the shared folder in laptop.

Problem:

[root@localhost ~]# mount -t cifs "//192.168.1.10/abc" -o username=admin,password=1234
ed /mnt/laptop/
mount: Cannot allocate memory

The server has at least 3GB cached RAM available in the memory pool. So that’s not possible with memory issues.

Take a look at dmesg and you should see this error

Oct  3 00:33:18 localhost kernel:  CIFS VFS: Send error in SessSetup = -12
Oct  3 00:33:18 localhost kernel:  CIFS VFS: cifs_mount failed w/return code = -12

If you have the above error, most likely it is due to your Windows 7 machine. Let’s move to the Windows 7 and troubleshoot.
Continue reading ‘Windows 7 cause “mount: Cannot allocate memory”’ »

WARNING: mismatch_cnt is not 0 on /dev/md0

I was about to head to bed when I receive a disturbing email from my BlackBerry phone.

A email from weekly cron.d send me this:

WARNING: mismatch_cnt is not 0 on /dev/md0

A quick command shows that the RAID array (md0) is the number of
unsynchronized blocks in the raid.

As you can see below, md0 is having 128 count of unsynchronized blocks.

[svr4:/root]# cat /sys/block/md0/md/mismatch_cnt
128
[svr4:/root]# cat /sys/block/md1/md/mismatch_cnt
0

Let’s attempt to fix it.
Continue reading ‘WARNING: mismatch_cnt is not 0 on /dev/md0’ »

3ware Controller soft-reset

Problems:

sd 0:0:0:0: WARNING: (0x06:0x002C): Command (0x2a) timed out, resetting card.
3w-9xxx: scsi0: AEN: INFO (0x04:0x005E): Cache synchronization completed:unit=0.
sd 0:0:0:0: WARNING: (0x06:0x002C): Command (0x28) timed out, resetting card.
3w-9xxx: scsi0: AEN: INFO (0x04:0x005E): Cache synchronization completed:unit=0.

As I am facing soft-reset on my controller card, the latest version of the firmware will fix the problem.
Continue reading ‘3ware Controller soft-reset’ »

Kloxo lxadmin reset password

To reset lxadmin, you can do through SSH with just two commands.

cd /usr/local/lxlabs/lxadmin/httpdocs
lphp.exe ../bin/common/resetpassword.php master mypassword

Enjoy!

Force fsck on reboot

Sometimes if you suspect your file system is corrupted, you might want to run fsck to check against the file system. You just need to create a simple file at the root partition.

touch /forcefsck
reboot

Simple and easy =)

Manager of pid-file quit without updating file

[adserver1:~]# service mysql start
Starting MySQL..Manager of pid-file quit without updating file [FAILED]

A silly mistake by me as I forget to disable the selinux after a fresh installation of a ad server =)

Hope this helps …