<?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>kotfu.net &#187; Software</title>
	<atom:link href="http://www.kotfu.net/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kotfu.net</link>
	<description></description>
	<lastBuildDate>Thu, 15 Sep 2011 19:45:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Give a little credit</title>
		<link>http://www.kotfu.net/2011/08/give-a-little-credit/</link>
		<comments>http://www.kotfu.net/2011/08/give-a-little-credit/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 16:21:33 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=219</guid>
		<description><![CDATA[Yesterday I saw Matt Drance&#8217;s post about webkit turning ten. He omitted one important fact, and mis-stated another. First, WebKit does not power &#8220;nearly every relevant browser and engine used today&#8221;. WebKit does have the mobile space locked up: Android, &#8230; <a href="http://www.kotfu.net/2011/08/give-a-little-credit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I saw <a href="http://www.appleoutsider.com/2011/08/24/webkit/">Matt Drance&#8217;s post about webkit turning ten</a>.  He omitted one important fact, and mis-stated another.</p>
<p>First, WebKit does not power &#8220;nearly every relevant browser and engine used today&#8221;.  WebKit does have the mobile space locked up: Android, iOS and WebOS all use WebKit for their mobile browsers.  Windows Phone 7 does not.  However, on the desktop, WebKit is a distant third.  Trident (the IE rendering engine), and Gecko (the Firefox rendering engine) both have a larger share of users than WebKit.  Matt&#8217;s statement is misleading at best.</p>
<p>Secondly, there was no mention at all of where WebKit came from.  It was not born in Cupertino.  WebKit was <a href="http://lists.kde.org/?l=kfm-devel&#038;m=104197092318639&#038;w=2">forked</a> from KHTML and KJS, part of the KDE project (yes kids that&#8217;s linux).  Matt linked to the first changeset in the WebKit repo, here&#8217;s the <a href="http://trac.webkit.org/changeset/4">4<sup>th</sup> changeset</a>, with a pile of KHTML code.</p>
<p>There is no doubt that WebKit is the best <del datetime="2011-08-25T22:13:31+00:00">open source</del> rendering engine out there, and Apple did most of the work to make it that way.  Here&#8217;s my nod to the KDE project for getting that all started, since neither Drance or <a href="http://daringfireball.net/linked/2011/08/24/webkit">Gruber</a> gave any props.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2011/08/give-a-little-credit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jactiveresource 0.4 released</title>
		<link>http://www.kotfu.net/2011/08/jactiveresource-0-4-released/</link>
		<comments>http://www.kotfu.net/2011/08/jactiveresource-0-4-released/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 00:25:45 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[jactiveresource]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=187</guid>
		<description><![CDATA[I&#8217;ve made a new release of jactiveresource, a Java port of the ActiveResource module in Rails. Many classes have been refactored, enabling better test coverage. Creation of http client objects has been refactored as well, making it super easy to &#8230; <a href="http://www.kotfu.net/2011/08/jactiveresource-0-4-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a new release of <a href="http://jactiveresource.org">jactiveresource</a>, a Java port of the <a href="http://api.rubyonrails.org/classes/ActiveResource/Base.html">ActiveResource</a> module in Rails.  Many classes have been refactored, enabling better test coverage.  Creation of http client objects has been refactored as well, making it super easy to implement any authentication scheme out there. Thanks to Filepe Leme for his contributions in this release.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2011/08/jactiveresource-0-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe AIR on amd64 or ia64 Ubuntu/Kubuntu</title>
		<link>http://www.kotfu.net/2009/04/adobe-air-on-amd64-or-ia64-ubuntukubuntu/</link>
		<comments>http://www.kotfu.net/2009/04/adobe-air-on-amd64-or-ia64-ubuntukubuntu/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 14:33:25 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=23</guid>
		<description><![CDATA[Adobe does not yet have a 64 bit version of the AIR SDK or runtime for Linux. They do have some instructions for getting it to work. If you run Ubuntu, it is much simpler. just type: $ sudo aptitude &#8230; <a href="http://www.kotfu.net/2009/04/adobe-air-on-amd64-or-ia64-ubuntukubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Adobe does not yet have a 64 bit version of the AIR SDK or runtime for Linux.  They do have <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=kb408084&#038;sliceId=1">some instructions</a> for getting it to work.  If you run Ubuntu, it is much simpler. just type:</p>
<pre>
$ sudo aptitude install ia32-libs lib32asound2 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32z1 libc6 libc6-i386
</pre>
<p>I have only tested this on Jaunty, so I can&#8217;t promise it works on earlier releases, but it&#8217;s lots easier than the manual unpacking stuff on Adobe&#8217;s page.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2009/04/adobe-air-on-amd64-or-ia64-ubuntukubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zenoss Plugins now support OpenBSD</title>
		<link>http://www.kotfu.net/2008/11/zenoss-plugins-now-support-openbsd/</link>
		<comments>http://www.kotfu.net/2008/11/zenoss-plugins-now-support-openbsd/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 23:16:41 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[zenoss]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=21</guid>
		<description><![CDATA[Zenoss is a great open source system monitoring tool. I usually configure it to get data using SNMP. However, I have a few remote OpenBSD boxes that I want to keep an eye on, and I am not going to &#8230; <a href="http://www.kotfu.net/2008/11/zenoss-plugins-now-support-openbsd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zenoss.com">Zenoss</a> is a great open source system monitoring tool.  I usually configure it to get data using SNMP.  However, I have a few remote OpenBSD boxes that I want to keep an eye on, and I am not going to expose SNMP to the universe.  Zenoss has a cool thing called <a href="http://www.zenoss.com/community/docs/howtos/zenoss-plugins/">Zenoss Plugins</a> which let your collector SSH into a machine and get basic statistics.  The current version of Zenoss Plugins (2.0.4) does not have support for OpenBSD.<br />
Here&#8217;s how you add it:</p>
<p><span id="more-21"></span><br />
1.  Get <a href="http://pypi.python.org/pypi/setuptools">Python setuptools</a> if you don&#8217;t have it already.  Zenoss Plugins requires setuptools in order to run.<br />
2.  Download Zenoss Plugins from <a href="http://downloads.sourceforge.net/zenoss/Zenoss-Plugins-2.0.4.tar.gz">SourceForge</a> and put them on your OpenBSD machine.<br />
3.  Extract the files.  You&#8217;ll have a <tt>Zenoss-Plugins-2.0.4</tt> directory.<br />
4.  Download <a href='http://www.kotfu.net/wp-content/uploads/2008/11/openbsd4.py'>openbsd4.py</a> and put it in the <tt>Zenoss-Plugins-2.0.4/zenoss/plugins</tt> directory.<br />
5.  Run <tt>sudo python setup.py install</tt><br />
6.  Test it out by running <tt>zenplugin.py cpu</tt><br />
This OpenBSD plugin supports the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ zenplugin.py cpu
$ zenplugin.py mem
$ zenplugin.py disk [mount_point]
$ zenplugin.py intf [network_interface]</pre></div></div>

<p>I have taken the liberty of assigning the copyright for this script to Zenoss, Inc. in hopes that they will include it in the next release of Zenoss Plugins.<br />
Happy monitoring.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2008/11/zenoss-plugins-now-support-openbsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Bespin on Kubuntu 8.10</title>
		<link>http://www.kotfu.net/2008/11/installing-bespin-on-kubuntu-8-10/</link>
		<comments>http://www.kotfu.net/2008/11/installing-bespin-on-kubuntu-8-10/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 15:51:28 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[kubuntu]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=20</guid>
		<description><![CDATA[I have I have had Kubuntu 8.10 (Intrepid) on one of my machines for a month or so. I really miss baghira, which makes linux look at much like OSX as linux can look. Alas, there will be no baghira &#8230; <a href="http://www.kotfu.net/2008/11/installing-bespin-on-kubuntu-8-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have I have had Kubuntu 8.10 (Intrepid) on one of my machines for a month or so.  I really miss <a href="http://www.kde-look.org/content/show.php?content=8692">baghira</a>, which makes linux look at much like OSX as linux can look.  Alas, there will be no baghira for QT4.  I thought I&#8217;d try out <a href="http://cloudcity.sourceforge.net/">cloudcity</a> (or bespin, I can&#8217;t figure out what the real name is), written by the same guy who wrote baghira.  It&#8217;s not an OSX clone (boo), it&#8217;s still early code, and you&#8217;ll have to compile your own, but it&#8217;s not hard.  Here&#8217;s what I did:</p>
<p><span id="more-20"></span><br />
First, get the necessary development packages installed:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ sudo apt-get install build-essential cmake kdebase-dev kdelibs5-dev libplasma-dev kdebase-workspace-dev subversion</pre></div></div>

<p>There is quite a bit of stuff to download and install here, so it&#8217;s gonna take a few minutes.  After it&#8217;s done, get cloudcity out of subversion:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ svn co https://cloudcity.svn.sourceforge.net/svnroot/cloudcity</pre></div></div>

<p>This will make a directory called `cloudcity` wherever you are.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ cd cloudcity
$ bash configure</pre></div></div>

<p>Yes the configure script needs bash&#8230;.. it will likely break if you just do `./configure`</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ cd build
$ make</pre></div></div>

<p>It will compile, and you&#8217;ll see lots of warnings.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">$ sudo make install</pre></div></div>

<p>Now you can go to System Settings and Bespin will be a choice for window decorations and widget styles.</p>
<p>Enjoy.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2008/11/installing-bespin-on-kubuntu-8-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jactiveresource launched</title>
		<link>http://www.kotfu.net/2008/05/jactiveresource-launched/</link>
		<comments>http://www.kotfu.net/2008/05/jactiveresource-launched/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:10:08 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[ActiveResource]]></category>
		<category><![CDATA[jactiveresource]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=19</guid>
		<description><![CDATA[ActiveResource is one of the cooler parts of Ruby on Rails. It uses the dynamic goodness of ruby to consume RESTful resources without having to hardly write any code. How about this for a stupid-easy class: class Person < ActiveResource::Base &#8230; <a href="http://www.kotfu.net/2008/05/jactiveresource-launched/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryandaigle.com/articles/2006/06/30/whats-new-in-edge-rails-activeresource-is-here">ActiveResource</a> is one of the cooler parts of Ruby on Rails.  It uses the dynamic goodness of ruby to consume RESTful resources without having to hardly write any code.  How about this for a stupid-easy class:</p>
<pre>
class Person < ActiveResource::Base
site = http://api.example.com
end
</pre>
<p>Three lines of code makes a proxy class for a remote service, ActiveResource dynamically figures everything else out.<br />
I needed some Java code that could consume RESTful resources in a Rails application.  I looked around to see if I could find any code that would do this for me.  I found <a href="http://www.restlet.org/">Restlet</a>, which looks like a pretty good server side framework for writing and publishing restful services, but I need the client side of that.  So I decided to start a new project called <a href="http://jactiveresource.org">jactiveresource</a>, which is a port of ActiveResource to java.  Because java is statically typed it won't be quite as easy as it is in ruby, but I think we can get close.  This weekend I stood up a site to host it, and got the first bits of code working.  Stay tuned....</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2008/05/jactiveresource-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The perfect template engine</title>
		<link>http://www.kotfu.net/2008/04/the-perfect-template-engine/</link>
		<comments>http://www.kotfu.net/2008/04/the-perfect-template-engine/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 14:37:17 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=17</guid>
		<description><![CDATA[There are a ton of template engines out there, for every different language and platform you can imagine. Some people claim PHP is just a fancy template engine. Others say printf is the first and only real template engine. There &#8230; <a href="http://www.kotfu.net/2008/04/the-perfect-template-engine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a ton of template engines out there, for every different language and platform you can imagine.  Some people claim PHP is just a fancy template engine.  Others say printf is the first and only real template engine.  There are many tools out there that meet various niches and requirements in this fairly broad space.  Many templating engines are only available for one or two programming languages/platforms.  Without debating the merits of the platforms, here are the criteria for the perfect template engine.</p>
<p><span id="more-17"></span></p>
<h3>Be output format agnostic</h3>
<p>Template engines are most commonly used to produce SGML and it&#8217;s derivitives, XML and HTML.  However, most applications of any substantial size have a need to generate other forms of output, like email messages, or SMS messages, CSS, JavaScript, or (heaven forbid) dynamic SQL.  if your template engine is based on XML tags, it makes it kinda hard to generate other kinds of output.  So why not use two template engines, one for SGML/XML/HTML and one for other stuff?  <a href="http://genshi.edgewall.org/">Genshi</a> is one of the better examples of this approach.  They have a single engine that can support two different template syntaxes; one based on XML, one that isn&#8217;t.  But isn&#8217;t it smarter to have a single template syntax that can gracefully handle any kind of output?</p>
<h3>Looks</h3>
<p>How it looks matters.  The templates should be pretty, and the output should be pretty, and the template should look similar to the output.  For example, <a href="http://haml.hamptoncatlin.com/">HAML</a> is pretty, and the output is pretty, but the template doesn&#8217;t look much like the output.  <a href="http://velocity.apache.org/">Velocity</a> templates look OK, the output looks similar to the template, but the output is ugly, it&#8217;s darn near impossible to have a nicely indented template and nicely indented output.</p>
<h3>Speed</h3>
<p>The engine has to be fast.  It doesn&#8217;t make much sense for your application to spend a huge percentage of it&#8217;s time rendering a display.  That should be the easy part of your application.  I know that CPU and RAM are cheaper than they have ever been, and I believe in horizontal scalability, but I also believe in clean, fast code.  XSLT is great at a lot of things, but it is _so_ slow.</p>
<h3>Code does not belong in templates</h3>
<p>We are talking about a template engine, not a compiler.  You should not be able to put &#8220;code&#8221; in your template.  This is one of the things I hate about PHP, JSP and ERB.  Even though you shouldn&#8217;t, you can put any hunk of code you want into your template.  PHP is a fairly robust object oriented programming language, but at it&#8217;s roots, it was a template tool, and I can put any chunk of code I want into my &#8220;template&#8221;.  If your template language can handle exceptions, or has the notion of subclassing, then it isn&#8217;t a template, it&#8217;s a programming language.</p>
<h3>Logic does belong in templates</h3>
<p>There is a place in a template engine for making decisions, just not complicated ones.  Looping constructs, conditional statements and variable assignment are all perfectly acceptable things to do in a template.  Lots of template engines have this right, with just the right number and function of their template commands.  <a href="http://www.clearsilver.net/docs/man_templates.hdf">ClearSilver</a>, <a href="http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html">Velocity</a> and <a href="http://www.smarty.net/manual/en/language.builtin.functions.php">Smarty</a> are good examples of the proper scope of implementation.</p>
<h3>Allow definition and calling of macros</h3>
<p>I am a firm believer in not repeating myself.  The template language should let me define macro&#8217;s or snippets or whatever you want to call your reusable hunks of template.  The engine should allow for some kind of include directive, so that my commonly used macros can live in a separate file and be accessed from a number of different templates.  JSP tag libraries are exactly the right idea, although perhaps carried a bit far.</p>
<h3>Can be processed to an intermediate representation for effeciency purposes</h3>
<p>We would call this compiling your template, but that would make people think that you can put code in your template.  And that is wrong.  But there is nothing wrong with making it fast.  <a href="http://www.cheetahtemplate.org/">Cheetah</a> does this, and so does <a href="http://www.smarty.net/whyuse.php">Smarty</a>.  Cheetah&#8217;s way is better, because processing to an intermediate representation for effeciency purposes (compiling) is a development activity, not a run-time activity.  In some languages the interpreter is the compiler (Python and Ruby), but that&#8217;s no excuse to do something dumb like compiling at run-time.  On a related side note, optimizing runtime performance is a worthwhile and encouraged activity (say what you want about Java, but the HotSpot Virtual Machine is dang cool), and yes, I&#8217;m aware that these are essentially the same activities.</p>
<h3>Support layouts</h3>
<p>And don&#8217;t be backwards.  Include != layout.  Rails has a <a href="http://api.rubyonrails.org/classes/ActionController/Layout/ClassMethods.html">very nice layout facility</a>.  It essentially let you &#8220;include&#8221; the changing content, instead of &#8220;including&#8221; the static content.  The <a href="http://genshi.edgewall.org/wiki/GenshiTutorial#AddingaLayoutTemplate">genshi method</a> works, but isn&#8217;t quite as elegant; XML is too verbose to really be elegant.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2008/04/the-perfect-template-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Kubuntu 7.10 (Gutsy Gibbon) on an ThinkPad X61 Tablet</title>
		<link>http://www.kotfu.net/2007/10/installing-kubuntu-7-10-gutsy-gibbon-on-an-thinkpad-x61-tablet/</link>
		<comments>http://www.kotfu.net/2007/10/installing-kubuntu-7-10-gutsy-gibbon-on-an-thinkpad-x61-tablet/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 13:57:05 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[gutsy]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[thinkpad x61]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=14</guid>
		<description><![CDATA[This weekend I installed Gutsy, now officially known as Kubuntu 7.10 on my X61. I decided I&#8217;d try and write up a guide on thinkwiki.org. Because I don&#8217;t have an optical drive for my laptop, installation was a bit tricky, &#8230; <a href="http://www.kotfu.net/2007/10/installing-kubuntu-7-10-gutsy-gibbon-on-an-thinkpad-x61-tablet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This weekend I installed Gutsy, now officially known as <a href="http://kubuntu.org/announcements/7.10-release.php">Kubuntu 7.10</a> on my X61.  I decided I&#8217;d try and write up a guide on <a href="http://thinkwiki.org/wiki/Installing_Kubuntu_7.10_(Gutsy_Gibbon)_on_an_X61_Tablet">thinkwiki.org</a>.  Because I don&#8217;t have an optical drive for my laptop, installation was a bit tricky, I ended up booting off the network.  Once over that hurdle, everything else pretty much just worked.  No fussing with X configuration settings, wired and wireless network just worked, sound worked etc.  Installing Linux has come a long way in the last few years.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2007/10/installing-kubuntu-7-10-gutsy-gibbon-on-an-thinkpad-x61-tablet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHCP Failover on OpenBSD</title>
		<link>http://www.kotfu.net/2007/10/dhcp-failover-on-openbsd/</link>
		<comments>http://www.kotfu.net/2007/10/dhcp-failover-on-openbsd/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 13:50:40 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[openbsd]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=12</guid>
		<description><![CDATA[I have been running a DHCP server on my home network for eons now, and today I decided I&#8217;d move it on to my OpenBSD firewall cluster. It probably really shouldn&#8217;t be there but I already run a handful of &#8230; <a href="http://www.kotfu.net/2007/10/dhcp-failover-on-openbsd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been running a DHCP server on my home network for eons now, and today I decided I&#8217;d move it on to my OpenBSD firewall cluster.  It probably really shouldn&#8217;t be there but I already run a handful of other internal services there, like DNS, and NTP.  Running DHCP on the firewall cluster also means that I can upgrade any machine on my network without losing internet access.  Here&#8217;s how I got it set up and working.</p>
<p><span id="more-12"></span><br />
I assume you already have a working dhcpd configuration for your single server, if you don&#8217;t, then you can get a <a href="http://www.openbsd.org/faq/faq6.html#DHCP">basic DHCP configuration</a> from the OpenBSD FAQ.</p>
<p>You need ISC&#8217;s DHCP server (at least version 3), to do DHCP failover.  As of OpenBSD 4.1, they ship version 2 by default.  You can get version 3 out of the packages tree by installing isc-dhcp-server-3.0.4p0.tgz.  It installs itself into /usr/local, so if you want to view the man pages, you have to do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">export MANPATH=/usr/share/man:/usr/local/man</pre></div></div>

<p>otherwise, you won&#8217;t see the new man pages for the config files.<br />
Once you have it installed, you need to get it configured to run at startup.  I did it by adding the following lines to my /etc/rc.conf.local file:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"># turn on dhcpd3
dhcpd3=YES
dhcpd3_flags=&quot;-pf /var/run/dhcpd.pid&quot;</pre></div></div>

<p>I then added some stuff to my /etc/rc.local file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ISC dhcpd3 with failover configured</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> X<span style="color: #ff0000;">&quot;<span style="color: #007800;">${dhcpd3}</span>&quot;</span> == X<span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dhcpd <span style="color: #660033;">-a</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcpd.conf <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>dhcpd.leases
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcpd.interfaces <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">dhcpd_ifs</span>=<span style="color: #000000; font-weight: bold;">`</span>stripcom <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcpd.interfaces<span style="color: #000000; font-weight: bold;">`</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">' dhcpd'</span>
  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dhcpd <span style="color: #800000;">${dhcpd3_flags}</span> <span style="color: #800000;">${dhcpd_ifs}</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>This will get the new version of DHCP started at boot time.  You ought to remember to disable the other dhcpd by putting this line in your rc.conf.local:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">dhcpd_flags=NO          # for normal use: &quot;&quot;</pre></div></div>

<p>No that you are already to start it up, we need to get the /etc/dhcpd.conf file ready.  You probably already have one configured and working.  If so then just do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"># mv /etc/dhcpd.conf /etc/dhcpd.master</pre></div></div>

<p>and then create a new dhcpd.conf file for your primary node that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#
# dhcpd configuration
#
# failover definition
failover peer &quot;dhcp-failover&quot; {
  primary; # declare ourselves primary
  address 192.168.13.6;
  port 520;
  peer address 192.168.13.7;
  peer port 520;
  max-response-delay 10;
  max-unacked-updates 10;
  load balance max seconds 3;
  mclt 1800;
  split 128;
}
# include the rest.  This allows us to copy dhcpd.master
# between the two machines safely
include &quot;/etc/dhcpd.master&quot;;</pre></div></div>

<p>The method to my madness is simple.  The contents of /etc/dhcpd.master can be exactly replicated between you two dhcp servers.  This is where you will have all your subnets, ranges, mac addresses, etc.etc.  Use your favorite method to keep them synched.  The contents of /etc/dhcpd.conf are different on the primary dhcp server and the secondary.  You obviously wouldn&#8217;t want to be copying them all over the place.<br />
Some comments on the new dhcpd.conf file.  The &#8220;dhcp-failover&#8221; string in the</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">failover peer &quot;dhcp-failover&quot; {</pre></div></div>

<p>line can be whatever you want, but we&#8217;re going to use it in several other places, and it has to be the same in all of those places.  You would of course replace the appropriate address and peer address IP addresses with the ones of the two servers you will be balancing.<br />
The /etc/dhcpd.conf file on the secondary server looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#
# dhcpd configuration
#
# failover definition
failover peer &quot;dhcp-failover&quot; {
  secondary; # declare ourselves secondary
  address 192.168.13.7;
  port 520;
  peer address 192.168.13.6;
  peer port 520;
  max-response-delay 10;
  max-unacked-updates 10;
  load balance max seconds 3;
}
# include the rest.  This allows us to copy dhcpd.master
# between the two machines safely
include &quot;/etc/dhcpd.master&quot;;</pre></div></div>

<p>Notice the changes from the primary config file.  The addresses and peer addresses are swapped, and there a couple of missing config lines, that must not be present..<br />
The final step is to modify our /etc/dhcpd.master file so that it knows that it should be failing over.  Here is a small snippet from mine:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">subnet 192.168.13.0 netmask 255.255.255.0 {
  option routers 192.168.13.1;
  option broadcast-address 192.168.13.255;
  pool {
    failover peer &quot;dhcp-failover&quot;;
    deny dynamic bootp clients;
    range 192.168.13.32 192.168.13.47;
  }
}</pre></div></div>

<p>The only new thing here is the failover peer line.  The string there needs to be the same one that we used in our /etc/dhcpd.conf file.<br />
That&#8217;s it.  Now to test it out.<br />
You can fire up the server and prevent if from forking and logging to standard out by doing something like:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"># /usr/local/sbin/dhcpd -pf /var/run/dhcpd.pid -d -f xl0</pre></div></div>

<p>You would of course replace &#8220;xl0&#8243; with the interface on your machine you want the server to listen on.  Look for error messages, etc.  If things are going right, you should see something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">Internet Systems Consortium DHCP Server V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 8 leases to leases file.
Multiple interfaces match the same subnet: xl0 carp0
Multiple interfaces match the same shared network: xl0 carp0
Multiple interfaces match the same subnet: xl0 carp2
Multiple interfaces match the same shared network: xl0 carp2
Multiple interfaces match the same subnet: xl0 carp3
Multiple interfaces match the same shared network: xl0 carp3
Listening on BPF/xl0/00:01:03:d6:82:a1/192.168.13/24
Sending on   BPF/xl0/00:01:03:d6:82:a1/192.168.13/24
Sending on   Socket/fallback/fallback-net
failover peer dhcp-failover: I move from normal to startup
failover peer dhcp-failover: peer moves from normal to communications-interrupted
failover peer dhcp-failover: I move from startup to normal
failover peer dhcp-failover: peer moves from communications-interrupted to normal
pool 80f93200 192.168.15/24 total 16  free 16  backup 0  lts -8
pool 80f93100 192.168.13/24 total 16  free 8  backup 7  lts 0
pool 80f93200 192.168.15/24  total 16  free 16  backup 0  lts 8</pre></div></div>

<p>Now you can try to get a client on your network to request an address, and you should see it happen.  If that all works right, then you should try rebooting your machines, making sure that everything comes up propertly on startup.  You can now experiment with taking one or the other server down, and you should still be able to DHCP properly.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2007/10/dhcp-failover-on-openbsd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Running xntpd on my OpenBSD firewall cluster</title>
		<link>http://www.kotfu.net/2007/10/running-xntpd-on-my-openbsd-firewall-cluster/</link>
		<comments>http://www.kotfu.net/2007/10/running-xntpd-on-my-openbsd-firewall-cluster/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 13:52:34 +0000</pubDate>
		<dc:creator>kotfu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[carp]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[ntpd]]></category>
		<category><![CDATA[openbsd]]></category>

		<guid isPermaLink="false">http://www.kotfu.net/?p=13</guid>
		<description><![CDATA[Now that my firewall cluster is working better, I can add some additional critical services to it. For a long time I have run a time server on a machine on my network so we can have consistant accurate time. &#8230; <a href="http://www.kotfu.net/2007/10/running-xntpd-on-my-openbsd-firewall-cluster/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Now that my firewall cluster is working better, I can add some additional critical services to it.  For a long time I have run a time server on a machine on my network so we can have consistant accurate time.  I thought I would move this over to my firewall cluster, giving me redundant time servers.  The setup was pretty easy.</p>
<p>First, get the xntpd package for OpenBSD from your favorite mirror.  OpenNTPD is fine, but the lack of the ntpq command is enough for me to not use it.  Once you have xntpd installed, we need to get it set up so it will run when you boot.<br />
<span id="more-13"></span><br />
Add the following lines to /etc/rc.conf.local:</p>
<pre>
# flags to get xntpd started
xntpd=YES
xntpdate_flags="pool.ntp.org"
</pre>
<p><strong>Then add the following to /etc/rc.local:</strong></p>
<pre># xntpd stuff
# run ntpdate prior to ntpd
if [ $securelevel -le 1 -a X"${xntpdate_flags}" != X"NO" \
-a -x /usr/local/sbin/ntpdate ]; then
echo -n ' ntpdate'
/usr/local/sbin/ntpdate -b ${xntpdate_flags} >/dev/null
fi
if [ X"${xntpd}" == X"YES" -a -x /usr/local/sbin/ntpd \
-a -e /etc/ntp.conf ]; then
xntpd_flags="-p /var/run/ntpd.pid"
if [ $securelevel -ge 1 ]; then
xntpd_flags="${xntpd_flags} -x"
fi
echo -n ' ntpd'; /usr/local/sbin/ntpd ${xntpd_flags}
fi
</pre>
<p>Now that it will start and run, we just need a config file.  OpenNTPD uses /etc/ntpd.conf as it&#8217;s configuration file, xntpd uses /etc/ntp.conf.  Here&#8217;s my ntp.conf file from one of the machines in the cluster:</p>
<pre># /etc/ntp.conf:  Configuration file for ntpd.
#
logfile         /var/log/ntpd.log
driftfile       /etc/ntp.drift
keys            /etc/ntp.keys
# set up our keys for run time modification
requestkey 137
controlkey 137
trustedkey 137
#enable auth
# time servers
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
# use local system clock if all else fails
server 127.127.1.0 iburst
fudge 127.127.1.0 stratum 11
# restrict who can get time from us
restrict 127.0.0.1
restrict 192.168.13.0 mask 255.255.255.0
restrict default nomodify nopeer
</pre>
<p>Note how I am using <a href="http://www.pool.ntp.org">pool.ntp.org</a> as my time servers.  This gets me a randomly assigned time server each time I boot the machine.  The config file on the other machine in the cluster is exactly the same, except that I am not using the ntp pool.  I found several restricted time servers, and have acquired permission to utilize their services.  This means that I will be sure and have different time sources on each of my time servers.<br />
Notice also how I have the:</p>
<pre># use local system clock if all else fails
server 127.127.1.0 iburst
fudge 127.127.1.0 stratum 11
</pre>
<p>section in the file.  This makes it so that if I lose internet connectivity, this time server will look at the local clock for a time source, so at least all the machines on my network will drift time together.  The other machine in the cluster has it&#8217;s local clock set to stratum 10, so there will only be one &#8220;master&#8221; local clock.</p>
<p>All the clients on my network now have a simple configuration file to use these two new time servers.  It looks like this:</p>
<pre># /etc/ntp.conf:  Configuration file for ntpd.
#
logfile         /var/log/ntpd.log
driftfile       /etc/ntp.drift
keys            /etc/ntp.keys
# set up our keys for run time modification
requestkey 137
controlkey 137
trustedkey 137
#enable auth
# time servers
server tick.kotfu.net iburst
server tock.kotfu.net iburst
# use local system clock if all else fails
server 127.127.1.0 iburst
fudge 127.127.1.0 stratum 13
# restrict who can get time from us
restrict 127.0.0.1
restrict 192.168.13.0 mask 255.255.255.0
restrict default nomodify nopeer noquery noserve
</pre>
<p>Now I have my own redundant, reliable time services for my home network.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.kotfu.net/2007/10/running-xntpd-on-my-openbsd-firewall-cluster/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 xcache
Page Caching using xcache

Served from: www.kotfu.net @ 2012-02-07 15:07:27 -->
