Sunday, May 8, 2011

Bugs I experienced with Natty

1. Bash auto-completion. This bug is described in https://bugs.launchpad.net/ubuntu/+source/bash/+bug/769866, the solution, which is also provided within the bug-post, is to change '-o default' on line 1587 of file /etc/bash_completion to '-o filenames'.

2. Compiz has 100% CPU usage after the machine resumes from sleep. No solution presented on the Internet yet. :-(

3. To be continued, even though I hope there will not be any more.

Wednesday, April 27, 2011

Thoughts on password preservation

Usually within the user authentication module of a system, username and password are preserved in a database or similar data structures, and moreover, the password should be encrypted first before being stored in the database for safety.

Here comes the issue about the encryption: should the encrypted password be associated with the username?
I don't know the answer (future work to do); but in my opinion, it should be.

Fact in User authentication of OpenNebula:
When doing the user authentication for oneadmin (default admin account), I always get the following error:
Error: [UserPoolInfo] User couldn't be authenticated, aborting call.
I digged deeper on this issue: I looked into the one.db and found that there is no password for oneadmin but I did set the password for it. Here is the output from user_pool table of one.db:
oid|user_name|password|enabled
0|oneadmin||1
 I fixed this in a stupid but effective way: by updating its password field with the encrypted password of another account (which has the same password), which means in this case, encrypted password is NOT associated with the username.

Additional notes to passwordless ssh login

There are plenty of tutorials about passwordless ssh login to remote machines. Here is a simple guide:
1. @local: Generate rsa key-pair (skip this step if it exists) with #ssh-keygen -t rsa
2. @local: Append the content in .ssh/id_rsa.pub to .ssh/authorized_keys on remote server
               #cat $HOME/.ssh/id_rsa.pub | ssh USER@REMOTE 'cat >> $HOME/.ssh/authorized_keys'
3. DONE

Additional notes:
SSH has a restricted requirement on the permission of $HOME directory on the remote machine. Here is something you need to check if the above method fails:

@remote: #chmod 755 $HOME
@remote: #chmod 700 $HOME/.ssh
@remote: #chmod 744 $HOME/.ssh/authorized_keys

Tuesday, March 8, 2011

Remove unused metrics from Ganglia

As described on the Ganglia wiki page (or IBM's related post), there are currently two ways to add customized metrics to ganglia (3.1.7):

  • Spoofing with gmetric
  • Writing loadable metric module with Python or C
Every time when we modify the module (or simply don't need it anymore), the old module will stay in the system, and a new figure corresponding to the module will be added (not updated) to the Ganglia front end. To remove the unused metrics, two approaches could be used here:

  • For gmetric: if you go through the man page of gmetric, you probably would notice the -d (--dmax) option which sets the expiration time of a metric if no new message is received within dmax seconds. It's default value is 0 which means this metric will never expire. To remove the unused metrics, just simply re-run the gmetric command with --dmax set to a positive integer.
  • For loadable modules: there is no simple way to do the job. Since each gmond multicast (default way) its information to the collector (gmetad), it probably has to kill not only the gmetad process and gmond process where this metric originates, but all gmond processes related to this multicast. The safest way is to kill all gmond and gmetad processes (if it's possible and easy to do). See this post for more details: