jump to navigation

Google Maps – get latitude and longtitude for a location November 25, 2008

Posted by maxmil in : GIS, javascript , add a comment

Useful trick that i got from here

Navigate so that the point you want is in the center of the map.

Then put this in the address bar of your browser.

$javascript$:void(prompt('',gApplication.getMap().getCenter()));

Note remove the $’s from the above command. I had too put them in to allow my WYSIWIG editor to process the code.

Apache mod_jk and tomcat with multiple virtual hosts November 22, 2008

Posted by maxmil in : Apache, tomcat , 12 comments

I recently had to configure a couple of different tomcat web applications as virtual hosts, each with its own domain. Although in my case tomcat is serving all the content of these applications i decided to use mod_jk to clean up the URL's and profit from apache's load balancing.

I found plenty of articles on the web that explained how to install and configure mod_jk with tomcat. However they all mapped an apache virtual host to a root tomcat context. Since i had two different tomcat context this seemed to mean that i would have to install two tomcat instances which was not a ideal solution.

The answer to my dilema was to define two separate hosts in tomcat, each one with its own mod_jk worker and one weapp as its root context. This idea came from Grig Gheorghiu. Thanks Grig!

I thought it would be worth describing the steps i took in a post so that others might benefit.

So here goes… My environment is:

Debian Lenny, Apache2.2, Tomcat 6.0.16.

http://test.domain1.org must map to webapp-domain1.war
http://test.domain2.org must map to webapp-domain2.war

(more…)

Installing JDK 6 Update 10 on debian Lenny November 17, 2008

Posted by maxmil in : Debian, Java , 3 comments

At the time of writing both the JRE and JDK 6 Update 10 have been released for over a month but are not available on the non-free branch of the official debian testing repositories. I imagine that this is because Lenny is about to go stable and the maintainers are not accepting new versions, only bug fixes.

This is a shame because Update 10 includes a major revamping of client side Java with new look and feels and much improved applets.

Being impatient i wanted to try this out.

Normally to install sun binaries as debian packages i use java-package which nicely prepares a .deb file that i can use dpkg to install. The advantage of this technique is that the new package integrates nicely with the overall system allowing you to use update-alternatives etc.

However, trying this, i found that java-package has not been updated to handle Update 10 either. The problem seems to be that it only works with versions 6 Update X where X is one single digit.

More info can be found here http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504778

For my architecture the solution was to add this to /usr/share/java-package/sun-j2sdk.sh
"jdk-6u10-linux-i586.bin") # SUPPORTED
j2se_version=1.6.0+update10${revision}
j2se_expected_min_size=130
found=true
;;

just after
"jdk-6u"[0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=130
found=true
;;

My architecture is i586, modify this according to yours.

Then, as usuall to prepare, install and set as default.
$ fakeroot make-jpkg jdk-6u10-linux-i586.bin
$ sudo dpkg -i sun-j2sdk1.6_1.6.0+update10_i386.deb
$ sudo update-alternatives java --config

I then wanted to try the new draggable applet feature. So i went to http://java.sun.com/developer/technicalArticles/javase/6u10_applets/ but the demo didn’t work and whats more the page told me that i didn’t have update 10 installed.

However my browser definitely is running the update 10 plugin, as verified on this site.

Could it be because i’m running iceweasel and not firefox?

Getting hibernate and suspend to work from gnome power applet November 8, 2008

Posted by maxmil in : Debian , add a comment

After tweaking HAL this already worked for me on the command line using pm-hibernate and pm-suspend as root.

However to work from the gnome power applet you need it to work for your user. This was achieved by adding the user to the group powerdev

Subversion batch commands November 3, 2008

Posted by maxmil in : Subversion , add a comment

A few useful svn batch commands.

1) Add multiple files

svn st | grep "^?" | awk '{ print $2}' | while read f; do svn add $f; done

2) Revert multiple files

svn st | grep "^M" | awk '{ print $2}' | while read f; do svn revert $f; done

3) Delete multiple missing files

svn st | grep "^\!" | awk '{ print $2}' | while read f; do svn delete $f; done