Saturday, March 15, 2014

mqlicense unable to locate Java Program

In the recent WebSphere MQ version (v7.0.1.3 as of this writing) installation on Ubuntu 13.04, I have some difficulty issue in accepting the WebSphere license. The output shows that the JAVA program went missing. Below is the message being prompt for the missing JAVA program.
...

ERROR: No useable java programs at ./lap/jre/jre/bin/java 

ERROR:  Installation will not succeed unless the license
        agreement can be accepted.

        If the error was caused by a display problem,
        read the license agreement file  (LA_xx, where
        xx represents your language ) in the 'licenses'
        directory, and then run the following command:

            mqlicense.sh -accept

        Only use this command if you accept the license
        agreement.

        For other errors, contact your IBM support centre.
I find it interesting why the mqlicense shell script is looking for the JAVA program in ./lap/jre/jre/bin. My curiosity is leading me to dig into mqlicense.sh to find out what is going on to the script, and I found this piece:
...

# Set JRE location
  JRE=${JRE:-$(find $PROGPATH/lap -type d -name bin)/java }
  if [ ! -x ${JRE?} ]; then
    echo "ERROR: No useable java programs at ${JRE}"
    errormsg
    exit 1
  fi

...
I was so surprise that WebSphere isn't install the JAVA program in default location (/bin or /usr/bin). Anyhow I just change the JRE variable to suit my needs. Now the screen will turn out a license agreement page for me to accept. Once accepted, following message will be seen:
...
...

Displaying license agreement on :0

Agreement accepted:  Proceed with install.

Thursday, March 13, 2014

Preventing users from committing specific files to SVN

There was an incident where someone has misuses SVN (Subversion) as a file server which causes the server running out of disk space. I have no choice, in order control such an irresponsible attitude staff; I’m force to implement a security check on each file whenever a commit request has received.

The script is implemented in pre-commit hooks script. This file locate inside the hooks directory of each repository, initially it has a file named pre-commit.tmpl, I’m require to remove the tmpl extension and grant this file with execute access right.

Append the following content into pre-commit file.
#Put all the restricted formats in variable FILTER
FILTER=".(xls|xlsx|exe|pptx|PPTX|vsd|VSD|bak|BAK|class|CLASS|zip|ZIP|doc|DOC|docx|DOCX)$"

# Capture extension token of each new files to be commit
FILES=$(${SVNLOOK} changed -t ${TXN} ${REPOS} | ${AWK} '{ print $NF }') > /dev/null

for FILE in $FILES 
do
  EXTENSION=`echo "$FILE" | cut -d'.' -f2-`

  if [[ "$FILTER" == *"$EXTENSION"* ]]; then
    echo "Your commit has been blocked because you are trying to commit a restricted file." 1>&2
    echo "Please contact SVN Admin. -- Thank you" 1>&2
    exit 1
  fi
done
Now whenever users commit a file or files having the extension mention in the FILTER, the commit will not be success.

Sunday, March 9, 2014

apt-get gone crazy due to my mistake

I was installing WebSphere MQ for my own research. Due to some technical mistake, I have cause some trouble on apt-get command not able to function. Below is the error I got:
...
...

