<?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>Blogging to Nowhere &#187; Howtos</title>
	<atom:link href="http://webworxshop.com/category/howtos/feed" rel="self" type="application/rss+xml" />
	<link>http://webworxshop.com</link>
	<description>cat /dev/brain &#62; /dev/null</description>
	<lastBuildDate>Wed, 04 Jan 2012 02:45:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>Installing and Configuring Arch Linux: Part 1</title>
		<link>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1</link>
		<comments>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1#comments</comments>
		<pubDate>Thu, 01 Apr 2010 04:52:04 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[archrob]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[crunchbang]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=168</guid>
		<description><![CDATA[OTHERWISE ENTILED: Rob tries to install Arch Linux some of the time, but really spends most of the time drinking beer.

Before I start: NO, UNLIKE EVERY OTHER ARTICLE ON THE WEB, PUBLISHED TODAY, THIS IS NOT A JOKE, K?!?

I've been looking for a new distro recently. I do this from time to time, principally ...]]></description>
			<content:encoded><![CDATA[<p><strong>OTHERWISE ENTILED: Rob tries to install Arch Linux some of the time, but really spends most of the time drinking beer.</strong></p>
<p><em>Before I start: NO, UNLIKE EVERY OTHER ARTICLE ON THE WEB, PUBLISHED TODAY, THIS IS NOT A JOKE, K?!?</em></p>
<p>I&#8217;ve been looking for a new distro recently. I do this from time to time, principally because I get bored of what I&#8217;m currently running. Last time it was <a href="http://crunchbanglinux.org">Crunchbang</a> which I settled on. This time I wanted to go more advanced, so I started researching <a href="http://www.archlinux.org">Arch Linux</a>.</p>
<p>For those that don&#8217;t know, Arch Linux describes itself as:</p>
<blockquote><p>&#8230;a lightweight and flexible Linux® distribution that tries to Keep It Simple.</p></blockquote>
<p>I&#8217;d heard about Arch in the past from several sources and had heard that you basically have to install and configure everything yourself, but that the package manager (awesomely named <a href="http://wiki.archlinux.org/index.php/Pacman">Pacman</a>!) manages software without having to compile from source (unless you want to!).</p>
<p>The following series of posts will be a record of my experiences installing and configuring Arch on my home desktop machine. This isn&#8217;t intended to be an exhaustive installation guide, more just a record of where I tripped up in order to aid those who come next. If you are searching for an installation guide, try the <a href="http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide">excellent article</a> on the <a href="http://wiki.archlinux.org">Arch Wiki</a>.</p>
<p>I&#8217;ve separated the post out into days. Note: it didn&#8217;t actually take me a full day for each part, I work during the day and only really had a couple of hours each evening to spend on this.</p>
<p><strong>Day 1: Backing Up</strong></p>
<p>Before installing I wanted to make sure I didn&#8217;t trash my existing Ubuntu system and all my personal data, as I still need to do all the stuff I usually do with my machine. So I made a backup.</p>
<p>I&#8217;m not really going to go into how. Suffice to say I used LVM snapshots and rsync, I might write about this in a future post.</p>
<p>This took a while, as I have quite a lot of data. I thought it best to have a beer in the mean time, so I did.</p>
<p><strong>Day 2: Making Space, Starting the Installation and Various Adventures with LVM</strong></p>
<p>The next thing to do was to resize my existing LVM partition containing Ubuntu so that I had space for Arch. I couldn&#8217;t work out how to do this at first as none of the partition tools I tried (GParted and Cfdisk) could resize the partition. I eventually worked out how to do it.</p>
<p>First, on my running Ubuntu system I resized the physical volume with:</p>
<p><code>$ pvresize --setphysicalvolumesize 500G /dev/sda1</code></p>
<p>This shrank the space used by LVM down to 500GB (from about 1000GB on my machine).</p>
<p>I then rebooted into the Arch live CD (64-bit edition in my case), and ran:</p>
<p><code>$ fdisk /dev/sda</code></p>
<p>Now what you have to do next is slightly alarming. You actually have to delete the partition and recreate it in the new size. This works, without destroying your data, because fdisk only manipulates the partition table on the disk, it doesn&#8217;t do any formatting of partitions, etc.</p>
<p>I did this through fdisk so that the partition was 501GB (making it a little bigger than the PV just to make sure). I then rebooted back into Ubuntu and ran:</p>
<p><code>$ pvresize /dev/sda1</code></p>
<p>To allow it to use all the space. This probably isn&#8217;t necessary but I wanted to be safe.</p>
<p>Next, I proceeded to the installation. For some reason the Arch boot CD was really slow to boot and gave me loads of read errors, I think this might have something to do with my drive as I&#8217;ve been experiencing the same with other disks. Eventually it booted and dropped my at the default prompt.</p>
<p>From then I basically followed the <a href="http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide">installation guide</a> for setting up the package source (CD) and the date and time.</p>
<p>I then set about partitioning the disks. The Arch installer uses Cfdisk, which is fine. I just added two partitions to my disk, a small (255Meg) one for my /boot partition and a large LVM one for the rest of the system (I like LVM and wanted to use it again on Arch).</p>
<p>This was fine, but I had some problems setting up the LVM through the installer, even though the user guide seems to think it can do it. Every time I tried, it would just fail on creating the Volume Group, weird.</p>
<p>I gave up for the evening and (you guessed it) went for a beer!</p>
<p><strong>Day 3: Successful Installation</strong></p>
<p>The next day I thought I&#8217;d try googling for LVM on Arch, luckily when I got in to work <a href="http://identi.ca/duffkitty">@duffkitty</a> on <a href="http://identi.ca">identi.ca</a> had seen one of my posts complaining about having problems and had given me a link to the <a href="http://wiki.archlinux.org/index.php/LVM">LVM article</a> on the Arch Wiki.</p>
<p>This advocated setting up the whole LVM setup manually (and guides you through it) and then just setting the partitions to use in the installer. It also gives you some important things to look out for when configuring the system. Following these instructions worked like a charm and I was able to format everything correctly and install the base system.</p>
<p>I then moved on to configuring the system, following the install guide and taking into account the instructions in the LVM article. Everything went pretty much fine here and I eventually got to installing the bootloader. Here I replaced the Ubuntu Grub version with the one installed by Arch. This left me having to add an entry for Ubuntu, which wasn&#8217;t difficult, I just copied the Arch one and changed the partition and file names.</p>
<p>Then it was time to &#8216;type reboot and pray&#8217; as the Arch installation guide puts it.</p>
<p>So I did.</p>
<p>When I rebooted the bootloader came up with the Arch and Ubuntu entries. I selected Ubuntu just to check everything was OK.</p>
<p>It didn&#8217;t work.</p>
<p>Panicking and Swearing Ensued.</p>
<p>I rebooted and selected Arch.</p>
<p>That worked (thankfully).</p>
<p>When it had booted I logged in and opened up the Grub config file again. it turned out I mis-typed the name of the Ubuntu initrd file, that was easily fixed. Rebooting got me safely back to Ubuntu.</p>
<p>So now I have a functioning dual boot between my original Ubuntu install and a very basic Arch install, I think I might need some software there!</p>
<p>But first&#8230; beer.</p>
<p><strong>So What&#8217;s Next???</strong></p>
<p>Well, firstly I need to get my network connection up and running as I didn&#8217;t do that during the install. It&#8217;s a Wifi connection over WPA so that&#8217;s going to be fun. Then I can start installing software. I&#8217;ll probably follow the <a href="http://wiki.archlinux.org/index.php/Beginners_Guide">Beginners Guide</a> on the Wiki (from Part 3). I was also recommended <a href="http://wiki.archlinux.org/index.php/Yaourt">Yaourt</a> by <a href="http://identi.ca/duffkitty">@duffkitty</a>, so I&#8217;ll give that a try.</p>
<p>I&#8217;ll be continuing to play with Arch over the next few days and reporting my progress in follow up posts here. I&#8217;ll also be denting as I go along and you can follow all of these on my <a href="http://identi.ca/tag/archrob">#archrob hash tag</a>.</p>
<p>There&#8217;ll probably be beer too.</p>
<p>We&#8217;ll see how it goes, but eventually I hope to have a system I can use full time.</p>
<p>Bye for now! Happy Easter!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/04/01/installing-and-configuring-arch-linux-part-1/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>UoA ECE Department ‘DonKey’ on Linux</title>
		<link>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux</link>
		<comments>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:02:24 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[auckland]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[DonKey]]></category>
		<category><![CDATA[ECE]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[microcontrollers]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UoA]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=153</guid>
		<description><![CDATA[Introduction: Since finishing my Part IV Project, I've been threatening to do some embedded/microcontroller stuff in my spare time at home. I've now finally go around to it and I thought I'd start by playing with a few components I had left over from a Uni project a while back. I've also ordered an ...]]></description>
			<content:encoded><![CDATA[<p><em><strong>Introduction:</strong> Since finishing my Part IV Project, I&#8217;ve been threatening to do some embedded/microcontroller stuff in my spare time at home. I&#8217;ve now finally go around to it and I thought I&#8217;d start by playing with a few components I had left over from a Uni project a while back. I&#8217;ve also ordered an Arduino board (see below), but it hasn&#8217;t arrived yet. When it does, I think I&#8217;m going to have a go programming it in C rather than the random Arduino language, as I have much more experience of programming embedded systems than your average Arduino user. I&#8217;ll report on my progress when I have some!</em></p>
<p>In the Electrical and Computer Engineering Deaprtment of the University of Auckland, where I work we have a little device, internally known as the &#8216;DonKey&#8217;. The purpose of this is to allow easy programming of Atmel AVR based microcontrollers via USB, rather than the simpler serial interface. We also have some internally developed software to program microcontrollers via the device, unfortunately this software is pretty much windows only (we did have a successful attempt to compile it for Linux, but this was quite a while ago, a better solution would be to use a native Linux application).</p>
<p>Internally the DonKey uses an FTDI based USB to UART chip (specifically the FT232R) to communicate with the microcontroller. This presents some problems as, despite being the basis of the programmer on incredibly popular Arduino boards, the main Linux programming tool (AVRdude) has no official FTDI support. I think this is largely due to the use of a bootloader on the Arduino boards, which negates the need of the programming tool to directly flash the board. If however you brick the AVR on the Arduino, you would be out of luck and would need a physical programmer (more on this below).</p>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 480px"><a href="http://blog.webworxshop.com/wp-content/uploads/2010/01/donkey.jpg"><img src="http://blog.webworxshop.com/wp-content/uploads/2010/01/donkey.jpg" alt="The DonKey" title="The DonKey" width="470" height="224" class="size-full wp-image-164" /></a><p class="wp-caption-text">The DonKey in all it's glory.</p></div>
<p>In this howto I&#8217;ll cover how to get the DonKey working on Linux with AVRdude. Luckily, while researching how I might go about this I found that a large part of the work had been done for me, due to the fact that the Arduino also uses these chips. I found instructions on <a href='http://doswa.com/blog/2009/12/20/avrdude-58-with-ftdi-bitbang-patch-on-linux/'>doswa.com</a> on how to patch and compile AVRdude for just this purpose (so you could flash a bootloader to a new AVR).</p>
<p>These instructions work quite well for the DonKey, up until you get to running the &#8216;./configure&#8217; command, I replaced this with:</p>
<p><code>$ ./configure --prefix=$HOME/.local</code></p>
<p>to setup the code to do a local install in my home directory (as I want this to be my primary version of AVRdude, but not to screw with things on the root filesystem).</p>
<p>Next I followed the instructions on modifiying the makefile and compiling AVRdude via the &#8216;make&#8217; command. After &#8216;make&#8217; I also typed:</p>
<p><code>$ make install</code></p>
<p>to install into the directory setup earlier. Now AVRdude is installed, the next thing to do is a bit of configuration, firstly you&#8217;ll want to make sure it&#8217;s on your $PATH so add the following to your ~/.bashrc file:</p>
<p><code>export PATH=$HOME/.local/bin:$PATH</code></p>
<p>and run the command:</p>
<p><code>$ source ~/.bashrc</code></p>
<p>to re-read the file.</p>
<p>The next issue is that you may wish to remove any copy of AVRdude that is otherwise installed (I found that sometimes my shell would run the wrong one &#8211; especially if you use &#8216;sudo&#8217; to run it):</p>
<p><code>sudo apt-get remove --purge avrdude</code></p>
<p>Now, I just mentioned above that you might use &#8216;sudo&#8217; to run AVRdude, well according to the doswa article you do need to use sudo when using the FTDI based programmers. I&#8217;m not sure why this is, but it&#8217;s not very useful if you want to be able to call AVRdude from a Makefile or the like.</p>
<p>I solved this by setting a &#8216;suid root&#8217; on my AVRdude binary. For those that don&#8217;t know what this is, the suid bit is a Unix permission setting that makes any program with it run under it&#8217;s owning user rather than the user who called it. If the owner happens to be root, the program runs as root even if the user who calls it isn&#8217;t. This is probably really insecure if you do it a lot, but you should be OK in this case.</p>
<p><b>WARNING: Despite what I say, it might not be OK. Allowing any program unrestricted root access has the potential to hose your system and scatter all your data to the winds. FOLLOW THESE INSTRUCTIONS AT YOUR OWN RISK!!</b></p>
<p>So here we go:</p>
<p><code>$ sudo chown root:root ~/.local/bin/avrdude<br />
$ sudo chmod u+s ~/.local/bin/avrdude</code></p>
<p>Now you should be able to successfully run AVRdude on FTDI based devices without resorting to using sudo every time.</p>
<p>But, what of the DonKey I hear you cry! Well all we have to do to support the DonKey is give AVRdude a little bit of configuration which tells it what the DonKey actually is. This can go in ~/.avrduderc, and looks a bit (well exactly) like this:</p>
<p><code>programmer<br />
  id    = "donkey";<br />
  desc  = "University of Auckland ECE DonKey";<br />
  type  = ft245r;<br />
  miso  = 1; # D1<br />
  sck   = 2; # D2<br />
  mosi  = 3; # D3<br />
  reset = 4; # D4<br />
;</code></p>
<p>OK, now you should be able to successfully use the DonKey with AVRdude, using a command similar to this:</p>
<p><code>avrdude -c donkey -p m8 -P ft0 -U myawesomeavrproject.hex</code></p>
<p><em>Note: this command is for the ATMega8 as denoted by the &#8216;-p m8&#8242;, check the AVRdude manual page for the correct -p option if you are using a different type of AVR.</em></p>
<p>OK, well that&#8217;s pretty much it, I&#8217;ll post back soon regarding my other progress with some microcontroller stuff. Bye for now!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Even easier netboot installation…</title>
		<link>http://webworxshop.com/2009/06/24/even-easier-netboot-installation</link>
		<comments>http://webworxshop.com/2009/06/24/even-easier-netboot-installation#comments</comments>
		<pubDate>Wed, 24 Jun 2009 02:12:16 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[netboot]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=94</guid>
		<description><![CDATA[A while ago I covered netbooting/installation on ubuntu, well I've now found an even easier way to do this! It's probably the easiest way to go about this as it really only involves editing one config file. Some of the info here comes from the official Ubuntu documentation on this, though my approach is ...]]></description>
			<content:encoded><![CDATA[<p>A while ago I covered <a href="/2009/02/09/pxe-netinstalling-for-simpletons">netbooting/installation on ubuntu</a>, well I&#8217;ve now found an even easier way to do this! It&#8217;s probably the easiest way to go about this as it really only involves editing one config file. Some of the info here comes from the <a href="https://help.ubuntu.com/community/Installation/Netboot">official Ubuntu documentation</a> on this, though my approach is actually easier, since you don&#8217;t need a separate tftp server.</p>
<p>The main piece of software you will need is dnsmasq, which you can install with the command:</p>
<p><code>sudo apt-get install dnsmasq</code></p>
<p>I already had this installed as I&#8217;m using it as a DNS cache for my network (which is also pretty useful). It turns out that dnsmasq is a bit of a &#8216;swiss army knife&#8217;, it can do DHCP, DNS and TFTP all together and very easily. You should edit the config file:</p>
<p><code>sudo nano /etc/dnsmasq.conf</code><span id="more-94"></span></p>
<p>And add/uncomment/edit the following lines:</p>
<p><code>dhcp-range=192.168.1.3,192.168.1.50,12h # sets the ip address range and update frequency for the network<br />
dhcp-boot=pxelinux.0 # set up network booting to boot the pxelinux bootloader<br />
enable-tftp # enable built in tftp server<br />
tftp-root=/var/tftpd # set tftp directory</code></p>
<p>Basically this sets up dnsmasq to be both the DHCP server for the network and push the PXE boot options out over the network. It also enables the built in TFTP server in dnsmasq and sets the directory to serve files from.</p>
<p>The next step is to get some files to serve, I got the PXE/netboot image from the Ubuntu <a href="http://cdimage.ubuntu.com/netboot/">cdimages</a> site, and untarred the files to the correct directory:</p>
<p><code>wget http://archive.ubuntu.com/ubuntu/dists/jaunty/main/installer-i386/current/images/netboot/netboot.tar.gz<br />
sudo mkdir -p /var/tftp<br />
tar -xvzf netboot.tar.gz -C /var/tftp/<br />
chown -R nobody:nogroup /var/tftp</code></p>
<p>The tar file of course is basically just the minimal install CD, set up for netbooting, so when you install you will need to download all the packages, for a simple cli install this doesn&#8217;t take very long, and you can use a package cache or something to help with future installs.</p>
<p>OK, now restart dnsmasq:</p>
<p><code>sudo /etc/init.d/dnsmasq restart</code></p>
<p>&#8230;and you should be good to go (make sure that your machine is the only DHCP server on the network). For tips on booting clients see my <a href="/2009/02/09/pxe-netinstalling-for-simpletons">original article</a> &#8211; btw, since I used the new version of Ubuntu I can now boot my Eee PC 901 over the network!</p>
<p>If you have any questions or problems with this I&#8217;d be happy to answer them, just post them below.</p>
<p>Bye for now!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/06/24/even-easier-netboot-installation/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A mobile electronic survey unit – A.K.A. A Cunning Use for Netbooks</title>
		<link>http://webworxshop.com/2009/04/17/a-mobile-electronic-survey-unit-aka-a-cunning-use-for-netbooks</link>
		<comments>http://webworxshop.com/2009/04/17/a-mobile-electronic-survey-unit-aka-a-cunning-use-for-netbooks#comments</comments>
		<pubDate>Thu, 16 Apr 2009 23:56:20 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[acer aspire one]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=70</guid>
		<description><![CDATA[Hi, it's been a while since I've posted anything here, mainly because I've been incredibly busy with Uni and work and haven't had time for hacking on anything interesting at home. However, I'm going to tell you about a really interesting and quite novel use for netbooks that I've been setting up at work, ...]]></description>
			<content:encoded><![CDATA[<p>Hi, it&#8217;s been a while since I&#8217;ve posted anything here, mainly because I&#8217;ve been incredibly busy with Uni and work and haven&#8217;t had time for hacking on anything interesting at home. However, I&#8217;m going to tell you about a really interesting and quite novel use for netbooks that I&#8217;ve been setting up at work, hopefully someone else will find it useful and use it in a similar way&#8230;</p>
<p>A while ago my boss came to me with an idea. He wanted to purchase a number of netbooks and install <a href="http://www.limsurvey.org">LimeSurvey</a> on each of them to be used as a mobile survey unit, that could be taken to schools, colleges, workplaces, etc. and used to collect data for research projects. I pointed out that if we were to install LimeSurvey on all the netbooks each would need an individual webserver and MySQL server, which apart from being a lot of effort would fragment the dataset and make it much more difficult to collect the data together.</p>
<p>Hence, I suggested that we setup one of the machines as the server and set it&#8217;s built-in Wifi to work as an access point for the others so they could access the server. This means that no external network access is required, you carry the server with you!<span id="more-70"></span></p>
<p>Well, today the netbooks arrived (we ended up with <a href="http://en.wikipedia.org/wiki/Acer_Aspire_One">Acer Aspire One</a>s in the end). So I set about configuring one to be our server. This model came with Windows XP pre-installed (not sure if you can get a Linux version), but also had a 160GB hard drive. My instinct was to install Ubuntu Server as it has an option to deploy a LAMP server out of the box (which is awesome and would have saved me loads of time). So I downloaded it from our local mirror and flashed the iso to my usbstick with <a href="http://en.wikipedia.org/wiki/Unetbootin">Unetbootin</a>, which I hadn&#8217;t used before. I booted from the usbstick and everything went well until I got to the &#8216;detect CDROM drives&#8217; bit &#8211; which usually detects the usbstick as containing the files from the iso. Not so here, no matter what I tried it wouldn&#8217;t be convinced that the usbstick was a CDROM!</p>
<p>So, I fell back to what I have previously used, <a href="http://download.ubuntu-fr-secours.org/isotostick.sh">Isotostick</a>, a nice little shell script thats always done this well for me. Same problem.</p>
<p>Turns out the problem is with the server and alternate isos of Ubuntu, which don&#8217;t contain the correct FAT driver for loading the installation packages from a usbstick. There is a workaround for this, <a href="https://help.ubuntu.com/community/UbuntuServerFlashDriveInstaller">here</a>, but I couldn&#8217;t get it to work. So, I decided to use the Ubuntu Desktop version (thank God our mirror is internal to the university!). I realised later that this had the advantage that the server could also be used as a client and the server software would be invisible to the user.</p>
<p>So I installed that. Which went fine as you&#8217;d expect. When I rebooted after the install I found that the wifi didn&#8217;t work. A quick google turned up a <a href="https://help.ubuntu.com/community/AspireOne#Install%20Ubuntu%20Intrepid%20Ibex%208.10%20on%20the%20Acer%20Aspire%20One">page</a> which gave instructions on how to install the latest madwifi driver from source, which I did, though I had to manually dig up build-essential (and dependancies) from the /pool folder on my usbstick and install them with dpkg as I couldn&#8217;t get it to recognise the usbstick as an apt repository. I wouldn&#8217;t have had this problem if I&#8217;d have had a wired connection on the machine though.</p>
<p>Then I set about installing the packages required to turn it into a server:</p>
<p><code>$ sudo apt-get install apache2 phpmyadmin mysql-server dhcp3-server bridge-utils</code></p>
<p>I&#8217;m not sure whether the bridge-utils package is strictly required, but I installed it anyway. It doesn&#8217;t do any harm as it&#8217;s only a few kB to download. If you are following this as a howto and are only using the Wifi as your net connection (as I was), make sure you install all of this now as later on you&#8217;ll lose your connection when we setup the Wifi to be an access point. If you&#8217;re on ethernet, you&#8217;ll be able to keep your connection (but see later).</p>
<p>Installing those packages took a while over the Wifi, so while it was going on I downloaded and installed LimeSurvey. I don&#8217;t really need to say how to do that as it&#8217;s all documented on <a href="http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;structure=">their site</a>. I unpacked it to /var/www/survey on the server and configured it as per the instructions. Once I had all the packages above installed I was able to create a database and user through phpmyadmin and run the LimeSurvey installation script. Pretty much the same as installing any other PHP app.</p>
<p>Next came the wifi setup, I played around for a while trying to get this working, but I think the following is probably the best course to take in setting this up. You need to start by putting the wireless adapter into access point/master mode, you do this (for the atheros card used in the Aspire One) by editing/creating the /etc/modprobe.d/madwifi file (documented <a href="https://help.ubuntu.com/community/WifiDocs/MasterMode#Atheros%20(Madwifi)">here</a>):</p>
<p><code>$ sudo nano /etc/modprobe.d/madwifi</code></p>
<p>The file contents should be:</p>
<p><code>options ath_pci autocreate=ap</code></p>
<p>Then reload the kernel module:</p>
<p><code>$ sudo modprobe ath_pci</code></p>
<p>You&#8217;re then ready to reconfigure the network interfaces, if you type iwconfig, you should see that the ath0 device now has the capability to act as an access point. To setup the access point you need to edit the network interfaces file:</p>
<p><code>$ sudo nano /etc/network/interfaces</code></p>
<p>The contents of my file were as follows:</p>
<p><code>auto lo</code></p>
<p>iface lo inet loopback</p>
<p># uncomment the following two lines if you&#8217;re on ethernet and you want to still have a connection once you restart the networking!</p>
<p>#auto eth0</p>
<p>#iface eth0 inet dhcp</p>
<p>auto ath0</p>
<p>iface ath0 inet static</p>
<p>wireless-mode master</p>
<p>wireless-essid my-access-point</p>
<p>address 192.168.1.1</p>
<p>network 192.168.1.0</p>
<p>netmask 255.255.255.0</p>
<p>broadcast 192.168.1.255</p>
<p>This sets up the network interface acting as an access point with name &#8216;my-access-point&#8217; and assigns the local machine a static address of 192.168.1.1 on the network. To reload the configuration, do this:</p>
<p><code>$ sudo /etc/init.d/networking restart</code></p>
<p>Note: at this point you will lose &#8216;outgoing&#8217; wifi connectivity as your adapter is now acting as an access point!</p>
<p>Now, if you boot up another machine with Wifi, you should be able to see the &#8216;my-access-point&#8217; network in the list of available networks. However, connecting to it won&#8217;t currently work as you won&#8217;t be able to get an IP address, this is where the DHCP server, which we installed earlier, comes in.</p>
<p>In order to set this up we first need to tell it to listen for DHCP requests on the correct interface, in our case ath0. We do this by editing the /etc/default/dhcp3-server file to look like this:</p>
<p><code># Defaults for dhcp initscript</code></p>
<p># sourced by /etc/init.d/dhcp</p>
<p># installed at /etc/default/dhcp3-server by the maintainer scripts</p>
<p>#</p>
<p># This is a POSIX shell fragment</p>
<p>#</p>
<p># On what interfaces should the DHCP server (dhcpd) serve DHCP requests?</p>
<p>#	Separate multiple interfaces with spaces, e.g. &#8220;eth0 eth1&#8243;.</p>
<p>INTERFACES=&#8221;ath0&#8243;</p>
<p>Next we setup the DHCP server to dish out addresses to the clients on out network, edit the file /etc/dhcp3/dhcpd.conf to have an entry like the following:</p>
<p><code>subnet 192.168.1.0 netmask 255.255.255.0 {</code></p>
<p>range 192.168.1.100 192.168.1.200;</p>
<p>option domain-name-servers 192.168.1.1;</p>
<p>option domain-name &#8220;mynetwork.local&#8221;;</p>
<p>option routers 192.168.1.1;</p>
<p>option broadcast-address 192.168.1.255;</p>
<p>default-lease-time 600;</p>
<p>max-lease-time 7200;</p>
<p>}</p>
<p>I don&#8217;t know whether all those options are definitely needed, but this configuration works. I think you could probably get away without the routers and name servers, as these won&#8217;t exist on this small standalone network.</p>
<p>OK, now start up the DHCP server and you should be in business:</p>
<p><code>$ sudo /etc/init.d/dhcp3 start</code></p>
<p>Assuming that works OK, try connecting to the &#8216;my-access-point&#8217; network from another machine, it should work (if it doesn&#8217;t or you can&#8217;t see the network, try rebooting the server machine).</p>
<p>Once you&#8217;ve successfully connected you should be able to browse pages hosted on the server at http://192.168.1.1, so my LimeSurvey install would be at http://192.168.1.1/survey. Now you have a portable server that you can take round to serve web apps to machines in the vicinity! Awesome!</p>
<p>That just covers the server part of what I have planned for these small netbooks, my ultimate aim is to set them all up running Ubuntu with a lightweight desktop and Firefox started automatically in Kiosk mode (thanks to the <a href="https://addons.mozilla.org/en-US/firefox/addon/1659">R-Kiosk</a> addon). This will give us ten little survey machines which will just &#8216;boot&#8217; into Firefox and go to the LimeSurvey page. I&#8217;ll post details of that setup once I&#8217;ve done it, but for now that&#8217;s all! Bye!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/04/17/a-mobile-electronic-survey-unit-aka-a-cunning-use-for-netbooks/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PXE netinstalling for simpletons</title>
		<link>http://webworxshop.com/2009/02/09/pxe-netinstalling-for-simpletons</link>
		<comments>http://webworxshop.com/2009/02/09/pxe-netinstalling-for-simpletons#comments</comments>
		<pubDate>Mon, 09 Feb 2009 01:59:05 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[netboot]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[tftp]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=13</guid>
		<description><![CDATA[Since posting this article I have found a much easier way to do this. This article is still great background information and goes into more detail if you want to take this further, but you should consider reading my new article.

Well, I promised something technical and here it is. It's turned into a bit ...]]></description>
			<content:encoded><![CDATA[<p><em>Since posting this article I have found a <a href="/2009/06/24/even-easier-netboot-installation">much easier way to do this</a>. This article is still great background information and goes into more detail if you want to take this further, but you should consider reading my <a href="/2009/06/24/even-easier-netboot-installation">new article</a>.</em></p>
<p>Well, I promised something technical and here it is. It&#8217;s turned into a bit of a mammoth post, but the end result is pretty cool!</p>
<p>The idea of being able to install your favourite Linux distro over the network and so do away with burning CD&#8217;s (which ultimately get used once and then thrown away) is tantalizing. Not to mention the serious geek points for anyone who has a boot server on their network.</p>
<p>I started out using <a href="http://ubuntu-tutorials.com/2007/10/11/how-to-configure-pxe-network-booting-on-ubuntu-for-network-based-installations/">this</a> article as a reference, as the process seemed relatively simple. However, I soon found out that this article wasn&#8217;t strictly accurate and didn&#8217;t explain some things too brilliantly! So I decided to see if I could do better.</p>
<p>The following is my account of setting up my own boot server on a spare box I had lying around (though you can just as easily do it on your main computer). I started from a base install of Ubuntu Server 8.10 (Intrepid Ibex) which I installed in the normal way (i.e. from a CD).<span id="more-13"></span></p>
<p><strong>Prerequisites</strong></p>
<p>Once my server was up and running and I could ssh into it, the fun really started. The article I linked to above tells you what you need, namely:</p>
<ol>
<li>A dhcp server (sudo apt-get install dhcp3-server)</li>
<li>An Ubuntu CD image (the alternate CD not the live CD one, though presumably the server version works too).</li>
<li>A TFTP server (more on this below)</li>
<li>A web server, such as apache (sudo apt-get install apache2)</li>
</ol>
<p>Out of those, only the TFTP server caused me problems, I dutifully installed the suggested package (tftpd), only to find much later that it didn&#8217;t support one of the options needed by the bootloader.  To avoid this use the tftpd-hpa package instead (sudo apt-get install tftpd-hpa).</p>
<p><strong>What happens&#8230;</strong></p>
<p>At this stage, it might help if I run through the actual netbooting process as this will give you a general understanding of what we need to configure:</p>
<ol>
<li>When you choose the netboot option on the machine you want to boot (usually in the boot order settings in the bios), the bios will run a small program stored in on the motherboard (PXE-ROM). This program is essentially a DHCP client, which sends out broadcasts on the network looking for someone to provide it with an IP address and information on what to do next.</li>
<li>The DHCP server on your network respond to the broadcast and dishes out an IP address to the client. It also passes it the IP address of a boot server and the name of the bootloader file to request.</li>
<li>The client contacts the boot server (which can actually be the same machine as the DHCP server) and requests the bootloader file and executes it.</li>
<li>The bootloader loads it&#8217;s configuration from the server and displays a menu of the boot options.</li>
<li>When the user selects an option, the bootloader requests the kernel and initrd images from the server and boots the kernel.</li>
</ol>
<p>Our kernel will run the Ubuntu installer so that we can install an Ubuntu system on the client machine, but to get the packages we will use apache to serve them out for us across the network.</p>
<p><strong>Let&#8217;s get down to it</strong></p>
<p>OK, let&#8217;s configure some stuff, first up is the DHCP server. Here&#8217;s my configuration:</p>
<p><code>default-lease-time 600;<br />
max-lease-time 7200;<br />
option subnet-mask 255.255.255.0;<br />
option broadcast-address 192.168.1.255;<br />
option routers 192.168.1.3;<br />
option domain-name-servers &lt;ns1&gt;, &lt;ns2&gt;;<br />
option domain-name "mydomain.com";<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
range 192.168.1.2 192.168.1.51;<br />
}<br />
next-server 192.168.1.5;<br />
filename "pxelinux.0";</code></p>
<p>This goes in /etc/dhcp3/dhcpd.conf (sudo nano /etc/dhcp3/dhcpd.conf). I&#8217;m actually only going to expalin the last two lines (the rest is pretty standard DHCP stuff which you can find out about <a href="https://help.ubuntu.com/7.04/server/C/dhcp.html">somewhere else</a>. The last two lines are expalined below:</p>
<ol>
<li>next-server 192.168.1.5; &#8211; gives the client the address of your boot server, in most cases this will be the same as your DHCP server address (I&#8217;m running all this on my one server box). Change the address to the address of the machine you want to use.</li>
<li>filename &#8220;pxelinux.0&#8243;; &#8211; the bootloader file to use, just leave this as it is.</li>
</ol>
<p>Once you&#8217;ve done that, restart the DHCP server with &#8216;sudo /etc/init.d/dhcp3-server restart&#8217;. Also if you&#8217;re running a commercial (wireless) router, you&#8217;ll need to disable the DHCP server on the router from it&#8217;s control panel.</p>
<p><strong>TFTP or not TFTP</strong></p>
<p>The TFTP server needs very little configuration. All I did was create directory in the root of my filesystem to serve from:</p>
<p><code>sudo mkdir /tftpboot</code></p>
<p>Then you just need to make sure that tftpd serves from that directory (I spent ages wondering why mine wasn&#8217;t working because of this!), by changing the ftpd line in /etc/inetd.conf to:</p>
<p><code>tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpboot</code></p>
<p>(I basically changed the path at the end). Then restart the inetd service (sudo /etc/init.d/openbsd-inetd restart).</p>
<p><strong>Serving the iso files from Apache<br />
</strong></p>
<p>Now we&#8217;re going to copy everything out of the iso image to somewhere that Apache can find it:</p>
<p><code>sudo mkdir -p /var/www/netinstall/ubuntu8.10-alternate<br />
sudo mount -o loop ubuntu-8.10-alternate.iso /mnt<br />
sudo cp -a /mnt/* /var/www/netinstall/ubuntu8.10-alternate/<br />
sudo umount /mnt</code></p>
<p>First, we made the required directories to serve our files from. Structuring the directories like this allows us to serve other versions out from the same server if we want to. Secondly, we mounted the iso file on the /mnt directory, then we copied all the files from that to our server directory and finally unmounted the iso image.</p>
<p>If you now go to http://&lt;serveraddress&gt;/netinstall/ubuntu8.10-alternate, you should see a listing of the files that were on the CD. That was easy, let&#8217;s move on.</p>
<p><strong>The elusive pxelinux.0</strong></p>
<p>You should recognise &#8216;pxelinux.o&#8217; from the filename perameter in the DHCP config above, this is the bootloader that loads our kernel. Unfortunately, I couldn&#8217;t find it (and the other article gave me no clue!).  I eventually found it in the files I copied from the iso (I&#8217;ve since learned that you can also get it from the &#8216;syslinux&#8217; package). To copy it to the correct place use:</p>
<p><code>sudo cp /var/www/netinstall/ubuntu8.10-alternate/install/netboot/pxelinux.0 /tftpboot/</code></p>
<p>Next we need a kernel and initrd image we&#8217;ll also get these from the files we just copied:</p>
<p><code>sudo mkdir /tftpboot/ubuntu8.10-alternate<br />
sudo cp /var/www/net</code><code>install</code><code>/ubuntu8.10-alternate/install/netboot/ubuntu-installer/i386/linux /tftpboot/ubuntu8.10-alternate/<br />
sudo cp /var/www/net</code><code>install</code><code>/ubuntu8.10-alternate/install/netboot/ubuntu-installer/i386/initrd.gz /tftpboot/ubuntu8.10-alternate/</code></p>
<p>Now we need to configure pxelinux to find our kernel, the configuration goes in /tftpboot/pxelinux.cfg/default:</p>
<p><code>default 1<br />
timeout 200<br />
prompt 1<br />
display pxelinux.cfg/msgs/boot.msg<br />
# begin list of available boot options<br />
# Local hard disk boot<br />
label 1<br />
localboot 0<br />
# Ubuntu 8.10 Alternate install CD<br />
label 2<br />
kernel ubuntu8.10-alternate/linux<br />
append initrd=ubuntu8.10-alternate/initrd.gz</code></p>
<p>The first two lines select the default boot entry (see below) to use and give us a timeout of 20 seconds after which that option will be selected (the timout value is measure in tenths of a second). The next two display a menu of the available kernels (which goes in /tftpboot/pxelinux.cfg/msgs/boot.msg).</p>
<p>Next we have our boot entries. Each of  these have a label line which enables us to identify the listing later. The first listing just has a directive telling pxelinux to boot from the local hard disk. As this option is selected as the default (above) the computer will attempt to boot from it&#8217;s hard disk once the timout has occured.</p>
<p>The second listing is more interesting, we have the kernel directive with the path relative to the /tftpboot/ directory, this tells  pxelinux what kernel should be booted if this option is selected (duh!). We have the append line, which adds options to the kernel, in this case we tell it to use our initrd  image, but you can add any valid kernel option. Obviously this file can have as many listing as you want to give boot options, there&#8217;s also support for multiple different menu&#8217;s and help screen, but I&#8217;m keeping it at this for now.</p>
<p>OK, now all we need is our display message. I put mine in the msgs directory (mkdir /tftpboot/pxelinux.o/msgs) and put this in the  file  (boot.msg):</p>
<p><code>^Y^L                  ^O0fNETWORK BOOT OPTIONS^O07<br />
Select one of the options below, or press enter for the default:<br />
1 - Local Hard disk boot [Default]<br />
2 - Install Ubuntu 8.10 'Intrepid Ibex'<br />
NB: Default will be selected after 20 seconds</code></p>
<p>That&#8217;s it! Just make sure the bit before the hyphen matches the label field we used above, so that the user knows what to type at the prompt. The funny characters in the file correspond to specially interpreted charaters for clearing the screen, etc. I just copied them from another file!</p>
<p><strong>Booting Clients</strong></p>
<p>The first client I tried to boot was my ASUS EeePC 901. I succesfully configured the bios to boot from the network and got to the menu screen. Booting the Ubuntu kernel worked and I was able to get into the installer, however a few steps in it told me that my ethernet adaptor was unsupported so it was unable to get packages for installation. Apparently, the next version of Ubuntu (Jaunty) is going to have the driver included by default in it&#8217;s kernel, so maybe that&#8217;ll work (I&#8217;ll try it at some point and report back).</p>
<p>Next I decided it would be cool to try and boot a virtual machine from my network. Having done some research I found that if I used VirtualBox with host networking I should be able to get an IP address from my network (rather than VirtualBox&#8217;s build in DHCP) and so boot from the network. I currently had the Open Source edition of VirtualBox installed, which is an older version (2.04) which doesn&#8217;t support host based networking without a lot of fiddling around.</p>
<p>I decided to take the easy way out and upgraded to version 2.1 via the <a href="http://www.virtualbox.org/wiki/Linux_Downloads">VirtualBox repository</a>. Once this was installed I was able to select &#8216;Host Network Interface&#8217; in the virtual machine network settings and then select eth0 as my interface. In the advanced settings I set network as the first boot device and then booted the machine:</p>
<div id="attachment_27" class="wp-caption aligncenter" style="width: 742px"><a href="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot2.png"><img class="size-full wp-image-27" title="Network boot screen" src="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot2.png" alt="Network boot screen, as seen in VirtualBox" width="732" height="477" /><br />
</a><p class="wp-caption-text">Network boot screen, as seen in VirtualBox</p></div>
<p>As  you can see from the screenshot, this worked just fine, as did proceeding to the installer. When I reached the step in the install which asked me to select a mirror I scrolled up and selected &#8221;. On the next few screens I had to enter information about the server I was using, namely the IP address (192.168.1.5) and the path to the repository (/netinstall/ubuntu8.10-alternate/). See the screenshots below for details:</p>
<div id="attachment_28" class="wp-caption aligncenter" style="width: 656px"><a href="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-1.png"><img class="size-full wp-image-28" title="Repository selection" src="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-1.png" alt="Select 'enter information manually' on the repository selection screen." width="646" height="555" /></a><p class="wp-caption-text">Select &#39;enter information manually&#39; on the repository selection screen.</p></div>
<div id="attachment_29" class="wp-caption aligncenter" style="width: 658px"><a href="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-2.png"><img class="size-full wp-image-29" title="Enter server IP" src="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-2.png" alt="Enter the IP address of the webserver where you copied the files from the ISO" width="648" height="559" /></a><p class="wp-caption-text">Enter the IP address of the webserver where you copied the files from the ISO</p></div>
<div id="attachment_30" class="wp-caption aligncenter" style="width: 659px"><a href="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-3.png"><img class="size-full wp-image-30" title="Enter correct directory" src="http://blog.webworxshop.com/wp-content/uploads/2009/02/screenshot-3.png" alt="Enther the path of the directory which you copied the files to, relative to the web server root." width="649" height="558" /></a><p class="wp-caption-text">Enther the path of the directory which you copied the files to, relative to the web server root.</p></div>
<p>The rest of the install proceeded just fine, with the packages being retrieved and installed from the network. I ended up with a functional desktop system (in a virtual machine) just as I would get if I had used a CD.</p>
<p><strong>Next Steps&#8230;</strong></p>
<p>Wow, that turned out to be pretty long. Hopefully you&#8217;ve made it this far and I&#8217;ve managed to help you get to grips with this. I still have a few things I want to try to setup with this and I&#8217;ll report back if I make any progress:</p>
<ul>
<li>It would be really great to have <a href="http://clonezilla.org/">Clonezilla</a> and/or some kind of rescue toolkit distribution available for booting over the network, that way I can just plug in a machine and boot up whatever I need.</li>
<li>I eventually want to have a go at making a completely diskless system, which doesn&#8217;t look that difficult as I seem to have done most of the work. Ideally it would be nice to be able to install/design a system in a virtual machine on my desktop and then deploy it across the network when it&#8217;s ready!</li>
</ul>
<p>I hope you&#8217;ve enjoyed this How-To and have found it informative, if you have any problems, corrections or just want to say thanks, feel free to post a comment. Bye for now!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/02/09/pxe-netinstalling-for-simpletons/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

