Archive for October, 2009

Auto Install the SUN JDK on Linux

Sometimes (yes it does happen), you need to install the JDK from SUN automatically (without having to answer yes/no to the license). Why? For example in a Kick Start script to auto-install the JDK.

And so to do this, here a bash & perl script for this exact purpose. This script works only with the .bin install package that you download from SUN’s website.

#!/bin/bash

jdkBinFile=$1

echo $1

# just spew out the agreement
perl -p -i -e 's/^more/cat/g' $1

# set the 'agreed' value for jdk 1.5
perl -p -i -e 's/\s+agreed=$/agreed=1/g' $1

# set the agree value for jdk 1.6
perl -p -i -e 's/`agree`/yes/g' $1

# do not call the register_jdk method
perl -p -i -e 's/\s+register_JDK/#register_JDK/g' $1

# and now run the installation
bash $1

How to

Create a new script file called autoinstall.sh containing the above script. and run it as follows:

$ cd /install/to/directory
$ autoinstall.sh /my/downloads/jdk-6u16-linux-x64.bin

Ruby FIX Message Viewer 1.0

Today I released my Ruby FIX Message Viewer 1.0. This is a command line based FIX message viewer programmed in Ruby. I made it command line because most, if not all, of the FIX logs that I have at work are on a server when I have only ssh access. Rather than copy them over and use some GUI tools, I find it quicker just to use this tool on the server.