<?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>Infernus</title>
	<atom:link href="http://infernus.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://infernus.org</link>
	<description>Don&#039;t feel you have to take any notice of me, please.</description>
	<lastBuildDate>Sat, 17 Sep 2011 19:57:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Swinging Clojure</title>
		<link>http://infernus.org/2010/08/swinging-clojure/</link>
		<comments>http://infernus.org/2010/08/swinging-clojure/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:25:52 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://infernus.org/?p=513</guid>
		<description><![CDATA[Having played with threading, I thought I&#8217;d have a go with Java integration. Swing was the obvious target, and a simple quote fetcher was the result. For simplicity, I stuck with URLConnection, but there are a number of Clojure libraries to solve the HTTP problem. All of them are somewhat nicer to deal with. I [...]]]></description>
			<content:encoded><![CDATA[<p>Having played with threading, I thought I&#8217;d have a go with Java integration. Swing was the obvious target, and a simple quote fetcher was the result.</p>
<p>For simplicity, I stuck with URLConnection, but there are a number of Clojure libraries to solve the HTTP problem. All of them are somewhat nicer to deal with.</p>
<p>I also completely failed to get <code>apply</code> working with <code>addItem</code> on the ComboBoxes &#8211; I&#8217;m assuming PEBKAC at present, given my limited knowledge of the integration.</p>
<p>Still, the Swing integration was surprisingly easy to do &#8211; I had envisioned nightmares here, given the variation in style, but it proved not half as horrid as expected.</p>
<pre>
(import
  '(java.net URL URLConnection)
  '(java.io BufferedReader InputStreamReader)
  '(javax.swing JFrame JLabel JTextField JButton JComboBox BorderFactory)
  '(java.awt.event ActionListener)
  '(java.awt GridBagLayout GridBagConstraints Insets)
  )

(def currencies ["EUR" "GBP" "JPY" "USD"])

(defn build-url [from-code to-code]
  (str "http://quote.yahoo.com/d/quotes.csv?s="
    from-code to-code "=X&#038;f=sl1d1t1c1ohgv&#038;e=.csv")
  )

(defn read-file [input-stream]
  (loop [line (.readLine input-stream)
         content []]
    (if (= line nil)
      content
      (recur (.readLine input-stream) (concat content [line]))
      )
    )
  )

(defn get-quote [quote-string]
  (nth (.split quote-string ",") 1))

(defn read-url [url]
  (let [connection (.openConnection (URL. url))]
    (read-file (BufferedReader. (InputStreamReader.
      (.getInputStream connection)))))
  )

(defn set-currencies [combo-box]
  (loop [current (first currencies)
         remainder (rest currencies)]
    (if (not (= nil current))
      (do
        (.addItem combo-box (str current))
        (recur (first remainder) (rest remainder))
        )
      )
    )
  )

(defn quote-fetcher []
  (let [frame (JFrame. "Quote Fetcher")
        button (JButton. "Get Quote")
        from-label (JLabel. "From:")
        from-field (JComboBox.)
        to-label (JLabel. "To:")
        to-field (JComboBox.)
        value-label (JLabel. "Result:")
        value-field (JTextField.)]

    (.addActionListener button
      (proxy [ActionListener] []
        (actionPerformed [e]
          (let [from-code (.getSelectedItem from-field)
                to-code (.getSelectedItem to-field)]
            (.setText value-field
              (get-quote (first (read-url
                (build-url from-code to-code)))))
            )
          )
        )
      )

    (.setEditable value-field false)

    (set-currencies from-field)
    (set-currencies to-field)

    (.setBorder (.getContentPane frame)
      (BorderFactory/createEmptyBorder 10 10 10 10))

    (doto frame
      (.setLayout (GridBagLayout.))
      (.add from-label (GridBagConstraints. 0 0 1 1 0.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/NONE) (Insets. 4 4 4 4) 0 0))
      (.add from-field (GridBagConstraints. 1 0 1 1 1.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/HORIZONTAL) (Insets. 4 4 4 4) 0 0))
      (.add to-label (GridBagConstraints. 0 1 1 1 0.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/NONE) (Insets. 4 4 4 4) 0 0))
      (.add to-field (GridBagConstraints. 1 1 1 1 1.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/HORIZONTAL) (Insets. 4 4 4 4) 0 0))
      (.add button (GridBagConstraints. 0 2 2 1 0.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/NONE) (Insets. 4 4 4 4) 0 0))
      (.add value-label (GridBagConstraints. 0 3 1 1 0.0 0.0
        (GridBagConstraints/EAST) (GridBagConstraints/NONE) (Insets. 4 4 4 4) 0 0))
      (.add value-field (GridBagConstraints. 1 3 1 1 1.0 1.0
        (GridBagConstraints/EAST) (GridBagConstraints/HORIZONTAL) (Insets. 4 4 4 4) 0 0))
      (.setSize 300 176)
      (.setVisible true)
      )
    )
  )

