<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tilion</title>
	<atom:link href="http://www.tilion.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tilion.org.uk</link>
	<description>Resources and technical documentation</description>
	<lastBuildDate>Wed, 13 Mar 2013 11:51:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Xmpp/Jabber commons-logging handler (Tomcat)</title>
		<link>http://www.tilion.org.uk/2013/03/xmppjabber-commons-logging-handler-tomcat/</link>
		<comments>http://www.tilion.org.uk/2013/03/xmppjabber-commons-logging-handler-tomcat/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 11:49:34 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=157</guid>
		<description><![CDATA[I wanted to create a live monitoring system to use with some of the webapps I have running in Apache Tomcat. There were various options, but as I have a secure xmpp/jabber chat system setup already, I thought it&#8217;d be &#8230; <a href="http://www.tilion.org.uk/2013/03/xmppjabber-commons-logging-handler-tomcat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I wanted to create a live monitoring system to use with some of the webapps I have running in Apache Tomcat.  There were various options, but as I have a secure xmpp/jabber chat system setup already, I thought it&#8217;d be handy to use that as the transport medium for any communication.</p>
<p>On one server I have an xmpp chat system (ejabberd running on debian) running over SSL.  On other servers I have instances of Apache Tomcat running various web applications.</p>
<ul>
<li>I created a new java.util.logging.Handler that could be used with tomcat.</li>
<li>Created xmpp user accounts within ejabberd for each webapp I wanted to monitor.</li>
<li>Updated the logging.properties file for each webapp and restarted.</li>
</ul>
<p>The handler was setup to auto-accept contact requests (not a problem on an internal chat server), so I added the new xmpp user accounts as contacts on my own account.  Step 1 successful, I can now see when the webapps are online and do something about it when I notice they go offline.  To receive live logging information, I&#8217;d also built the following commands into the handler.</p>
<ul>
<li>!subscribe</li>
<li>!unsubscribe</li>
<li>!level &lt;LEVEL_NAME&gt;</li>
</ul>
<p>First two are pretty obvious, they allow you to subscribe and unsubscribe from being sent log messages via chat.  The third command allows you to select the minimum level messages you want to see &#8211; on production servers I get way too many messages if I listen to ALL, so I tend to choose WARNING as I&#8217;m only interested in seeing if things go wrong.</p>
<p>An example logging.properties file updated from the default one that ships with tomcat;</p>
<pre>handlers = org.apache.juli.FileHandler, uk.org.tilion.logging.XmppHandler, java.util.logging.ConsoleHandler

uk.org.tilion.logging.XmppHandler.server = chat.tilion.org.uk
uk.org.tilion.logging.XmppHandler.port = 5222
uk.org.tilion.logging.XmppHandler.username = webapp1-name
uk.org.tilion.logging.XmppHandler.password = webapp1-password

org.apache.juli.FileHandler.level = ALL
org.apache.juli.FileHandler.directory = ${catalina.base}/logs

java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter</pre>
<p>The code is squeezed into a single file and packaged in a maven project that uses smack/smackx to perform the xmpp communication.  I&#8217;ve not attached it to this post, but if anyone is interested, leave a comment below and I&#8217;ll make it available.</p>
<!-- AdSense Now! Lite V3.04 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-3357713325835138";
/* 728x90, created 12/02/08 */
google_ad_slot = "0996730963";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2013/03/xmppjabber-commons-logging-handler-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake 3 network protocol 43 proxy server</title>
		<link>http://www.tilion.org.uk/2012/08/quake-3-network-protocol-43-proxy-server/</link>
		<comments>http://www.tilion.org.uk/2012/08/quake-3-network-protocol-43-proxy-server/#comments</comments>
		<pubDate>Sun, 12 Aug 2012 22:50:31 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[quake3]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=143</guid>
		<description><![CDATA[I decided to experiment with java NIO and thought it&#8217;d be useful to resurrect my quake 3 proxy server. The completed code may be a useful followup to an original article I wrote many years ago about the Quake 3 &#8230; <a href="http://www.tilion.org.uk/2012/08/quake-3-network-protocol-43-proxy-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I decided to experiment with java NIO and thought it&#8217;d be useful to resurrect my quake 3 proxy server. The completed code may be a useful followup to an original article I wrote many years ago about the <a href="http://www.tilion.org.uk/2011/11/quake-3-network-format/" title="Quake 3 network protocol">Quake 3 network protocol</a></p>
<p>If I get time I&#8217;ll create a version for protocol 68 that can decode the Huffman compressed packet data on the fly, but don&#8217;t hold your breath!</p>
<p>Instructions can be found in the code comments, otherwise leave me a message below.
<pre class="prettyprint ">package uk.org.tilion.quake3.proxy;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.charset.Charset;
import java.util.Iterator;

/**
 * A Quake3 proxy server that communicates using protocol 43, 1.11 - 1.16 point
 * release of quake3 engine. It's designed to handle a single client and provide
 * a way of experimenting with the quake3 protocol on the fly.
 * 
 * Packet fragmentation is ignored for simplicity, with sequenceId being read
 * without performing fragmentation checks.
 * 
 * Example handshake (OOB prefixed packets)
 *   CLIENT : getChallenge
 *   SERVER : challengeResponse &lt;ID&gt;
 *   CLIENT : connect &quot;cg_predictItems1sexmalehandicap100color3snaps40rate10000modeldoom/rednameUnnamaedPlayerprotocol68qport&lt;PORT&gt;challenge&lt;ID&gt;&quot;
 *   SERVER : connectResponse
 * 
 * Client game data packet
 * +-----------------+-----+----------+-----------+
 * | NAME            | LEN | ENCODING | ENDIANESS |
 * +-----------------+-----+----------+-----------+
 * |  SequenceNumber |  32 |     None |    Little |
 * |           QPort |  16 |     None |    Little |
 * |                 |     |      XOR |           |
 * 
 * Server game data packet
 * +-----------------+-----+----------+-----------+
 * | NAME            | LEN | ENCODING | ENDIANESS |
 * +-----------------+-----+----------+-----------+
 * |  SequenceNumber |  32 |     None |    Little |
 * |                 |     |      XOR |           |
 * 
 * If anyone gets time to implement the XOR decoding, do let me know! I suspect
 * it's the Netchan_UnScamblePacket() function from qcommon/net_chan.c in the 
 * 1.32 full source release.
 * 
 * @author Darren Edmonds
 */
public class Protocol43ProxyServer {

    private static final int BUFFER_SIZE = 1024 * 2;  // size in bytes
    
    private int localPort;
    private SocketAddress serverAddr;
    private SocketAddress clientAddr;
    private DatagramChannel serverChannel; // proxy &lt;==&gt; quake3 server
    private DatagramChannel clientChannel; // proxy &lt;==&gt; quake3 client
    private boolean running;
    
    Protocol43ProxyServer(int localPort, String remoteServer, int remotePort) {
        this.localPort = localPort;
        this.serverAddr = new InetSocketAddress(remoteServer, remotePort);
    }

    /**
     * Start the proxy server
     * @throws IOException 
     */
    public void start() throws IOException {
        Selector selector = Selector.open();
        
        this.clientChannel = DatagramChannel.open();
        this.clientChannel.configureBlocking(false);
        this.clientChannel.socket().bind(new InetSocketAddress(this.localPort));
        this.clientChannel.register(selector, SelectionKey.OP_READ);
        
        this.serverChannel = DatagramChannel.open();
        this.serverChannel.configureBlocking(false);
        this.serverChannel.socket().bind(null);
        this.serverChannel.register(selector, SelectionKey.OP_READ);
        
        ByteBuffer buffer = ByteBuffer.allocateDirect(BUFFER_SIZE);
        buffer.order(ByteOrder.BIG_ENDIAN);

        this.running = true;
        Iterator&lt;SelectionKey&gt; it = null;
        SelectionKey key = null;
        while (this.running) {
            int n = selector.select();
            if (n == 0) continue; // nothing to do
            
            it = selector.selectedKeys().iterator();
            while (it.hasNext()) {
                key = it.next();
                
                if (key.isReadable()) {
                    this.handlePacket((DatagramChannel)key.channel(), buffer);
                }
                
                it.remove();
            }
        }
    }

    /**
     * Read a packet of data from the client (or server) datagram channel then
     * proxy it over to the other channel.
     * @param channel
     * @param buffer
     * @throws IOException 
     */
    private void handlePacket(DatagramChannel channel, ByteBuffer buffer)
            throws IOException {
        buffer.clear();
        
        if (channel == this.clientChannel) {
            SocketAddress sender;
            
            while ((sender = channel.receive(buffer)) != null) {
                if (this.clientAddr == null) this.clientAddr = sender;
                //System.out.println(&quot;CLIENT sent &quot; + buffer.position() + &quot; bytes&quot;);
                inspectClientPacket(buffer);
                writePacket(this.serverChannel, buffer, this.serverAddr);
            }
            
        } else {
            while (channel.receive(buffer) != null) {
                //System.out.println(&quot;SERVER sent &quot; + buffer.position() + &quot; bytes&quot;);
                inspectServerPacket(buffer);
                writePacket(this.clientChannel, buffer, this.clientAddr);
            }
        }
    }

    /**
     * Write buffer to channel, transmitting content to recipient
     * @param channel
     * @param buffer
     * @param recipient
     * @throws IOException 
     */
    private void writePacket(DatagramChannel channel, ByteBuffer buffer,
            SocketAddress recipient) throws IOException {
        buffer.flip();
        while (buffer.hasRemaining()) {
            channel.send(buffer, recipient);
        }
    }

    /**
     * Chance to inspect/modify packet sent from client before it is relayed
     * to the server
     * @param buffer
     */
    private void inspectClientPacket(ByteBuffer buffer) {
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        int sequenceId = buffer.getInt(0);

        if (sequenceId == -1) { // 4 OOB bytes in the header
            byte[] textArr = new byte[buffer.position() - 4];
            int oldPos = buffer.position();
            buffer.position(4);
            buffer.get(textArr);
            buffer.position(oldPos);

            String command = new String(textArr, Charset.forName(&quot;UTF-8&quot;));
            System.out.println(&quot;CLIENT &quot; + command);
            
            if (command.startsWith(&quot;connect &quot;)) {
                /* rewrite the qport value to reflect the proxy local port
                 * rather than the client local port - not critical for testing
                 * but required for multiple clients on same IP via NAT */
            }
        } else {
            int qport = buffer.getShort(4);
            System.out.println(&quot;CLIENT seq=  &quot; + String.format(&quot;%15d&quot;, sequenceId));
            System.out.println(&quot;CLIENT qport=&quot; + String.format(&quot;%15d&quot;, qport));
        }
        
        buffer.order(ByteOrder.BIG_ENDIAN);
    }

    /*
     * Chance to inspect/modify packet sent from server before it is relayed
     * to the client
     * @param buffer
     */
    private void inspectServerPacket(ByteBuffer buffer) {
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        int sequenceId = buffer.getInt(0);
        
        if (sequenceId == -1) { // 4 OOB bytes in the header
            byte[] textArr = new byte[buffer.position() - 4];
            int oldPos = buffer.position();
            buffer.position(4);
            buffer.get(textArr);
            buffer.position(oldPos);

            String command = new String(textArr, Charset.forName(&quot;UTF-8&quot;));
            System.out.println(&quot;SERVER &quot; + command);
            
            if (command.startsWith(&quot;connectResponse&quot;)) {
                /* server puts client into connecting state and starts sending
                 * game updates */
            }
        } else {
            System.out.println(&quot;SERVER seq=  &quot; + String.format(&quot;%15d&quot;, sequenceId));
        }
        
        buffer.order(ByteOrder.BIG_ENDIAN);
    }

    /**
     * Main
     * @param args 
     */
    public static void main(String[] args) {
        Protocol43ProxyServer server = new Protocol43ProxyServer(
                27960, 
                &quot;myserver.com&quot;, // CHANGE TO REAL SERVER IP
                27961); // CHNAGE TO REAL SERVER PORT
        try {
            server.start();
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
        
        /* now start quake3.exe and connect localhost:27960
         * your connection will end up at myserver.com:27961, proxied via
         * localhost to allow you to inspect packets on the fly */
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/08/quake-3-network-protocol-43-proxy-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert java keystore key into DSA (understood by Apache)</title>
		<link>http://www.tilion.org.uk/2012/07/convert-java-keystore-key-into-dsa-understood-by-apache/</link>
		<comments>http://www.tilion.org.uk/2012/07/convert-java-keystore-key-into-dsa-understood-by-apache/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 14:05:17 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[keystore]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=138</guid>
		<description><![CDATA[I have a wildcard SSL certificate bought from GoDaddy that serves various websites. Most of them run on Apache Tomcat, but when I had the need to run an SSL secured site in Apache HTTP server as well, I had &#8230; <a href="http://www.tilion.org.uk/2012/07/convert-java-keystore-key-into-dsa-understood-by-apache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have a wildcard SSL certificate bought from GoDaddy that serves various websites.  Most of them run on Apache Tomcat, but when I had the need to run an SSL secured site in Apache HTTP server as well, I had the choice &#8230; buy another SSL certificate (which seemed pointless as I already own a wildcard certificate and can use whatever subdomains I need), or work out how to get my certificate up and running on both servers.</p>
<p>The problem isn&#8217;t getting my signed certificate in formats that both Apache Tomcat and Apache HTTP will understand, that bit&#8217;s easy.  The problem is that my certificate request was created using a private key stored in a java keystore, which Apache HTTP doesn&#8217;t understand. Quick google later and the solution wasn&#8217;t very difficult, here&#8217;s what I did!</p>
<p>GoDaddy created my certificate and provide their root CA bundle, let&#8217;s call them <em>wild.tilion.org.uk.crt</em> and <em>gd_bundle.crt</em> respectively.</p>
<p>I created the initial signing request with a java keystore, <em>tomcat.keystore</em>, under alias <em>tilion</em>.</p>
<p><a href="https://code.google.com/p/java-exportpriv/wiki/Usage" rel="nofollow">Usage instructions for ExportPriv</a> were quick and easy to follow.</p>
<pre>javac ExportPriv.java Base64Coder.java
java ExportPriv tomcat.keystore tilion &lt;password&gt; | openssl pkcs8 -inform PEM -nocrypt > wild.tilion.org.uk.key</pre>
<p>Apache2 configuration parameters:</p>
<pre>SSLEngine on
SSLCertificateFile /path/to/wild.tilion.org.uk.crt
SSLCertificateKeyFile /path/to/wild.tilion.org.uk.key
SSLCertificateChainFile /path/to/gd_bundle.crt</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/07/convert-java-keystore-key-into-dsa-understood-by-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Cheat Sheet</title>
		<link>http://www.tilion.org.uk/2012/05/subversion-cheat-sheet/</link>
		<comments>http://www.tilion.org.uk/2012/05/subversion-cheat-sheet/#comments</comments>
		<pubDate>Wed, 16 May 2012 13:34:21 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=133</guid>
		<description><![CDATA[Examples below use an imaginery repository located at svn+ssh://user@svn.domain.com/project Create and Import I prefer to create plain file backed repositories as they don&#8217;t suffer the same inconsistency quirks as the berkley database backed repositories. The following will create a new &#8230; <a href="http://www.tilion.org.uk/2012/05/subversion-cheat-sheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Examples below use an imaginery repository located at <strong>svn+ssh://user@svn.domain.com/project</strong></p>
<h3>Create and Import</h3>
<p>I prefer to create plain file backed repositories as they don&#8217;t suffer the same inconsistency quirks as the berkley database backed repositories.  The following will create a new repository called <em>project</em> in the current working directory.</p>
<pre class="code">svnadmin create project --fs-type fsfs</pre>
<p>If you don&#8217;t have any files to import you can start creating files as you develop and then use <em>svn add</em> to put them into version management.</p>
<h3>Checkout</h3>
<p>The following will checkout the project into a directory called <em>myproject</em>, created in the current working directory.</p>
<pre class="code">svn checkout svn+ssh:/user@svn.domain.com/project/trunk myproject</pre>
<h3>Ignoring File/Directories</h3>
<p>Build directories or log directories can be annoying when they continue to show up in the <em>svn status</em> command.  You can instruct subversion to ignore them using</p>
<pre class="code">svn propedit svn:ignore target</pre>
<h3>Tagging and Branching</h3>
<p>Make sure the <em>tags</em> or <em>branches</em> directory is created first.</p>
<pre class="code">svn mkdir svn+ssh://user@svn.domain.com/project/tags</pre>
<p>From the base directory of your project, tag the release or create the branch.</p>
<pre class="code">svn copy . svn+ssh://user@svn.domain.com/project/tags/1_0_0</pre>
<h3>Updating a tagged revision</h3>
<p>If you need to make updates to a tagged revision (say 2.1.0) when the main trunk has already progressed with new development (2.2.0 for instance) you can do it as follows.</p>
<p>Copy the 2.1.0 tag into a branch</p>
<pre class="code">svn copy svn+ssh://user@svn.domain.com/project/tags/2_1_0 svn+ssh://user@svn.domain.com/project/branches/2_1_1</pre>
<p>Checkout this new branch and make code updates within it.  You can commit changes as you would if you were working on the trunk.</p>
<pre class="code">svn checkout svn+ssh:/user@svn.domain.com/project/branches/2_1_1 myproject-2_1_1</pre>
<p>When finished, tag the new version.</p>
<pre class="code">svn move svn+ssh:/user@svn.domain.com/project/branches/2_1_1 svn+ssh:/user@svn.domain.com/project/tags/2_1_1</pre>
<h3>Conflict Resolution</h3>
<p>If you try to apply changes and end up with a file in conflict (marked with a <strong>C</strong> next to its name) you have 3 ways to solve this; merge text in the file by hand, copy one of the temporary files over the top of the original, run <em>svn revert</em> on the file.</p>
<p>If you fix the problem by hand, or by copying one of the temporary files over the top, you must let subversion know by using the following command.
<pre class="code">svn resolved &lt;FILE&gt;</pre>
<h3>Merging changes from a tag/branch back into trunk</h3>
<p>You need checked out copies of the tag/branch and trunk.  It&#8217;s easier if changes in trunk are committed as it makes rolling back easier (just use the revert command).</p>
<p>Next, work out which revisions from the tag/branch you want to apply into trunk.  You can do this with <em>svn log</em> (within the tag/branch) to see when it was created and what has been committed.  From with trunk, run the following command.</p>
<pre class="code">svn merge -r 200:204 svn+ssh:/user@svn.domain.com/project/branch/big_change</pre>
<p>At this point changes are made locally in trunk (201,202,203,204, 200 is <strong>not</strong> inclusive).  Compile code, check changes work then commit them being very specific of what just happened in the log message, e.g. <em>Merged branch/big_change r200:204 into trunk</em></p>
<h3>Relocating a subversion repository</h3>
<p>Maybe the server breaks down, or you just need to move the location of your subversion server.  In theory you can do it with the following command.</p>
<pre class="code">svn switch --relocate svn+ssh:/user@svn.domain.com/project/branch/2_2_2 svn+ssh:/newuser@svn.newdomain.com/project/branch/2_2_2 .</pre>
<p>The command above should recurse into subdirectories, although when I tried it, it didn&#8217;t work for me.  Resorting back to sed you can do the same as follows.</p>
<pre class="code">for file in `find . -name 'entries'`; do sed s/user@svn.domain.com/newuser@svn.newdomain.com/g $file > $file'A'; done
for file in `find . -name 'entriesA'`; do mv `dirname $file`/entriesA `dirname $file`/entries; done</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/05/subversion-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCORM (Adobe Captivate and ADL Test Suite 1.2.7)</title>
		<link>http://www.tilion.org.uk/2012/03/scorm-adobe-captivate-and-adl-test-suite-1-2-7/</link>
		<comments>http://www.tilion.org.uk/2012/03/scorm-adobe-captivate-and-adl-test-suite-1-2-7/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 11:13:48 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=114</guid>
		<description><![CDATA[This document describes my experience using Adobe Captivate to generate a SCORM 1.2 content package. This includes the verification of such a package using the ADL test suite. Using captivate I created a set of multiple choice questions &#8211; I &#8230; <a href="http://www.tilion.org.uk/2012/03/scorm-adobe-captivate-and-adl-test-suite-1-2-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This document describes my experience using Adobe Captivate to generate a SCORM 1.2 content package.  This includes the verification of such a package using the ADL test suite.</p>
<p>Using captivate I created a set of multiple choice questions &#8211; I won&#8217;t go into all the details of how to do this as it was the easy bit!  Export the package as a SCORM 1.2 zip file.</p>
<p>Running the output from captivate straight through the ADL test suite you&#8217;ll see it fails with an initial error of <strong>ERROR: LMS Not initialized</strong>.  If you look at the content window opened up by the test suite you&#8217;ll also notice there are javascript errors, the first one being access denied to scorm_support.js</p>
<p>The details of this fix have been borrowed, then embellished, from http://www.mylearning.be/2009/09/adobe-captivate-and-the-adl-scorm-test-suite-1-2-7/</p>
<p>To make sure that your SCO gets launched in the test suite, you need to <strong>edit the html file</strong> that is generated by Captivate when publishing your content (the .html that has the same name as your project .swf). Open the file with a text editor (Notepad), on the second line you will find <em>&lt;!&#8211; saved from url=(0013)about:internet &#8211;&gt;. </em><strong>Delete</strong> that line.</p>
<p>Restart your test, and your SCO will now launch. But you will get errors in your test now.  Fix number two: change the <strong>security settings of the Flash player</strong> on your machine.</p>
<ul>
<li>Get some Flash content playing in your browser. Any Flash animation will do. Go e.g. to <a href="http://www.adobe.com">www.adobe.com</a>.</li>
<li>Right-click on the animation, you will get the Flash context menu. Select <strong>Settings</strong>.</li>
<li>You will get a little menu like this:<br />
<img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/flash-settings.png" alt="" title="flash-settings" width="218" height="141" class="alignnone size-full wp-image-112" /></li>
<li>Click the <strong>Advanced </strong>button. This will bring you to an <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html" target="_blank">Adobe Web site</a>.</li>
<li>In the table of contents on the left, click <strong>Global Security Settings Panel</strong>. This will show you a panel like this:<br />
<img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/trusted-locations.png" alt="" title="trusted-locations" width="403" height="278" class="alignnone size-full wp-image-113" /></li>
<li>Add the location where your ADL TestSuite software is installed to the trusted locations. The location of the TEST SUITE software, not the location of your zip file or your content files. Those get copied automatically to a TestSuite subfolder when you run the test.</li>
<li>Close all your browser windows and re-run the test.</li>
</ul>
<p>From here, I continue the explanation with my own experience &#8230; having unzipped the original zip file to make changes to the HTML file I decided to test with it unzipped as the test suite has that option &#8211; <strong>do not do this</strong>.  I wasted a great deal of time trying to work out why LMSInitialize() was not being called by my content, to the extent that I actually hardcoded a change in to make sure it was called.  This unzipped package now passed the test suite, but having never run anything through the test suite before I couldn&#8217;t tell if it was working correctly.</p>
<p>Everything now works, hurrah, so I rezip the package and decide to give it a final test.  LMSInitialize() now gets called twice, hence the waste of all my effort &#8211; I then removed my hardcoded call.  Now, when you run this package through the test suite, not only does it pass, but it shows you all the data communicated from the content package to the LMS (getValue/setValue calls).</p>
<p>In summary, the only thing wrong with the initial Captivate output is that it contains a comment (on line 2) that needs to be removed.  I suspect the other fix is only needed to satisfy the test suite running the package from the local disk, as opposed to being served through a web server over HTTP.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/03/scorm-adobe-captivate-and-adl-test-suite-1-2-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tomcat SSL Certificate &#8211; Alias tomcat name does not identify a key entry</title>
		<link>http://www.tilion.org.uk/2012/03/tomcat-ssl-certificate-alias-tomcat-name-does-not-identify-a-key-entry/</link>
		<comments>http://www.tilion.org.uk/2012/03/tomcat-ssl-certificate-alias-tomcat-name-does-not-identify-a-key-entry/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 11:28:55 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=108</guid>
		<description><![CDATA[A post that may help someone out if they get into the same situation I did with regards to importing SSL certificates into a java keystore for Tomcat. When renewing my certificate, my CA had the ability to use my &#8230; <a href="http://www.tilion.org.uk/2012/03/tomcat-ssl-certificate-alias-tomcat-name-does-not-identify-a-key-entry/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A post that may help someone out if they get into the same situation I did with regards to importing SSL certificates into a java keystore for Tomcat.</p>
<p>When renewing my certificate, my CA had the ability to use my old CSR (certificate signing request) which I accepted as it saved me a few minutes.  Before, I&#8217;d always started with an empty keystore, generated my private key, CSR, then imported my new certificate along with the any needed to complete the chain.  It seemed easy, I just needed to import my new certificate into the old keystore, right?</p>
<pre>keytool -import -alias intermed -keystore tomcat.keystore -trustcacerts -file gd_intermediate.crt
Enter keystore password:  
keytool error: java.lang.Exception: Certificate not imported, alias <intermed> already exists</pre>
<p>I see, I&#8217;ve already got a certificate under that alias, so I need to remove it first.  Into the manual, -delete option looks good and away we go &#8230; I delete and then import 2 certificates that make up the chain and do the same with my newly issued certificate.  Update my tomcat config to be greeted by the following:</p>
<pre>LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.io.IOException: Alias name tomcat does not identify a key entry</pre>
<p>To cut a long story short, when you use the -delete option of keytool on an alias with a private key in it, it doesn&#8217;t just remove the certificate, it removes your private key as well.  Adding in my new certificate is all well and good if I no longer have a private key associated with it!  The correct thing to do is not use the -delete option at all, because keytool will not complain if you&#8217;re importing a new certificate like that over the top of an old one, e.g I already have a certificate in the alias &#8216;tomcat&#8217; but &#8230;</p>
<pre>keytool -import -alias tomcat -keystore tomcat.keystore -trustcacerts -file mydomain.com.crt
Enter keystore password:  
Certificate was added to keystore</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/03/tomcat-ssl-certificate-alias-tomcat-name-does-not-identify-a-key-entry/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tilion Live Tournament Manager Demo</title>
		<link>http://www.tilion.org.uk/2012/02/tilion-live-tournament-manager-demo/</link>
		<comments>http://www.tilion.org.uk/2012/02/tilion-live-tournament-manager-demo/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 09:13:50 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tournament]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=91</guid>
		<description><![CDATA[Imagine the scene &#8230; you&#8217;re running a pool competition and need some way to coordinate everything on the day. You could use pieces of paper, even excel spreadsheets, but wouldn&#8217;t it be easier if you could do it all in &#8230; <a href="http://www.tilion.org.uk/2012/02/tilion-live-tournament-manager-demo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Imagine the scene &#8230; you&#8217;re running a pool competition and need some way to coordinate everything on the day.  You could use pieces of paper, even excel spreadsheets, but wouldn&#8217;t it be easier if you could do it all in one simple software application?</p>
<p>What follows isn&#8217;t a new idea and doesn&#8217;t necessarily include new concepts. However, it is my take on a solution that allows me to continually extend if necessary &#8211; it&#8217;s often very difficult to extend someone else&#8217;s work, especially if it is closed source.</p>
<h3>Screenshots</h3>
<p>Players overview: when you announce a competition you&#8217;ll get a list of players stating their interest, some even paying you money, but at this point there is no guarantee they&#8217;ll turn up on the day.</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.11.46.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.11.46-300x241.png" alt="" title="TLTM_Players" width="300" height="241" class="alignnone size-medium wp-image-94" /></a></p>
<p>Competitions overview: most competitions I&#8217;ve been involved in include a main event and then a plate event to keep early round losers interested.  Competitions have multiple rounds and can be run simultaneously over the available tables.</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.22.02.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.22.02-300x238.png" alt="" title="TLTM_Competitions" width="300" height="238" class="alignnone size-medium wp-image-96" /></a></p>
<p>Teams overview: for most competitions this tab would be better named as <em>Registered Players</em>, but the software is designed to work for single, or team events, in the same way. When the players arrive at the venue you can register them by creating a team entry (1 or more players per team) for a particular competition.</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.24.31.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.24.31-300x239.png" alt="" title="TLTM_Teams" width="300" height="239" class="alignnone size-medium wp-image-100" /></a></p>
<p>Matches overview: this tab shows a complete list of matches that need to be played.  Grouped by competition/round and showing home team and away team.</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.25.28.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.25.28-300x240.png" alt="" title="TLTM_Matches" width="300" height="240" class="alignnone size-medium wp-image-101" /></a></p>
<p>Tables overview: tables available for use at the venue. Each table has a status so you can tell if it&#8217;s in use, or the players on it just happen to be practicing and causing delays!</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.26.06.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.26.06-300x238.png" alt="" title="TLTM_Tables" width="300" height="238" class="alignnone size-medium wp-image-102" /></a></p>
<p>Status: this page is where the benefit of using a software application comes into its own.  At the top you can see the currently in progress matches.  At the bottom you can see a list of matches that need to be played and if there are any free tables.</p>
<p><a href="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.27.37.png"><img src="http://www.tilion.org.uk/wp-content/uploads/2012/03/Screen-Shot-2012-02-29-at-09.27.37-300x238.png" alt="" title="TLTM_Status" width="300" height="238" class="alignnone size-medium wp-image-103" /></a></p>
<h3>Omissions from this first demo?</h3>
<p>Yes, there are some things missing and some things I&#8217;ll change as development progresses. For example, most tabs include a data entry area and an <em>Add</em> button which makes development/testing easier, but these will be moved into dialog boxes in time as they clutter up the main UI.</p>
<p>There&#8217;s also no obvious way to create matches between teams.  This is coming, although it&#8217;s a bit more complex than other tabs as it needs to include a manual match creation and a randomised draw creation.</p>
<p>Results, I don&#8217;t see anywhere I can see match results! Again, an extra tab to be developed. The reason it&#8217;s not in the demo screenshots is that I don&#8217;t want it to be a tab in the same way as the other sections. I want it to be a separate window so those that run tournaments with a laptop and second screen can display the results window on the second screen. This allows players to come and see results (as well as the draw) without having to bug the organiser with questions.</p>
<p>Finally, the extra bits only possible by a software application. What if there was an internet forum you planned to update with results throughout the day? Wouldn&#8217;t it be nice if there was a <em>Publish</em> button that did everything for you &#8211; from logging into the forum, formatting the results and continually updating each time you click the <em>Publish</em> button? And, what about a website? A lot of organisers need their results published in a way they can put on their website.</p>
<p>The development continues &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/02/tilion-live-tournament-manager-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Snippets</title>
		<link>http://www.tilion.org.uk/2012/02/scripting-snippets/</link>
		<comments>http://www.tilion.org.uk/2012/02/scripting-snippets/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:09:50 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tilion.org.uk/?p=84</guid>
		<description><![CDATA[Bits of scripting I use infrequently and always have to lookup! Looping and reading a line at a time while read line; do echo $line done < test.txt Remove annoying .DS_Store files even if directories that have spaces in them &#8230; <a href="http://www.tilion.org.uk/2012/02/scripting-snippets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Bits of scripting I use infrequently and always have to lookup!</p>
<p>Looping and reading a line at a time</p>
<pre class="code">while read line; do
  echo $line
done < test.txt</pre>
<p>Remove annoying .DS_Store files even if directories that have spaces in them</p>
<pre class="code">find . -name .DS_Store -exec rm {} \;</pre>
<p>Find differences between two directories (with subdirectories), stating if files differ</p>
<pre class="code">diff -rq $DIR1 $DIR2</pre>
<p>Count files in current and all subdirectories</p>
<pre class="code">find . -type f | wc -l</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/02/scripting-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notification Wrapper</title>
		<link>http://www.tilion.org.uk/2012/01/notification-wrapper/</link>
		<comments>http://www.tilion.org.uk/2012/01/notification-wrapper/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 22:45:42 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://ray.tilion.org.uk/?p=63</guid>
		<description><![CDATA[In a few of my projects I need to provide feedback using notifications, configurable by the user. What I need is a lightweight framework that allows a user to subscribe to notifications via various channels, e.g. growl, taskbar notification, email, &#8230; <a href="http://www.tilion.org.uk/2012/01/notification-wrapper/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In a few of my projects I need to provide feedback using notifications, configurable by the user. What I need is a lightweight framework that allows a user to subscribe to notifications via various channels, e.g. growl, taskbar notification, email, sms, instant message, etc.  Varying levels of severity, perhaps 5.</p>
<p>I&#8217;ve not researched this a huge amount, so there is likely something out there that can provide most of my requirements.  Initial searches show up web service solutions, but I need this to be local to the client machine or network for some channels of notification.</p>
<h2>Requirements</h2>
<ul>
<li>Subscribe to notifications from various channels with various levels of severity (thinking logging conifgurations)</li>
<li>Fire notification events and let the framework handle distributing them to the subscribers</li>
</ul>
<h2>Implementation</h2>
<ul>
<li>Configure new plugin wrapper via a configuration file &#8211; probably go down the <a href="http://www.springsource.org/" rel="nofollow">Spring</a> route for this</li>
<li>OSX growl implementation using a native libgrowl library</li>
<li>Windows growl implementation, <a href="http://sourceforge.net/projects/libgrowl/" rel="nofollow">libgrowl</a>, using the java library that supports GNTP (Growl Network Transport Protocol)</li>
<li>Java 6 system tray integration for taskbar notifications &#8211; looks crap on OSX</li>
</ul>
<h2>Progress</h2>
<p>Initial concept developed and working, but not a reusable library</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/01/notification-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cue Sport Diagrams</title>
		<link>http://www.tilion.org.uk/2012/01/cue-sport-diagrams/</link>
		<comments>http://www.tilion.org.uk/2012/01/cue-sport-diagrams/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 22:44:43 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://ray.tilion.org.uk/?p=61</guid>
		<description><![CDATA[If you&#8217;re creating diagrams of ball positions on a pool table it would be much easier if there was a dedicated tool rather than trying to use a paint package all the time. Whether you&#8217;re trying to show your friends &#8230; <a href="http://www.tilion.org.uk/2012/01/cue-sport-diagrams/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re creating diagrams of ball positions on a pool table it would be much easier if there was a dedicated tool rather than trying to use a paint package all the time.  Whether you&#8217;re trying to show your friends a position from a recent frame or describing a practice routine, you&#8217;d need the same tools.</p>
<p>I came across a tool that does most of what you&#8217;d need, but it is based around US 9 ball tables.  The tool is called <a href="http://www.cuetable.com" rel="nofollow">Cue Table</a>, although it is a bit buried within the forum section of the site.</p>
<h2>Requirements</h2>
<ul>
<li>Select a cue sport table to show the correct background (7&#215;4 uk 8 ball, 6&#215;3 uk 8 ball, etc)</li>
<li>Drag and drop balls into position on the backgrond image</li>
<li>Create line paths if ball movement needs to be displayed</li>
<li>Create multiple scenes within a diagram if the scenario is better illustrated with multiple steps</li>
</ul>
<h2>Progress</h2>
<p>Draft version created and functional, below is a rough idea of the save format.</p>
<pre class="code">&lt;diagram name="Yesterday" width="800" height="450"&gt;
  &lt;scene name="Default"&gt;
    &lt;background image="7x4_uk8ball.jpeg"&gt;
      &lt;coord x="0" y="0"/&gt;
    &lt;/background&gt;
    &lt;icon name="red1" image="50mmRedBall.png"&gt;
      &lt;coord x="100" y="150"/&gt;
    &lt;/icon&gt;
    &lt;icon name="white1" image="50mmWhiteBall.png"&gt;
      &lt;coord x="190" y="150"/&gt;
    &lt;/icon&gt;
    &lt;path colour="red" arrowhead="end"&gt;
      &lt;coord x="100" y="150"/&gt;
      &lt;coord x="790" y="155"/&gt;
      &lt;coord x="650" y="160"/&gt;
    &lt;/path&gt;
  &lt;/scene&gt;
&lt;/diagram&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tilion.org.uk/2012/01/cue-sport-diagrams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
