<?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>andybotting.com</title>
	<atom:link href="http://www.andybotting.com/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.andybotting.com/wordpress</link>
	<description>Blogs are like so 2005</description>
	<lastBuildDate>Wed, 01 Feb 2012 08:50:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>AFL streaming radio from Linux</title>
		<link>http://www.andybotting.com/wordpress/afl-streaming-radio-from-linux</link>
		<comments>http://www.andybotting.com/wordpress/afl-streaming-radio-from-linux#comments</comments>
		<pubDate>Sat, 02 Apr 2011 11:45:52 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=430</guid>
		<description><![CDATA[This is a big sarcastic thanks&#160;to AFL and Telstra for building the AFL web site in such a way that it only really works properly in Windows. Being in London, I want to listen to the Geelong games over the streaming radio, but in Linux (and probably Mac), Silverlight just won&#8217;t cut it &#8211; and [...]]]></description>
			<content:encoded><![CDATA[<p>This is a big sarcastic thanks&nbsp;to AFL and Telstra for building the AFL web site in such a way that it only really works properly in Windows.</p>
<p>Being in London, I want to listen to the Geelong games over the streaming radio, but in Linux (and probably Mac), Silverlight just won&#8217;t cut it &#8211; and the radio fails to load with an error.</p>
<p>I did some digging around, and worked out the URL for the the streaming radio, which you can then plug into MPlayer to obtain the ASX stream:</p>
<p><code>mplayer -user-agent "NSPlayer/11.08.0005.0000" http://lon-cdn220-is-1.se.bptvlive.ngcdn.telstra.com/online-radio-afl_12</code></p>
<p>The code on the end is the stream ID. These are the station codes I&#8217;ve managed to work out:</p>
<ul>
<li> ABC774: 2</li>
<li> 5AA Adelaide: 3</li>
<li> 6PR Perth: 4</li>
<li> 3AW Melbourne: 5</li>
<li> National Indigenous Radio Service: 6</li>
<li> Gold FM Gold Coast: 7</li>
<li> Triple M Sydney: 11</li>
<li> Triple M Melbourne: 12</li>
<li> Triple M Brisbane: 13</li>
<li> Triple M Adelaide: 14</li>
<li> K-Rock Geelong: 15</li>
</ul>
<p>I hope this proves useful to someone else.</p>
<p><strong>UPDATE:</strong></p>
<p>For Mac OSX, install MPlayer OSX Extended from http://www.mplayerosx.ch/#downloads.</p>
<p>Then, for the command line bit, just open up the Terminal application from the Utilities folder, and use this full path to find the mplayer binary:</p>
<p><code>/Applications/MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer -user-agent "NSPlayer/11.08.0005.0000" http://lon-cdn220-is-1.se.bptvlive.ngcdn.telstra.com/online-radio-afl_12</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/afl-streaming-radio-from-linux/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using pkgutil on Solaris with Puppet for easy package management</title>
		<link>http://www.andybotting.com/wordpress/using-pkgutil-on-solaris-with-puppet-for-easy-package-management</link>
		<comments>http://www.andybotting.com/wordpress/using-pkgutil-on-solaris-with-puppet-for-easy-package-management#comments</comments>
		<pubDate>Thu, 09 Dec 2010 17:18:10 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=419</guid>
		<description><![CDATA[I&#8217;ve been using Puppet on Linux systems for some time now, but I&#8217;ve only just started using it in a Solaris environment. I think one of the killer functions of Puppet is being able to easily install packages and manage services on a system. Most Linux distros these days have tools for working with repositories [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.puppetlabs.com">Puppet</a> on Linux systems for some time now, but I&#8217;ve only just started using it in a Solaris environment.</p>
<p>I think one of the killer functions of Puppet is being able to easily install packages and manage services on a system. Most Linux distros these days have tools for working with repositories of packages, like Yum on Fedora/RedHat/CentOS and Apt on Debian and Ubuntu. These work really well with Puppet, because you can easily script a class which requires a specific package, and Puppet will just call the package tool and it&#8217;ll install the right package and all of the required dependencies.</p>
<p>Using Solaris feels like a step back from Linux, not having an official repository tool like Yum and Apt. Its package system seems quite primitive which can suffer from the dependency hell that we used to have with RPM before it was wrapped up with Yum. Enter: <strong>pkgutil</strong>.</p>
<p><a href="http://pkgutil.wikidot.com/">Pkgutil</a> is like Yum for Solaris, written in Perl by Peter Bonivart. It was designed for <a href="http://www.opencsw.org/">OpenCSW</a>, which is a repository for Open Source packages on Solaris &#8211; and also the best place to install Puppet from. With a few simple steps, you can actually build an OpenCSW compatible repository of Solaris packages and tell pkgutil to use it, rather than the standard OpenCSW one.</p>
<p>Puppet has almost gained a proper package provider for Pkgutil (See <a href="http://projects.puppetlabs.com/issues/4258">Puppet issue #4258: Add pkgutil provider)</a>, which should be available in Puppet 2.6.4 maybe. In the mean time, we can just install it into our Ruby path to make use of it right now.</p>
<p>Steps involved are:</p>
<ul>
<li>Install pkgutil</li>
<li>Install Puppet on Solaris</li>
<li>Install the pkgutil provider</li>
<li>Build an OpenCSW-compatible repository of your own packages</li>
<li>Define pkgutil as a provder in your Puppet configuration</li>
<li>Install some packages!</li>
</ul>
<p>
<h2>Install pkgutil</h2>
<p>Before we do anything, we should install pkgutil. This handy one-liner will install it for Solaris 10 and OpenSolaris.</p>
<p><code># pkgadd -d http://mirror.opencsw.org/opencsw/pkgutil-`uname -p`.pkg</code></p>
<p>For Solaris 8 and 9, take a look at the <a href="http://www.opencsw.org/get-it/pkgutil/">pkgutil installation page</a> for more details.</p>
<p>
<h2>Install Puppet</h2>
<p>Now that pkgutil is installed, installing Puppet is a breeze!</p>
<p><code># /opt/csw/bin/pkgutil --install puppet</code></p>
<p>This will resolve all the dependencies and install everything just like the Linux package management tools do.</p>
<p>
<h2>Install the pkgutil provider</h2>
<p>I&#8217;m using a version of pkgutil from Dominic Cleal&#8217;s git repository.</p>
<p><code># wget --no-check-certificate https://github.com/domcleal/puppet/raw/143fc744a839affd328234fca26246d49d15d3d8/lib/puppet/provider/package/pkgutil.rb -O /opt/csw/lib/ruby/site_ruby/1.8/puppet/provider/package/pkgutil.rb</code></p>
<p>This wget will download it, and copy into the right place in the filesystem for Puppet to pick it up.</p>
<p>
<h2>Build an OpenCSW-compatible repository</h2>
<p>As part of OpenCSW, Peter Bonivart has released a tool for creating OpenCSW repositories, called <a href="http://pkgutil.wikidot.com/bldcat">bldcat</a>. You can find it as part of the pkgutilplus package from OpenCSW.</p>
<p>Create yourself a new directory for your packages on your webserver. For me, I needed OpenSolaris 2009.06 and Solaris 10 support, so:</p>
<p><code># mkdir -p repo/solaris/i386/5.11/<br />
# mkdir -p repo/solaris/i386/5.10/</code></p>
<p>Then just put all your packages into that directory, and run bldcat:</p>
<p><code># bldcat .</code></p>
<p>This will generate the catalog, and descriptions file needed for pkgutil. Once you make this directory available by HTTP, you can add the URL into the pkgutil.conf file.</p>
<p>One thing to remember is that you&#8217;ll need to do this on a Solaris machine. Although bldcat will work on Linux, it requires some of the Solaris package tools, which won&#8217;t be available. For me, I just did it NFS mounted from a Linux server.</p>
<p>Now, set the mirror and noncsw entries like this:</p>
<p><code>mirror=http://repo.mydomain/repo/solaris<br />
noncsw=true</code></p>
<p>For my situation, I had to include a few packages that we provided as our standard environment, and the package names weren&#8217;t prefixed with CSW, to the &#8216;noncsw&#8217; option needs to be set.</p>
<p>Because I wanted a mix of OpenCSW packages and our corporate standard packages, I copied in the OpenCSW packages (and dependencies) along with the corporate ones into the one repository. You can put Puppet in there also.</p>
<p>NOTE: All your packages need to be *.pkg.gz format, so make sure you compress any packages that aren&#8217;t already gzipped!</p>
<p>
<h2>Define pkgutil as a provider in your Puppet configuration</h2>
<p>In the site.pp file on my Puppet Master, I include this definition:</p>
<pre>
Package {
    provider => $operatingsystem ? {
        redhat => yum,
        centos => yum,
        sles => zypper,
        solaris => pkgutil,
    }
}
</pre>
<p>To see this in action, I&#8217;ve used Nagios&#8217;s NRPE as an example.</p>
<pre>
package { nrpe_package:
  name => $operatingsystem ? {
    Solaris => 'CSWnrpe'
    CentOS  => 'nrpe',
    SLES    => 'nagios-nrpe',
    Debian  => 'nagios-nrpe-server',
  },
  ensure => installed,
}
</pre>
<p>So with pkgutil, installing packages on Solaris can be as easy as Linux with Puppet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/using-pkgutil-on-solaris-with-puppet-for-easy-package-management/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Tram Hunter web site</title>
		<link>http://www.andybotting.com/wordpress/new-tram-hunter-web-site</link>
		<comments>http://www.andybotting.com/wordpress/new-tram-hunter-web-site#comments</comments>
		<pubDate>Sat, 09 Oct 2010 11:12:08 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=410</guid>
		<description><![CDATA[I&#8217;ve been slowly doing some bits and pieces for a new Tram Hunter web site. I would now like to announce the new site at http://tramhunter.andybotting.com/. Since v0.5 of Tram Hunter, we&#8217;ve included an option to send anonymous usage statistics to a server I have running on Google&#8217;s App Engine. My main aim was to generate [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been slowly doing some bits and pieces for a new Tram Hunter web site. I would now like to announce the new site at <a href="http://tramhunter.andybotting.com/">http://tramhunter.andybotting.com/</a>.</p>
<p>Since v0.5 of Tram Hunter, we&#8217;ve included an option to send anonymous usage statistics to a server I have running on Google&#8217;s App Engine. My main aim was to generate some heat maps, based on the location of tram stop requests.</p>
<p>You can now see the final version of the <a href="http://tramhunter.andybotting.com/stats/map/">heap map</a>, which is generated nightly, from the latest 1000 requests. It turns out to be quite interesting to look at.</p>
<p>I&#8217;m also using the Google Chart API to generate some nice <a href="http://tramhunter.andybotting.com/stats/chart/">pie charts</a> showing some other info like <a href="http://tramhunter.andybotting.com/stats/chart/device_model">handset model</a>, <a href="http://tramhunter.andybotting.com/stats/chart/device_version">Android version</a> and <a href="http://tramhunter.andybotting.com/stats/chart/mobile_network_number">mobile networks</a>.</p>
<p>In other Tram Hunter news, the latest stats from the Android Market show <span><strong>5687</strong></span> total installs, with <span><strong>4293</strong></span> active installs (<span>75%</span>). We also have a <strong>4.85</strong> rating out of 5, with <strong>255</strong> comments. The comments are all really positive, so it definitely makes development worthwhile.</p>
<p>I&#8217;ve created a new Twitter account for Tram Hunter, so for the latest updates, follow <a href="http://twitter.com/tram_hunter">@tram_hunter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/new-tram-hunter-web-site/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tram Hunter: the blog post</title>
		<link>http://www.andybotting.com/wordpress/tram-hunter-the-blog-post</link>
		<comments>http://www.andybotting.com/wordpress/tram-hunter-the-blog-post#comments</comments>
		<pubDate>Tue, 14 Sep 2010 09:02:00 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=400</guid>
		<description><![CDATA[I think this post has been a long time in the making, but I thought it might be time to share this little story. Tram Hunter is a project I started nearly 2 years ago. It&#8217;s an Android client to the Yarra Trams TramTracker web service, which their iPhone client leaverages to provide real-time tram [...]]]></description>
			<content:encoded><![CDATA[<p>I think this post has been a <strong>long</strong> time in the making, but I thought it might be time to share this little story.</p>
<p><strong>Tram Hunter</strong> is a project I started nearly 2 years ago. It&#8217;s an Android client to the <a href="http://www.yarratrams.com.au">Yarra Trams</a> <strong>TramTracker</strong> web service, which their iPhone client leaverages to provide real-time tram arrival information to users of trams in Melbourne.</p>
<p>I&#8217;m not sure what it is about Trams, but I&#8217;m almost enchanted by them. They&#8217;re slow, many are really old and usually it&#8217;s a pretty rough ride, but they also have much more character than buses and trains.</p>
<p>A friend and I made a mashup of Google Maps with tram stops once, and using timetable information, we plotted approximated locations of trams along a line. The trams even moved along the line, although it wasn&#8217;t really realistic, it was fun to watch. I spoke to Yarra Trams about what we had done, and I was invited to come and see the Operations Centre in South Melbourne, which was quite interesting. They offered me a job working with their development team on some .NET/Windows web services stuff (which turned out to be the TramTracker service), but I just couldn&#8217;t leave <a href="http://www.vpac.org">VPAC</a> at the time.</p>
<div id="attachment_402" class="wp-caption alignnone" style="width: 210px"><a href="http://www.andybotting.com/wordpress/wp-content/uploads/tramhunter-stopdetails.png"><img class="size-medium wp-image-402" title="Tram Hunter Stop Details" src="http://www.andybotting.com/wordpress/wp-content/uploads/tramhunter-stopdetails-200x300.png" alt="Tram Hunter Stop Details" width="200" height="300" /></a><p class="wp-caption-text">Real Time Departures</p></div>
<div id="attachment_401" class="wp-caption alignnone" style="width: 210px"><a href="http://www.andybotting.com/wordpress/wp-content/uploads/tramhunter-menu.png"><img class="size-medium wp-image-401" title="Tram Hunter Menu" src="http://www.andybotting.com/wordpress/wp-content/uploads/tramhunter-menu-200x300.png" alt="Tram Hunter Menu" width="200" height="300" /></a><p class="wp-caption-text">Application Menu</p></div>
<p>So once Android was finally released, I bought their ADP1 development phone as quickly as I could. It cost a fortune, as the Australian dollar was quite weak at the time, but was pretty exciting. The idea of an Open Source phone to finally kick start some innovation in the mobile industry really appealed to me. I started messing with the Android API soon after.</p>
<p>I started working on Tram Hunter but got a bit stuck. I ended up shelving the project because I couldn&#8217;t figure out a problem I had, and moved on to other projects. It wasn&#8217;t until later (and I had moved to <em>London</em>), I was speaking to a friend of mine who was doing some Android development and he offered to help with the project. I proceeded to clean up the code, so it was in a compile-able state for someone else to look at. Somehow I managed to solve the issue and get something working. Everything seemed to just fall into place, and I had a working first version done.</p>
<p>I came across another project by accident by a couple of guys looking to do the same thing. I emailed them, and suddenly we had three developers and another joined soon after. I opened a <a href="http://tramhunter.googlecode.com">Google Code project</a>, put all our stuff into SVN and released version 0.1 to the Android Market. I later started a <a href="http://groups.google.com/group/tramhunter">Google Groups mailing list</a> for the project also.</p>
<p>The Tram Tracker iPhone application is slow and takes many taps to get  to the information you want. Their interface has been designed to mimic  the information screens at tram stops which is a nice idea, but actually provides an  irritating user experience.</p>
<p>In comparison, the goal of Tram Hunter is to bring as many useful features as we can,  without compromising the interface. I wanted to provide users the  ability to get the information they want, with the least amount of  clicks.</p>
<p>By using all the standard Android UI features, we gain a lot without needing to write a lot of code. Google Maps, location information by GPS, Network and Wifi, UI and search are all provided in the API so we don&#8217;t need to write this stuff ourselves. It also means it&#8217;s fast and simple.</p>
<p>Since the first version, we&#8217;ve introduced a few new features and have been fixing bugs. We&#8217;re on version 0.5 right now, and there&#8217;ll be a new one just around the corner.</p>
<p>The latest stats from the Android Market show<span> <strong>4325</strong></span> total installs, with<span> <strong>3128</strong></span> active installs (<span>72%</span>). Not bad considering the slow uptake of Android in Melbourne, and the limited number of tram users in Melbourne.</p>
<p>In version 0.4 of Tram Hunter, I introduced some code which (when only specifically enabled by the user) would send some usage information to a Google App Engine site I have set up. Tram Hunter will provide information about the user&#8217;s handset and Tram Hunter settings (e.g. What device is being used, what version of Tram Hunter is installed, which mobile network are we using, etc). It will also send information about which stops a user is requesting, and their location when they make the request.</p>
<p><a href="http://tramhunter.andybotting.com/stats/map/"><img class="size-medium wp-image-403" title="Melbourne Heat Map" src="http://www.andybotting.com/wordpress/wp-content/uploads/screenshot-test-mozilla-firefox-300x234.png" alt="Melbourne Heat Map" width="300" height="234" /></a></p>
<p>I&#8217;m currently in the process of generating heat maps, to indicate the location of Tram Hunter requests. Unfortunately, the code isn&#8217;t finished so I can&#8217;t release them out in the open yet. I have some Google App Engine bit to sort out first, but I&#8217;ll be releasing all the interesting statistics to the Android community.</p>
<p><strong>UPDATE: </strong>The <a href="http://tramhunter.andybotting.com/stats/map/">heat map</a> is now running well on App Engine. The totally new <a href="http://tramhunter.andybotting.com/">Tram Hunter web site</a> is now up and running with lots of <a href="http://tramhunter.andybotting.com/stats/">cool graphs</a> and stuf.</p>
<h2>What&#8217;s next?</h2>
<p>For Tram Hunter, I&#8217;m still taking feature requests and bug reports at our <a href="http://code.google.com/p/tramhunter/issues/list">issue tracker</a>, but I think development of this is starting to slow down.</p>
<p>I have been throwing around the possibility of porting it to Maemo/Meego to support the Nokia N900 (although something similar <a href="http://blogs.gnome.org/danni/2009/12/20/melbourne-tram-tracker-for-the-n900/">already exists</a>) and possibly to BlackBerry devices. BlackBerry also uses Java, so it should be quite easy to reuse a lot of code.</p>
<p>I&#8217;m also looking into developing another application for timetable information. I have had many requests for an app for buses and trains, so I&#8217;m looking to leaveraging some Google Transit code and proving users with an ability to download specially formatted timetables to their handset and use many of the features of Tram Hunter, but in an offline fashion. The idea is that it&#8217;ll be generic enough that it can be used for any type of timetable information for anywhere in the world, as long as people are willing to help port the timetable information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/tram-hunter-the-blog-post/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using the Yubikey for two-factor authentication on Linux</title>
		<link>http://www.andybotting.com/wordpress/using-the-yubikey-for-two-factor-authentication-on-linux</link>
		<comments>http://www.andybotting.com/wordpress/using-the-yubikey-for-two-factor-authentication-on-linux#comments</comments>
		<pubDate>Thu, 20 May 2010 12:47:30 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=373</guid>
		<description><![CDATA[The Yubikey is a nice little device. It&#8217;s quite simple in design and operation. The key actually emulating a USB keyboard, which makes it instantly usable on any modern OS. You just press the button on the key to generate a one-time-password (OTP) to validate you. The method works by typing in your password, but before [...]]]></description>
			<content:encoded><![CDATA[<p>The Yubikey is a nice little device. It&#8217;s quite simple in design and operation. <img class="alignright size-full wp-image-388" title="Yubikey" src="http://www.andybotting.com/wordpress/wp-content/uploads/yubikey.jpg" alt="Yubikey" width="219" height="147" /></p>
<p>The key actually emulating a USB keyboard, which makes it instantly usable on any modern OS. You just press the button on the key to generate a one-time-password (OTP) to validate you. The method works by typing in your password, but before hitting the return key, you press the Yubikey button to finish it off. At the end of the OTP generation, it sends a carriage return itself.</p>
<p>The OTP is then sent to a validation server, either hosted by Yubico themselves, or you can host your own.</p>
<p>I&#8217;m going to walk through how you can set the infrastructre for doing two-factor authentication on Debian. In my specific case, the requirement was two-factor with an Active Directory username/password combination and the Yubikey as the second factor.</p>
<p>Unfortunately, the documentation from Yubico is quite average. To top it off, they insist on using multiple Google Code project sites for hosting their software.</p>
<p>This would normally be fine, but in this case, they have a Google Code project for every single little piece of code. Much of the documentation I found relates to older projects which are not supported by Yubico. This makes working out exactly what you need difficult. Within the Google Code project sites, documentation often runs in circles between projects.</p>
<p>In this document, I&#8217;ll look at using PAM to auth again the Yubico auth servers first. Once that&#8217;s working, I&#8217;ll move onto flashing the Yubikey with a new key and using our own Validation System.</p>
<p><strong>NOTE:</strong> This is just some rough notes I put together. You should definitely read the Yubico documentation for this to really make sense.</p>
<h1>Authenticating with the Yubikey with PAM</h1>
<p>Get some dependencies</p>
<pre>apt-get install libpam-dev libcurl4-openssl-dev libpam-radius-auth</pre>
<p>Make ourselves a source directory</p>
<pre>mkdir ~/yubikey; cd ~/yubikey</pre>
<p>Get the current tarball of libyubikey, and install it</p>
<pre>wget http://yubico-c.googlecode.com/files/libyubikey-1.5.tar.gz
tar xf libyubikey-1.5.tar.gz
cd libyubikey-1.5
./configure
make check install</pre>
<p>Get the current tarball of the Yubico C client, and install it</p>
<pre>wget http://yubico-c-client.googlecode.com/files/ykclient-2.3.tar.gz
tar -xf ykclient-2.3.tar.gz
cd ykclient-2.3
./configure
make
make install</pre>
<p>Get the current tarball of the Yubico PAM module, and install it</p>
<pre>wget http://yubico-pam.googlecode.com/files/pam_yubico-2.3.tar.gz
tar -xf pam_yubico-2.3.tar.gz
cd pam_yubico-2.3
./configure
make
make install</pre>
<p>You should end up with your Yubico PAM module &#8216;/usr/local/lib/security/pam_yubico.so&#8217;</p>
<p>We&#8217;ll refer to this in our PAM config /etc/pam.d/openvpn</p>
<pre>#
# /etc/pam.d/openvpn - OpenVPN pam configuiration
#
# We fall back to the system default in /etc/pam.d/common-*
#
auth required /usr/local/lib/security/pam_yubico.so id=1 debug authfile=/etc/yubikeyid
auth required pam_radius_auth.so no_warn try_first_pass
@include common-account
@include common-password
@include common-session</pre>
<p>This configuration will tell PAM to hit the Yubico module first. This splits apart your password field into your password and OTP. The OTP is validated against the Validation Servers, and the password is then passed onto the next module. This configuration will use the Yubico auth servers to check your token.</p>
<p>Once you have a working config, we&#8217;ll move to setting up our own Validation Servers. We&#8217;ll need to specify the URL for that in this config later on.</p>
<p>In that case, we&#8217;re also using RADIUS. This could be LDAP if you had an LDAP server available. You should be able to use the standard UNIX credentials (/etc/password, /etc/shadow) also.</p>
<p>The other important piece to note here is the authfile, /etc/yubikeyid</p>
<p>This file lists the mapping between username and the fixed part of your Yubikey. This is the first 12 chars of the Yubikey OTP (e.g. when you press the button)</p>
<pre>abotting:vvcnrdkvevtj</pre>
<h1>FreeRADIUS authenticating against Active Directory 2008.</h1>
<p>I banged my head against a wall for a while on this one. The trick is that you need at least FreeRADIUS 2.1.6 for AD authentication to work properly.</p>
<p>Add Debian backports to your /etc/apt/sources.list</p>
<pre>deb http://www.backports.org/debian lenny-backports main contrib non-free</pre>
<p>Import the backports key</p>
<pre>wget -O - http://backports.org/debian/archive.key | apt-key add -</pre>
<p>Update and install the new freeradius</p>
<pre>apt-get update
apt-get -t lenny-backports install freeradius freeradius-ldap</pre>
<p>In your radiusd.conf</p>
<pre>ldap {
    # Define the LDAP server and the base domain name
    server = "ad.yourcompany.com"
    basedn = "dc=ad, dc=yourcompany, dc=com"

    # Active Directory doesn't allow for Anonymous Binding
    identity = "ldap_bind_user@ad.yourcompany.com"
    password = password

    password_attribute = "userPassword"
    filter = "(&amp;(sAMAccountname=%{Stripped-User-Name:-%{User-Name}})(memberOf=CN=Users,DC=ad,DC=yourcompany,DC=com))"

    # This fixes Active Directory 2008 access
    chase_referrals = yes
    rebind = yes

    # The following are RADIUS defaults
    start_tls = no
    dictionary_mapping = ${raddbdir}/ldap.attrmap
    ldap_connections_number = 5
    timeout = 4
    timelimit = 3
    net_timeout = 1
}</pre>
<p>In our FreeRADIUS client file /etc/freeradius/clients.conf:</p>
<pre>client localhost {
    ipaddr = 127.0.0.1
    secret = testing123
    nastype = other
}</pre>
<p>Use radtest to test our RADIUS is authenticating properly</p>
<pre>radtest &lt;username&gt; &lt;password&gt; localhost 1 testing123</pre>
<p>Should return Accept.</p>
<p>Set the address and shared secret of the radius server in <strong>/etc/pam_radius_auth.conf</strong>. The password of testing123 was defined in our RADIUS client config.</p>
<pre># server[:port] shared_secret   timeout (s)
127.0.0.1       testing123      1</pre>
<p>OpenVPN has an issue with PAM loading the Yubikey module, so we have to LD_PRELOAD the pam module before starting OpenVPN.</p>
<pre>export LD_PRELOAD=/lib/libpam.so.0.81.12; openvpn --config openvpn.conf</pre>
<p>For a permanent fix, at the end of the start_vpn function in /etc/init.d/openvpn, just before the $DAEMON line:</p>
<pre>    export LD_PRELOAD=/lib/libpam.so.0.81.12
    $DAEMON $OPTARGS --writepid /var/run/openvpn.$NAME.pid \
        $DAEMONARG $STATUSARG --cd $CONFIG_DIR \
        --config $CONFIG_DIR/$NAME.conf || STATUS=1</pre>
<p>Change the path of /lib/libpam.so.0.81.12 to suit your own system.</p>
<p>I won&#8217;t go into the OpenVPN configuration, except that for PAM authentication you need these options in your server config:</p>
<pre>plugin /usr/lib/openvpn/openvpn-auth-pam.so openvpn
username-as-common-name
ns-cert-type server
client-cert-not-required</pre>
<h1>Personalising your Yubikey</h1>
<p>To host your own Yubikey validation system, you require the secret AES key of your Yubikey. In the past, Yubico could provide this to you. Now, you&#8217;re required to flash your Yubikey yourself which will generate a new AES key.</p>
<p>Yubico provide a personalisation tool for Linux, Mac and Windows. If you&#8217;re on Windows, you get a nice little GUI. For Linux and Mac, you have a CLI based tool. It&#8217;s worth having a look at the &#8216;Personalization Tool&#8217; page at: <a href="http://www.yubico.com/developers/personalization/">http://www.yubico.com/developers/personalization/</a></p>
<h2>Installing the Personalisation Tool</h2>
<p>Install some dependencies:</p>
<pre>apt-get install libusb-1.0.0-dev</pre>
<p>Grab the latest Pesonalisation Tool tarball from: http://code.google.com/p/yubikey-personalization/</p>
<pre>cd ~/yubikey
wget http://yubico-c.googlecode.com/files/libyubikey-1.5.tar.gz</pre>
<p>Extract, build and install libyubikey</p>
<pre>tar xf libyubikey-1.5.tar.gz
cd libyubikey-1.5
./configure
make
make install</pre>
<p>You&#8217;ll need to provide a UID value for flashing your Yubikey. It needs to be 6 characters, and in hexadecimal. You can use this command to generate one for you.</p>
<pre>dd if=/dev/urandom of=/dev/stdout count=100 2&gt;/dev/null | xargs -0 modhex | cut -c 1-10 | awk '{print "vv" $1}'
74657374696e</pre>
<p>You must provide the public name (fixed) parameter in modhex format. The modhex format is a special encoding used to ensure characters sent by the key are always correctly interpreted whatever keyboard layout you use.</p>
<p>You also need to generate yourself a public name for your key. This is known as the &#8216;fixed&#8217; part, and it&#8217;ll be the first 16 chars when you generate your OTP. This will identify your key from anybody else&#8217;s.</p>
<pre>dd if=/dev/urandom of=/dev/stdout count=100 2&gt;/dev/null | xargs -0 modhex | cut -c 1-10 | awk '{print "vv" $1}'
vvcnrdkvevtj</pre>
<p>This comamnd generate some random text, does a modhex operation, grabs the first 10 chars, then adds &#8216;vv&#8217; to the front to make it up to 12.</p>
<p>You&#8217;ll be prompted for a passphrase on your AES key. I leave mine blank, but if you do set one, don&#8217;t ever lose it. I believe it&#8217;ll stop you from re-personalising your Yubikey.</p>
<pre>ykpersonalize -ouid=74657374696e -ofixed=vvcnrdkvevtj
Firmware version 2.1.2 Touch level 1793 Program sequence 1
Passphrase to create AES key:
Configuration data to be written to key configuration 1:
fixed: m:vvcnrdkvevtj
uid: h:74657374696e
key: h:fcaad309a20ne1809c2db2f7f0e8d6ea
acc_code: h:000000000000
ticket_flags: APPEND_CR
config_flags:

Commit? (y/n) [n]: y</pre>
<p>Save this information, as we&#8217;ll need it later.</p>
<h1>Setting up yor own YubiKey OTP Validation Server</h1>
<p>You need to install two things: The Key Storage Module and the Yubico Validation Server. The Key Storage Module (KSM) holds the secret AES key of your Yubikey token, while the Validation Server does the OTP check against the KSM.</p>
<p>In their 2.0 architecture, you can have multiple KSM&#8217;s and Validation servers with work together for reduncancy.</p>
<h2>KSM Installation</h2>
<p>Make a working directory, and get the KSM package</p>
<pre>mkdir ~/yubikey &amp;&amp; cd ~/yubikey
wget http://yubikey-ksm.googlecode.com/files/yubikey-ksm-1.3.tgz
tar xfz yubikey-ksm-1.3.tgz</pre>
<p>Install the KSM files</p>
<pre>cd yubikey-ksm-1.3
make install</pre>
<h2>Install Apache2 and PHP</h2>
<p>Install Apache2, PHP and MySQL</p>
<pre>apt-get install apache2 php5 php5-mcrypt php5-curl mysql-server php5-mysql libdbd-mysql-perl</pre>
<p>Create the ykksm table</p>
<pre>echo "CREATE DATABASE ykksm;" | mysql -u root -p</pre>
<p>Import the DB schema</p>
<pre>mysql -u root -p ykksm &lt; /usr/share/doc/ykksm/ykksm-db.sql</pre>
<p>Set up some MySQL permissions</p>
<pre>CREATE USER 'ykksmreader';
GRANT SELECT ON ykksm.yubikeys TO 'ykksmreader'@'localhost';
SET PASSWORD FOR 'ykksmreader'@'localhost' = PASSWORD('hYea3Inb');

CREATE USER 'ykksmimporter';
GRANT INSERT ON ykksm.yubikeys TO 'ykksmimporter'@'localhost';
SET PASSWORD FOR 'ykksmimporter'@'localhost' = PASSWORD('ikSab29');

FLUSH PRIVILEGES;</pre>
<h2>Include path configuration</h2>
<p>Set the include path by creating a file /etc/php5/conf.d/ykksm.ini</p>
<pre>cat &gt; /etc/php5/conf.d/ykksm.ini &lt;&lt; EOF
include_path = "/etc/ykksm:/usr/share/ykksm"
EOF</pre>
<p>Make a web server symlink</p>
<pre>make -f /usr/share/doc/ykksm/ykksm.mk symlink</pre>
<p>Set your configuration settings in /etc/ykksm/ykksm-config.php</p>
<pre>&lt;?php
  $db_dsn      = "mysql:dbname=ykksm;host=127.0.0.1";
  $db_username = "ykksmreader";
  $db_password = "hYe63Inb";
  $db_options  = array();
  $logfacility = LOG_LOCAL0;
?&gt;</pre>
<p>Restart Apache2</p>
<pre>/etc/init.d/apache2 restart</pre>
<h2>Test the KSM Server</h2>
<p>Try this URL:</p>
<pre>curl 'http://localhost/wsapi/decrypt?otp=dteffujehknhfjbrjnlnldnhcujvddbikngjrtgh'
ERR Unknown yubikey</pre>
<p>It should return &#8216;Unknown Key&#8217; until we have imported our Yubikey into the database.</p>
<h1>Install the Yubico Validation Server</h1>
<p>The latest version, and documentation can be found at: <a href="http://code.google.com/p/yubikey-val-server-php/">http://code.google.com/p/yubikey-val-server-php/</a></p>
<h2>Installation</h2>
<p>Go to our working source directory, and grab the package</p>
<pre>cd ~/yubikey
wget http://yubikey-val-server-php.googlecode.com/files/yubikey-val-2.4.tgz</pre>
<p>Extract, build and install the server</p>
<pre>tar -zxf yubikey-val-2.4.tgz
cd yubikey-val-2.4
make install</pre>
<p>Create the ykval database and import the schema</p>
<pre>echo 'create database ykval' | mysql -u root -p
mysql -u root -p ykval &lt; /usr/share/doc/ykval/ykval-db.sql</pre>
<p>Install the symlink</p>
<pre>make symlink</pre>
<p>Include path configuration</p>
<pre>cat &gt; /etc/default/ykval-queue &lt;&lt; EOF
DAEMON_ARGS="/etc/ykval:/usr/share/ykval
EOF</pre>
<p>Create a htaccess file: /var/www/wsapi/2.0/.htaccess</p>
<pre>RewriteEngine on
RewriteRule ^([^/\.\?]+)(\?.*)?$ $1.php$2 [L]</pre>
<pre>php_value include_path ".:/etc/ykval:/usr/share/ykval"</pre>
<p>Symlink the htaccess file</p>
<pre>cd /var/www/wsapi; ln -s 2.0/.htaccess /var/www/wsapi/.htaccess</pre>
<p>Copy the template config file for the Validation Server</p>
<pre>cp /etc/ykval/ykval-config.php-template /etc/ykval/ykval-config.php</pre>
<p>Edit the file and configure settings in /etc/ykval/ykval-config.php</p>
<pre>&lt;?php

  # For the validation interface.
  $baseParams = array ();
  $baseParams['__YKVAL_DB_DSN__'] = "mysql:dbname=ykval;host=127.0.0.1";
  $baseParams['__YKVAL_DB_USER__'] = 'ykvalverifier';
  $baseParams['__YKVAL_DB_PW__'] = 'password';
  $baseParams['__YKVAL_DB_OPTIONS__'] = array();

  # For the validation server sync
  $baseParams['__YKVAL_SYNC_POOL__'] = array("http://localhost/wsapi/2.0/sync");

  # An array of IP addresses allowed to issue sync requests
  # NOTE: You must use IP addresses here.
  $baseParams['__YKVAL_ALLOWED_SYNC_POOL__'] = array("127.0.0.1");

  # Specify how often the sync daemon awakens
  $baseParams['__YKVAL_SYNC_INTERVAL__'] = 10;

  # Specify how long the sync daemon will wait for response
  $baseParams['__YKVAL_SYNC_RESYNC_TIMEOUT__'] = 30;

  # Specify how old entries in the database should be considered aborted attempts
  $baseParams['__YKVAL_SYNC_OLD_LIMIT__'] = 10;

  # These are settings for the validation server.
  $baseParams['__YKVAL_SYNC_FAST_LEVEL__'] = 1;
  $baseParams['__YKVAL_SYNC_SECURE_LEVEL__'] = 40;
  $baseParams['__YKVAL_SYNC_DEFAULT_LEVEL__'] = 60;
  $baseParams['__YKVAL_SYNC_DEFAULT_TIMEOUT__'] = 1;

  // otp2ksmurls: Return array of YK-KSM URLs for decrypting OTP for
  // CLIENT.  The URLs must be fully qualified, i.e., contain the OTP
  // itself.
  function otp2ksmurls ($otp, $client) {
    return array("http://localhost/wsapi/decrypt?otp=$otp",);
  }
?&gt;</pre>
<p>In the above configuration, we&#8217;re only expecting to use one Validation Server and one KSM. If you&#8217;re planning on having multiple Validation servers and KSM&#8217;s, then you&#8217;ll be including the other Validation Servers in the SYNC_POOL, and your KSM&#8217;s in the URLs at the bottom, returned by the otp2ksmurls function.</p>
<p>Enable the mod_rewrite</p>
<pre>a2enmod rewrite</pre>
<p>Create the ykval database user</p>
<pre>CREATE USER 'ykvalverifier'@'localhost' IDENTIFIED BY  'password';
GRANT ALL PRIVILEGES ON `ykval`. * TO  'ykvalverifier'@'localhost';</pre>
<p>Fix some privileges on our config file</p>
<pre>chgrp www-data /etc/ykval/ykval-config.php</pre>
<p>The Sync Daemon uses the PEAR module System_Daemon so you need to install it:</p>
<pre>apt-get install php-pear
pear install System_Daemon-0.9.2</pre>
<p>Install the init.d script</p>
<pre>ykval-queue install
update-rc.d -f ykval-queue defaults</pre>
<p>Start the daemon</p>
<pre>/etc/init.d/ykval-queue start</pre>
<h2>Testing</h2>
<p>Use CURL to test our server is working</p>
<pre>curl 'http://localhost/wsapi/verify?id=1&amp;otp=vvcnrdkvevtefjbrjnlnldnhcujvddbikngjrtgh'</pre>
<p>It should return something like this:</p>
<pre>h=aPCQ4kWJilDgriyEii3j8J8lfuY=
t=2009-04-27T19:08:51Z0100
status=NO_SUCH_CLIENT</pre>
<p>Once we import our Yubikey into the database, we should get a nice &#8216;status=OK&#8217; message.</p>
<h2>Importing your keys into the KSM server</h2>
<p>Refer back to the output from personalising your Yubikey. You&#8217;ll need the fixed part (referred to as publicname in the DB), internal name (UID) and our AES key.</p>
<p>This is an entry for our newly personalised Yubikey.</p>
<pre>USE ykksm;
INSERT INTO `yubikeys` (`serialnr`, `publicname`, `created`, `internalname`, `aeskey`, `lockcode`, `creator`, `active`, `hardware`)
VALUES (101209, 'vvcnrdkvevtj', '2010-05-07 15:18:40', '74657374696e', 'fcaad309a20ne1809c2db2f7f0e8d6ea', '000000000000', '', 1, 1);</pre>
<p>This entry is required for our systems to authenticate against the Validation server. I&#8217;m not exactly sure about this, as the documentation is somewhat bare. I think you need an administrator-type person&#8217;s key details in here. The imporant part is the ID. This values corresponds the the &#8216;id=&#8217; value in our CURL requests and in our PAM config.</p>
<pre>USE ykval;
INSERT INTO `clients`
(`id`, `active`, `created`, `secret`, `email`, `notes`, `otp`)
VALUES
(1, 1, 1, 'fcaad309a20ne1809c2db2f7f0e8d6ea', 'your@email.addr', 'Any text your want', 'vvcnrdkvevterfbtelvnvkkueenecrlfnlhdjetrhgnk');</pre>
<p>We&#8217;ll hit our new Validation Server to make sure it&#8217;s working</p>
<pre>curl "http://localhost/wsapi/2.0/verify?id=1&amp;nonce=askjdnvajsndjkasndvjsnad&amp;otp=vvcnrdkvevtjkreuvvlhtubjecbrticjneckgrigkck"
h=KLEb3gOJ4KqQaCVbh8cEvXjH50U=</pre>
<p>It should return something like this:</p>
<pre>t=2010-05-20T11:24:53Z0051
otp=vvvcnrdkvevtjkreuvvlhtubjecbrticjneckgrigkck
nonce=askjdnvajsndjkasndvjsnad
sl=100
status=OK</pre>
<p>In this URL, we&#8217;ve added the &#8216;nonce&#8217; parameter. This just a test to make sure the v2.0 API is working. &#8216;status=OK&#8217; means it&#8217;s all good! If you get &#8216;NOT_ENOUGH_ANSWERS&#8217;, it means it has trouble trying to sync with other Validation Servers.</p>
<p>We&#8217;ll get PAM using our new Validation Servers for auth</p>
<p>/etc/pam.d/openvpn</p>
<pre>auth required /usr/local/lib/security/pam_yubico.so id=1 authfile=/etc/yubikeyid url=http://10.68.130.198/wsapi/verify?id=%d&amp;otp=%s debug</pre>
<p>If you watch /var/log/auth.log, you should see the PAM module spitting out some debugging information which may be useful. It also spits out your plain text password too, while you have the debug option on. Make sure you remove this later.</p>
<h1>Problems</h1>
<p>If you see an error like this:</p>
<pre>PAM unable to dlopen(/lib/security/pam_yubico.so): /lib/security/pam_yubico.so: undefined symbol: pam_set_data</pre>
<p>you&#8217;ll need the LD_PRELOAD trick from above. Something to do with dlopening the PAM module I believe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/using-the-yubikey-for-two-factor-authentication-on-linux/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Automating Debian installs with Preseeding</title>
		<link>http://www.andybotting.com/wordpress/automating-debian-installs-with-preseeding</link>
		<comments>http://www.andybotting.com/wordpress/automating-debian-installs-with-preseeding#comments</comments>
		<pubDate>Thu, 17 Sep 2009 23:03:51 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=362</guid>
		<description><![CDATA[Following on from my post about building Debian virtual machines with libvirt, I&#8217;ve now got automated installations of Debian Lenny using the preseeding method. Coupling this with using virt-install, I can have a Debian virtual machine installation in only a few minutes. No questions asked. The virt-install command contains an extra-args argument, where you can [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from my post about <a href="wordpress/using-libvirt-with-xen-on-debian-lenny">building Debian virtual machines with libvirt</a>, I&#8217;ve now got automated installations of Debian Lenny using the preseeding method. Coupling this with using <strong>virt-install</strong>, I can have a Debian virtual machine installation in only a few minutes. No questions asked.</p>
<p>The virt-install command contains an <strong>extra-args</strong> argument, where you can fill-in the specific parts of the preseeding. I don&#8217;t want to set an IP address in the file as it&#8217;s going to be used to build lots of machines, so I just specify that at install time. The URL part is where out preseed config file is stored. This obviously means that the machine needs to able to contact with webserver at install time to download the config.</p>
<p><code>$ NAME=debian-test<br />
virt-install 	--name=${NAME} \<br />
		--ram=512 --file=/var/lib/xen/images/${NAME}.img \<br />
		--file-size 8 \<br />
		--nographics \<br />
		--paravirt \<br />
		--network=bridge:br0 \<br />
		--location=http://mirrors.uwa.edu.au/debian/dists/lenny/main/installer-i386 \<br />
		--extra-args="auto=true interface=eth0 hostname=${NAME} domain=vpac.org netcfg/get_ipaddress=192.168.1.2 netcfg/get_netmask=255.255.255.0 netcfg/get_gateway=192.168.1.1 netcfg/get_nameservers=192.168.1.1 netcfg/disable_dhcp=true url=http://webserver/preseed.cfg"</code></p>
<p>To get an idea of the contents of the preseed config file, the best place to start is the <a href="http://www.debian.org/releases/stable/example-preseed.txt">Debian stable example preseed file</a>. It lists lots of different options, with plenty of comments so you can understand what&#8217;s going on.</p>
<p>For me to get a fully-automated install, I used these options. It&#8217;s fairly standard, but definitely worth reading the comments about each line.</p>
<p><code>$ egrep -v "(^#|^$)" preseed.cfg<br />
d-i debian-installer/locale string en_AU<br />
d-i console-keymaps-at/keymap select us<br />
d-i netcfg/choose_interface select eth0<br />
d-i netcfg/disable_dhcp boolean true<br />
d-i netcfg/dhcp_options select Configure network manually<br />
d-i netcfg/confirm_static boolean true<br />
d-i mirror/protocol string http<br />
d-i mirror/country string manual<br />
d-i mirror/http/hostname string mirrors.uwa.edu.au<br />
d-i mirror/http/directory string /debian<br />
d-i mirror/http/proxy string<br />
d-i clock-setup/utc boolean true<br />
d-i time/zone string Australia/Melbourne<br />
d-i clock-setup/ntp boolean true<br />
d-i clock-setup/ntp-server string ntp.vpac.org<br />
d-i partman-auto/method string regular<br />
d-i partman-lvm/device_remove_lvm boolean true<br />
d-i partman-md/device_remove_md boolean true<br />
d-i partman-lvm/confirm boolean true<br />
d-i partman-auto/choose_recipe select atomic<br />
d-i partman/confirm_write_new_label boolean true<br />
d-i partman/choose_partition select finish<br />
d-i partman/confirm boolean true<br />
d-i passwd/make-user boolean false<br />
d-i passwd/root-password-crypted password [MD5 Sum of the password]<br />
tasksel tasksel/first multiselect standard<br />
d-i pkgsel/include string openssh-server vim puppet<br />
popularity-contest popularity-contest/participate boolean false<br />
d-i grub-installer/only_debian boolean true<br />
d-i grub-installer/with_other_os boolean false<br />
d-i finish-install/reboot_in_progress note</code></p>
<p>Some good resources I found, which might help you are:</p>
<ul>
<li><a href="http://wiki.debian.org/DebianInstaller/Preseed">The <em>Preseeding d-i</em> page on the Debian wiki</a></li>
<li><a href="http://blogs.cae.tntech.edu/mwr/2007/04/17/unattended-debian-installations-or-how-i-learned-to-stop-worrying-and-love-the-preseedcfg/">Mike Renfro&#8217;s <em>Unattended Debian Installations (or How I Learned to Stop Worrying and Love the preseed.cfg)</em></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/automating-debian-installs-with-preseeding/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adobe has issued a DMCA removal request for rtmpdump</title>
		<link>http://www.andybotting.com/wordpress/adobe-has-issued-a-dmca-removal-request-for-rtmpdump</link>
		<comments>http://www.andybotting.com/wordpress/adobe-has-issued-a-dmca-removal-request-for-rtmpdump#comments</comments>
		<pubDate>Fri, 22 May 2009 23:27:37 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=343</guid>
		<description><![CDATA[It seems that Adobe, after issuing a press release claiming they would be opening up the RTMP protocol in the &#8216;first half of 2009&#8242;, have issued a DMCA take down request for an open source implementation of the protocol, RTMPdump. The SourceForge project site for RTMPdump now shows &#8216;Invalid Project&#8217;. This is going to mean [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that Adobe, after issuing a <a href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200901/012009RTMP.html">press release</a> claiming they would be opening up the RTMP protocol in the &#8216;first half of 2009&#8242;, have issued a DMCA take down request for an open source implementation of the protocol, RTMPdump. The SourceForge project site for RTMPdump now shows &#8216;Invalid Project&#8217;.</p>
<p>This is going to mean it&#8217;s going to become much harder to get RTMPdump for downloading copies of ABC&#8217;s iView files, which I <a href="http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-1">previously</a> <a href="http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2">posted</a> <a href="http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02">about</a>. This might also have interesting consequences for XBMC and Boxee which both include this code for supporting streaming media from BBC&#8217;s iPlayer.</p>
<p>This is pretty disappointing from Adobe, especially after claiming they would be in the process of opening up the protocol.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/adobe-has-issued-a-dmca-removal-request-for-rtmpdump/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>iView for XBMC plugin v0.2</title>
		<link>http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02</link>
		<comments>http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02#comments</comments>
		<pubDate>Sun, 03 May 2009 10:46:41 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=336</guid>
		<description><![CDATA[A plugin for ABC iView on XBMC has been released. See this page for progress of ABC iView on XBMC. I just rewrote the iView plugin for XBMC.. and it&#8217;s far more robust. There is still lots to finish, but it kinda works. This was spurred on by someone actually trying it out, and then [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">A plugin for ABC iView on XBMC has been released. See <a href="http://www.andybotting.com/wordpress/using-abcs-iview-on-xbmc">this page</a> for progress of ABC iView on XBMC.</span></p>
<p>I just rewrote the iView plugin for XBMC.. and it&#8217;s far more robust. There is still lots to finish, but it kinda works. This was spurred on by someone actually trying it out, and then me finding out that ABC changed their XML.</p>
<p>You&#8217;ll need the <a href="http://www.andybotting.com/~andy/iview/abc-iview-rtmp-tcurl-fix.patch">RTMP patch</a> for XBMC, and <a href="http://andybotting.com/~andy/iview/ABC_iView_xbmc_plugin_v0.2.zip">version 0.2 of the ABC iView plugin for XBMC</a>.</p>
<p>Some things that still need improving are:</p>
<ul>
<li>Auth token still times out. That means that if you watch something, you&#8217;ll need to go back to the channels list and then back into the channel to list the programs again and get a new auth token. Annoying.</li>
<li>No thumbnails or extended metadata available for channels or programs.</li>
<li>Some programs have funny names. Pretty minor, but annoying.</li>
<li>Programs are streamed in 4:3, but are actually produced in 16:9. I set XBMC to 16:9 Stretch mode.</li>
</ul>
<p>For more info about the plugin, see this <a href="http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2">other entry</a> I wrote.</p>
<p><strong>Don&#8217;t forget</strong> to vote for an iView plugin for Boxee at the <a href="http://getsatisfaction.com/boxee/topics/add_abc_iview_for_australian_viewers">Customer Support Community for               boxee.</a> It might might help get iView into Boxee!<a href="http://getsatisfaction.com/boxee/topics/add_abc_iview_for_australian_viewers"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>ABC&#8217;s iView on XBMC.. update 2</title>
		<link>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2</link>
		<comments>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2#comments</comments>
		<pubDate>Wed, 15 Apr 2009 03:27:03 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=328</guid>
		<description><![CDATA[A plugin for ABC iView on XBMC has been released. See this page for progress of ABC iView on XBMC. Following on from the last post about using rtmpdump to grab ABC&#8217;s iView programs, I&#8217;ve made a start on an XBMC plugin.. with the hope of eventually working on a Boxee plugin also. To start [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">A plugin for ABC iView on XBMC has been released. See <a href="http://www.andybotting.com/wordpress/using-abcs-iview-on-xbmc">this page</a> for progress of ABC iView on XBMC.</span></p>
<p>Following on from the <a href="http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-1">last post</a> about using rtmpdump to grab ABC&#8217;s iView programs, I&#8217;ve made a start on an XBMC plugin.. with the hope of eventually working on a Boxee plugin also.</p>
<p>To start with, you&#8217;ll need <a href="http://www.andybotting.com/~andy/iview/abc-iview-rtmp-tcurl-fix.patch">my patch</a> to all you to specify the tcurl of an rtmp stream from with the XBMC API. This is needed because XBMC makes some assumptions about RTMP urls, based on other streams like Hulu and BBC&#8217;s iPlayer. ABC&#8217;s method is similar, but a little different. I&#8217;ll be trying to get the patch sent upstream, but it may need a little more work.</p>
<p>Now you&#8217;re going to have to compile XBMC yourself from source. I&#8217;ve only done it on Linux, so I can&#8217;t help you with Mac, Windows or Xbox versions. For information about compiling it on Ubuntu, you can check out <a href="http://xbmc.org/wiki/?title=HOW-TO_compile_XBMC_for_Linux_from_source_code">the page on the XBMC wiki</a>. You just need to do &#8216;cd&#8217; into the XBMC directory you did your SVN checkout on, and then:</p>
<p><code>patch -p0 &lt; /path/to/abc-iview-rtmp-tcurl-fix.patch</code></p>
<p>Hopefully you shouldn&#8217;t see any errors.</p>
<p>You can then grab my very basic <a href="http://www.andybotting.com/~andy/iview/ABC_iView_xbmc_plugin_v0.1.zip">iView plugin for XBMC</a>. It&#8217;ll need to be extracted into your plugins/video directory of your XBMC installation.</p>
<p>This plugin has some serious limitations right now..</p>
<p>Firstly, some shows are listed as just &#8216;Episode 1&#8242;. It seems that in the XML files describing the shows, the data is very inconsistent. I&#8217;ll be looking at this in the next version of the plugin.</p>
<p>Next, because of the nature of the auth token that is generated, if you watch a program and then go back to the list of programs, if you try another, it will fail to play, as the token has timed out. You need to go back another level to the channels, then click the channel you want. This means that the URLS listed will generate a new token which will be valid again.</p>
<p>Last, the shows are all broadcasted in 16:9 on the TV, but streamed at 640&#215;480 (4:3). This is really silly, but you can fix it by setting your XBMC view to use &#8216;Stretch 16:9&#8242;. Not ideal, but I&#8217;ll be looking into automatically setting the view if it&#8217;s exposed in the XBMC API.</p>
<p>It&#8217;s still very rough, but a start. Boxee has just announced a new API which I&#8217;ll be taking a look at shortly.</p>
<p><strong>UPDATE:</strong> Version 0.2 of the plugin is out. <a href="http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02iview-for-xbmc-plugin-v02">See here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ABC&#8217;s iView on XBMC.. update 1</title>
		<link>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-1</link>
		<comments>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-1#comments</comments>
		<pubDate>Wed, 15 Apr 2009 03:05:58 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
				<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=317</guid>
		<description><![CDATA[A plugin for ABC iView on XBMC has been released. See this page for progress of ABC iView on XBMC. I&#8217;ve done a little bit of work since my last post on this, and a couple of people have asked for my stuff. Here goes. Firstly, you can use RTMPdump to download the iView stream [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">A plugin for ABC iView on XBMC has been released. See <a href="http://www.andybotting.com/wordpress/using-abcs-iview-on-xbmc">this page</a> for progress of ABC iView on XBMC.</span></p>
<p>I&#8217;ve done a little bit of work since my last post on this, and a couple of people have asked for my stuff. Here goes.</p>
<p>Firstly, you can use RTMPdump to download the iView stream on your Linux box. You&#8217;ll need to download <a href="http://sourceforge.net/project/showfiles.php?group_id=248826&amp;package_id=303903&amp;release_id=667694">rtmpdump 1.4</a> and compile it yourself. It should just take a &#8216;make&#8217; as long as you have all the requirements.</p>
<p>When iView starts, it first requests an XML config file, from the URL <a href="http://www.abc.net.au/iview/iview_config.xml">http://www.abc.net.au/iview/iview_config.xml</a></p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;config&gt;<br />
&lt;param name="authenticate_path"   value="http://202.125.43.119/iview.asmx/isp" /&gt;<br />
&lt;param name="media_path"          value="flash/playback/_definst_/" /&gt;<br />
&lt;param name="media_path_mp4"      value="flash:mp4/playback/_definst_/" /&gt;<br />
&lt;param name="server_streaming"    value="rtmp://cp53909.edgefcs.net/ondemand" /&gt;<br />
&lt;param name="server_speedtest"    value="rtmp://cp44823.edgefcs.net/ondemand" /&gt;<br />
&lt;param name="xml_help"            value="iview_help.xml" /&gt;<br />
&lt;param name="xml_channels"        value="iview_channels.xml" /&gt;<br />
&lt;param name="xml_series"          value="http://www.abc.net.au/playback/xml/rmp_series_list.xml" /&gt;<br />
&lt;param name="xml_thumbnails"      value="http://www.abc.net.au/playback/xml/thumbnails.xml" /&gt;<br />
&lt;param name="xml_classifications" value="http://www.abc.net.au/playback/xml/classifications.xml" /&gt;<br />
&lt;param name="xml_feature"         value="http://www.abc.net.au/playback/xml/iview_feature.xml" /&gt;<br />
&lt;param name="xml_feature_home"    value="http://www.abc.net.au/playback/xml/iview_homepage.xml" /&gt;<br />
&lt;param name="server_time"         value="http://www.abc.net.au/iview/time.htm" /&gt;<br />
&lt;param name="thumbs_path"         value="http://www.abc.net.au/playback/thumbs/" /&gt;<br />
&lt;param name="base_url"            value="http://www.abc.net.au/iview" /&gt;<br />
&lt;param name="channel_id_arts"     value="2260366" /&gt;<br />
&lt;param name="channel_id_news"     value="2186765" /&gt;<br />
&lt;param name="channel_id_docs"     value="2176127" /&gt;<br />
&lt;param name="channel_id_shop"     value="2186639" /&gt;<br />
&lt;param name="channel_id_catchup"  value="2172737" /&gt;<br />
&lt;param name="channel_id_kazam"    value="2288241" /&gt;<br />
&lt;param name="channel_id_faves"    value="2478452" /&gt;<br />
&lt;param name="channels_main"       value="catchup,news,docs,arts,shop" /&gt;<br />
&lt;param name="channels_kids"       value="kazam,faves" /&gt;<br />
&lt;/config&gt;</code></p>
<p>From this file, you can find out which other XML files you need for the channels and program descriptions. Firstly though, you need a special <em>token</em>, which is like an authorisation string. It&#8217;s done by doing a HTTP GET on the <strong>authenticate_path</strong>, which will return something like:</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;iview xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="iview.abc.net.au"&gt;<br />
&lt;ip&gt;124.168.17.31&lt;/ip&gt;<br />
&lt;isp&gt;iiNet&lt;/isp&gt;<br />
&lt;desc&gt;iiNet Limited&lt;/desc&gt;<br />
&lt;host&gt;Akamai&lt;/host&gt;<br />
&lt;server /&gt;<br />
&lt;bwtest /&gt;<br />
<strong>&lt;token&gt;daEdOckcEbtaqdmdLasbhcBbCbobAbOaxa5-bjOn1r-8-jml_rFAnL&amp;amp;aifp=v001&lt;/token&gt;</strong><br />
&lt;text&gt;iView is unmetered for &amp;lt;a href="http://www.iinet.net.au/" target="_blank"&amp;gt;iiNet&amp;lt;/a&amp;gt; customers.&lt;/text&gt;<br />
&lt;free&gt;yes&lt;/free&gt;<br />
&lt;count&gt;5557&lt;/count&gt;<br />
&lt;init&gt;false&lt;/init&gt;<br />
&lt;/iview&gt;</code></p>
<p>This is doing a lookup of my IP address, to ensure I&#8217;m in Australia, and pass me the token. The token has a short lifetime also, only a few minutes. You then need this token to help you build the URL to request the video stream you want.</p>
<p>To find the programs of a particular channel, you need to grab a URL like this: <a href="http://www.abc.net.au/playback/xml/output/catchup.xml">http://www.abc.net.au/playback/xml/output/catchup.xml</a>.</p>
<p><code>&lt;?xml version="1.0"?&gt;<br />
&lt;rmp-content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;<br />
&lt;channel enabled="true" id="2172737"&gt;<br />
&lt;name&gt;ABC CatchUp&lt;/name&gt;<br />
&lt;description&gt;&lt;![CDATA[Recent best of ABC1 &amp; ABC2 TV]]&gt;&lt;/description&gt;<br />
&lt;intro&gt;&lt;/intro&gt;<br />
&lt;ident&gt;&lt;/ident&gt;<br />
&lt;channel-logo&gt;http://www.abc.net.au/playback/img/chl_catchup.png&lt;/channel-logo&gt;<br />
&lt;image id="258433" order="1"&gt;<br />
&lt;title&gt;&lt;![CDATA[ABC Catchup Background 09]]&gt;&lt;/title&gt;<br />
&lt;version id="1071615"&gt;<br />
&lt;title&gt;&lt;![CDATA[1230x564jpg]]&gt;&lt;/title&gt;<br />
&lt;url&gt;http://www.abc.net.au/reslib/200806/r258433_1071615.jpg&lt;/url&gt;<br />
&lt;/version&gt;<br />
&lt;/image&gt;<br />
&lt;image id="257912" order="2"&gt;<br />
&lt;title&gt;&lt;![CDATA[ABC Catchup background 06]]&gt;&lt;/title&gt;<br />
&lt;version id="1068909"&gt;<br />
&lt;title&gt;&lt;![CDATA[1230x564jpg]]&gt;&lt;/title&gt;<br />
&lt;url&gt;http://www.abc.net.au/reslib/200806/r257912_1068909.jpg&lt;/url&gt;<br />
&lt;/version&gt;<br />
&lt;/image&gt;<br />
&lt;program-title-list&gt;<br />
&lt;program-title id="352699" promo="false" order="9"&gt;<br />
&lt;title&gt;&lt;![CDATA[Catalyst Series 10 Episode 8]]&gt;&lt;/title&gt;<br />
&lt;short-title&gt;&lt;/short-title&gt;<br />
&lt;synopsis&gt;&lt;![CDATA[Malaria jumps the gap from monkey to man; could bubbles be a solution to the hard hit  mining industry? And see how a horse trainer applies his skill to the training of elephants, with remarkable success.]]&gt;&lt;/synopsis&gt;<br />
&lt;publish-date&gt;03/04/2009 12:00:00&lt;/publish-date&gt;<br />
&lt;expire-date&gt;17/04/2009 00:00:00&lt;/expire-date&gt;<br />
&lt;transmission-date&gt;02/04/2009 00:00:00&lt;/transmission-date&gt;<br />
&lt;censorship&gt;G&lt;/censorship&gt;<br />
&lt;censorship-warning&gt;&lt;/censorship-warning&gt;<br />
&lt;website&gt;Go to website&lt;/website&gt;<br />
&lt;website-url&gt;http://www.abc.net.au/catalyst/&lt;/website-url&gt;<br />
&lt;video-download&gt;&lt;/video-download&gt;<br />
&lt;video-download-url&gt;http://www.abc.net.au/tv/geo/catalyst/vodcast/default.htm&lt;/video-download-url&gt;<br />
&lt;shop&gt;&lt;/shop&gt;<br />
&lt;shop-url&gt;&lt;/shop-url&gt;<br />
&lt;category&gt;Science and Technology&lt;/category&gt;<br />
&lt;cue-points&gt;<br />
&lt;/cue-points&gt;<br />
&lt;video-asset id="1619127" order="0"&gt;<br />
&lt;title&gt;&lt;![CDATA[1850flv]]&gt;&lt;/title&gt;<br />
<strong>&lt;url&gt;catch_up/catalyst_09_10_08.flv&lt;/url&gt;</strong><br />
&lt;unc-path&gt;catalyst_09_10_08.flv&lt;/unc-path&gt;<br />
&lt;duration&gt;27.00&lt;/duration&gt;<br />
&lt;file-size&gt;135&lt;/file-size&gt;<br />
&lt;thumb&gt;abc_catchup.jpg&lt;/thumb&gt;<br />
&lt;/video-asset&gt;<br />
&lt;/program-title&gt;<br />
&lt;program-title id="...."&gt;<br />
...more programs...<br />
&lt;/program-title&gt;<br />
&lt;/program-title-list&gt;<br />
&lt;/channel&gt;<br />
&lt;/rmp-content&gt;<br />
</code></p>
<p>I&#8217;ve shortened the output of the &#8216;Catch Up&#8217; channel here. This is what you&#8217;re likely to see when you get the channel XML file. As you can see, this is describing an episode of <em>Catalyst</em>, and I&#8217;ve marked the URL in bold.</p>
<p><code>TOKEN=`curl -q http://202.125.43.119/iview.asmx/isp | grep token | sed 's/&lt;token&gt;//g' | sed 's/\&amp;amp;/\&amp;/g' | sed 's,&lt;/token&gt;,,g' | sed 's/ //g'`; ./rtmpdump --rtmp "rtmp://203.206.129.37:1935////flash/playback/_definst_/catch_up/catalyst_09_10_08.flv" --auth "auth=${TOKEN}" -t "rtmp://cp53909.edgefcs.net/ondemand?auth=${TOKEN}"  -o test.flv</code></p>
<p>This horrible command is getting the token, and stripping out all unncessesary characters, and then passing it onto rtmpdump. You might have also noticed in the command above, I have four slashes in the RTMP url. This is to work around some assumptions that rtmpdump makes about the path. I had made a patch, but in rtmpdump 1.4, you can just use 4 slashes to make it work.</p>
<p>Most of this data came from doing <strong>Wireshark</strong> packet traces while working with the flash-based iView interface. Also important to note that the programs have an expiry date also. If the command above returns a &#8216;stream not found&#8217; message, you&#8217;ll probably need a newer episode.</p>
<p>In the <a href="http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-2">next post</a>, I&#8217;ll be posting the code for the XBMC plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/abcs-iview-on-xbmc-update-1/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

