Monday, January 28, 2013

VirtualBox Guest Addition installation is hard on CentOS 6.3

Forgot how to install this very important tool, VirtualBox Guest Addition. But it has been a long time to remember what I did last time. Anyhow the installation for CentOS seems a bit hardcore than other Linux as it require me to recompiling the kernel.
VirtualBox Guest Additions on Fedora 17/18, CentOS/RHEL 6.3/5.8 VirtualBox Guest Additions is special software that can be installed inside Linux virtual machines to improve performance and make integration much more seamless. Among the features provided by these VirtualBox Guest Additions are mouse pointer integration and arbitrary screen solutions (e.g. by resizing the guest window).

Linux kernel is updated but VirtualBox is not update

Just did an upgrade on my Linux kernel to 3.7.3-101.fc17.x86_64 in my Fedora 17 anyhow this have cause my VirtualBox Linux kernel driver (vboxdrv) not able loaded. When I tried to load it manually /etc/sysconfig/modules/VirtualBox.modules, it failed and throwing me this rubbish:

ERROR: Module vboxdrv not found.
ERROR: Module vboxnetflt not found.
ERROR: Module vboxnetadp not found.

Then I tried this /etc/init.d/vboxdrv setup, I get this:

bash: /etc/init.d/vboxdrv: No such file or directory

I did also try VirtualBox-OSE-kmodsrc, follow by service vboxdrv setup, I get this:

Redirecting to /bin/systemctl setup  vboxdrv.service
Unknown operation 'setup'.

My last option is to check on the VirtualBox kernel module version, I found out that it is not up to date as it is still stick to the old version of 3.6.6. This remind me it did happened to me before long time ago where VirtualBox kernel module have to be update manually whenever Linux kernel is updated.

After this make a manual load and the VirtualBox is back to normal. What a mess ;o)

Sunday, January 27, 2013

Unable to connect to network in CentOS 6.3

When I was installing openldap-server and openldap-client in CentOS 6 inside VirtualBox, I was encountering following error.
Could not retrieve mirrorlist error was
14: PYCURL ERROR 6 - "Couldn't resolve host ''"
Error: Cannot find a valid baseurl for repo: base
Googling around only realize that the default installation doesn't configure to network interface, whereas it is configure to Network Manager. To fixed this, make sure following thing has been done.
  1. Attache to Bridge Adapter in VirtualBox network setting.
  2. Set NM_CONTROLLED="no" and ONBOOT="yes" in /etc/sysconfig/network-scripts/ifcfg-eth0.
  3. Last but not least, send a reboot command.
Cannot enable network after CentOS 6.3 fresh install The NM_Controlled option would be Network Manager controlled and that would mean that you would control interfaces through network manager vs the ifup, ifdown methods.
The option to include Bridged vs Nat in the virtalbox option will assign a separate ip address to your vm in the same ip network as your physical machine, while the nat option would translate the ip of your vm in your virtual network (inside the virtualbox) into the ip address of your physical machines. It's the same approach as NAT in a home lan connecting to the internet through one router.

Changing console font color in CentOS

The original look on the CentOS console is something like the image shown below, which is quite annoying.

Not a big deal. That can be adjust to more nicer look and feel.
Linux Console Color What you say? Yeah, I'm talking about coloring the 'linux console' - the little thing that you get when you login without X. Most people I know use a framebuffer. That's due to the fact that non-framebuffered text is huge by default. 

Thursday, January 24, 2013

Failed to configure LDAP on Fedora 17

A been following this tutorial to configure LDAP on my Fedora 17 for quite some time, anyhow I am not able to complete this tutorial as the targeted Fedora version in this tutorial is quite far behind (only last minute I aware of this). A lot have been change.
OpenLDAP How To (Fedora) This tutorial explains how you can set up centralised LDAP authentication for a network, covering both the setting up of the LDAP server and client. Whilst based on Fedora 13, it may also apply to other versions.

Debugging SSH shows success!!

This tutorial shows that I have successfully configure SSH. As I see the following output after this command ssh -vT
Error: Permission denied (publickey) This terribly nondescript error simply means that the server rejected your connection. There are a number of reasons this can happen, this guide will cover the most common causes.

Here is the output:
debug1: Connecting to [] port 22.
debug1: Connection established.
debug1: identity file /home/huahsin68/.ssh/id_rsa type 1
Hi huahsin68! You've successfully authenticated, but GitHub does not provide shell access.

Is the Github SSH tutorial correctly done?

According to this tutorial, I am sure I have successfully configure SSH. But why am I do still getting this error Permission Denied (publickey) when connecting to Can I use the same account ID for both in Gerrit?
Generating SSH Key If you have decided not to use the recommended HTTPS method, we can use SSH keys to establish a secure connection between your computer and GitHub. The steps below will walk you through generating an SSH key and then adding the public key to your GitHub account.

LibreOffice Gerrit configuration failed!

Spending my whole day setting up the Gerrit end up nothing is being done. When I issue the command ssh logerrit, I got this Permission denied (publickey). Whats went wrong?!!
Setting Yourself Up for Gerrit
  • login at (requires OpenID -- which you get for free with your google, yahoo, blogger, launchpad, flickr, wordpress, myspace account)
  • you must set your user name so: use your Freenode IRC nick as your Username in the "Profile". Users are associated by username -and- ssh key. This username is referenced as YOUR_USERNAME_HERE below.

Sunday, January 20, 2013

Configuring LDAP authentication into SVN on AIX

On last week, I have successfully configure Windows Active Directory authentication in our's new SVN server for the whole group of people. I'm feeling so great that I manage to configure this on a UNIX machine, AIX 7.1. Two components required on this setup, subversion, and Apache server. To ensure the correct version has to be install for AIX, I download all dependencies from this site. The installation was handle by rpm, every dependencies are install into /opt/freeware directory, basically not much worry on this, just use the default installation settings.

