Monday, June 30, 2008

Pretty URL for MediaWiki

MediaWiki is a very popular open source platform for wikis. The most notable user (and actual developer) being the infamous Wikipedia.

As I have previously mentioned, we run a MediaWiki based wiki within my research group. As a purely aesthetic function I chose to use a pretty URL. This essentially means the URL I use to access the wiki is shorter,
www.domain.com/wiki/Chemistry
instead of:
www.domain.com/wiki/index.php/Chemistry
It turns out it is quite fiddly to get the setup sorted, but the end result is definitely preferable.

N.B. These instructions only work when using domain.com/wiki/Chemistry. If you use wiki.domain.com/Chemistry that is more tricky and domain.com/Chemistry is not recommended, see here for info on those scenarios. In addition, I assume you have root access to your webserver, you are using MediaWiki 1.9.x or later and an apache webserver.

In this example I assume your DocumentRoot for html files is /srv/htdocs. Move your unpackaged mediawiki files to /srv/htdocs/w. We will use apache to make wiki valid.

Edit your httpd.conf, to enable /srv/htdocs to read .htaccess files. Alter AllowOverride None to AllowOverride FileInfo.

Now create the file to read /srv/htdocs/.htaccess, with the contents:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Make the wiki appear to come from wiki/
RewriteRule ^wiki/?(.*)$ /w/index.php?title=$1 [L,QSA]
Next tell your mediawiki configuration about this change by adding/editing /srv/htdocs/w/LocalSettings.php with:
$wgScriptPath       = "/w";
$wgArticlePath = "/wiki/$1";
Now when you access domain.com/wiki/Chemistry, Apache will actually request domain.com/w/index.php?title=Chemistry. Although you will not see this in the address bar unless you edit a page. If you edit a page but it wants to edit a page called Index.php, something has gone wrong!

Do check here for other information, perhaps the details there are sufficiently up to date to get this work - they were not when I originally tried.

There is one restriction with this method - articles names must not include a question mark (ampersands, &, are fine).

Friday, June 27, 2008

Deploy your software with IzPack

In terms of free software packagers there are two contenders for me NSIS and IzPack. NSIS is restricted to Windows, so on its own isn't suitable for my needs. IzPack is Java-based, so instantly suitable for every major platform. Granted it is ideal for Java software, but it is not at all restricted to it. Obviously you need a Java runtime environment (JRE) installed to run, but that is common enough nowadays.

A run down of the features:
  • Open source
  • Cross-platform
  • Fully customisable
  • Native integration (Shortcuts for Windows and Linux)
  • Ant integration
  • Uninstaller
  • Unattended mode
  • User input
  • Translations
Just like ant all your settings are stored in a XML file and parsed to create your customised package.

One of the advantages of IzPack being Java-based means you can add it directly to our continuous integration environment, using the Ant integration. That of course runs using CruiseControl, as the final step after compiling and testing our code (courtesy of JUnit), IzPack can step into package my software. So for each build I can take away an ready-to-deploy package.

Thursday, June 26, 2008

Subversion integration with Eclipse

The latest version of Eclipse, Ganymede, has just been released. I'm a keen Eclipse user, I like having all my programming needs met by one application (mainly thanks to many language plugins available; Perl, Shell, LaTeX etc.).

I'm not going to detail why you might want to upgrade to ganymede as there is plenty on that already. All I will say is that, as with previously releases, only some (in this case 23) of the ~90 projects that make up eclipse are actually releasing new milestones in this release, so your favourite subproject may not be updated at the current time.

For me the most important plugin is subversion (although, personally I feel this should be built in like CVS support). Previously I have used Subclipse, but I thought I'd try Subversive this time around.

Installation is fairly straightforward:
  1. Open Software update
  2. Select the Ganymede update site
  3. From Collaborative Tools pick SVN Team Provider

This doesn't include an SVN connector, which is a show stopper!
  1. Add http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ as a new remote site in software update
  2. For future reference get the latest update site from http://www.eclipse.org/subversive/downloads.php
  3. Install SVNKit 1.x Implementation, or 2.x if you want to try the beta.
Now you should be good to go. Select SVN from the New Project Wizard, and explore repositories from the SVN Repository Exploring perspective (Window > Open Perspective > Other...)

Subversion users should also note that version 1.5 has also recently been released, and accordingly you will want your clients to run this version.

If Subversive isn't for you Subclipse works fine in Ganymede too.

Friday, June 20, 2008

Condor on openSUSE 11.0

Having just installed my first openSUSE 11.0 (32-bit) machine I've thrown condor (7.1.0 binary: RH9, x86, dynamic) on to see it runs fine.

As with openSUSE 10.x you need to install compat-libstdc++ first. As root run: zypper in compat-libstdc++ to do this.

Update: Although compiled, it doesn't behave correctly when running jobs, producing lots of shadow exceptions.

Thursday, June 19, 2008

Setup network install for openSUSE 11.0


We run openSUSE on all our linux machines. Therefore, the quickest and easier way to install on lots of machines and ensure quick access to updates is to maintain a local copy of the core repositories onsite.

As we have the entire installation repository we only need network install discs which contain a setup program and then you select whatever packages you want from the repository.

First, download the repositories. There are 3 core repository you need:
  1. Installation
  2. 3rd party add on software
  3. Updates
Find a local mirror and use wget to grab the repositories. The mirror I use in the UK has rsync support, which is very handy for keeping the repositories up to date by only downloading content that has altered.

rsync -Pvptrl --delete rsync://rsync.mirrorservice.org/sites/ftp.opensuse.org/pub/opensuse/distribution/11.0/repo/oss/ /www/suse/SUSE11.0-INSTALL/

