<?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>micolous.id.au &#187; Lanning</title>
	<atom:link href="http://micolous.id.au/archives/category/lanning/feed/" rel="self" type="application/rss+xml" />
	<link>http://micolous.id.au</link>
	<description>the result of a blogging accident</description>
	<lastBuildDate>Mon, 05 Sep 2011 08:29:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>I&#8217;m leaving StreetGeek.</title>
		<link>http://micolous.id.au/archives/2010/11/02/im-leaving-streetgeek/</link>
		<comments>http://micolous.id.au/archives/2010/11/02/im-leaving-streetgeek/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 14:17:54 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=346</guid>
		<description><![CDATA[Just so you know, I&#8217;m no longer involved with StreetGeek. Unfortunately the problems are quite deep seeded. I&#8217;m still actively participating in the LAN scene (I recently travelled to Sydney to help out with LANTACO, a LAN run by the &#8230; <a href="http://micolous.id.au/archives/2010/11/02/im-leaving-streetgeek/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://firstyear.id.au/blog/?p=166">Just so you know, I&#8217;m no longer involved with StreetGeek.</a></p>
<p>Unfortunately the problems are quite deep seeded.  I&#8217;m still actively participating in the LAN scene (I recently travelled to Sydney to help out with <a href="http://www.lantaco.com">LANTACO</a>, a LAN run by the <a href="http://mu-cs.com">Macquarie University Computer Society</a> and that was a lot of fun), however I&#8217;m not involved the ongoing operation of any public events.</p>
<p>On the roadmap is the completion of the Jabberwocky project, which will provide a complete integrated stack of services for LAN parties.  I&#8217;ll also be looking at releasing the software I&#8217;ve developed for StreetGeek as open source in the coming months.</p>
<p><strong>Update 2010-11-08</strong>: I&#8217;ve read a lot of stuff about &#8220;bad blood&#8221;, and a lot of people are frustrated that I&#8217;m not involved with this event anymore.</p>
<p><strong>I would ask that you do not engage in attacks against StreetGeek or it&#8217;s admins in my name.</strong>  It doesn&#8217;t do anyone any favours, and just rubs further salt in the wounds.</p>
<p>If you don&#8217;t like where StreetGeek is going, either work towards fixing it or don&#8217;t attend anymore.  Just don&#8217;t do anything stupid.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/11/02/im-leaving-streetgeek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Captive Portal at StreetGeek X (10.10)</title>
		<link>http://micolous.id.au/archives/2010/10/05/captive-portal-at-streetgeek-x-10-10/</link>
		<comments>http://micolous.id.au/archives/2010/10/05/captive-portal-at-streetgeek-x-10-10/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 07:01:30 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=343</guid>
		<description><![CDATA[The Captive Portal system used at StreetGeek X was not mine, and if I&#8217;m involved with StreetGeek 10.11, we will not be using it. Just thought I should post this, because I do not wish to be attributed as having &#8230; <a href="http://micolous.id.au/archives/2010/10/05/captive-portal-at-streetgeek-x-10-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Captive Portal system used at StreetGeek X was not mine, and if I&#8217;m involved with StreetGeek 10.11, we will not be using it.</p>
<p>Just thought I should post this, because I do not wish to be attributed as having written such horrible software, nor impose it on anyone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/10/05/captive-portal-at-streetgeek-x-10-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Our non-involvement at StreetGeek X (10.10)</title>
		<link>http://micolous.id.au/archives/2010/09/15/our-non-involvement-at-streetgeek-x-10-10/</link>
		<comments>http://micolous.id.au/archives/2010/09/15/our-non-involvement-at-streetgeek-x-10-10/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 14:21:00 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=334</guid>
		<description><![CDATA[As you may have heard, Firstyear and I will not be involved with StreetGeek X (10.10). We&#8217;ve announced the withdrawal of our support yesterday to the StreetGeek committee and admin team. This will only affect StreetGeek X (10.10). We will &#8230; <a href="http://micolous.id.au/archives/2010/09/15/our-non-involvement-at-streetgeek-x-10-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As you may have heard, Firstyear and I will <strong>not</strong> be involved with StreetGeek X (10.10).  We&#8217;ve announced the withdrawal of our support yesterday to the StreetGeek committee and admin team.</p>
<p>This will <strong>only</strong> affect StreetGeek X (10.10).  We will be resuming our support of StreetGeek for the 10.11 event, provided the rest of the committee is happy for us to do so.</p>
<p>We are withdrawing our support for the event as we are not happy with the organisation of the event, and certain repeated actions by particular members of the committee.  We have made every attempt to outline our concerns with the committee, and we believe that with the exception of a few members, it has fallen on deaf ears.  These issues are, for the most part, specific to the way StreetGeek X has been handled, and do not apply to other events run by StreetGeek.</p>
<p>We have set extremely high standards for ourselves over the term of our involvement with StreetGeek, and we believe that these issues will prevent us from continuing to provide the quality of service that we pride ourselves on.</p>
<p>Unfortunately, as these issues are considered confidential by the admin team, we cannot disclose the full details of them publicly.</p>
<p>Our non-involvement means that any service that we provide will not be provided by us at StreetGeek X.  This covers a wide variety of things, which we won&#8217;t go in to here due to confidentiality issues.</p>
<p>We hope that this will be a singular occurrence, and we will continue to strive towards resolving these issues in the future.  Unfortunately, our words have not been heeded and we felt that action was to become our voice in this matter.</p>
<p>Do not take this as a &#8220;banner of protest&#8221;. This issue is purely between us (William and I) and the SGX team.</p>
<p>Sincerely,</p>
<p>.</p>
<p>~micolous and ~firstyear</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/09/15/our-non-involvement-at-streetgeek-x-10-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More portal2 v2.8.3 API changes</title>
		<link>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/</link>
		<comments>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 11:49:53 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=330</guid>
		<description><![CDATA[There&#8217;s some more updates to portal2&#8242;s API. UserProfile objects (returned by whoami and whois_ip) now also include the user&#8217;s forum numeric user ID. This means that your application can track when a user has changed their username. Additionally, there&#8217;s now &#8230; <a href="http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s some more updates to portal2&#8242;s API.</p>
<p><code>UserProfile</code> objects (returned by <code>whoami</code> and <code>whois_ip</code>) now also include the user&#8217;s forum numeric user ID.  This means that your application can track when a user has changed their username.</p>
<p>Additionally, there&#8217;s now a new &#8220;python&#8221; output method for the HTTP GET API which gives the output of <a href="http://docs.python.org/library/functions.html#repr">repr()</a> on the result object.  It&#8217;s not recommended that you use this with Python (instead use XMLRPC), but there may be instances where you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/09/07/more-portal2-v2-8-3-api-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>portal2 API v2.8.3</title>
		<link>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/</link>
		<comments>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:10:40 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=323</guid>
		<description><![CDATA[There&#8217;s been a minor change to the portal2 API as of v2.8.3 (to be deployed at LAN 10.09). Functions which attempt to identify you (usage, usage_history and whoami) will attempt to use cookie-based authentication before attempting to identify your computer &#8230; <a href="http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a minor change to the <a href="/projects/portal2/portal2_api/">portal2 API</a> as of v2.8.3 (to be deployed at LAN 10.09).  Functions which attempt to identify you (<code>usage</code>, <code>usage_history</code> and <code>whoami</code>) will attempt to use cookie-based authentication before attempting to identify your computer by MAC address.</p>
<p>This will allow in-browser applications to determine the identity of who you are logged in as before attempting to fall back to who owns the computer.</p>
<p>In other news, portal2 v2.8.3 now has a couple of other changes to it, such as support for clustering and a new graph on the usage page which is generated client side (and much faster than the server-side graph).</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/08/24/portal2-api-v2-8-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powering StreetGeek 0&#215;00: The Network</title>
		<link>http://micolous.id.au/archives/2010/08/11/powering-streetgeek-0x00/</link>
		<comments>http://micolous.id.au/archives/2010/08/11/powering-streetgeek-0x00/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 12:00:28 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Powering StreetGeek]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=298</guid>
		<description><![CDATA[I&#8217;m going to be working on a new series of blog posts with Firstyear in which we&#8217;re going to discuss a lot of StreetGeek&#8216;s network and server infrastructure. Information about this is around the place (or you can ask us), &#8230; <a href="http://micolous.id.au/archives/2010/08/11/powering-streetgeek-0x00/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to be working on a new series of blog posts with <a href="http://firstyear.id.au/blog/">Firstyear</a> in which we&#8217;re going to discuss a lot of <a href="http://www.streetgeek.com.au">StreetGeek</a>&#8216;s network and server infrastructure.  Information about this is around the place (or you can ask us), but we would talk about more publicly about what goes into making a &#8220;medium&#8221; LAN party work.  I say &#8220;medium&#8221;, which is what I&#8217;d personally group all LANs with 100 to 1,000 attendees.  As a contrast, I&#8217;d call an event like <a href="http://wilanga.net/">wiLANga</a> with about 50 people &#8220;small&#8221;, and the major (commercial) US/EU LANs like <a href="http://en.wikipedia.org/wiki/QuakeCon">QuakeCon</a> with &gt; 7,000 people &#8220;large&#8221;.</p>
<p>StreetGeek itself has seen many major changes over the years, as it grew from a LAN of about 20 people hanging out in <a href="http://www.adelaide.edu.au">The University of Adelaide</a> to running monthly events with over 100 attendees at Colonel Light Gardens Uniting Church, the LAN area at <a href="http://www.avcon.org.au">AVCON</a>, and leading <a href="http://www.gamersalliance.net.au">SAGAfest</a> in 2009.  With this, it&#8217;s had to adapt to these new, larger environments, and invest in better hardware.</p>
<p>Here&#8217;s what StreetGeek&#8217;s network looks like, showing only the switches.</p>
<p><img src="/static/resc/network-layout-jun10.png" alt=""/></p>
<p>StreetGeek&#8217;s backbone is a <a href="http://www.cisco.com/en/US/products/ps9984/">Cisco-Linksys SGE2010</a>.  It&#8217;s a 48 port managed full-fabric gigabit switch, with 4 <a href="http://en.wikipedia.org/wiki/Small_form-factor_pluggable_transceiver">SFP ports</a>.  It replaced a previous Alloy 48-port managed gigabit switch, which didn&#8217;t have as many features, and had the nasty habit of overheating under the load we put it through.  This switch lives on the &#8220;mu table&#8221; (formerly known as the B/C tables).</p>
<p>Coming off that are three <a href="http://www.cisco.com/en/US/products/ps9989/index.html">Cisco-Linksys SRW2024</a> switches.  They&#8217;re 24-port managed full-fabric gigabit switches, which are connected to the backbone each by two copper links using link aggregation.  This means between these switches and the backbone there is 2gbit/s of connectivity, full-duplex.  These switches live on D, E and G tables, where they together pushed about 7 TiB of traffic during the 10.06 event, with 1.1GiB/s peaks from clients on those tables (that&#8217;s about 10gbit/s).  While the amount may seem impressive, in reality it&#8217;s really not &#8211; the switches could push 8.3GiB/s (72gbit/s) of traffic, which if running flat out for an entire event would add up to about 758.6 TiB.</p>
<p>On the overflow tables, and in the console area, there are <a href="http://www.cisco.com/en/US/products/ps10015/index.html">Cisco-Linksys SR2024</a> switches.  They&#8217;re the unmanaged counterpart of the SRW2024, so they don&#8217;t support link aggregation.  These are connected in various points around the LAN, generally where there aren&#8217;t a large amount of clients to justify extra bandwidth.</p>
<p>At the moment, Firstyear has loaned the use of his <a href="http://www.apple.com/airportextreme/">Apple Airport Extreme</a> access point.  It&#8217;s a 802.11n access point, which is also one of the few wireless access points on the market that can do 2.4GHz and 5GHz at the same time (thereby effectively doubling the available spectrum that an access point can occupy).  They easily handle having 50 clients on the network, and have coverage around most of the venue.  We&#8217;re planning to replace this in the future with the LAN purchasing two of it&#8217;s own Airport Extremes: one in the main hall, and one in the console area.</p>
<p>We&#8217;ve tested these access points with <a href="http://gm.stackunderflow.com/blog/">gm</a> trying to perform denial of service attacks against it with thousands of simulated clients, and it held up where other routers would just crash.  Previously we had used 3 D-Link 802.11n access points to service the network, however the reliability of these access points under load was absolutely atrocious.</p>
<p>Something that may stand out with this is that the console area has a very poor layout.  In the end, the console area doesn&#8217;t push enough traffic to justify additional cabling to do things &#8220;properly&#8221;.  The only current-generation console that has gigabit ethernet is the Playstation 3, and nothing on the Playstation 3 actually pushes that kind of bandwidth.  Typically, LAN games use a megabit or two per second, which is just tiny.  The largest amount of bandwidth is used by the RetroLAN PCs, where 10 machines boot from an iSCSI virtual disk &#8211; and even then that&#8217;s only used for the operating system.</p>
<p>So this has pretty much covered our layout.  We run a lot of services on the network itself, which will be covered in later editions of this series.  Most of them are from servers in the office, or from servers in the admin area of the LAN hanging off the backbone.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/08/11/powering-streetgeek-0x00/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>portal2 2.8.1 API documentation</title>
		<link>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/</link>
		<comments>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:27:13 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=278</guid>
		<description><![CDATA[There have been some requests that I make portal2&#8216;s API documentation available online and not just available at LANs. So I have published a copy of the portal2 API v2.8.1. This covers the (at the time of writing) current version &#8230; <a href="http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There have been some requests that I make <a href="/projects/portal2/">portal2</a>&#8216;s API documentation available online and not just available at LANs.  So I have published a copy of the <a href="/projects/portal2/portal2_api/">portal2 API v2.8.1</a>.  This covers the (at the time of writing) current version of portal2&#8242;s HTTP GET and XMLRPC APIs.</p>
<p>Unfortunately, there&#8217;s no online &#8220;simulator&#8221; available, but that should be trivial for someone to write if they&#8217;re testing their program.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/05/01/portal2-2-8-1-api-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux iSCSI COW Images, and Windows integration.</title>
		<link>http://micolous.id.au/archives/2010/01/23/linux-iscsi-cow-images-and-windows-integration/</link>
		<comments>http://micolous.id.au/archives/2010/01/23/linux-iscsi-cow-images-and-windows-integration/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 10:38:32 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=164</guid>
		<description><![CDATA[More stuff for RetroLAN PCs, yay! I&#8217;ve now got all the RetroLAN PCs running out of a copy-on-write image. This means I now have a single 4GB &#8220;base&#8221; image with an installation of Windows XP, instead of having 10 of &#8230; <a href="http://micolous.id.au/archives/2010/01/23/linux-iscsi-cow-images-and-windows-integration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>More stuff for RetroLAN PCs, yay!</p>
<p>I&#8217;ve now got all the RetroLAN PCs running out of a copy-on-write image.  This means I now have a single 4GB &#8220;base&#8221; image with an installation of Windows XP, instead of having 10 of them.  It also means it is very trivial to reset the machine&#8217;s disk images, which I achieved with a bit of scripting. </p>
<p>First up, I needed to setup the copy-on-write images through `device-mapper`.  This program is designed to let you setup software RAID, but it also allows snapshotting disks to provide a backup of a device at a point in time.  Unfortunately, `dmsetup` doesn&#8217;t support accessing file images, only actual devices, so I need to create some loopback devices first.</p>
<pre lang="bash" line="1"># setup loop0 as the "master" image, and mark it as read-only so no changes ever get written back.
losetup -r /dev/loop0 /store/master.img
# we need to get the size of the image in sectors for use later on.
cow_size=`blockdev --getsize /dev/loop0`</pre>
<p>The next step is to create a blank image file and loopback device to commit changes to.  For my setup, I created 200MB images.  Be aware of things like disk-based caches and automatic defragmentation will use up the allocated space very quickly, and when you run out of space in this file further writes will not be allowed, and Windows will soon crash with a blue screen of death.  (More on dealing with this in a bit)</p>
<pre lang="bash" line="1"># remove any existing COW image
rm /store/pc-1.cow

# create a new 200MB image (it's actually comes out 5% more than stated, but it allows for overheads in the filesystem)
dd if=/dev/zero of=/store/pc-1.cow bs=1M count=200

# now hook it to a loopback device
losetup /dev/loop1 /store/pc-1.cow</pre>
<p>Now we have two devices, `/dev/loop0` which contains the master image, and `/dev/loop1` which will contain any changes made to the disk.  The next step is to use dmsetup to create a `device mapper` which will layer the COW image ontop of the original image.</p>
<pre lang="bash" line="1"># create the cow!
echo "0 ${cow_size} snapshot /dev/loop0 /dev/loop1 p 64" | dmsetup create pc1</pre>
<p>This will create a device called `/dev/mapper/pc1`.  You can use it in your iSCSI setup with something like this in your `/etc/ietd.conf`:</p>
<pre lang="txt" line="1">Target iqn.2010-01.lan.someplace.iscsihost:pc1
        Lun 0 Path=/dev/mapper/pc1,Type=fileio</pre>
<p>You can then start `ietd`.</p>
<p>Now the next part is writing a script to let you reset the COW images.  `ietd` does not like you changing things while it is running, so you&#8217;ll need to make sure your script suspends all disk activity before blanking out the COW image.  Something like this:</p>
<pre lang="bash" line="1"># disconnect the COW image #1
ietadm --op delete --tid 1 --lun 0

# suspend dm activity
dmsetup suspend pc1

# clear the cow cache
dd if=/dev/zero of=/dev/loop1

# reload the cow table
master="/dev/loop0"
cow_size=`blockdev --getsize ${master}`
echo "0 ${cow_size} snapshot ${master} /dev/loop1 p 64" | dmsetup reload pc1

# resume dm activity
dmsetup resume pc1

# reconnect the COW image #1
ietadm --op new --tid 1 --lun 0 --params Path=/dev/mapper/pc1</pre>
<p>You could change this script around so that it allows you to pass in a PC number as a command-line argument, and then hook in a CGI script that will call it to reset it remotely.  In my setup, I&#8217;m using gPXE to boot from iSCSI, but it can also be used to access a URL via HTTP.  So your CGI script reads in the request IP address, and if it is one of the resettable machines, it will reset it&#8217;s COW image.  Then it sends back a gPXE script instructing it to run a DOS .com file that will reboot the computer.  For this to work you need to have your CGI script execute the command as the superuser (root).</p>
<p>One of the things about the COWs is if you reset them or they become full while Windows is running, Windows will very soon crash, and refuse to boot up again.  To better inform both yourself and users about the usage levels, you can read the information from `dmsetup`:</p>
<pre lang="bash" line="1"># dmsetup status pc8
0 8385930 snapshot 55296/409600</pre>
<p>In this example, it is indicating that the full image is 8385930 sectors, and 55296 of 409600 sectors are used in the COW image.  So I wrote a Python CGI script that reports this in a parsable fashion to clients:</p>
<pre lang="python" line="1" escaped="true">#!/usr/bin/env python

print "Content-Type: text/plain\r\n\r"

from os import environ
from subprocess import Popen, PIPE

ip = environ['REMOTE_ADDR']
d = int(ip.split(".")[3])
if d &gt;= 41 and d &lt;= 54:
  machine = d - 40
  try:
    p = Popen(('/sbin/dmsetup', 'status', 'retrocow%d' % machine), stdout=PIPE, stderr=PIPE)
    stdout, stderr = p.communicate()
    use, total = stdout.split(' ')[3].split('/')
    use, total = long(use), long(total)
    print "OK %d %d" % (use, total)
  except:
    print "ERR Problem getting parsing information"
else:
  # return error
  print "ERR Not a RetroLAN Machine"
</pre>
<p>For me, the RetroLAN machines have IPs ending in 41 to 54.  That corresponds to their PC number (retro-01 to retro-14).  This script outputs the following text file when requested via CGI if successful:</p>
<pre>OK 55296 409600</pre>
<p>This isn&#8217;t very usable for the end user, so I wrote a .NET 2.0 app called `CowBell` that runs in the system tray showing the percentage of COW usage, and notifies them if they&#8217;re over 75% usage (which means they will crash soon).  I&#8217;ve made <a href="/static/projects/cowbell/cowbell-1.0-src.7z">source code available for download</a>, which you&#8217;ll need to modify `frmMain.cs` line 37 to include the path to where you put the CGI script, and uncomment the line otherwise it <strong>will not compile</strong>.  If you make modifications to this program I do ask that you share your improvements with me.</p>
<p>This is the message that constantly pops up when you&#8217;re over 75% usage:</p>
<p><img src="http://micolous.id.au/static/projects/cowbell/cowbell.png" alt="" /></p>
<p>The application refreshes it&#8217;s status every 10 seconds, and if you right-click the icon it shows the COW usage in sectors.</p>
<h4>Update 2010-10-05: Dealing with duplicate names</h4>
<p>Something which I omitted from the original version of this post was how to deal with the duplicate names on the network.  In my configuration, I&#8217;ve set the computer name <code>PC-00</code> on the master iSCSI image.</p>
<p>I then setup a DNS and WINS server.  On the DNS server, I created forward and reverse entries for each of the computers on iSCSI (eg: <code>pc-01.example.lan</code>).  On the WINS server, I used Samba to make it proxy DNS (<code>dns proxy = yes</code>), but that shouldn&#8217;t be required as Windows will fall back to using DNS after failing WINS (and DNS is faster than WINS).  The benefit to having the WINS server is for non-iSCSI clients register their names to it, so they can still be looked up without NetBIOS.</p>
<p>I configured the master image to use this WINS server and search domain (eg: <code>example.lan</code>), as DHCP options are ignored when booting from iSCSI with the exception of the DNS server.  I then disabled NetBIOS over TCP/IP manually (see <a href="http://support.microsoft.com/kb/323357">Microsoft Knowledge Base article 323357</a>).</p>
<p>Now, Windows does not try to discover other hosts, or advertise it&#8217;s presence using NetBIOS.  You can still connect to other clients via normal UNC names (eg: <code>\\PC-01</code>), and if your non-iSCSI clients have DNS entries created by DHCP or WINS configured, it will allow those to be discovered as well.  Normally when Windows detects a duplicate computer name on the network it will pop up a notification &#8211; with these changes the computer name can be &#8220;wrong&#8221; according to Windows and it won&#8217;t matter or complain.</p>
<p>Mark Russinovich (of SysInternals fame, now working for Microsoft) <a href="http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx">wrote that duplicate SIDs for the most part don&#8217;t matter</a>, so having duplicate SIDs isn&#8217;t really a problem either.  Though I don&#8217;t run these clients on a domain &#8211; but according to the post that shouldn&#8217;t matter either.</p>
<p>If you&#8217;re using a script to perform an action based on the computer&#8217;s name, you&#8217;ll have to modify it to look up the computer&#8217;s DNS name from it&#8217;s IP address rather than getting it from Windows.  <a href="/archives/2010/01/20/dynamically-changing-windows-wallpaper-based-on-hostname/">I&#8217;ve included an example of this in an earlier post where I wrote a VBScript to change the wallpaper based on the computer&#8217;s name as reported by DNS.</a>  I use this with StreetGeek&#8217;s RetroLAN setup to show the computer&#8217;s hostname in the top right corner of the screen.</p>
<p>Something else you should be aware with in this configuration is your licensing requirements.  All the machines will have the same product key.  You may be able to use this setup if you have a Volume Licensing Agreement with Microsoft for Windows (where you have one key that is used for all installations of a Windows version in your organisation).  Some organisations believe that having the same product key where the key is not a volume licensing key, even when your organisation holds enough licenses for that version of Windows, that it is illegal.  I&#8217;m not a lawyer though, and you should seek legal advice about before deploying this.</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/01/23/linux-iscsi-cow-images-and-windows-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically changing Windows&#8217; wallpaper based on hostname</title>
		<link>http://micolous.id.au/archives/2010/01/20/dynamically-changing-windows-wallpaper-based-on-hostname/</link>
		<comments>http://micolous.id.au/archives/2010/01/20/dynamically-changing-windows-wallpaper-based-on-hostname/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:06:12 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=159</guid>
		<description><![CDATA[I have a situation where I&#8217;ve got 14 machines booting Windows XP over iSCSI, and they&#8217;ve all got the same computer name set, and they each need to have a different wallpaper set on each machine. This runs the &#8220;RetroLAN&#8221; &#8230; <a href="http://micolous.id.au/archives/2010/01/20/dynamically-changing-windows-wallpaper-based-on-hostname/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a situation where I&#8217;ve got 14 machines booting Windows XP over iSCSI, and they&#8217;ve all got the same computer name set, and they each need to have a different wallpaper set on each machine.  This runs the &#8220;RetroLAN&#8221; machines at StreetGeek in the new setup, to make it much easier to roll out updates to machines.  They&#8217;re all using the same base image, and this will get restored if things get broken.  I&#8217;m using gPXE to boot the machines in the first place, and I&#8217;ve disabled NetBIOS over TCP/IP (to avoid the problem where Windows complains if two computers have the same name), and manually set the DNS search order (because when you boot Windows over iSCSI, Windows&#8217; own DHCP client doesn&#8217;t get activated).</p>
<p>So I hacked together this VBScript that does a reverse DNS lookup on the IP, and uses that to get a specific wallpaper for the machine using a bit of copy-paste from the &#8216;net.  The script requires you use <a href="http://www.jsware.net/jsware/scripts.php5#jssys">JSWare&#8217;s JSSys</a> addin for VBScript, so make sure you have that DLL installed and registered before trying to use my script.  There&#8217;s a way to do it without JSWare using the registry, but it only applies after logging out and logging in again.</p>
<p>In the code it will try to grab the wallpaper from <code>\\logres\wallpapers</code>.  You&#8217;ll need to change this for your setup.  To activate this, I added it to the Startup folder, so about 5 seconds after login, the wallpaper is automatically changed to be for the correct machine.</p>
<p>One minor caveat: Apparently my network card was network card #2, and there was no #1.  You can check what ID your card is in <code>HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkCards\</code>, and change the line in the script appropriately.</p>
<pre lang="vb" line="1">' Automatically setup wallpaper (autowallpaper.vbs)

Function GetFQDN(ipaddress)
  set sh = createobject("wscript.shell")
  set fso = createobject("scripting.filesystemobject")
  Set Env = sh.Environment("PROCESS")

  workfile = fso.gettempname
  sh.run "%comspec% /c nslookup " &#038; ipaddress &#038; "  > " &#038; workfile,0,true
  set sh = nothing
  set ts = fso.opentextfile(workfile)
  data = split(ts.readall,vbcr)
  ts.close

  set ts = nothing
  fso.deletefile workfile
  set fso = nothing
  for n = 0 to ubound(data)
    if instr(data(n),"Name") then
      parts = split(data(n),":")
      hostname= trim(cstr(parts(1)))
      Exit For
    end if
    hostname = "could not resolve IP address"
  next

  GetFQDN = hostname
End Function

Const HKCU = &#038;H80000001
Const HKLM = &#038;H80000002

Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")

' Get NIC service name
objReg.GetStringValue HKLM, "Software\Microsoft\Windows NT\CurrentVersion\NetworkCards\2", "ServiceName", nicService

' Get IP address
objReg.GetMultiStringValue HKLM, "System\CurrentControlSet\Services\TCPIP\Parameters\Interfaces\" &#038; nicService, "IPAddress", addrs

' Resolve name
fullname = GetFQDN(addrs(0))
shortname = split(fullname, ".")(0)

Dim objOps
Set objOps = CreateObject("JSSys3.Ops")

r = objOps.SetWallpaper("\\logres\wallpapers\" &#038; shortname &#038; ".bmp", "center")
</pre>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2010/01/20/dynamically-changing-windows-wallpaper-based-on-hostname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RetroLAN fun!</title>
		<link>http://micolous.id.au/archives/2009/09/30/retrolan-fun/</link>
		<comments>http://micolous.id.au/archives/2009/09/30/retrolan-fun/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 13:35:14 +0000</pubDate>
		<dc:creator>micolous</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lanning]]></category>

		<guid isPermaLink="false">http://micolous.id.au/?p=151</guid>
		<description><![CDATA[For StreetGeek 9.08, some people may have noticed that I changed the format of the presentation software for that event. I really should have blogged about this, say&#8230; a month ago&#8230; but I really just ran out of time to &#8230; <a href="http://micolous.id.au/archives/2009/09/30/retrolan-fun/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For StreetGeek 9.08, some people may have noticed that I changed the format of the presentation software for that event.  I really should have blogged about this, say&#8230; a month ago&#8230; but I really just ran out of time to talk about it and I really didn&#8217;t want to spoil the surprise before the event. <img src='http://micolous.id.au/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="/static/resc/retro2.png" alt=""/></p>
<p>In SAGAPresenter (the presentation software I wrote for StreetGeek and SAGAfest), I wrote a fully functioning PETSCII telnet server.  This meant that I wasn&#8217;t just pretending to look like a Commodore 64 with downgraded graphics, but I was sending <em>actual</em> command-codes that a Commodore 64 with a network card (and telnet client) could interpret and display.  Unfortunately, we didn&#8217;t have a C64 with a network adaptor for the LAN, so I installed <a href="http://www.paradroid.net/cgterm/">Per Olofsson&#8217;s cgterm</a>, which emulated the C64 on a normal PC without the need for special hardware.  It was also much easier to hook up to a projector for the event.</p>
<p>All the while, the traditional GTK# interface was still running, and the displays all perfectly synchronised with each other.  I used <a href="http://it.toolbox.com/blogs/paytonbyrd/howto-implement-a-text-encoder-in-net-20-13243">this PETSCII .NET encoding handler</a> to do a little bit of the text conversion, however I had to write my own code to handle the text alignment and inserting control characters in the right spot.</p>
<p>All in all it was a fun hack, with not a huge amount of code additions required.  I spent most of the time converting sponsor banners by hand to PETSCII and tweaking to get them just right!</p>
]]></content:encoded>
			<wfw:commentRss>http://micolous.id.au/archives/2009/09/30/retrolan-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