To configure the Subversion to have HTTP access will require Apache server to do this job for me. Once the Apache server has been installed, additional configuration need to be done on this file, httpd-subversion.conf located at /opt/freeware/etc/httpd/conf/extra. The same file can be used for Active Directory/LDAP authentication configuration, it is just right inside the same < Location > section. 
       DAV svn
       SVNParentPath /u01/svn
       SVNListParentPath off
       AuthType Basic
       AuthName "Huahsin Source Code Repository"
       AuthBasicProvider file ldap
       AuthBasicAuthoritative off
       AuthUserFile /opt/freeware/etc/httpd/conf/svn_auth_file
       AuthzLDAPAuthoritative off
       AuthLDAPURL "ldap://,dc=java?sAMAccountName?sub"
       AuthLDAPBindDN "CN=TestUser,OU=javagroup,DC=intralab,DC=java"
       AuthLDAPBindPassword Test123
       require valid-user
Assuming I'm connecting to an Active Directory server having this IP and port,, and the JAVA developer locate in the domain java.intranet will be granted access into the SVN. Thus the configuration will look like this.
Extra note on AuthLDAPBindDN and AuthLDAPBindPassword, this is the user account that dedicate for the SVN to get pass into Active Directory server authentication, without this the rest of the authentication will not get pass. AuthBasicProvider file ldap giving an option that first will look for the authentication inside /opt/freeware/etc/httpd/conf/svn_auth_file, if the user wasn't there, look into the Active Directory/LDAP server.

Sunday, January 13, 2013

invalid LOC header

I found a new error code while running my app using maven build, see this:
Failed to parse plugin descriptor for \
org.apache.maven.plugins:maven-war-plugin:2.1.1 \
(/home/huahsin68/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.jar): \
invalid LOC header (bad signature)
What happen?!! A post from has safe me on this problem. Simply remove m2 folder and download again the whole jars. How?!! Usually I'll use this mvn command to do the download but this round when I upgrade my Fedora box, all tools are gone!! sigh~ Luckily eclipse solve this problem for me, remember I have this maven Goal set: clean install tomcat:run-war? This will do the download during the build. Cheers~

Disable info log in WebSphere

Now I realize there is one problem with log4j. I have an info level log in my application, but when I set it to error level, the log still print out in SystemOut.log in WebSphere. Asking around the experts and they told me that there is work around on.

In WebSphere console, go to Logging and tracing > server1 > Diagnostic trace service > Change log detail levels > runtime tab. There is existing log in that look like this:

*=info: ConnLeakLogic=finest

this is the info log which belong to WebSphere, if it were disabled, SystemOut.log will be very clean. This is how I disable my info log configuration by append it to the existing one like this:

*=info: ConnLeakLogic=finest : org.huahsin.*=off

So whatever shit and rubbish belonging to org.huahsin package will be filter out.

Wednesday, January 9, 2013

Cryptographic Protocol is one of the Cryptography?

In the time before 1976, majority of the people were using secret key to hide a message, this secret is only known by the parties involved in transferring the message. This method is called Symmetric Algorithm. Since then different types of method has introduce to hide a message by using a public key and a secret key. This method is called Asymmetric Algorithm. These two algorithms are the main branches of Cryptography. Beside this, there is also another branch called Cryptographic Protocol, to be frank, I am not really sure what this have to do with the cryptography algorithm?

Monday, January 7, 2013

Forcing Solaris C compiler to use GCC

The C compiler that come together with Solaris always cause me an error. When I compiling the open source program, I get this output:

/usr/ucb/cc: language optional software package not installed

I have no way to remove this error even though I have update the makefile to use gcc. One way I could though of is to cheat the make program to use gcc by using a soft-link pointing cc to gcc. How? Here is the steps:

  1. Backup a copy of /usr/ucb/cc to /usr/ucb/cc.bak
  2. Make a soft-link to gcc. ln -s /usr/local/bin/gcc /usr/ucb/cc
I am not sure whether this is a good one or bad one? But the result is it works!

Handle data passing in JSF request scope

JSF2 has introduce a new feature called Flash. This feature allow the data to be pass in between different view even though these views are in request scope, thus saving memory in holding data in session scope. Read more on this site article.

Sunday, January 6, 2013

Windows 8 app introduction showcase

Developing an Windows 8 app is just as easy as one two three. See David Chou, evangelist at Microsoft, giving an introduction showcase about app development in Windows 8.

Writing beautiful code

To write a beautiful code, I need some guideline from the expert, and I found this article, Best Practices to write JUnit test, which pretty useful for me. Anyhow this answering my question what to test. If I work together with this article, Testing Support in Spring Framework, could answer my question on how to test?

I do not know the theory of XML

There are 10 popular XML Interview questions has to be aware of, especially I am JAVA programmer. Remember last time after my graduated I was attending an interview for a Web programmer position, I do not know how to answer this question: What is XML, What is DTD, and What is DOM although I know how to write the code. But interestingly I'm not able to answer this question and this seems that I don't even know the theory of XML.

What make up of LibreOffice patches review board?

Every time I involved in the LibreOffice code review session, there is a tool that could allow me to compare the code site by site, put in review comment, mark on the patches that has been reviewed. Then this review comment will then publish to everyone around the world. I am so curious how this cool feature could happen? My curiosity always lead me to explore some rubbish, good or bad, that could bring benefits to the world and in the same time, forgot about my task that I suppose to work on. 

I did a few search on Google and I found out it was an open source tool called Splinter. It was make from Python, and the source code can be clone from here but I'm not interest into that. I continue my searching and found out this casual writing about this tool, Splinter - Patch review for Bugzilla. Interesting to read.