<?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; General IT</title>
	<atom:link href="http://play.datalude.com/blog/category/it/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>ClamAV reporting Outdated version</title>
		<link>http://play.datalude.com/blog/2010/05/clamav-reporting-outdated-version/</link>
		<comments>http://play.datalude.com/blog/2010/05/clamav-reporting-outdated-version/#comments</comments>
		<pubDate>Tue, 04 May 2010 03:05:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[latest version]]></category>
		<category><![CDATA[repositories]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=200</guid>
		<description><![CDATA[Just to remind myself as much as anything, as I&#8217;ve been through this a few times. ClamAV was complaining loudly in the logfiles about not having the most up to date ClamAV. I searched around and was pointed to the Debian Unstable repository to /etc/apt/sources.list (Read the whole article before you add this one &#8230;there [...]]]></description>
			<content:encoded><![CDATA[<p>Just to remind myself as much as anything, as I&#8217;ve been through this a few times. ClamAV was complaining loudly in the logfiles about not having the most up to date ClamAV. I searched around and was pointed to the Debian Unstable repository to /etc/apt/sources.list (Read the whole article before you add this one &#8230;there is a better one)</p>
<p>After that, on running<strong> apt-get update</strong>, you get a message like this:</p>
<p>W: GPG error: http://volatile.debian.org etch/volatile Release: The following signatures couldn&#8217;t be verified because the public key is not available: NO_PUBKEY DFD993306D849617</p>
<p>So, take the pubkey number off the end and do this with it.</p>
<pre>sudo gpg --keyserver subkeys.pgp.net --recv-keys DFD993306D849617</pre>
<pre>sudo gpg --armor --export DFD993306D849617 &gt; new.key</pre>
<pre>sudo apt-key add new.key</pre>
<p>I then got a message saying &#8220;The following packages have been kept back: clamav clamav-daemon clamav-freshclam&#8221;</p>
<p>By using</p>
<pre> sudo <strong>aptitude</strong> dist-upgrade</pre>
<p>(NB aptitude rather than apt-get) the new packages are downloaded. However they&#8217;re still not up to the level that ClamAV is telling me to upgrade to.</p>
<p>So, more searching. It turns out the most up to date Ubuntu Repositories are from this page &#8230; <a href="https://launchpad.net/~ubuntu-clamav/+archive/ppa">https://launchpad.net/~ubuntu-clamav/+archive/ppa</a>. In my case the solution was to add these lines to my /etc/apt/sources.list</p>
<pre>deb http://ppa.launchpad.net/ubuntu-clamav/ppa/ubuntu hardy main</pre>
<pre>deb-src http://ppa.launchpad.net/ubuntu-clamav/ppa/ubuntu hardy main</pre>
<p>And then run through the pubkey process above, with the different pubkey id number. Later distros might get away with the add-apt-key command, but I was running hardy (8.04) on this particular server.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2010/05/clamav-reporting-outdated-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in unbricking a router</title>
		<link>http://play.datalude.com/blog/2010/04/adventures-in-unbricking-a-router/</link>
		<comments>http://play.datalude.com/blog/2010/04/adventures-in-unbricking-a-router/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 04:15:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[dd-wrt]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[SimpleHTTPServer]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=196</guid>
		<description><![CDATA[Another fantastic illustration of how Linux &#8216;gets the job&#8217; done. Although sometimes the operator (ahem) is sometimes a bit slow on the uptake. Anyway, I had a Linksys WRT54G router in which the wireless unit had blown up after a power outage and surge. Gotta love the Philippines. I had dd-wrt on it, but decided [...]]]></description>
			<content:encoded><![CDATA[<p>Another fantastic illustration of how Linux &#8216;gets the job&#8217; done. Although sometimes the operator (ahem) is sometimes a bit slow on the uptake.</p>
<p>Anyway, I had a Linksys WRT54G router in which the wireless unit had blown up after a power outage and surge. Gotta love the Philippines. I had dd-wrt on it, but decided to try out OpenWRT. Well lets just say that OpenWRT isn&#8217;t to my taste. I wanted something which worked more or less immediately, rather than poring over documentation trying to figure out how to get the WAN interface up via a command line.</p>
<p>So I dropped the router into a drawer until today, when I needed to use it for something (without the need for wireless). Well of course when I needed it, it wouldn&#8217;t boot. In fact I couldn&#8217;t even ping it. This is bad news.</p>
<p>I tracked down an internet post which mentioned that if I held the reset button while booting, the router would go into admin mode, which meant I could ping it. I did this and it worked. I read elsewhere that in order to flash it with tftp, I needed to do so when the ping response time was 100ms, before it dropped to 64ms. Exciting stuff. I set up the tftp flashing machine and tried, possibly 50 or 60 times, to flash back ddwrt. No luck. For reference, here is the one liner:</p>
<pre>echo -e "binary\nrexmt 1\ntimeout 60\ntrace\nput ddwrt.bin\n" | tftp 192.168.1.1
</pre>
<p>I did an nmap scan of the router and found that port 23 was open, so I managed to telnet into it. I couldn&#8217;t connect the wan interface (as previously noted), but I had a command prompt. No SSH, no web interface. So how to get the ddwrt.bin file onto the router via telnet?</p>
<p>Here&#8217;s how: On my PC, at 192.168.1.50, I went to the directory which held the ddwrt.bin file. At the command prompt I typed</p>
<pre>python -m SimpleHTTPServer</pre>
<p>This serves up the current directory over HTTP, port 8080.</p>
<p>In my router telnet session I went to the /tmp directory (the only place with enough space for the file) and typed</p>
<pre>wget http://192.168.1.50:8080/ddwrt.bin</pre>
<p>After a few seconds, the file was there! Alright!</p>
<p>Still in the router, I did</p>
<pre><code>mtd -r write dd-wrt.bin linux</code></pre>
<p>The router whirred for a while, rebooted and &#8230; ddwrt was back, in all its web-interfacy autoconfigurating glory.</p>
<p>What a great trick with SimpleHTTPServer. Shame I wasted hours on the tftp approach. Incidentally, there&#8217;s a similar tool which will let people upload files to your computer via HTTP, called droopy.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2010/04/adventures-in-unbricking-a-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Captcha Madness</title>
		<link>http://play.datalude.com/blog/2009/11/captcha-madness/</link>
		<comments>http://play.datalude.com/blog/2009/11/captcha-madness/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 04:40:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[captcha]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=186</guid>
		<description><![CDATA[I understand what captchas are for, and why we need them, but they seem to be getting out of control. I recently visited a site which had the captcha displayed here. For the record the first word wasn&#8217;t &#8216;stirred&#8217;. I saw the option for an audio captcha and wondered how you pronounce &#8216;Ohehyahtah&#8217;. If that [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_187" class="wp-caption alignright" style="width: 342px"><a href="http://play.datalude.com/blog/wp-content/uploads/2009/11/captcha_if-you_can.png"><img class="size-full wp-image-187" title="captcha_if you_can" src="http://play.datalude.com/blog/wp-content/uploads/2009/11/captcha_if-you_can.png" alt="Captcha If You Can" width="332" height="162" /></a><p class="wp-caption-text">Captcha If You Can</p></div>
<p>I understand what captchas are for, and why we need them, but they seem to be getting out of control. I recently visited a site which had the captcha displayed here.</p>
<p>For the record the first word wasn&#8217;t &#8216;stirred&#8217;. I saw the option for an audio captcha and wondered how you pronounce &#8216;Ohehyahtah&#8217;. If that indeed was the second word. Too good to miss. I pressed the button and found that the audio captcha is just as bizzarrely impenetrable as the text. The mp3 file of it is <a href="http://play.datalude.com/blog/wp-content/uploads/2009/11/gobbledegook.mp3">here</a>, and it reminded me strongly of an early David Lynch film]. Back to the text: after refreshing the words two or three times I was eventually able to get to the next stage.</p>
<p>The next stage involved typing a random string of letters into a box &#8211; approximately 200 characters. The web page did kindly suggest that I could cut and paste them into the box, which I did, but really, what this did was turn a quick attempt to give someone some feedback on their blog into a task akin to hacking into NASA.</p>
<p>Security shouldn&#8217;t be that hard. It should be as unobtrusive as possible. Roll on the next anti-bot paradigm.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/11/captcha-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://play.datalude.com/blog/wp-content/uploads/2009/11/gobbledegook.mp3" length="27144" type="audio/mpeg" />
		</item>
		<item>
		<title>Ubuntu upgrade 9.04 to 9.10</title>
		<link>http://play.datalude.com/blog/2009/11/ubuntu-upgrade-9-04-to-9-10/</link>
		<comments>http://play.datalude.com/blog/2009/11/ubuntu-upgrade-9-04-to-9-10/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 03:28:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[thinkpad R51e]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=181</guid>
		<description><![CDATA[I&#8217;ve learnt my lesson on this a few times: things break when you upgrade Ubuntu on laptops. I can understand why. There is a huge variety of hardware for laptops, particularly BIOSes, sound chips and wireless chips, and every manufacturer likes to tweak them a bit. The Linux kernel has the unenviable task of having [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://play.datalude.com/blog/wp-content/uploads/2009/11/Screenshot-Update-Manager.png"><img class="alignright size-medium wp-image-184" title="Screenshot-Update Manager" src="http://play.datalude.com/blog/wp-content/uploads/2009/11/Screenshot-Update-Manager-237x300.png" alt="Screenshot-Update Manager" width="237" height="300" /></a>I&#8217;ve learnt my lesson on this a few times: things break when you upgrade Ubuntu on laptops. I can understand why. There is a huge variety of hardware for laptops, particularly BIOSes, sound chips and wireless chips, and every manufacturer likes to tweak them a bit. The Linux kernel has the unenviable task of having to support ALL of them immediately, whereas in Windows the hardware component manufacturer supplies drivers which you have to install to get your machine working correctly.</p>
<p>Anyway, for example, last time I upgraded my two laptops from 8.10 to 9.04, a lot of things broke, and I was hurting for a long time. In fact one of the laptops never really got straight. This was irritating for me, but as I had another laptop to use for my main work, it wasn&#8217;t a major annoyance. But I can imagine if you only have one machine and the sound doesn&#8217;t work on it, for example, it would leave a nasty taste in your mouth.</p>
<p>So this time, I started with the Thinkpad R51e, which is my spare laptop. I have the /home directory mounted on a separate partition, which makes things really easy. Basically you just blow away the main OS partition, and then remount the your data partition at /home, preserving all your data. (OK its a little more complicated than that, but I&#8217;m not blogging about that right now).<span id="more-181"></span></p>
<p>What I <strong>am</strong> blogging about is the complete success of the upgrade. The Thinkpad R51e works flawlessly. The sound, which never worked previously is now fine. The random freezes which I put down to some sort of ACPI weirdness, now don&#8217;t occur. The wireless, which was working OK, <em>failed to break</em>. Marvellous. So if you&#8217;ve got a Thinkpad R51e out there, do yourself a favour and upgrade it. I&#8217;d recommend the re-install rather than the in-place upgrade.</p>
<p>Emboldened, I also tried it on my Dell Mini 10v. As this was a new install, and I hadn&#8217;t had any problems with 9.04, I did an in-place upgrade. Also running fine. Now &#8230; should I do it on my main work machine &#8230;.?</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/11/ubuntu-upgrade-9-04-to-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropbox for offsite backup</title>
		<link>http://play.datalude.com/blog/2009/06/dropbox-for-offsite-backup/</link>
		<comments>http://play.datalude.com/blog/2009/06/dropbox-for-offsite-backup/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 07:07:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[offsite backup]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=150</guid>
		<description><![CDATA[I&#8217;ve recently been using Dropbox. Its a free offsite backup service, which works with Windows, Linux and Mac and gives you 2Gb of space for free. You can pay for more if you need it. Here&#8217;s what I like about it: It just works. Drop your files into a folder and forget about it. You [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been using Dropbox. Its a free offsite backup service, which works with Windows, Linux and Mac and gives you 2Gb of space for free. You can pay for more if you need it. Here&#8217;s what I like about it:</p>
<ul>
<li> It just works. Drop your files into a folder and forget about it.</li>
<li>You can join more than one computer to the same account and the files sync between both computers. eg one at work, one at home.</li>
<li>If you&#8217;re away from you computer and you need a file, you can get it from the web interface. (But of course you&#8217;d only do this on computers you trust</li>
<li>There are different levels of privacy. Private files are only seen by you. However you can share files with certain people, by supplying their email addresses. You also have Public files which can be downloaded by anyone at all with the given URL. Much more control than senduit.com for example.</li>
<li>Photos put in the photo folder are instantly made into galleries. Neat.</li>
<li>You can roll back to a previous version of a file if you make a mistake.</li>
</ul>
<p>Having said all that, I wouldn&#8217;t trust super secret work or personal documents to it, but for keeping a backup of photos and non-sensitive personal docuements, it works a treat.</p>
<p>Also, there&#8217;s a referral program on at the moment, so if you sign up via the link below, you get an extra 250Mb of space. And so do I as well &#8230; go on &#8230; its free, and you&#8217;ll be glad you did.<br />
<a class="moz-txt-link-freetext" href="https://www.getdropbox.com/referrals/NTI3NDkwMDk">https://www.getdropbox.com/referrals/NTI3NDkwMDk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/06/dropbox-for-offsite-backup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PLDT SMTP server.</title>
		<link>http://play.datalude.com/blog/2009/06/pldt-smtp-server/</link>
		<comments>http://play.datalude.com/blog/2009/06/pldt-smtp-server/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 06:13:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Philippines]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[pldt]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[stupid]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=147</guid>
		<description><![CDATA[Man this is the best kept secret in the entire telecoms industry &#8230; I&#8217;ve been trying to send email through PLDT&#8217;s SMTP servers as I&#8217;m a broadband customer of theirs, and my normal SMTP server wasn&#8217;t working. I needed to get an email out, and I was getting a little desperate. So apparently the published [...]]]></description>
			<content:encoded><![CDATA[<p>Man this is the best kept secret in the entire telecoms industry &#8230; I&#8217;ve been trying to send email through PLDT&#8217;s SMTP servers as I&#8217;m a broadband customer of theirs, and my normal SMTP server wasn&#8217;t working. I needed to get an email out, and I was getting a little desperate.</p>
<p>So apparently the published SMTP servers don&#8217;t actually work. Yay! If you try looking on the PLDT website, where you might expect to see this kind of useful information &#8230; well just don&#8217;t bother. You get seasick pretty quickly from all the flash whoopiness, and the dead ends and 404 start to piss you off after a while. So then you do a few google searches and come up with a couple of published servers, which basically don&#8217;t work:  smtp.info.com.ph and smtp.pldtdsl.net</p>
<p>So, eventually I cracked and went to the Customer Hotline. After re-phrasing my question several thousand times until I was understood, the answer was &#8230; smtpdsl4.pldtdsl.net , using port 587. Which actually works.</p>
<p>Port 587, yes of course, why didn&#8217;t I guess that one.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/06/pldt-smtp-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Printing Web pages the way you want &#8216;em</title>
		<link>http://play.datalude.com/blog/2009/05/printing-web-pages-the-way-you-want-em/</link>
		<comments>http://play.datalude.com/blog/2009/05/printing-web-pages-the-way-you-want-em/#comments</comments>
		<pubDate>Mon, 04 May 2009 05:49:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[web page]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=138</guid>
		<description><![CDATA[Just came across this awesome tool which will let you format webpages in real time, and then output them to a printer. Here&#8217;s the URL http://www.printwhatyoulike.com/ And here&#8217;s a link to this very page opened up in the site, so you can try it out. Brilliant. Why didn&#8217;t I think of that &#8230;. Oh, and [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-142" href="http://play.datalude.com/blog/?attachment_id=142"><img class="alignright size-full wp-image-142" title="icon_alone_full" src="http://play.datalude.com/blog/wp-content/uploads/2009/05/icon_alone_full.png" alt="icon_alone_full" width="135" height="140" /></a>Just came across this awesome tool which will let you format webpages in real time, and then output them to a printer.</p>
<p>Here&#8217;s the URL http://www.printwhatyoulike.com/</p>
<p>And here&#8217;s a <a href="http://www.printwhatyoulike.com/print?url=http%3A%2F%2Fplay.datalude.com%2Fblog%2F%3Fp%3D138" target="_blank">link to this very page</a> opened up in the site, so you can try it out.</p>
<p>Brilliant. Why didn&#8217;t I think of that &#8230;. Oh, and they&#8217;ve also got a &#8216;bookmarklet&#8217; (great idea, terrible name) which you can drop onto your IE or Firefox toolbar which gives you quick access to the functionality of the site. Just click the button, and the page you&#8217;re currently browsing will open in the Printwhatyoulike website.</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/05/printing-web-pages-the-way-you-want-em/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Firefox&#8217;s Tattletale Search Query</title>
		<link>http://play.datalude.com/blog/2009/04/ubuntu-firefoxs-tattletale-search-query/</link>
		<comments>http://play.datalude.com/blog/2009/04/ubuntu-firefoxs-tattletale-search-query/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 02:52:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://play.datalude.com/blog/?p=131</guid>
		<description><![CDATA[Have you ever noticed that when you type a search term into the search box in the top right of your Firefox browser, that a load of junk gets added to the search term. For example, you search for &#8216;banana&#8217; and you get something like this: http://www.google.com.ph/search?q=banana&#38;ie=utf-8&#38;oe=utf-8&#38;aq=t&#38;rls=com.ubuntu:en-US:unofficial&#38;client=firefox-a Well what you&#8217;re effectively doing is giving Google [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-133" href="http://play.datalude.com/blog/?attachment_id=133"><img class="alignright size-full wp-image-133" title="Search Simplification" src="http://play.datalude.com/blog/wp-content/uploads/2009/04/prismendoppelfernrohr_1905.jpg" alt="Search Simplification" width="136" height="150" /></a>Have you ever noticed that when you type a search term into the search box in the top right of your Firefox browser, that a load of junk gets added to the search term. For example, you search for &#8216;banana&#8217; and you get something like this:</p>
<p>http://www.google.com.ph/search?q=banana&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=com.ubuntu:en-US:unofficial&amp;client=firefox-a</p>
<p>Well what you&#8217;re effectively doing is giving Google a lot of information for free. Which irritates me. All I really need is this,</p>
<p>http://www.google.com.ph/search?q=banana</p>
<p>and if they really want to know more about me, then they&#8217;re welcome to go digging through their logs.</p>
<p>OK its a minor irritation, but one that we can fix! I understand that Ubuntu does it as part of a deal with Google, but there&#8217;s no reason why we can&#8217;t take matters into our own hands and change the defaults.</p>
<p><span id="more-131"></span>So, the file you need to find is this one: /usr/lib/firefox-addons/searchplugins/google.xml, and you&#8217;ll need to open it in an editor as root.  So:</p>
<pre>sudo gedit /usr/lib/firefox-addons/searchplugins/google.xml</pre>
<p>If you use another search engine as your default, then choose a different file, of course. With this file open in an editor,  remove the offending lines. In the case above, its</p>
<pre>  &lt;Param name="ie" value="utf-8"/&gt;
  &lt;Param name="oe" value="utf-8"/&gt;
  &lt;Param name="aq" value="t"/&gt;
  &lt;!-- Dynamic parameters --&gt;
  &lt;Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/&gt;
  &lt;MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/&gt;</pre>
<p>Save the file, restart Firefox, and we&#8217;re good to go.  Now the problem is that whenever you upgrade Firefox, the problem reappears, so you might want to make a copy of the correct file, and write a script to replace it every time you upgrade.  I always manage to forget where the file is, so I&#8217;m blogging this for my own benefit as much as anyone elses &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://play.datalude.com/blog/2009/04/ubuntu-firefoxs-tattletale-search-query/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>
	</channel>
</rss>
