<?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>Everything is Broken &#187; Linux</title>
	<atom:link href="http://play.datalude.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://play.datalude.com/blog</link>
	<description>Efficiency vs. Inefficiency, in a no-holds barred fight.</description>
	<lastBuildDate>Tue, 04 May 2010 03:05:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>One Line Guitar Tuner</title>
		<link>http://play.datalude.com/blog/2010/03/one-line-guitar-tuner/</link>
		<comments>http://play.datalude.com/blog/2010/03/one-line-guitar-tuner/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 01:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[guitar tuner]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=193</guid>
		<description><![CDATA[Every now and then I come across something which makes me marvel at the flexibility of Linux. This is one of these things. I play guitar, and I&#8217;d previously written a small script to act as a guitar tuner. I generated some .ogg files of the correct pitch and then wrote a script to loop [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then I come across something which makes me marvel at the flexibility of Linux. This is one of these things.</p>
<p>I play guitar, and I&#8217;d previously written a small script to act as a guitar tuner. I generated some .ogg files of the correct pitch and then wrote a script to loop through them in sequence. &#8220;Pretty good&#8221;, I thought, &#8220;Clever Me.&#8221;</p>
<p>Then a few days ago I came across this little gem of a script.</p>
<pre>for n in E2 A2 D3 G3 B3 E4;do play -n synth 4 pluck $n repeat 2;done
</pre>
<p>That&#8217;s it. Sheer brilliance. Of course you&#8217;ll need to install the sox package first.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2010/03/one-line-guitar-tuner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Counting files in subdirectories.</title>
		<link>http://play.datalude.com/blog/2009/02/counting-files-in-subdirectories/</link>
		<comments>http://play.datalude.com/blog/2009/02/counting-files-in-subdirectories/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 10:00:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[du]]></category>
		<category><![CDATA[file]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=124</guid>
		<description><![CDATA[OK, it sounds simple, and it probably is if you&#8217;re sitting at your desktop with Gnome or KDE fired up. However if you&#8217;re looking on a server half way across the world, using the command line its not so easy. There are a number of tools which are useful in finding out things about your [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-128" href="http://play.datalude.com/blog/?attachment_id=128"><img class="alignright size-full wp-image-128" style="margin: 10px;" title="ze count" src="http://play.datalude.com/blog/wp-content/uploads/2009/02/count.jpeg" alt="ze count" width="113" height="113" /></a>OK, it sounds simple, and it probably is if you&#8217;re sitting at your desktop with Gnome or KDE fired up. However if you&#8217;re looking on a server half way across the world, using the command line its not so easy.</p>
<p>There are a number of tools which are useful in finding out things about your filesystem. ls, du, df are three of them, but sometimes they just don&#8217;t give you the information you need. In my case I&#8217;m backing up a server to a remote location. The script was timing out becase I was trying to back up too many files at once, so I needed to find the number of files in each subdirectory.</p>
<p><span id="more-124"></span>Sounds easy at first, and there are numerous attempts at finding that information around the internet. But none of them did exactly what I wanted.</p>
<p>There were PERL scripts and python scripts, and the minimal</p>
<pre>ls -alR | wc -l</pre>
<p>which gives the total files under a directory, but not quite. Anyway, after experimenting for a long time, I finally put together the following command in all its glory.</p>
<pre>find . -type f | awk -F/ '{ print $2 }' | sort | uniq -c</pre>
<p>Lets just go through this, so you can tailor it to  your own needs. Each part of the command passes its output to the next part of the command through the pipe sign ( | ), so we can consider each part separately.</p>
<p><strong>find . -type f</strong> . This provides a listing of all the files (ie not directories and symlinks etc) underneath the current directory. You can modify the options to the find command to find other items as well, but I wanted files. This pumps out a list like this.</p>
<p>./dir1/file1</p>
<p>./dir1/file2</p>
<p>./dir2/file1</p>
<p>./dir2/subdir1/file1</p>
<p>./dir2/subdir1/file2</p>
<p><strong>awk -F/ &#8216;{ print $2 }&#8217;</strong> This takes the previous list and splits it into fields using the / sign (-F./). It will then output a list of these. Continuing the example above:</p>
<p>dir1</p>
<p>dir1</p>
<p>dir2</p>
<p>dir2</p>
<p>dir2</p>
<p><strong>sort</strong> Sorts the list, as you might expect. There are two reasons for this. First is that find doesn&#8217;t always find files in alphabetical order. Second is that the next command needs like terms to be grouped together to count them properly. Anyway, this leaves the list above unchanged in this case.</p>
<p><strong>uniq -c</strong> Takes the list above and returns only unique values, with a count in the left margin ie.</p>
<p>2   dir1</p>
<p>3 dir2</p>
<p>&#8230; which is exactly what I wanted.</p>
<p>I also used the</p>
<pre>du -h --max-depth=1</pre>
<p>to find out the sizes of these directories.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/02/counting-files-in-subdirectories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Memory Usage Summary Script</title>
		<link>http://play.datalude.com/blog/2008/11/linux-memory-usage-summary-script/</link>
		<comments>http://play.datalude.com/blog/2008/11/linux-memory-usage-summary-script/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:21:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[report troubleshooting]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=110</guid>
		<description><![CDATA[I was having trouble with a webserver this week, which I&#8217;d just set up for a client. When it went live, it seemed OK initially, but when we left it overnight it curled up its toes and died. It was so dead that I couldn&#8217;t even ssh in to reboot it, so we had to [...]]]></description>
			<content:encoded><![CDATA[<p>I was having trouble with a webserver this week, which I&#8217;d just set up for a client. When it went live, it seemed OK initially, but when we left it overnight it curled up its toes and died. It was so dead that I couldn&#8217;t even ssh in to reboot it, so we had to do a remote reboot. Crunch.</p>
<p>Anyway, on getting it back up, I poked around in the logs and found that it was running out of memory, which it really shouldn&#8217;t do given that it was a fairly low load on the webserver, and only apache, mysql and php were running on it. I looked around the Interwebs and found an excellent resource called <a href="http://rimuhosting.com/howto/memory.jsp" target="_blank">Troubleshooting Memory Usage</a>, which gave me some pointers about how to rein in apache and stop it from eating up memory so quickly. Thanks!</p>
<p>Anyway on the page was a script for summarising memory usage, which I thought was a good idea, so i grabbed that one and adapted it to my own purposes. I thought I&#8217;d make the results available here, so feel free to grab it and adapt it to your own needs.<span id="more-110"></span></p>
<pre>#!/bin/bash
# Mem-info.sh. Version 1.5 2008-12-20
# Adapted from various sources around the Internet.
# Requires mutt to be installed to use the email function. 

#################### Functions ####################
function print_help {
	echo "  Usage:"
	echo "    $0 [-a full|summary] -f /tmp/memoryreport.txt"
	echo "    Parameters:"
	echo "    -a              Specify full or summary report"
	echo "    -f              Specify alternate filename "
	echo "    -e &lt;adddr&gt;      Send report to specified email address"
	echo "    -h | --help     This usage information"
	echo "    Running the script with no parameters writes a summary report to ./output.txt"
}

function summary_report {
	echo "=========================== SUMMARY ============================" &gt; $mem_outputfile
	date &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo "=========================== uptime ==============================" &gt;&gt; $mem_outputfile
	uptime &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo "========================== free -m ==============================" &gt;&gt; $mem_outputfile
	free -m &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo "========================= vmstat 1.5 ============================" &gt;&gt; $mem_outputfile
	vmstat 1 5 &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo "================== ps top 20 Processes by CPU ===================" &gt;&gt; $mem_outputfile
	ps -eo user,%mem,%cpu,pid,cmd --sort -%cpu | head -n 20 &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile

}

function full_report {
	summary_report
	echo "========================= FULL DETAIL ===========================" &gt;&gt; $mem_outputfile
	echo "======================== top raw output =========================" &gt;&gt; $mem_outputfile
	top -b -n 1 &gt;&gt; $mem_outputfile
	echo " " &gt;&gt; $mem_outputfile
	echo "======================= ps auxf raw output ======================" &gt;&gt; $mem_outputfile
	ps auxf --width=200 &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo "=========================== end ================================ " &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
	echo  &gt;&gt; $mem_outputfile
}

#################### Process Command line ####################

while [ "$1" != "" ]; do
    case $1 in
        -f )           	shift
                                mem_outputfile=$1
                                ;;
        -a )    	shift
				mem_action=$1
                                ;;
        -e )            shift
				email_to=$1
				;;
        -h | --help )           print_help
                                exit
                                ;;
        * )                     print_help
                                exit
				;;
    esac
    shift
done

######################### Set Defaults #########################
if [ -z "${mem_action}" ]; then
    echo "    No action Specified. Defaulting to summary report"
    mem_action="summary"
fi
if [ -z "${mem_outputfile}" ]; then
    echo "    No output file specified. Writing to `pwd`/output.txt"
    mem_outputfile="output.txt"
fi

######################### Do Stuff #########################

if [ "$mem_action" = "full" ]; then
		full_report
	else
		summary_report
fi

if [ "$email_to" = "" ]; then
		echo "    No email address specified. Not emailing report."
	else
		mutt -s "Memory Usage Report" $email_to &lt; $mem_outputfile
fi</pre>
<p>Or you can download the file <a href="http://play.datalude.com/blog/wp-content/uploads/2008/11/mem-info1.sh">mem-info1 </a> if the formatting above is all messed up. Make sure you go to the page I linked to above for excellent advice on interpreting the report.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/11/linux-memory-usage-summary-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimeTime Linux</title>
		<link>http://play.datalude.com/blog/2008/08/primetime-linux/</link>
		<comments>http://play.datalude.com/blog/2008/08/primetime-linux/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 07:00:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[kernel update]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=37</guid>
		<description><![CDATA[I&#8217;ve been thinking of setting up a company to set people up with Open Source workplaces, and every year that goes past makes me think that the time is almost here. There are a number of factors which are conspiring to make Linux a viable alternative: The fact that Linux, via distributions such as Ubuntu, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking of setting up a company to set people up with Open Source workplaces, and every year that goes past makes me think that the time is almost here.</p>
<p>There are a number of factors which are conspiring to make Linux a viable alternative:</p>
<ul>
<li>The fact that Linux, via distributions such as Ubuntu, Mandriva, Suse et al, are now easy enough to install and intuitive enough for the Everyday User. I set my girlfriend up with an account on a spare laptop and just let her play. Soon enough she was asking for it on her laptop as well.</li>
<li>OpenOffice. Enough said. Hardly anyone uses the full feature set of Word, so why do we slavishly upgrade every time a new version comes out? Well actually we don&#8217;t &#8230;<span id="more-37"></span></li>
<li>The nightmare of Vista. Hardware incompatibilities galore, a confusing new interface with more eyecandy than improved usability, increased hardware requirements. The security enhancements which, ahem, aren&#8217;t really all that more secure, are they?</li>
<li>Open source = no license fees. Can&#8217;t argue with that.</li>
<li>Reduced downtime due to viruses.</li>
</ul>
<p>All of these are great reasons, as well as the more emotive reasons for doing it. (Hate Microsoft!; Can&#8217;t afford a Mac!  Irritated with bloatware!). However while Linux is great for me, I still spend more time fixing it than most people are prepared to spend.</p>
<p>Take last week for example. A standard Update to my OS suddenly starts installing a different kernel &#8211; it decided all of a sudden that I&#8217;d like a laptop kernel. This would have been alright in itself, but then suddenly</p>
<ul>
<li>my display driver doesn&#8217;t work. I install it again.</li>
<li>My microphone stops working in Skype. I try for a few hours to get it going again, but can&#8217;t. I use my spare laptop to do Skype calls.</li>
<li>My VMware server doesn&#8217;t work. I try to re-compile it, but in the end can&#8217;t get it to work,</li>
</ul>
<p>So I roll back, eventually to the desktop kernel. I reinstall the display driver. I manage to get VMware back up. The Skype Mic problem is still with me.</p>
<p>I&#8217;ve still no idea why I was given a different kernel. I&#8217;m experienced enough after 4 years with Linux to get it back working again, but that really shouldn&#8217;t have happened in the first place. And its things like that which I think is hampering the progress of Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/08/primetime-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trust Scanner Success</title>
		<link>http://play.datalude.com/blog/2008/06/trust-scanner-success/</link>
		<comments>http://play.datalude.com/blog/2008/06/trust-scanner-success/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 03:45:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[pclinuxos]]></category>
		<category><![CDATA[sane]]></category>
		<category><![CDATA[scanner]]></category>
		<category><![CDATA[trust]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[xsane]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=27</guid>
		<description><![CDATA[My girlfriend turned up this morning with her scanner, a Trust Flat Scan USB 19200. Its an old model from around 5-6 years ago, and she&#8217;d lost the driver disk. This was clearly a challenge for Linux &#8230; I plugged the thing in (its a USB scanner, which pulls all its power from the USB [...]]]></description>
			<content:encoded><![CDATA[<p>My girlfriend turned up this morning with her scanner, a <em>Trust Flat Scan USB 19200</em>. Its an old model from around 5-6 years ago, and she&#8217;d lost the driver disk. This was clearly a challenge for Linux &#8230;</p>
<p>I plugged the thing in (its a USB scanner, which pulls all its power from the USB bus) and the light went on. However the scanner application which comes with both PCLinuxOS and Ubuntu wouldn&#8217;t start up. Time for some investigation. I got a root terminal shell and tried poking around</p>
<p><strong>lsusb</strong> showed that the scanner was recognised.<span id="more-27"></span></p>
<p style="padding-left: 30px;">Bus 002 Device 005: ID 05d8:4002 Ultima Electronics Corp. Artec Ultima 2000 (GT6801 based)/Lifetec LT9385/ScanMagic 1200 UB Plus Scanner</p>
<p>And the Sane website told me it was supported.</p>
<p>The first piece of research suggested that I needed to edit a configuration file, /etc/sane.d/gt68xx.conf</p>
<p>I opened this up, and found the following four lines, all commented, so I uncommented the last three.</p>
<p style="padding-left: 30px;"># Trust Flat Scan USB 19200:<br />
override &#8220;artec-ultima-2000&#8243;<br />
vendor &#8220;Trust&#8221;<br />
model &#8220;Flat Scan USB 19200&#8243;</p>
<p>The xsane application still didn&#8217;t want to work though.</p>
<p>Now I tried the command line application scanimage. <strong>scanimage -L</strong> correctly listed the scanner</p>
<p style="padding-left: 30px;">device `gt68xx:libusb:002:005&#8242; is a Trust Flat Scan USB 19200 flatbed scanner</p>
<p>But <strong>scanimage</strong> on its own gave me the following message</p>
<p style="padding-left: 30px;">[gt68xx] Couldn&#8217;t open firmware file (`/usr/share/sane/gt68xx/Gt680xfw.usb&#8217;): No such file or directory</p>
<p>OK, so we need to find some firmware. A google search on Gt680xfw.usb revealed two candidates. I made a directory in /usr/share/sane/gt68xx/ and dropped the first firmware in there, taking care to rename it with the correct capitalization. Bingo. Now Xsane works. You can get the file <a href="http://play.datalude.com/blog/wp-content/uploads/2008/06/gt680xfw.usb">here</a> &#8230;</p>
<p>That was easy. And yes, I know I could have downloaded the windows drivers from <a href="http://www.trust.com/products/product_detail.aspx?item=11691">here</a>, but that wasn&#8217;t the point!</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/06/trust-scanner-success/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://play.datalude.com/blog/wp-content/uploads/2008/06/gt680xfw.usb" length="8192" type="video/unknown" />
		</item>
		<item>
		<title>Ubuntu 7.10 to PCLinuxOS 2008</title>
		<link>http://play.datalude.com/blog/2008/06/ubuntu-710-to-pclinuxos-2008/</link>
		<comments>http://play.datalude.com/blog/2008/06/ubuntu-710-to-pclinuxos-2008/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 05:07:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pclinuxos 2008]]></category>
		<category><![CDATA[re-install]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=26</guid>
		<description><![CDATA[I started a new project at a client&#8217;s office a month or so ago. On the first day I turned up, and managed to work for about an hour, before my laptop died. Somewhat embarassing. I tried for about an hour to resuscitate it, but couldn&#8217;t get it to boot at all: it just died [...]]]></description>
			<content:encoded><![CDATA[<p>I started a new project at a client&#8217;s office a month or so ago. On the first day I turned up, and managed to work for about an hour, before my laptop died. Somewhat embarassing. I tried for about an hour to resuscitate it, but couldn&#8217;t get it to boot at all: it just died and froze before the KDE login screen. It seemed to be some sort of graphical mishap, and no amount of fiddling with xorg.conf from rescue mode would fix it.</p>
<p>I excused myself, went back home and after some more fiddling, decided to backup and re-install. Having made this decision I was looking through my pile of install CDs, and I came across PCLinuxOS 2008, which I&#8217;d downloaded a few weeks previously, and I&#8217;d been meaning to try out. &#8220;So why not try it out on this laptop?&#8221; said the evil part of my brain &#8212; the same part which forces me to spend time on Facebook instead of working.</p>
<p><span id="more-26"></span>I decided to go ahead with this monstrous plan, partly due to the inexplicable freezing above, and partly because there were a couple of issues I&#8217;d never managed to resolve with Ubuntu 7.10, namely:</p>
<ul>
<li>Truecrypt wouldn&#8217;t work</li>
<li>Wireless didn&#8217;t work very well. It had taken me a couple of days to get it working initially, and it still doesn&#8217;t fully work &#8211; sometimes dropping the connection.</li>
<li>One part of my filesystem was mounted twice. I forget which part now, and it was not causing any problems, but it was irritating me.</li>
<li>Probably some more things as well &#8230;</li>
</ul>
<p>OK, so time to try something new then. I&#8217;m not going to dwell on the details, but here&#8217;s the shortened version of the process.</p>
<ol>
<li>Backup existing partitions to an external USB hard disk, using Gparted Live CD.  These were a two ext3 partitions, mounted on / and /home, and a VFAT32 partition containing some bits of data, and storage.</li>
<li>Run the PCLinuxOS installer. What I was trying to do was to leave the /home and VFAT partitions intact, and replace the / partition. However the installer was somewhat clumsy in this respect, and actually reformatted the whole disk. I wasn&#8217;t sure whether or not this was due to me misunderstanding the installer or due to a bug. Anyway, good job I backed up.</li>
<li>Restore the /home and VFAT partitions from the backup using Gparted CD again. Awesome tool.</li>
<li>Replace the existing /home directory with the newly restored partition. eg.
<ul>
<li>Booting in single mode, rename /home to /oldhome.</li>
<li>edit fstab to mount the new partition as /home</li>
</ul>
<ul>
<li>Restart</li>
<li>Check permissions. Need to change ownership of files within my user directory.</li>
<li>Some applications don&#8217;t work. Remove preference directories from /home/user directory and replace them a few at a time. Replace the .gnome directory with the corresponding one from /oldhome.
<pre>          /dev/hda6       /home   ext3    user,exec,rw,auto       0 0</pre>
</li>
</ul>
</li>
</ol>
<p>That was actually pretty easy. Now the good stuff.</p>
<ul>
<li>Wireless worked immediately with WPA2, something I&#8217;d never been able to get running on Ubuntu.</li>
<li>The fonts on the screen were a good size. I&#8217;d always found Ubuntu fonts a bit large, but the ones on PClinux OS were much better suited to my 1024&#215;768 display.</li>
<li>Sound and video worked fine out of the box. I&#8217;d had to fiddle with Ubuntu to get them going. I still needed to use the noapic boot trick though, which I was anticipating anyway.</li>
</ul>
<p>Now to install some software. PClinuxOS doesn&#8217;t come with as much pre-installed as Ubuntu, so I added the following applications. Oddly, PClinuxOS is an rpm based distro, but it still uses apt-get.</p>
<ul>
<li>su -l  (N.B. PClinuxOS uses a root login rather than sudo)</li>
<li>apt-get install nano, openoffice, filezilla, keepass, wine, skype, kopete, k3b, bind-utils</li>
<li>apt-get remove ephiphany, gnumeric, abiword</li>
</ul>
<p>Then I installed my favourite windows apps under wine: treepad and notepad++</p>
<p>I wasn&#8217;t able to install vmware server from apt-get, so I installed it by downloading from the vmware site, which entailed also getting a new serial number.</p>
<p>Truecrypt wasn&#8217;t in the original list of available applications in Synaptic. However I updated the repositories to a different one, and it appeared. Great! I installed it, and it worked perfectly immediately. This was a major coup, as it wouldn&#8217;t work under Ubuntu 7.10.</p>
<p>That was pretty much it. The initial setup had taken me around 4 hours, which I could have easily spent tinkering with config files, trying to get the old, troubled install of Ubuntu to work. I installed more applications as I needed them over the next few weeks, but the initial install was good enough to get me up and running again.</p>
<p>After having used it for a month or so, one frustrating element of PClinuxOS is that there is a limited selection of software available for it. There are dire warnings and threats in the user forum about compiling your own software, for which you forego any chance of support. They have a point of course, but the&#8217;re definitely a bit less friendly than Ubuntu.</p>
<p>By the time I got around to writing this, of course Ubuntu 8.10 is out. I may switch back to it next time I have to re-install, but the point that this exercise has demonstrated to me, is that switching OSes, linux to linux is a lot easier than going cross platform, and can easily be done inside a day. Food for thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/06/ubuntu-710-to-pclinuxos-2008/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>More Power</title>
		<link>http://play.datalude.com/blog/2008/04/more-power/</link>
		<comments>http://play.datalude.com/blog/2008/04/more-power/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 03:20:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[notebook]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[thinkpad]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=23</guid>
		<description><![CDATA[We&#8217;re getting into summer in the Philippines, and I was just worrying how hot my Thinkpad R51e was running. Its 32 degrees in the room, and my CPU is running at a consistent 73 degrees, according to cat /proc/acpi/thermal_zone/THM0/temperature which seems a bit unhealthy. My motherboard fried itself twice last year, and I figure that [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re getting into summer in the Philippines, and I was just worrying how hot my Thinkpad R51e was running. Its 32 degrees in the room, and my CPU is running at a consistent 73 degrees, according to</p>
<pre>cat /proc/acpi/thermal_zone/THM0/temperature</pre>
<p>which seems a bit unhealthy. My motherboard fried itself twice last year, and I figure that might have had something to do with it.</p>
<p>Anyway, I started casting around for things to reduce the power consumption, and found this powertop utility, apparently developed by Intel. (http://www.lesswatts.org/projects/powertop/) You can download it and install it from the site, but I just did a quick</p>
<pre>sudo apt-get install powertop</pre>
<p>and that seemed to work pretty well. When you run it (with sudo powertop), it reports all the things that are keeping your CPU awake and suggests a few things you can do to consume less power. Even better it will make these changes for you, if you press the appropriate letter on the keyboard.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/04/more-power/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Big Switch 6: Virtually there.</title>
		<link>http://play.datalude.com/blog/2008/02/the-big-switch-part-6/</link>
		<comments>http://play.datalude.com/blog/2008/02/the-big-switch-part-6/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 06:14:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[partitioning]]></category>
		<category><![CDATA[thinkpad]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=12</guid>
		<description><![CDATA[OK a quick recap from my last post, where I realised that then next step was going to take some explaining &#8230; A week or so went by without incident and it was time to consider the final stage: moving Windows to a virtual machine and getting rid of the old Windows partition. Here are [...]]]></description>
			<content:encoded><![CDATA[<p>OK a quick recap from my <a href="http://play.datalude.com/blog/?p=9">last post</a>, where I realised that then next step was going to take some explaining &#8230; A week or so went by without incident and it was time to consider the final stage: moving Windows to a virtual machine and getting rid of the old Windows partition. Here are the main stages.</p>
<ol>
<li>Make a windows install CD from the install files on the windows partition (Thinkpads don’t have an install CD, they use an Install partition)</li>
<li>Install vmware on Ubuntu and make a Windows Virtual Machine.</li>
<li>Delete the old Windows and IBM Install partitions</li>
<li>Re-arrange the remaining partitions to suit the new arrangement.<span id="more-12"></span></li>
</ol>
<p><strong>Making the Windows Install CD.</strong></p>
<p>This is a little bit complex because I have an IBM Thinkpad. The OS on these comes as a 4Gb rescue partition which you can boot into and restore your Thinkpad to factory condition. I made the DVDs and CDs to complete this, but actually I didn&#8217;t want to use these, as it a) reformats the hard disk into a single partition + recovery partition, and b) installs a whole raft of IBM drivers widgets and bloatware that I don&#8217;t want. Nevertheless I have an OEM license for Windows XP home which I&#8217;m entitled to use on this machine, so the question is how to get it installed in a Virtual machine.</p>
<p>The answer I found in several blog posts and howto articles, which I&#8217;ve subsequently lost. You can get most of the info here http://www.howtohaven.com/system/createwindowssetupdisk.shtml</p>
<p>Here is how I modified that info and the main steps I took:.</p>
<ol>
<li>Start with the files installed in c:\i386. Copy these to another location so you can work on them without breaking anything (despite the fact you&#8217;re going to vape your windows install in a couple of hours anyway)</li>
<li>With the files in the new location (say d:\xpinstall) you need to add some plain text files to tell it that the install is an OEM install (see reference article above)</li>
<li>Slipstream in Service Pack 2.</li>
<li>Use nLite to slim down the installation to the essentials, (we don&#8217;t need no stinkin&#8217; helpfiles!) and then build you a boot CD iso image.</li>
</ol>
<p><strong>VMware Install and setup</strong></p>
<p>Meanwhile, back in Linux Mint / Ubuntu, we have to install vmware server. This is done pretty easily through Synaptic. If you don&#8217;t see it in there, you&#8217;ll have to enable the third party software repositories. I chose VMware server as opposed to Workstation or Player because it was freer than Workstation, and it had more functionality than the Player.</p>
<p>Once vmware Server is set up, you need to start it from the item it put in your Start Menu, and connect to localhost. From here you can create a new machine. I opted to use a dynamic container with a max size of 8Gb, although I could have got away with less. I set the CD Drive to point to the .iso image I created above (brilliant feature!), and then booted it up. Windows installed like a charm, and using the OEM licence key on the bottom of my Thinkpad, it was all legal. I also set up the Network connection to NAT to my network so that the Windows machine is never directly exposed to the Network / Internet and the Ubuntu install effectively acts as a router. VMware takes care of all this for you, so you don&#8217;t have to think about it too much. However if you want to run a server in VMware, you&#8217;d probably use the direct, non-NAT connection.</p>
<p>The final setting you may want to play with is the memory allocation. I have 1Gb of RAM, and I allocated half of that to the virtual machine. Windows runs fine in that, and this is a very low spec machine.</p>
<p>Once Windows is installed, obviously you have to do all that updating, and installing of AntiVirus. I also installed a couple of tools I use and my accounting software. Within the virtual machine, I set up a Truecrypt container for my accounts data, and then wrote a quick script to sync this back up to my Ubuntu installation using scp. This means once I&#8217;ve finished doing my monthly accounts I can just hit the button and it backs it up for me.</p>
<p>Having set all this up, I took a snapshot, and backed up the entire VM to an external hard disk, so if I ever need to recover it, I can do so in minutes. Very cool.</p>
<p><strong>Deleting the old partitions</strong></p>
<p>Once again, I left this for a week or so until I was sure things were working smoothly. During that time I also experimented with a couple of other VM images &#8211; I built one of Centos 5 server so I could prototype some development, and tried out Zimbra mail server. Unfortunately the Zimbra server comes as an rPath device, so you don&#8217;t really get to play with it properlly. Anyway, this virtualization stuff is great. I wish I&#8217;d done it properly sooner.</p>
<p>The trouble with having all these virtual images is they take up a lot of space, so I was now beginning to run out of disk space. Time to get rid of those unused partitions.</p>
<p>The tool for the job is the gparted live CD, which I hadn&#8217;t used for about a year. I was pleased to see that the latest version, despite a modest increment in its version number, is streets ahead of the last one I used. Great job guys!</p>
<p>So here&#8217;s what we do.</p>
<ol>
<li>Plug in an external USB drive to back up onto.</li>
<li>Boot from the gparted Live CD, and make sure the USB drive is mounted. eg.
<ul>
<li>mount -t vfat /mnt/sda1 /mount/usb</li>
</ul>
</li>
<li>Start partimage from the menu, and use it to back up the partitions we&#8217;re going to delete. Hack them into 2Gb chunks as suggested by partimage, as we&#8217;re backing up to a VFAT drive. A 20Gb partition took about 20 mins. That&#8217;s fast if you&#8217;ve ever used something like Encase &#8230;</li>
<li>Back up any live data partitions you&#8217;ve got as well, just for good measure. You can delete them if all goes well</li>
<li>Use Gparted to delete the partitions on the disk that you don&#8217;t want.</li>
<li>Reboot the computer and check you got rid of the correct ones &#8230;</li>
<li>OK now to organise them</li>
</ol>
<p><strong>Rearranging the partitions on the disk</strong></p>
<p>Reboot into the Gparted CD. In my case what I now have is</p>
<ul>
<li>a 10 Gb root Linux partition (/) on /dev/hda5</li>
<li>a 1 Gb swap partition on /dev/hda6</li>
<li>a 100Mb /boot partition on /dev/hda7</li>
<li>a 15Gb vfat data partition on /dev/hda3 which is in an extended partition, /dev/hda4</li>
<li>Two chunks of free space.</li>
</ul>
<p>Moving partitions around in gparted is just a case of copying and pasting. Really. The potential for disaster is high, but if you&#8217;re all backed up, then there&#8217;s nothing to lose right? I cut and pasted, and re-sized and re-organized, until I was left with this:</p>
<ul>
<li> /dev/hda1 &#8211; 20Gb &#8211; Linux main system (moved and enlarged)</li>
<li>/dev/hda2 &#8211; 100Mb &#8211; /boot partition (moved)</li>
<li>/dev/hda4 &#8211; 1 Gb &#8211; swap partition (moved)</li>
<li>/dev/hda3 &#8211; Extended partition containing
<ul>
<li>/dev/hda5 &#8211; 17 Gb Data partition (enlarged)</li>
<li>/dev/hda6 &#8211; 17Gb /home partition (newly created to house all the VMs)</li>
</ul>
</li>
</ul>
<p>Having done such major reconstructive surgery I knew I was in for a few glitches on boot up, but I knew I could get around them eventually.</p>
<p>This post has got a bit long &#8230; its continued <a href="http://play.datalude.com/blog/?p=18">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2008/02/the-big-switch-part-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