rsync -Pvptrl --delete rsync://rsync.mirrorservice.org/sites/ftp.opensuse.org/pub/opensuse/distribution/11.0/repo/non-oss/ /www/suse/SUSE11.0-ADDON/

rsync -Pvptrl --delete rsync://rsync.mirrorservice.org/sites/ftp.opensuse.org/pub/opensuse/update/11.0/ /www/suse/SUSE11.0-UPDATE/

The installation and addon repositories are static, but updates will need updating. Let cron take care of that for you by running the command above once a day.

Next grab the network install CD's, http://download.opensuse.org/distribution/11.0/iso/cd (Don't forget to use a mirror).

We make the repositories available via a local apache web server. So when running the setup program just point to the IP and folder on the web server. During the installation add the addon and update repos, and hey presto fast install with up to date repositories!

Wednesday, June 18, 2008

Compile condor 7.1.0 on openSUSE 10.3

Condor has traditionally only been available as binaries, most of the time this is fine. We successfully run the Mac OS X PowerPC & Intel binaries and for openSUSE 10.x use the Red Hat 9/dynamic binaries. However for 64-bit openSUSE the binary (RH5) doesn't really work, it struggles to start up. Since the release of condor 7.x they have included the source, so that seemed a sensible avenue to explore. It does compile, but it is a bit more involved than just configure; make; make install!

These instructions should hold true for 7.0.0, 7.0.1 & 7.0.2 as well.

Grab the source for the latest stable or development release (I personally go with the development release).

First off glance through the README, check you have all the prerequisites. I also found I needed to add termcap, terminfo, ncurses-devel and flex (grab them from yast).

Now lets start configuring:

cd src
./build_init
./configure --disable-gcc-version-check --disable-full-port --without-classads

The configure flags mean:
  1. Our gcc version is newer than the built-in checks.
  2. No standard universe/checkpointing. Standard for a new OS port not to have these.
  3. ClassAds not yet supported (no condor_q -better-analyze).
You will get an error:

configure: error: Condor does NOT know what glibc external to use with glibc-2.6.1

To get around this edit configure.ac with your favourite editor. Around line 2500 add this option for the case statement:

"2.6.1" ) # openSUSE 10.3
including_glibc_ext=NO
;;

Now run build_int and configure again as above.

If that runs you can then execute make. Sit back as this may take a while!

If there is a problem, typically on the externals part view the log which will be indicated. You may need to install something (such as the packages I mentioned earlier).

Compilation is finished when something like this pops up (and no obvious errors)

make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/build/condor-7.1.0/src/condor_examples'

Everything is compiled so now prepare the release:

make release (output to release_dir, dynamically linked with debugging, ready for testing)
make public (output to ../public, add stripped dynamic/static linked binaries and no debugging)

Find your final installation bundle in ../public as condor-7.1.0---dynamic.tar.gz. Unpack and use it as you normally would. condor_version, will reveal your custom compile:

$CondorVersion: 7.1.0 May 21 2008 $
$CondorPlatform: X86_64-LINUX_SuSE_UNKNOWN $

Need help/advice? There is an excellent presentation which covers this as well as the users mailing list which is both active and helpful.

Hopefully in the future condor will have better support for openSUSE so that a full port (standard universe/checkpointing) and ClassAds will be available.

Good luck!

Tuesday, June 17, 2008

Keep up with your literature


A colleague of mine recently blogged on useful websites and applications for keeping up with new journal articles and reference managers: How I keep track of scientific literature...

The popular social bookmarking service del.icio.us gets a mention. It has been under discussion on the CHMINF-L mailing list recently where Egon Willighagen recommends using Faviki (currently in beta). Similar idea, but using tags from wikipedia as well. I wonder if this will be the next big social bookmarker?

Image courtesy of Papers.

openSUSE 11.0 this week

The new version of openSUSE lands this week. It looks like it will be an excellent release building on the successful 10.2 and 10.3 releases.

Find out more: Sneak peaksscreenshots and wiki.

I download a local copy of the installation repository, which I'll post about later this week. 




Monday, June 16, 2008

Condor for number crunching


We have a need for HPC within our group (quantum chemistry calculations, machine learning, molecular dynamics simulations & analysis, etc.). To fulfil this need we have several SGE-based clusters within our department and the university. Our local clusters were in need of a refresh (multiple dated OS's - Red Hat 7!) and ideally needed to be unified somehow. It became tiresome having multiple clusters to pick from. What one has the most free slots, or the shortest queue? If it is full you would have to move all your data and get setup to run on a different cluster. We needed something to maximise our use of the compute nodes but simplify the submission process to avoid wasting time.

We opted for a more grid-based solution: condor. The reasons for this were:
  • All our local clusters are now combined into one condor pool.
  • It removes the needs for multiple head nodes, as users can submit direct from their desktops.
  • Cross-platform so you can use with Windows, Linux & Mac.
  • Grid approach means we take advantage of our desktop computers as well.
We still use the university's central SGE cluster, it is an invaluable resource. However, condor allows us to make the most of our local resources which are exclusively for our use.

Find out more about condor here: http://www.cs.wisc.edu/condor/. The annual Condor Week now has videos of some of tutorials (as well as slides) so check out what it is all about.

Image courtesy of Wikipedia.

Friday, June 13, 2008

Post one

It was recently recommended that I start my own blog, so here it is! I imagine it will be fairly technical, detailing the adventures I've had as sys admin within my research group at Nottingham. Alas, everything currently resides on our intranet-based wiki. Rest assured I'm not going to cut and paste the entire wiki here. I plan to share some of the solutions to problems I've had and other titbits of interest. Who knows where it might lead, certainly a novel venture for me to try.

The over-riding theme will be in silico chemistry, but that covers quite a lot!