(quote-fetcher)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2010/08/swinging-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travels in Clojure</title>
		<link>http://infernus.org/2010/08/travels-in-clojure/</link>
		<comments>http://infernus.org/2010/08/travels-in-clojure/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 10:04:20 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://infernus.org/?p=504</guid>
		<description><![CDATA[I&#8217;m currently reading through Pragmatic&#8217;s Seven Languages in Seven Weeks. After every chapter it has a series of small &#8216;self-study&#8217; tasks. For Clojure, the final of these is the Sleeping Barber problem. So, mostly for my own reference, I present my solution. If anyone who actually knows Clojure ever reads this, I&#8217;d welcome any suggestions. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently reading through Pragmatic&#8217;s <a href="http://pragprog.com/titles/btlang/seven-languages-in-seven-weeks">Seven Languages in Seven Weeks</a>. After every chapter it has a series of small &#8216;self-study&#8217; tasks. For Clojure, the final of these is the <a href="http://en.wikipedia.org/wiki/Sleeping_barber_problem">Sleeping Barber problem</a>.</p>
<p>So, mostly for my own reference, I present my solution. If anyone who actually knows Clojure ever reads this, I&#8217;d welcome any suggestions.</p>
<p>As for Clojure, I&#8217;m still endlessly conflicted on whether Lisp is the most elegant language of them all, or if the endless mass of paranthesis is just syntactic pain. What I am sure of is that I wouldn&#8217;t trust many of the programmers I&#8217;ve run into with a language of its power. Mind, I don&#8217;t trust many of those same with the relatively limited power of Java.</p>
<pre>
(ns barber)

(def seats (ref (clojure.lang.PersistentQueue/EMPTY)))
(def the-barber (agent 0))

(defn barber [b]
    (dosync
        (if (peek @seats)
            (do
                (alter seats pop)
                (Thread/sleep 20)
                (inc b)
            )
            b
        )
    )
)

(defn enter-shop [customer]
    (dosync
        (if (< (count @seats) 3)
            (alter seats conj customer)
        )
    )
)

(defn run-barber [milliseconds]
    (do
        (add-watch seats :send-to-barber
            (fn [_ _ _ _] (send-off the-barber barber))
        )

        (def end-time (+ milliseconds (System/currentTimeMillis)))

        (while (< (System/currentTimeMillis) end-time)
            (Thread/sleep (+ 10 (rand-int 20)))
            (send (agent :customer) enter-shop)
        )
        (await the-barber)
        @the-barber
    )
)

(run-barber 10000)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2010/08/travels-in-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Datasources, One Rails Application</title>
		<link>http://infernus.org/2010/03/two-datasources-one-rails-application/</link>
		<comments>http://infernus.org/2010/03/two-datasources-one-rails-application/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 19:27:51 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://infernus.org/?p=380</guid>
		<description><![CDATA[Rails has a habit of lulling you into a false sense of security. The ease of use for common tasks makes you wonder why you&#8217;re wasting your time with Spring or JEE. Then you try to do something off the common path and watch Rails just shrug its shoulders and grin. I was working on [...]]]></description>
			<content:encoded><![CDATA[<p>
   Rails has a habit of lulling you into a false sense of security. The ease of use for common tasks makes you wonder why you&#8217;re wasting your time with Spring or JEE. Then you try to do something off the common path and watch Rails just shrug its shoulders and grin.
</p>
<p>
	I was working on a community project recently and ran into the requirement to access some static data in another database. Multiple datasources, easy enough. Unfortunately, Rails expects you&#8217;ll be sticking with just one, and so I had to go hunting for a solution. Thankfully, I wasn&#8217;t the first to hit this and so many people had already done the hard work, leaving me with my piecing together the most elegant solution.
</p>
<p>
	The first thing to do is define your datasource, presumably in <i>database.yml</i>.
</p>
<pre>
legacy_datasource:
  adapter: mysql
  database: legacy_database
  timeout: 5000
  encoding: utf8
  host: localhost
  username: readonly
  enable_call: true
  password: readonly
</pre>
<p>
	You&#8217;ll then need to introduce a base class for the models which will use this datasource. It&#8217;ll need to be abstract, to avoid declaring any columns and establish a connection to the secondary source.
</p>
<pre>
class LegacyObject < ActiveRecord::Base
  establish_connection :legacy_datasource

  self.abstract_class = true

  def self.columns() @columns ||= []; end

  def self.column(name, sql_type = nil, default = nil, null = true)
    columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
  end

end
</pre>
<p>
	Now build the model classes you require, making sure to extend from your new base class.
</p>
<pre>
class AnObject < LegacyObject

  column :object_id, :integer

  # and so on...

end
</pre>
<p>
	If you just require read-only access then you're now done. If you require migration support then a bit more work is needed.
</p>
<p>
	Create a new base class for the migrations that redefines the connection.
</p>
<pre>
class LegacyMigration < ActiveRecord::Migration
  def self.connection
    LegacyDatasource.connection
  end
end
</pre>
<p>
	Now, extend from the new base class and write your migration as normal.
</p>
<pre>
class AMigration < LegacyMigration
  def self.up
    # ...
  end

  def self.down
    # ...
  end
end
</pre>
<p>
	And you now have a complete solution. Despite the lack of official documentation, it's surprisingly easy to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2010/03/two-datasources-one-rails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CheckStyle-IDEA: Adopt a project!</title>
		<link>http://infernus.org/2009/12/checkstyle-idea-adopt-a-project/</link>
		<comments>http://infernus.org/2009/12/checkstyle-idea-adopt-a-project/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:10:29 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/12/checkstyle-idea-adopt-a-project/</guid>
		<description><![CDATA[As any users have probably noticed, little is happening on this at present bar bug-fixes. This is primarily as I am no longer using it at work and therefore have little inclination to work on it, other than the guilt of support. Therefore, if you are interested in it and would like a try at [...]]]></description>
			<content:encoded><![CDATA[<p>As any users have probably noticed, little is happening on <a href="http://checkstyle-idea.googlecode.com/">this</a> at present bar bug-fixes. This is primarily as I am no longer using it at work and therefore have little inclination to work on it, other than the guilt of support.</p>
<p>Therefore, if you are interested in it and would like a try at either contributing or taking over the project, please drop me a line. I&#8217;d hate to see something I know people are using die through my neglect.</p>
<p>In the meantime, 3.0.9 has been uploaded to Jetbrains with some synchronisation fixes. Hopefully this will fix the NPE a few have seen.</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/12/checkstyle-idea-adopt-a-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009: A Quick &amp; Dirty Recap</title>
		<link>http://infernus.org/2009/12/2009-a-quick-dirty-recap/</link>
		<comments>http://infernus.org/2009/12/2009-a-quick-dirty-recap/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:07:37 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/12/2009-a-quick-dirty-recap/</guid>
		<description><![CDATA[As most have probably noticed, my posting has dropped below its normally abysmal rate into new subterranean depths. Nevertheless, I know some friends &#38; family still occasionally read this in the hope of finding out what I&#8217;m up to and so here&#8217;s a quick &#38; dirty update as I sip wine and ignore the [rather [...]]]></description>
			<content:encoded><![CDATA[<p>As most have probably noticed, my posting has dropped below its normally abysmal rate into new subterranean depths. Nevertheless, I know some friends &amp; family still occasionally read this in the hope of finding out what I&#8217;m up to and so here&#8217;s a quick &amp; dirty update as I sip wine and ignore the [rather chilly] outside world.</p>
<p>Firstly &#8211; why have I not been posting? Two major reasons: firstly, I&#8217;m old enough to recognise my essential insignificance and hence unless I&#8217;ve something concrete to pose about there seems little point in blogging; secondly, <a href="http://twitter.com/jshiell">Twitter</a> fulfils those tiny moments where I need to vent or bitch or even occasionally comment constructively &#8211; and forces me to be brief in my expression as well.</p>
<p>And now, on to the meat of the dish. On the personal side, life continues as it inevitably must. Polly &amp; I are still happily ensconced near the Oval, drinking tea and [in my case] complaining about the commute to work. We&#8217;re still saving for a house, and given the government&#8217;s contempt for those who didn&#8217;t get themselves into silly amounts of debt it looks like we&#8217;ll be saving for a while yet, while the banks profit from the practically absent interest rates. Although I&#8217;m not too bitter &#8211; given that my most cynical estimates of our politicians, leaders and the general populace seem to become closer to proven every time one of such opens their mouths, I&#8217;m merely having my misanthropy confirmed.</p>
<p>Despite air travel becoming more unpleasant every time the authorities see an excuse to extend their grasp a little we did still manage a couple of trips, the major one being Rome. We almost missed that one &#8211; miscalculating our departure times and ending up at Heathrow 30 minutes before the plane took off. However, Alitalia took pity on us and upgraded us to business class, bless them. Rome also turned out to be one of the few places we&#8217;ve left and still felt there was more to see and do, although a break was required before we saw any more Roman ruins &#8211; look upon my works, ye mighty, and despair.</p>
<p>We also resorted to public transport and indulged my inner-boy, visited <a href="http://duxford.iwm.org.uk/">Duxford</a> at Cambridge. Not only do they have a mass of planes, but a tank hall as well &#8211; what better a place to indulge my inner Peter-Pan? Polly then dragged me up to Northumberland for a week, trekking parts of Hadrian&#8217;s wall and even touching on the Lake District. I even managed without Internet for an evening, a feat never (or since) before attempted.</p>
<p>Polly also risked life &amp; limb and had me drive us into deepest darkest Somerset for Ben &amp; Tina&#8217;s wedding &#8211; very traditional and the first time I&#8217;ve been in a church for legit reasons for a long time. Congratulations were combined with catching up with some old friends &#8211; and, for that matter, crowning four years in which Ben and I have managed to avoid each other through shear uselessness.</p>
<p>On the work side, Amigo suffered from drifting goals and the business decided to kill it, making us redundant. Worse, this happened after a month&#8217;s planning on the subject of escaping Hammersmith and moving to the West End. Still, after a two week break where little was accomplished (and much fun was had) I returned to Signature, rejoining their efforts at world domination via online multi-player gaming, and getting work with grid-based systems as well. So, apart from my still being in Hammersmith I cannot really complain on that front.</p>
<p>I&#8217;ve also ended up biking more frequently &#8211; between the RMT finding any excuse to strike and the conditions on the Tube during summer it has proved a blessing. And besides, it does wonders for my hips.</p>
<p>On the hobby side, I&#8217;ve been struggling with the joys of open source &#8211; it&#8217;s all very fun creating a project, but support (especially when you end up not using it yourself) soon becomes a horrid drag. And so I&#8217;ve ended up being much less productive on that front than I should have, although I hope to learn some Cocoa in the new year as a start at remedying this. Whether I dare release it is another matter entirely.</p>
<p>I&#8217;ve also played too much World of Warcraft, although that is now firmly under control thanks to Blizzard, who did their best to destroy the game with their 3.2 patch. In return, however, I&#8217;ve picked up EVE and even worse got involved with Goonswarm, and so I have other terrible things to waste my time on. Add to this the superb Dragon Age: Origins, and time becomes a scarce resource.</p>
<p>And so that&#8217;s a quick, clean summary of my year. Needless to say, I can&#8217;t see updates coming much more frequently in the new year &#8211; <a href="http://www.flickr.com/photos/jshiell/">Flickr</a> and <a href="http://twitter.com/jshiell">Twitter</a> remain better resources to track me. But hope springs eternal.</p>
<p>Happy New Year to you all!</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/12/2009-a-quick-dirty-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CheckStyle IDEA 3.0 Release</title>
		<link>http://infernus.org/2009/06/checkstyle-idea-30-release/</link>
		<comments>http://infernus.org/2009/06/checkstyle-idea-30-release/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 14:43:12 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/06/checkstyle-idea-30-release/</guid>
		<description><![CDATA[After a long long wait, I&#8217;ve finally bit the bullet and released CheckStyle-IDEA 3.0. What is it? Integrated real-time and static CheckStyle scanning for IntelliJ IDEA 7 and 8. What&#8217;s new in 3.0? CheckStyle 5.0 support (thanks to jicken) Per-module configuration support Severity filtering on result list. Please note that you will need to reconfigure [...]]]></description>
			<content:encoded><![CDATA[<p>After a long long wait, I&#8217;ve finally bit the bullet and released <a href="http://checkstyle-idea.googlecode.com/">CheckStyle-IDEA 3.0</a>.</p>
<p><b>What is it?</b> Integrated real-time and static <a href="http://checkstyle.sf.net/">CheckStyle</a> scanning for <a href="http://www.jetbrains.com/idea/index.html">IntelliJ IDEA</a> 7 and 8.</p>
<p><b>What&#8217;s new in 3.0?</b></p>
<ul>
<li>CheckStyle 5.0 support (thanks to <a href="http://code.google.com/u/jicken/">jicken</a>)</li>
<li>Per-module configuration support</li>
<li>Severity filtering on result list.</li>
</ul>
<p><b>Please note</b> that you will need to reconfigure the plugin, due to changes in how we store configuration information. Annoying, but it was necessary to support multiple configuration files.</p>
<p>As always, you can find it in the <a href="http://plugins.intellij.net/plugin/?id=1065">IntelliJ Plugin repository</a>. And please throw any bugs you find into the <a href="http://code.google.com/p/checkstyle-idea/issues/">issue tracker</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/06/checkstyle-idea-30-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux love for TeamCity</title>
		<link>http://infernus.org/2009/02/linux-love-for-teamcity/</link>
		<comments>http://infernus.org/2009/02/linux-love-for-teamcity/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 15:41:22 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/02/linux-love-for-teamcity/</guid>
		<description><![CDATA[For far too long we&#8217;ve been running our TeamCity build agents on Windows 2003 Server. This was, originally, driven by necessity. We were using Selenium, and out client cared only for a single browser: Internet Explorer. As time progressed we decided Selenium was costing us more than we received from it, so we dropped it. [...]]]></description>
			<content:encoded><![CDATA[<p>For far too long we&#8217;ve been running our <a href="http://www.jetbrains.com/teamcity/index.html">TeamCity</a> build agents on Windows 2003 Server. This was, originally, driven by necessity. We were using Selenium, and out client cared only for a single browser: Internet Explorer. As time progressed we decided Selenium was costing us more than we received from it, so we dropped it. And so we ended up using Windows to build for historical reasons only. And, of course, inertia.</p>
<p>So, over the last day or two, I&#8217;ve been building up replacements. Our build box is actually a PowerEdge 1950, split into two machines with the aid of <a href="http://www.vmware.com/products/esxi/">VMWare ESXi</a>. So I hacked together a build agent on VMWare Fusion to use as a template, copied it onto ESX, and set it spinning.</p>
<p>This was the point I got a kick in the arse. We were using Ubuntu 8.10 64bit &#8211; and ESX didn&#8217;t like it one bit. So I dragged a LCD and keyboard up to the server room and had a nose in the BIOS &#8211; sure enough, Dell had left VT off. Bloody Dell. I took advantage of the visit to <a href="http://www.yellow-bricks.com/2008/08/10/howto-esxi-and-ssh/">hack SSH on in ESXi</a> and headed downstairs.</p>
<p>No luck. Same error.</p>
<p>An hour later I stumbled on the solution. The VM had paravirtualisation turned on. Paravirtualisation, apparently, only supports 32bit hosts. Off went paravirtualisation and on went the build server. Win!</p>
<p>So, victory, one less Windows server, and once more a severe wish that VMWare would produce Infratructure Client for either Linux or Mac OS X.</p>
<p>That wasn&#8217;t all I learnt of value, however. JetBrains are good enough to <a href="http://www.jetbrains.net/confluence/display/TCD4/Setting+up+and+Running+Additional+Build+Agents">tell you how to start TeamCity automatically</a> on Windows (via a server) and the Mac (via launchd) and complete omit Linux. So I went and found out about <a href="http://upstart.ubuntu.com/">Upstart</a>.</p>
<p>End solution: create the scripts below in /etc/event.d. They&#8217;ll run on startup/shutdown, and can also be started manually using:</p>
<pre>sudo start [start|stop]-teamcity-buildagent</pre>
<h2>/etc/event.d/start-teamcity-buildagent</h2>
<pre>
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

console output

script
	exec su -l buildagent -c '/opt/build-agent/bin/agent.sh start'
end script
</pre>
<h2>/etc/event.d/stop-teamcity-buildagent</h2>
<pre>
start on shutdown

console output
script
	exec su -l buildagent -c '/opt/build-agent/bin/agent.sh stop'
end script
</pre>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/02/linux-love-for-teamcity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building Java 7 on Mac OS X</title>
		<link>http://infernus.org/2009/02/building-java-7-on-mac-os-x/</link>
		<comments>http://infernus.org/2009/02/building-java-7-on-mac-os-x/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 22:11:13 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/02/building-java-7-on-mac-os-x/</guid>
		<description><![CDATA[Update 26/5/9: Updated for last night&#8217;s source with the JIBX libraries, and note on the version of XCode. So, I&#8217;ve just got my laptop back after a brief separation. What does one do? Compile the JDK, of course! For those unfamiliar with the situation, Apple hate Java developers. Well, one suspects they do. Apple being [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update 26/5/9:</b> Updated for last night&#8217;s source with the JIBX libraries, and note on the version of XCode.</p>
<p>So, I&#8217;ve just got my laptop back after a brief separation. What does one do?</p>
<p>Compile the JDK, of course!</p>
<p>For those unfamiliar with the situation, Apple hate Java developers. Well, one suspects they do. Apple being Apple, one never knows. We could get Java 1.6.0_12 with 32bit support tomorrow, or it could never come. You&#8217;ll never know until it appears.</p>
<p>Luckily, <a href="http://landonf.bikemonkey.org/">Landon Fuller</a> loves us. Which Apple play with their iPhones, he beat the OpenJDK into submission on OS X. Only drawback &#8211; Swing is X11 based. But still, it&#8217;s JDK6 for 10.4, 10.5 and in both 32 and 64bit, and available as <a href="http://landonf.bikemonkey.org/static/soylatte/">SoyLatte</a>.</p>
<p>This work has all found its way back into the trunk, and so JDK7 is buildable on the Mac (usually). The only catch: the instructions are scattered, and often vary slightly. So I&#8217;m documenting them here for tonight&#8217;s build, mostly for my reference.</p>
<p>Thanks go to Landon Fuller and <a href="http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-January/000499.html">Stephen Bannasch</a> for putting these together.</p>
<p>1. Get version 3.1 (or above, presumably) of XCode.</p>
<p>2. Download <a href="http://landonf.bikemonkey.org/static/soylatte/">SoyLatte</a>. I found the JDK7 build Landon released in 2008 did not work as a bootstrap.</p>
<p>3. Get Mercurial</p>
<pre>sudo port install mercurial +bash_completion</pre>
<p>4. Install the Forest extension</p>
<pre>hg clone http://bitbucket.org/pmezard/hgforest-crew</pre>
<p>You&#8217;ll need to point Mercurial at the hgforest-crew directory, by adding the following to ~/.hgrc:</p>
<pre>[extensions]
hgext.forest=/opt/hgforest-crew/forest.py</pre>
<p>5. Grab Kurt Miller&#8217;s BSD binary plugs:</p>
<pre>wget http://www.intricatesoftware.com/distfiles/jdk-7-icedtea-plugs-1.6b.tar.gz</pre>
<p>6. Get the JIBX libraries (version 1.1.5) from:</p>
<pre>http://sourceforge.net/project/showfiles.php?group_id=69358&#038;package_id=68290</pre>
<p>7. Check out the OpenJDK:</p>
<pre>hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port</pre>
<p>8. Place the following in build.sh in the bsd-port directory (modify as appropriate, depending on where you placed downloaded items):</p>
<pre>LC_ALL=C
LANG=C
unset CLASSPATH
unset JAVA_HOME
make \
  ALT_BOOTDIR=/opt/soylatte16-i386-1.0.3/ \
  ALT_BINARY_PLUGS_PATH=/opt/jdk-7-icedtea-plugs \
  ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \
  ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \
  ALT_JIBX_LIBS_PATH=/opt/jibx/lib \
  ALT_CUPS_HEADERS_PATH=/usr/include \
  ANT_HOME=/usr/share/ant \
  NO_DOCS=true \
  HOTSPOT_BUILD_JOBS=2</pre>
<p>9. Run, and cross your fingers!</p>
<p>10. I ran into a ld error (archive has no table of contents). Should you hit this, try the following and then rerun build.sh:</p>
<pre>ranlib build/bsd-i586/tmp/java/fdlibm/obj/*.a</pre>
<p>11. Copy bsd-port/build/bsd-i586/j2sdk-image somewhere useful &#8211; and you&#8217;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/02/building-java-7-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Pixels of Doom!</title>
		<link>http://infernus.org/2009/02/pixels-of-doom/</link>
		<comments>http://infernus.org/2009/02/pixels-of-doom/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 21:30:19 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/02/pixels-of-doom/</guid>
		<description><![CDATA[About November last year I developed the afflication that all LCDs owners fear. Dead pixels. But not just one. Or two. Rather, I developed a cluster below the screen centre. In my darker moments I wondered if, like the black hole it resembled, it would slowly eat up my monitor, before sucking in my phone, [...]]]></description>
			<content:encoded><![CDATA[<p>About November last year I developed the afflication that all LCDs owners fear.</p>
<p>Dead pixels.</p>
<p>But not just one. Or two. Rather, I developed a cluster below the screen centre. In my darker moments I wondered if, like the black hole it resembled, it would slowly eat up my monitor, before sucking in my phone, tea, desk, living room&#8230;</p>
<p>Needless to say it had to be fixed. Before it was too late.</p>
<p>In reality, &#8216;too late&#8217; means &#8216;before the warranty expires&#8217;. Which is next week. And given I use my laptop for home, work and as a hot water bottle, I don&#8217;t like being separated from it. Further, I&#8217;ve heard horror stories before &#8211; Ivan in particular told me how his dead pixels had been scorned by Apple.</p>
<p>In any case, I bit the bullet last week and managed to get a Genius Bar appointment. Although it took some time, they agreed it required fixing and ordered the bits. I then dropped my laptop in Friday evening, which the promise it would be fixed in 3 to 4 days.</p>
<p>At 1500 the next day my phone rang. The laptop was ready.</p>
<p>So, for the price of two tube tickets and 24 hours of Windows-only living I have a brand new LCD. Thanks Apple!</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/02/pixels-of-doom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration</title>
		<link>http://infernus.org/2009/02/migration/</link>
		<comments>http://infernus.org/2009/02/migration/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 21:33:16 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://infernus.org/2009/02/migration/</guid>
		<description><![CDATA[Today, the most romantic day of the year, I finally sorted out this website. Previously I&#8217;d been running Drupal. Drupal has many good features &#8211; the problem is that it&#8217;s a better community CMS than a single-person blogging tool. Given that I seem to be slowly surrendering control over my tools to the cloud, the [...]]]></description>
			<content:encoded><![CDATA[<p>Today, the most romantic day of the year, I finally sorted out this website.</p>
<p>Previously I&#8217;d been running <a href="ttp://drupal.org/">Drupa</a>l. Drupal has many good features &#8211; the problem is that it&#8217;s a better community CMS than a single-person blogging tool. Given that I seem to be slowly surrendering control over my tools to the cloud, the lack of export facilities was also a killer. And so I&#8217;ve migrated to <a href="http://wordpress.org/">WordPress</a>.</p>
<p>Migration did look like it would prove a headache; luckily, I realised soon enough that I could just drag &amp; drop in <a href="http://illuminex.com/ecto/">ecto</a>. I&#8217;ve lost the [few] comments, and post categories, but it was otherwise entirely painless. I&#8217;ve also given up on my own theme &#8211; I&#8217;ve just tweaked one of the many nice themes for WordPress, and saved myself a heap of time.</p>
<p>Polly has had her blog go the whole mile &#8211; it&#8217;s now hosted on <a href="http://wordpress.com/">wordpress.com</a>. My own is still on my <a href="http://www.a2hosting.com/">A2</a> account, since I&#8217;ve already paid for it. However, it&#8217;s now a trivial exercise to move it off if I decide to. My photos, links and email are all farmed out &#8211; it seems silly to bugger about with web hosting.</p>
]]></content:encoded>
			<wfw:commentRss>http://infernus.org/2009/02/migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: infernus.org @ 2012-02-04 19:54:38 -->
