Friday, January 25, 2008

JNDI names of TransactionManager in J2EE application servers

java:comp/env/UserTransaction - Generic
java:comp/UserTransaction - Resin 2.x, Oracle OC4J (Orion), JOnAS (JOTM), BEA WebLogic
java:comp/TransactionManager - Resin 3.x, Geronimo
java:/TransactionManager - JBoss
jta/usertransaction - WebSphere (J2EE 1.2)

java:comp/UserTransaction - WebSphere (J2EE 1.3)

Friday, January 18, 2008

nvidia cuda environment on fedora core

All files required can be downloaded from:http://www.nvidia.com/object/cuda_get.html#linux


  1. change to boot into text mode before installing NVidia drivervi /etc/inittabchange: id:5:initdefault:to: id:3:initdefault:reboot (to text mode)
  2. install NVidia driver provided from the cuda download pagesh NVIDIA-Linux-version.-pkg1.run
  3. add the following into Section “Screen” of /etc/X11/xorg.confOption “SLI” “off”Option “ProbeAllGpus” “True”
  4. add the red part into /boot/grub/grub.confuppermem 524288kernel /vmlinuz-2.xxxxxxxx ……….. rhgb quiet vmalloc=256MBpci=nommconf
  5. install cuda package
  6. change to boot back to GUI modevi /etc/inittabchange: id:3:initdefault:to: id:5:initdefault:reboot (back to X GUI mode)
  7. install freegult package, it is required for cuda SDK samples:rpm -ivh freeglut-version.rpmrpm -ivh freeglut-devel-version.rpm
  8. add /usr/local/cuda/lib into /etc/ld.so.conf/sbin/ldconfig
  9. install CUDA SDK
  10. please make sure your SELinux setting is disabled:System -> Administration -> Security Level and Firewall -> SELinux -> SELinux Setting: Disabled
  11. add /usr/local/cuda/bin to your path


You are ready to CUDA!

Wednesday, January 16, 2008

remove unwanted revisions in subversion

In one of those days, people committed stuff should not be in a source code repository into the subversion repository by accident, or sometimes not being disciplined and lack of understanding in source code repository…
There’s no easy button to remove the unwanted revisions in subversion. The svndumpfilter that came with subversion distribution is the tool that is able to exclude or include revisions with filename/dirname, unfortunately if there are “copies” in revisions that refers to the stuff that you wanted to filter out, svndumpfilter would break without finishing filtering the rest of revisions.
This problem can be avoided by writing a script to utilize svndumpfilter, svnlook and etc., copy path/files that has dependcies on other revisions. There are already scripts such as svndumpfilter2 and svndumpfilter3 out there. svndumpfilter2 is a python script that eliminates the copy dependencies revisions that you wanted to filter out. You can download svndumpfilter2 from: http://tartarus.org/~simon-anonsvn/viewcvs.cgi/svn-tools/svndumpfilter2

Assuming the directories that you want to keep are trunk, branches tags:

$SVN_HOME/bin/svnadmin dump /path/to/repo ./svndumpfilter2 /path/to/repo trunk branches tags > clean.dump

$SVN_HOME/bin/svnadmin load /path/to/repo < clean.dump

Your repo is now clean without those revisions taking up your HDD space.

Tuesday, January 15, 2008

compile mysql 5.0.45 under freebsd 6.2

I had mysql4 running on my server, now I wanted to install mysql5 on the same box but also kept mysql4 co-exist. My choice was to compile mysql from source to a custom location. It is to be installed in: /opt/mysql-5.0.45/

After regular compilation and installation, FreeBSD complained about cannot find libmysqlclient_r.
From the INSTALL-SOURCE text file it indicated:
* If your client programs are using threads, you must compile a thread-safe version of the MySQL client library with the `–enable-thread-safe-client’ configure option. This creates a `libmysqlclient_r’ library with which you should link your threaded applications. See *Note threaded-clients::.

So what I was missing was the option
–enable-thread-safe-client

Below is the working config options that I’ve used:
./configure –prefix=/opt/mysql_5.0.45 –with-extra-charsets=complex –with-unix-socket-path=/opt/mysql-5.0.45/tmp/mysql.sock ;
make ; make install

The mysql5 libraries have been installed in:
/opt/mysql-5.0.45/lib/mysql

Now mysql5 libraries has to be added to the shared library path, add the following line to: /etc/ld-elf.so.conf
/opt/mysql-5.0.45/lib/mysql

Reload the ldconfig
/etc/rc.d/ldconfig restart

Remember to create /opt/mysql-5.0.45/my.cnf and change the port number so it doesn’t conflict with the mysql4 instance.
Now mysql5 is ready to be started!