<?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/"
	>

<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>Stuff happens.</description>
	<pubDate>Thu, 20 May 2010 12:47:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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 &#8217;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. &#8217;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>
		</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 fill-in [...]]]></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>
		</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 it&#8217;s [...]]]></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>
		</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 me [...]]]></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>
		</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 with, you&#8217;ll [...]]]></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>
		</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 on your [...]]]></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=&#8221;http://www.iinet.net.au/&#8221; target=&#8221;_blank&#8221;&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=&#8221;258433&#8243; order=&#8221;1&#8243;&gt;<br />
&lt;title&gt;&lt;![CDATA[ABC Catchup Background 09]]&gt;&lt;/title&gt;<br />
&lt;version id=&#8221;1071615&#8243;&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=&#8221;257912&#8243; order=&#8221;2&#8243;&gt;<br />
&lt;title&gt;&lt;![CDATA[ABC Catchup background 06]]&gt;&lt;/title&gt;<br />
&lt;version id=&#8221;1068909&#8243;&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=&#8221;352699&#8243; promo=&#8221;false&#8221; order=&#8221;9&#8243;&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=&#8221;1619127&#8243; order=&#8221;0&#8243;&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=&#8221;&#8230;.&#8221;&gt;<br />
&#8230;more programs&#8230;<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 &#8217;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>
		</item>
		<item>
		<title>Using libvirt with Xen on Debian Lenny</title>
		<link>http://www.andybotting.com/wordpress/using-libvirt-with-xen-on-debian-lenny</link>
		<comments>http://www.andybotting.com/wordpress/using-libvirt-with-xen-on-debian-lenny#comments</comments>
		<pubDate>Thu, 02 Apr 2009 05:14:23 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=308</guid>
		<description><![CDATA[So it seems that my CentOS 5 Dom0 wasn&#8217;t stable. When building new virtual machines, the machine would hang and I&#8217;ve have to go back into the machine room to reboot it.
I have suspicions that it was due to the 3ware 8006 RAID controller, but instead of messing around with that, I&#8217;ve installed Debian Lenny [...]]]></description>
			<content:encoded><![CDATA[<p>So it seems that my CentOS 5 Dom0 wasn&#8217;t stable. When building new virtual machines, the machine would hang and I&#8217;ve have to go back into the machine room to reboot it.</p>
<p>I have suspicions that it was due to the 3ware 8006 RAID controller, but instead of messing around with that, I&#8217;ve installed Debian Lenny as the Dom0 (using kernel 2.6.26 as opposed to kernel 2.6.18 with CentOS).</p>
<p>With this machine, I wanted to find the best way to support both Debian and CentOS machine, using a <em>common</em> method of installation. There seem to be two main ways to accomplish this.</p>
<p>You could use the (older) Debian route and use <strong>xen-create-image</strong> from xen-tools, which does a bootstrap of the OS on the filesystem, or use the newer <strong>virt-install</strong> from libvirt, to do an actual OS install. Libvirt seems like it&#8217;s the preferred method these days, which many of the distro&#8217;s now using for managing virtual machines using Xen, KVM or QEMU.</p>
<p>Using xen-create-image for Debian virtual machines has worked for me for a long time, but trying to use it for CentOS failed. The machine built, but I believe there were some packages missing from the install. I really didn&#8217;t want to have to mess around with the package lists, so I tried to use both xen-create-image for Debian and virt-install for CentOS. One problem with this is that virt-install doesn&#8217;t install the Xen config files into /etc/xen like the other tools do. Instead, it manages its own list, and contacts Xen directly using a Unix socket.</p>
<p>This would make management a pain, because you would have to use <em>xm create &lt;domain&gt;</em>to start a Debian VM, but then use <em>virsh start &lt;domain&gt;</em> for CentOS. I needed something simpler.</p>
<p>Then I discovered that Debian Lenny now has para-virtualisation support built into the Debian Installer.</p>
<p>This means that I could use virt-install to build Debian Lenny virtual machines, using the actual Debian installer.</p>
<p>With a quick install of the libvirt packages in the Debian Lenny&#8217;s repository:</p>
<p><code>apt-get install libvirt-bin virtinst</code></p>
<p>You&#8217;ve got all the libvirt stuff you need. Then, to create a Debian virtual machine using virt-install:</p>
<p><code>virt-install \<br />
--name=debian-test \<br />
--ram=512 \<br />
--file-size=8 \<br />
--nographics \<br />
--paravirt \<br />
--file=/var/lib/xen/images/debian-test.img \<br />
--location=http://mirrors.uwa.edu.au/debian/dists/lenny/main/installer-i386</code></p>
<p>The important part is that last line. You can actually just throw a path to the install images of a Debian mirror, and virt-install is smart enough to boot a new VM from that. This then begins a Debian install, identical to what you would use on a standard machine. This also gives you full access to use the nice <strong>virt-manager</strong>. You can install virt-manager by doing:</p>
<p><code>apt-get install virt-manager</code></p>
<div id="attachment_310" class="wp-caption alignnone" style="width: 595px"><img class="size-full wp-image-310" title="screenshot-virtual-machine-manager" src="http://www.andybotting.com/wordpress/wp-content/uploads/screenshot-virtual-machine-manager.png" alt="virt-manager" width="585" height="340" /><p class="wp-caption-text">virt-manager running on a Debian Lenny Dom0</p></div>
<p>So I just need to remember now that if I want to start a VM, I need to use <code>virsh start &lt;domain&gt;</code></p>
<p>Although, once started, you can use the standard xm tools. </p>
<p>So finally, I have reached open-source para-virtualisation nirvana. Now if only Debian did Kickstart&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/using-libvirt-with-xen-on-debian-lenny/feed</wfw:commentRss>
		</item>
		<item>
		<title>ABC iView on XBMC/Boxee</title>
		<link>http://www.andybotting.com/wordpress/abc-iview-on-xbmcboxee</link>
		<comments>http://www.andybotting.com/wordpress/abc-iview-on-xbmcboxee#comments</comments>
		<pubDate>Fri, 27 Feb 2009 10:41:56 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
		
		<category><![CDATA[Geek]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=306</guid>
		<description><![CDATA[A plugin for ABC iView on XBMC has been released. See this page for progress of ABC iView on XBMC.
I think it would be really neat to use ABC&#8217;s iView on the Xbox Media Centre (XBMC) and/or Boxee. Honestly, who really wants to watch TV on their computers? Haven&#8217;t we evolved from that now?
I&#8217;ve got [...]]]></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 think it would be really neat to use ABC&#8217;s iView on the Xbox Media Centre (XBMC) and/or Boxee. Honestly, who really wants to watch TV on their computers? Haven&#8217;t we evolved from that now?</p>
<p>I&#8217;ve got a modded XBOX running XBMC, and I have various Linux boxes running XBMC and Boxee and I think they&#8217;re the perfect platform for something like iView.. especially because it&#8217;s unmetered traffic on iiNet, Internode and other great ISP&#8217;s.</p>
<p>I did a little research, and they seem to use Adobe&#8217;s <em>Real Time Message Protocol</em> (RTMP) to stream the video from their server to the iView client, which is written in Flash. Recent versions of XBMC and Boxee have code to support RTMP, which is also used by other digital content providers like NBC&#8217;s Hulu, and the BBC&#8217;s iPlayer.</p>
<p>I have managed to work out most of the iView&#8217;s XML stuff, which describes channels, programs, thumbnails, etc but not quite got there with the actual streaming part. I&#8217;m playing with <strong>rtmpdump</strong>, which is based on the rtmp code from XBMC/Boxee, and have almost worked out the URL part to get the server to stream. I just keep getting a message about not being able to find the specified stream.</p>
<p>If anyone out there on the interwhizzle has worked this stuff out, I&#8217;d love to hear from them. My googling hasn&#8217;t really revealed anything like what I&#8217;m after. If you&#8217;re interested in using iView on XBMC or Boxee, I&#8217;d like to hear from you also.</p>
<p><strong>UPDATE: </strong>Please 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>
<p><strong>UPDATE 2: </strong>I&#8217;ve uploaded a basic plugin for XBMC. See: <a href="http://www.andybotting.com/wordpress/iview-for-xbmc-plugin-v02"><span id="sample-permalink">http://www.andybotting.com/wordpress/<span id="editable-post-name" title="Click to edit this part of the permalink">iview-for-xbmc-plugin-v02</span></span></a> for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/abc-iview-on-xbmcboxee/feed</wfw:commentRss>
		</item>
		<item>
		<title>Running a Debian Lenny DomU under a CentOS 5 Dom0</title>
		<link>http://www.andybotting.com/wordpress/running-a-debian-lenny-domu-under-a-centos-5-dom0</link>
		<comments>http://www.andybotting.com/wordpress/running-a-debian-lenny-domu-under-a-centos-5-dom0#comments</comments>
		<pubDate>Thu, 26 Feb 2009 03:30:06 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
		
		<category><![CDATA[Geek]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=290</guid>
		<description><![CDATA[The aim of this was to use the standard CentOS/RHEL Xen Dom0 tools to boot a Debian Lenny DomU.
I found plenty of instructions for doing CentOS DomU under a Debian Dom0, but not the other way around. So, this is a little how-to documenting the little things that need to be overcome.
I also wanted the [...]]]></description>
			<content:encoded><![CDATA[<p>The aim of this was to use the standard CentOS/RHEL Xen Dom0 tools to boot a Debian Lenny DomU.</p>
<p>I found plenty of instructions for doing CentOS DomU under a Debian Dom0, but not the other way around. So, this is a little how-to documenting the little things that need to be overcome.</p>
<p>I also wanted the Debian virtual machines to have their filesystems in a file, in the same standard way that the RHEL virt-install creates.</p>
<p>Steps involved:</p>
<ul>
<li>Use virt-install to build a standard CentOS virtual machine</li>
<li>Use debootstrap to build a Debian Lenny base install for transplanting</li>
<li>Break apart a CentOS filesystem-in-a-file, and move the Debian install into it</li>
<li>Modify Debian config for booting the CentOS kernel</li>
</ul>
<h3>Use virt-install to build a standard CentOS virtual machine</h3>
<p>I created a new virtual machine, using virt-install.</p>
<p><code>virt-install -n newvm -r 512 -f /var/lib/xen/images/debian.img -s 8 -l http://ftp.monash.edu.au/pub/linux/CentOS/5/os/i386/ -p --nographics -x</code></p>
<p>I needed some CentOS virtual machines anyway, so I let the install go through and do its thing. If you didn&#8217;t need it, you could probably kill the install before it started installing packages. We just needed the config file for the VM in /etc/xen and the filesystem image.</p>
<h3>Use debootstrap to build a Debian Lenny base install for transplanting</h3>
<p>I actually had a Debian Xen Dom0 with the xen-tools package installed. I used this to create a new Debian Lenny install, and also do some of the nice hook scripts with you would otherwise have to do by hand.</p>
<p><code># xen-create-image --hostname=vanila --size=8Gb --dist=lenny --memory=512M --ide --dhcp</code></p>
<p>This meant I had a hostname file, libc6-xen and other things already done for me.</p>
<p>This was installed into an LVM partition, so after building it, I mounted the LVM partition, and used tar to compress it.</p>
<p><code># mount /dev/mapper/vg-vanilla--disk /mnt<br />
# tar zc -C /mnt/ . &gt; /tmp/vanilla-debian.tar.gz</code></p>
<h3>Break apart a CentOS filesystem-in-a-file, and move the Debian install into it</h3>
<p>Set up the loop device<br />
<code># losetup -f /var/lib/xen/images/debian.img</code></p>
<p>Map the partitions inside the loop device<br />
<code># kpartx -av  /dev/loop0<br />
add map loop0p1 : 0 208782 linear /dev/loop0 63<br />
add map loop0p2 : 0 16032870 linear /dev/loop0 208845</code></p>
<p>At this point, you should have /dev/mapper/loop0p1 which is the root filesystem of your new VM. You&#8217;ll need to format the filesystem with:<br />
<code># mkfs.ext3 /dev/mapper/loop0p1</code></p>
<p>Mount the newly formatted filesystem<br />
<code># mount /dev/mapper/loop0p1 /mnt</code></p>
<p>Extract our Debian Lenny install into the filesystem<br />
<code># cd /mnt<br />
# tar xf /tmp/vanilla-debian.tar.gz</code></p>
<h3>Modify Debian config for booting the CentOS kernel</h3>
<p>We want to use CentOS/RHEL&#8217;s pygrub bootloader, just because it&#8217;s nice.</p>
<p>First, you&#8217;ll need to copy the CentOS kernel into your Debian install. You&#8217;ll need the config, kernel and initrd files from /boot of a DomU (or maybe the Dom0..)<br />
<code># cd /boot<br />
# cp config-2.6.18-92.1.22.el5xen vmlinuz-2.6.18-92.1.22.el5xen initrd-2.6.18-92.1.22.el5xen.img /mnt/boot</code></p>
<p>Rename the initrd to drop the .img from the end. It doesn&#8217;t work with the update-grub script in Debian<br />
<code># mv initrd-2.6.18-92.1.22.el5xen.img initrd-2.6.18-92.1.22.el5xen</code></p>
<p>Copy the kernel modules to your new VM too:<br />
<code># cp -r /lib/modules/2.6.18-92.1.22.el5xen /mnt/lib/modules</code></p>
<p>If you don&#8217;t have a /boot/grub directory in your Debian DomU, then you&#8217;ll need create one. You only really need three files: <strong>menu.lst</strong> and <strong>device.map</strong>. We&#8217;ll need to set it up properly so that both the update-grub script in Debian and the pyGrub bootloader work happily.</p>
<p>Edit the <strong>/boot/grub/device.map</strong> file. Make sure your <strong>hd0</strong> is set to <strong>/dev/xvda</strong>:<br />
<code>(hd0)   /dev/xvda</code></p>
<p>The pyGrub script reads grub.conf, and not menu.lst, so symlink it<br />
<code>cd /boot; ln -s menu.lst grub.conf</code></p>
<p>Here&#8217;s the contents of my <strong>/boot</strong> after I&#8217;m finished:<br />
<code>/boot/config-2.6.18-92.1.22.el5xen<br />
/boot/initrd-2.6.18-92.1.22.el5xen<br />
/boot/vmlinuz-2.6.18-92.1.22.el5xen<br />
/boot/grub<br />
/boot/grub/default<br />
/boot/grub/menu.lst<br />
/boot/grub/device.map<br />
/boot/grub/grub.conf<br />
</code></p>
<p>You&#8217;ll need to fix your inittab to use the xvc0 as your console. If you don&#8217;t you lose access to log into the console. In the file <strong>/etc/inittab</strong>, edit the tty1 line to be xvc0 instead.<br />
<code>1:2345:respawn:/sbin/getty 38400 <strong>xvc0</strong></code></p>
<p>Your first tty should be changed to xvc0, and the others (tty2-6) should be commented out (if they&#8217;re not already)</p>
<p>Unmap the partitions and destroy our loop device<br />
<code># kpartx -d /dev/loop0<br />
# losetup -d /dev/loop0</code></p>
<h3>Start the new Debian Lenny virtual machine</h3>
<p><code># xm create -c debian</code></p>
<p>You should see PyGrub come up, and let you pick the kernel.<br />
<code> pyGRUB  version 0.6<br />
==========================================================================<br />
| Debian GNU/Linux, kernel 2.6.18-92.1.22.el5xen                         |<br />
| Debian GNU/Linux, kernel 2.6.18-92.1.22.el5xen (single-user mode)      |<br />
|                                                                        |<br />
|                                                                        |<br />
|                                                                        |<br />
|                                                                        |<br />
|                                                                        |<br />
|                                                                        |<br />
==========================================================================<br />
Use the ^ and v keys to select which entry is highlighted.<br />
Press enter to boot the selected OS. 'e' to edit the<br />
commands before booting, 'a' to modify the kernel arguments<br />
before booting, or 'c' for a command line.</code></p>
<p>Will boot selected entry in  4 seconds</p>
<p>Hopefully, it works for you too <img src='http://www.andybotting.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve made one vanilla debian install, and just make a copy of that image file for each new VM I need to create. I have eth0 in the interfaces file commented out, so I just put the new IP in, set the hostname and I&#8217;m ready to go.</p>
<p>I may have missed a step in here, so if you&#8217;re trying this out, please comment to let us know how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/running-a-debian-lenny-domu-under-a-centos-5-dom0/feed</wfw:commentRss>
		</item>
		<item>
		<title>Thailand Trip (part 4)</title>
		<link>http://www.andybotting.com/wordpress/thailand-trip-part-4</link>
		<comments>http://www.andybotting.com/wordpress/thailand-trip-part-4#comments</comments>
		<pubDate>Fri, 28 Nov 2008 20:55:23 +0000</pubDate>
		<dc:creator>Andy Botting</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.andybotting.com/wordpress/?p=272</guid>
		<description><![CDATA[Once we realised how much Stable lodge was really costing us, we upgraded our accommodation for the four nights we had in Bangkok. We booked a serviced apartment at Citiadines in Sukhumvit 8, just down the road from Stable Lodge. 

Messy bed at Citadines
We booked it on Wotif and it cost us a little bit [...]]]></description>
			<content:encoded><![CDATA[<p>Once we realised how much Stable lodge was really costing us, we upgraded our accommodation for the four nights we had in Bangkok. We booked a serviced apartment at Citiadines in Sukhumvit 8, just down the road from Stable Lodge. </p>
<p><a href="http://picasaweb.google.com/lh/photo/71XKXX20FRv8CvARGT4DQg"><img src="http://lh5.ggpht.com/_KPmVE0YnzRY/SS4gQzyXTMI/AAAAAAAACH0/RkT0dsvNtJ4/s400/img_1589.jpg" /></a><br />
<em>Messy bed at Citadines</em></p>
<p>We booked it on <a href="http://www.wotif.com">Wotif</a> and it cost us a little bit more than what Stable Lodge was. It was totally worth it for the comfortable bed alone, especially after sleeping on really hard and really soft beds at the other places.</p>
<p><a href="http://picasaweb.google.com/lh/photo/zSYZiqPzdoDn18pK4g8Hsg"><img src="http://lh5.ggpht.com/_KPmVE0YnzRY/SS4gSHMOvHI/AAAAAAAACH4/AVWyMAG9uwI/s400/img_1590.jpg" /></a><br />
<em>Nice TV at Citadines</em></p>
<p>Somehow we ended up wth four nights in Bangkok with was way too much. If you&#8217;re going to Thailand, only spend a few days in Bangers at a maximum. It&#8217;s just not that exciting. It&#8217;s too similar to Melbourne really. Trains, shopping centers, etc.</p>
<p>We checked out the <strong>massive</strong> MBK shopping center and the King Power duty free place too. If you see King Power anywhere.. avoid it. Don&#8217;t waste your time, it&#8217;s fancy stuff that is way overpriced.</p>
<p>The last night in Bangkok, we found out about the semi-permanent beer gardens that get set up outside the CentralWorld shopping center. The beer garden for the Thai beer <em>Singha</em>, must have had some association with the Japanese beer Asahi, which just happens to be my favourite beer. So, you can imagine my excitement to find out they were serving it there.  </p>
<p><a href="http://picasaweb.google.com/lh/photo/FsZdcTPtTkuL2XXuzvXqPw"><img src="http://lh5.ggpht.com/_KPmVE0YnzRY/SS4ftbERWuI/AAAAAAAACGQ/k0wcRpcpv_k/s400/img_1510.jpg" /></a><br />
<em>The Asahi tower</em></p>
<p>Bek and I polished off a <em>tower</em> of Asahi. The tower is a 3 litre tube full of beer with a column of ice down the middle to keep it cold and a tap on the bottom to pour. It was awesome. I thought about how good it would be to do a similar thing in Melbourne, but I realised that it just wouldn&#8217;t work because it would get abused. People would be getting smashed and then smashing each other (like going to any pub in the city these days). The Thai people don&#8217;t drink that much and are very passive. It&#8217;s nice to walk around at any time and feel totally safe.</p>
<p><a href="http://picasaweb.google.com/lh/photo/E-MGN7_p62Y8xqs7Z-9AXg"><img src="http://lh3.ggpht.com/_KPmVE0YnzRY/SS4f2JwYV8I/AAAAAAAACGo/RmtAb11snMI/s400/img_1520.jpg" /></a><br />
<em>All gone</em></p>
<p>We had trouble getting a taxi to the airport when it was time to leave. The guy at the hotel mentioned something about a bomb, but we didn&#8217;t know anything else. Finally a taxi arrived who was willing to take us. This guy was crazy. He had this strange twitch in his seat while he was driving. He was doing 130 km/h down the freeway, which had 80 signs. Weaving through traffic and flashing his lights at anyone slowing him down. We also didn&#8217;t have any seat belts.</p>
<p>Closer to the airport, we started seeing lots of people in yellow shirts with plastic hand clappers. I had no idea who they were until later. They were protesters heading towards the airport to shut it down.</p>
<p><a href="http://picasaweb.google.com/lh/photo/MB_15dPhbfSK26zHCukrNQ"><img src="http://lh5.ggpht.com/_KPmVE0YnzRY/SS4ghsKwhJI/AAAAAAAACIo/5jktN7iHguU/s400/img_1605.jpg" /></a><br />
<em>Protester convoy</em></p>
<p>We managed to get most of the way to the airport before traffic stopped moving. Bek and I had to put our backpacks on and walk the last km to the terminal. It was pretty exciting actually. We were so lucky to get our fight, because not long after, the protesters stormed the terminal and all flights got shut down. It must have been only an hour or two after we left.</p>
<p>Their aim was to stop their prime minister from getting into the country, from Peru where the APEC summit was held. It seems they don&#8217;t like him very much&#8230; and it&#8217;s a long story.</p>
<p>A nine hour flight and we touched down in Melbourne. First stop, the Classic Curry Company <img src='http://www.andybotting.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All the photos have been uploaded to my <a href="http://picasaweb.google.com/andybotting/Thailand2008">Google Picasa account</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andybotting.com/wordpress/thailand-trip-part-4/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