chown: invalid user: ‘mqm:mqm’
chown: invalid user: ‘mqm:mqm’
chown: invalid user: ‘mqm:mqm’
dpkg: error processing mqseriesserver (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mqseriesserver
Not knowing why this could happened to me? Due to my mistake I guess? Then I spot apt-get autoremove would lend me a help. What this command actually do?
autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
I did try on that but no luck. While I'm almost hopeless, I see some light, it is pointing to apt-get remove --purge. What this command actually do?
--purge
Use purge instead of remove for anything that would be removed. An asterisk ("*") will be displayed next to packages which are scheduled to be purged. remove --purge is equivalent to the purge command. Configuration Item: APT::Get::Purge.
For my case, I'm going to purge any of the mqseriesserver thing, thus by launching following command:
sudo apt-get remove --purge mqseriesserver
I can see the rubbish is being purge from apt-get command:
...

Removing mqseriesserver ...
Purging configuration files for mqseriesserver ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Now my apt-get is back to normal. Phew~

Wednesday, March 5, 2014

Virtualbox failed me again.

Not sure what is happening? I came back from work and trying to start my VirtualBox, it failed to start any virtual machine with following error:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing
'/etc/init.d/vboxdrv setup'
as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
I always forgot that whenever there is an update on the kernel module, I'm require to update the DKMS thing as well. I try the following command as suggest in here but it didn't work:
ls /var/lib/initramfs-tools | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
I then try another solution as suggest in here:
sudo apt-get install linux-headers-`uname -r`
sudo dpkg-reconfigure virtualbox-dkms  
sudo modprobe vboxdrv
Then it works! Surprise me!

Sunday, March 2, 2014

Two annoying error in Cocos2d-x compilation

Working on Open Source technology require us to pay more attention on the works that we commit, especially the document/development guide must be up to date. For example, while I'm setting up the development environment for Cocos2d-x on Linux, there are some minor annoying build error which do not mention clearly on the document. As of this writing, I was using Ubuntu 13.04, and Cocos2d-x 2.2.2.

-Werror=maybe-unintialized
 CXX obj/release/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.o
../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp: In member function ‘virtual void TestColliderDetector::update(float)’:
../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp:1062:27: error: ‘maxx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp:1062:27: error: ‘miny’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
../Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp:1062:27: error: ‘minx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1plus: all warnings being treated as errors
make[1]: *** [obj/release/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.o] Error 1
The first error I encountered was the variable has not been initialize. This is due to the compilation flag set to -Werror set in cocos2dx.mk located in <Cocos2dx_root>/cocos2dx/proj.linux. The simplest way to get rid of this error is to initialize those variable to 0.

-Werror=unused-variable
 CXX obj/release/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.o
../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp: In member function ‘void UIListViewExTest_Vertical::selectedItemEvent(cocos2d::CCObject*, cocos2d::gui::ListViewEventType)’:
../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp:170:25: error: unused variable ‘listViewEx’ [-Werror=unused-variable]
../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp: In member function ‘void UIListViewExTest_Horizontal::selectedItemEvent(cocos2d::CCObject*, cocos2d::gui::ListViewEventType)’:
../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp:346:29: error: unused variable ‘listViewEx’ [-Werror=unused-variable]
cc1plus: all warnings being treated as errors
The second error is there are some variable has been declare but it is not being use. To get rid of this problem, put additional -Wno-unused-variable flag into cocos2dx.mk file as shown below:
CC = gcc
CXX = g++
CCFLAGS += -MMD -Wall -Werror -Wno-unused-variable -fPIC
CXXFLAGS += -MMD -Wall -Werror -Wno-unused-variable -fPIC
...
...

Saturday, March 1, 2014

Final solution on determine_new_packagename has released

The temporary work around on my previous post have finally solved. After some noise in the mailing list, the expert has finally found the real problem, read the defect details from this link. The affected code has been commit into SVN, have a quick check on this link.

Here is a quick diff on the affected file from my workspace:
svn diff -r HEAD configure.in

--- configure.in (revision 1571281)
+++ configure.in (working copy)
@@ -3354,9 +3354,9 @@
          AC_PATH_PROG(EPM, epm, no)
       fi
 
-      # Override system epm and --with-epm if --with-epm-url is used.
-      if test -n "$with_epm_url" ; then
+      if test "$EPM" = "no" && test -n "$with_epm_url" ; then
          # At this moment we can not verify the URL or the content that we want to download.
+        # Neither can we apply the test below for ruling out that it is the SunStudio dmake.
          EPM_URL=$with_epm_url
          AC_MSG_RESULT([epm will be downloaded and compiled in bootstrap])
          EPM=
@@ -3372,7 +3372,7 @@
             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
                AC_MSG_RESULT([yes])
             else
-        AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm (--with-epm). Or specify an URL to an epm-3.7 source package (--with-epm-url); run configure with the --help option for a list of possible URLs.])
+        AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
             fi
             AC_MSG_CHECKING([epm version])
             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
This fix will allow the build script to use the EPM package specified in --with-epm-url and disable the local EPM package.