<?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>Ronald! &#187; General</title>
	<atom:link href="http://www.rchu.nl/cat/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rchu.nl</link>
	<description>My own little corner of the world wide web</description>
	<lastBuildDate>Mon, 12 Jul 2010 23:44:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>KockFest 2010</title>
		<link>http://www.rchu.nl/2010/04/kockfest-2010/</link>
		<comments>http://www.rchu.nl/2010/04/kockfest-2010/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 11:55:15 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=468</guid>
		<description><![CDATA[Afgelopen weekeinde was het KockFest 2010. Eigenlijk gewoon het vrijgezellenfeest voor Jeroen, maar KockFest klinkt stoerder. Ik heb het idee dat we ons totaal niet aan de stereotypen van een vrijgezellenfeest (verkleden, gênante opdrachten, strippers en dergelijke) hebben gehouden, maar een aantal zoekopdrachten in Google naar &#8220;vrijgezellenfeest &#60;activiteit&#62;&#8221; toont aan dat die ook helemaal niet [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Resultaten van Google zoekopdrachten naar &quot;vrijgezellenfeest [woord]&quot;" href="http://www.rchu.nl/wordpress/wp-content/uploads/kockfest1.png"><img class="alignright size-medium wp-image-471" title="kockfest" src="http://www.rchu.nl/wordpress/wp-content/uploads/kockfest1-300x92.png" alt="kockfest" width="300" height="92" /></a>Afgelopen weekeinde was het KockFest 2010. Eigenlijk gewoon het vrijgezellenfeest voor Jeroen, maar KockFest klinkt stoerder. Ik heb het idee dat we ons totaal niet aan de stereotypen van een <a href="http://nl.wikipedia.org/wiki/Vrijgezellenfeest">vrijgezellenfeest</a> (verkleden, gênante opdrachten, strippers en dergelijke) hebben gehouden, maar een aantal zoekopdrachten in Google naar <em>&#8220;vrijgezellenfeest &lt;activiteit&gt;&#8221; </em>toont aan dat die ook helemaal niet zo hoog scoren in vergelijking met wat wij hebben gedaan. Ik heb bij de zoekwoorden plaatsnamen achterwege gelaten omdat die extreem veel hoger scoren. De conclusie van dit uitermate wetenschappelijke onderzoek verbaast me eigenlijk niet. Het is gewoon veel leuker om  met z&#8217;n allen leuke dingen te doen, en we zijn uiteraard niet de eersten zijn die dat hebben bedacht.</p>
<p><span id="more-468"></span><br />
<a href="http://www.rchu.nl/wordpress/wp-content/uploads/Piratenboot.jpg"><img class="alignnone size-medium wp-image-487" style="border: 1px solid black; margin: 2px;" title="Piratenboot" src="http://www.rchu.nl/wordpress/wp-content/uploads/Piratenboot-300x225.jpg" alt="Piratenboot" width="300" height="225" /></a><a href="http://www.rchu.nl/wordpress/wp-content/uploads/Immer-Gerade-Aus.ogv"><img class="alignnone size-full wp-image-495" style="border: 1px solid black; margin: 2px;" title="Immer Gerade Aus!" src="http://www.rchu.nl/wordpress/wp-content/uploads/Immer-Gerade-Aus.png" alt="Immer Gerade Aus!" width="300" height="225" /></a><a href="http://www.rchu.nl/wordpress/wp-content/uploads/Schipper-Frenken.JPG"><img class="alignnone size-medium wp-image-490" style="border: 1px solid black; margin: 2px;" title="Schipper Frenken" src="http://www.rchu.nl/wordpress/wp-content/uploads/Schipper-Frenken-300x225.jpg" alt="Schipper Frenken" width="300" height="225" /></a><a href="http://www.rchu.nl/wordpress/wp-content/uploads/Schipper-Schipper.JPG"><img class="alignnone size-medium wp-image-491" style="border: 1px solid black; margin: 2px;" title="Schipper Schipper" src="http://www.rchu.nl/wordpress/wp-content/uploads/Schipper-Schipper-300x225.jpg" alt="Schipper Schipper" width="300" height="225" /></a><a href="http://www.rchu.nl/wordpress/wp-content/uploads/Weduwe-Joustra.jpg"><img class="alignnone size-medium wp-image-492" style="border: 1px solid black; margin: 2px;" title="Weduwe Joustra" src="http://www.rchu.nl/wordpress/wp-content/uploads/Weduwe-Joustra-300x225.jpg" alt="Weduwe Joustra" width="300" height="225" /></a><a href="http://www.rchu.nl/wordpress/wp-content/uploads/Zwaard-in-de-kroeg.jpg"><img class="alignnone size-medium wp-image-493" style="border: 1px solid black; margin: 2px;" title="Zwaard in de kroeg" src="http://www.rchu.nl/wordpress/wp-content/uploads/Zwaard-in-de-kroeg-300x225.jpg" alt="Zwaard in de kroeg" width="300" height="225" /></a></p>
<p><em>Foto&#8217;s gemaakt door <a href="http://www.flickr.com/photos/breun/sets/72157623832170092/">Nils</a>, <a href="http://www.flickr.com/photos/petrikje/sets/72157623837281226/">Patrick</a> en <a href="http://www.dropbox.com/gallery/5950491/1/KockFest?h=e6495c">Ronald</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2010/04/kockfest-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.rchu.nl/wordpress/wp-content/uploads/Immer-Gerade-Aus.ogv" length="4333900" type="video/ogg" />
		</item>
		<item>
		<title>My Ubuntu AFP server and the 1.5TB of Doom</title>
		<link>http://www.rchu.nl/2009/12/my-ubuntu-afp-server-and-the-1-5tb-of-doom/</link>
		<comments>http://www.rchu.nl/2009/12/my-ubuntu-afp-server-and-the-1-5tb-of-doom/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 08:04:13 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[AFP]]></category>
		<category><![CDATA[Time Machine]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=407</guid>
		<description><![CDATA[
The bad part about my girlfriend moving in with me is that my friend who was living with me left and took our local sever with him. We had combined our spare hardware to build us a server and used his old computer because he had 4 ATA controllers and I had only 2. So [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rchu.nl/wordpress/wp-content/uploads/hdd3.JPG"><img class="size-medium wp-image-436 alignright" title="Hard Disk" src="http://www.rchu.nl/wordpress/wp-content/uploads/hdd3-300x225.jpg" alt="Hard Disk" width="300" height="225" /></a></p>
<p>The bad part about my girlfriend moving in with me is that my friend who was living with me left and took our local sever with him. We had combined our spare hardware to build us a server and used his old computer because he had 4 ATA controllers and I had only 2. So now I had to configure my old PC to create a new server (&#8217;cause you just can&#8217;t live without one of those :) and bought an extra 1.5TB hard disk. That caused quite some trouble. Since the first wasn&#8217;t properly detected by my onboard SATA controller I returned it and the replacement seemed to work, only to be mounted as read-only after formatting it. After a while the disk wasn&#8217;t properly detected at all. I was surprised with two new disks having the exact same problem, fortunately so was the owner of the web shop where I bought it. He actually called me personally to discuss the situation and concluded that my SATA controller was probably to old to work properly with this big modern disk. So I bought an PCI eSATA controller which solved my problems.</p>
<p>Last weekend I took this card to my friend who also bought a new hard disk and was experiencing similar problems. After I put the card back my big disk wouldn&#8217;t mount anymore, though it worked fine when I booted the Ubuntu Live CD. Long story short (live cd: works, reinstall ubuntu: works, dist-upgrade: broken, reinstall: works, reboot: broken) there we suddenly some errors in the FS which fsck managed to fix.</p>
<p>Anyway, most of you aren&#8217;t at all interested in the above snipped of my life and want some technical information. Which you are going to get in the remaining part of this post. Hey, the benefit of people blogging technical stuff on their personal blog is that you have to read through the irrelevant stuff. Nothing is perfect, right?</p>
<p><span id="more-407"></span></p>
<h2>Setting up ubuntu as an file server</h2>
<p>I followed a<a href="http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/"> great tutorial</a> to set up AFP on my server which was very easy and everything works like a charm. Well, almost everything.</p>
<h3>Permissions</h3>
<p>Since there are two users connecting to the machine there are files created by both that also need to be accessed by both users. Setting the setgid bit on the shares directories and adding both users to a common group is a start, unfortunately there doesn&#8217;t seem to be a way to set the umask for newly created files using netatalk, so in order for other users to be able to write/delete these files I just add the group write permission with a hourly cron job. It&#8217;s ugly, but it does the job.</p>
<h3>Time Machine</h3>
<p>After a short time of backing up with Time Machine I got the infamous <a href="http://discussions.apple.com/thread.jspa?threadID=2142747">error 109</a>.  Since this issue seems to have no solution and chances are slim Apple will do something about it since it they do not support it I decided to make only manual backups at night so they can run uninterrupted, and make backups of my time machine sparsebundle in case the backup gets broken. Yes, that does sound kind of redundant. It&#8217;s far from ideal, but a workable situation. I don&#8217;t need hourly backups anyway, I just want to have something in case of a hard disk crash or something like that.</p>
<p>Yesterday I read that <a href="http://netatalk.sourceforge.net/2.0/ReleaseNotes.html">netatalk 2.0.5 adds time machine support</a>! Since the current version of netatalk in the ubuntu repo is still 2.0.4 I removed it and downloaded the <a href="http://packages.debian.org/sid/netatalk">netatalk-2.0.5-2</a> (and <a href="http://packages.debian.org/sid/libdb4.8">libdb4.8</a> which it depends on and is also not yet in the ubuntu repo) packages from the debian site and installed them with <code>dpkg</code>. This was all much easier than I expected since people on the web were warning others that this is not the proper way to go and everything might get broken and so on. After some initial errors (removing the <code>.AppleDB</code> directories after error -5014 and removing the old sparsebundle as root after error 109 on an partially removed sparsebundle) it now seems to work just fine.</p>
<p>Interesting to note is that with this new time machine support I indeed do not have to create the sparsebundle by hand and that it is now named <code>Granny.sparsebundle</code> (Granny is my laptops name) without the MAC adres. Also interesting is that TM started to continue backing up in a copy of an old backup I made by hand named <code>Granny_macadres.copy.sparsebundle</code>. Apparently the name of the backup is much more flexible nowadays.</p>
<p>Now I&#8217;m just going to make backups wireless hourly without paying attention to it (and thus interrupting it when putting my laptop to sleep) as I used to with my old Time Capsule and see if the new version of netatalk solves the problems I had. For now I&#8217;ve interrupted the initial backup several times now and it is still running (and continuing every time where it was interrupted). So far so good, I can at least say that it works more reliable than with the previous version of netatalk.</p>
<p><strong>Update:</strong> after some initial success backing up to this AFP share is as unreliable as is was before, still getting a lot of 109 errors. Too bad. I decided to just buy an external USB/eSATA case and put the disk in that. It not expensive and works for sure, though I am deeply unhappy with the situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/12/my-ubuntu-afp-server-and-the-1-5tb-of-doom/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PDO: Configuring Apache, MySQL and PHP on OSX 10.5.7</title>
		<link>http://www.rchu.nl/2009/09/pdo-configuring-apache-mysql-and-php-on-osx-10-5-7/</link>
		<comments>http://www.rchu.nl/2009/09/pdo-configuring-apache-mysql-and-php-on-osx-10-5-7/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 11:00:51 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=376</guid>
		<description><![CDATA[I&#8217;d like to use PDO in conjunction with MySQL, but in the PHP installation shipped with OS X by default only pdo_sqlite is enabled. I do not want to compile my own Apache or PHP so the way to go is to simply add the pdo_mysql module. I followed these instructions but after running phpize [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to use PDO in conjunction with MySQL, but in the PHP installation shipped with OS X by default only pdo_sqlite is enabled. I do not want to compile my own Apache or PHP so the way to go is to simply add the pdo_mysql module. I followed <a href="http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/">these</a> instructions but after running phpize there were some warings on my screen and no makefile to be found. My current PHP version is 5.2.8 and I used the source of 5.3.0, so I tried again with 5.2.10 (since no other version was available at the <a href="http://www.php.net/downloads.php">PHP download page</a>). Both yield the same result, namely that it compiles, installs and won&#8217;t start.</p>
<p><code> PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0</code></p>
<p>Following instructions in the comment to remove all architectures but the x86_64 have no effect. I think I have to compile my own PHP installation and have apache use that. Which sucks so much I decided to just wait for Snow Leopard and pray that either pdo_mysql is installed or dynamicly loading libraries is allowed there. I am happy to inform you all that the first is the case. Hurray!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/09/pdo-configuring-apache-mysql-and-php-on-osx-10-5-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard</title>
		<link>http://www.rchu.nl/2009/09/snow-leopard/</link>
		<comments>http://www.rchu.nl/2009/09/snow-leopard/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 07:14:32 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=385</guid>
		<description><![CDATA[Once again I&#8217;ve installed some new OS and write a small post about it. This time it&#8217;s all about Snow Leopard and as usual this is probably more interesting for myself as a checklist sort of thing than for the world to read. It gives more order and satisfaction in the long proces of installing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rchu.nl/wordpress/wp-content/uploads/snow-leopard.jpg"><img class="alignright size-medium wp-image-531" title="Snow Leopard" src="http://www.rchu.nl/wordpress/wp-content/uploads/snow-leopard-300x187.jpg" alt="Snow Leopard" width="300" height="187" /></a>Once again I&#8217;ve installed some new OS and write a small post about it. This time it&#8217;s all about Snow Leopard and as usual this is probably more interesting for myself as a checklist sort of thing than for the world to read. It gives more order and satisfaction in the long proces of installing and customisation and it functions as a central storage for all cool applications, tweaks and scripts that I install and create to make OS X function just the way I like it.</p>
<p><span id="more-385"></span></p>
<h2>Installation</h2>
<p>I&#8217;ve decided not to upgrade my existing installation of Leopard but to go for a fresh clean installation. Leopard was my first OS X installation and I&#8217;ve done quite some installating, customization and so forth and it sounded like a good idea to just start fresh. I remember reading something about a clean install option, but the installer just asks me for the location, gives me some options what to install and starts right away. I had to abort, reboot, and then used the disk utility on the installer DVD to first format my hard drive. Installation went smooth from that point on.</p>
<p>First impressions are as expected, it works smooth. I am surprised about the time it takes to wake from sleep, almost instantly, but that can also be because this installation is fresh and I was used to my old cluttered Leopard.</p>
<h2>Afterwards</h2>
<p>Time to install some.</p>
<ul>
<li>Firefox 3.5</li>
<li>Growl 1.2b4, the latest beta of 1.2 because 1.1 is uncompatible with snow leopard. It seems to work fine, as does the HardwareGrowler.</li>
<li>Perian 1.1.4</li>
<li>Spark 3.0b9 for global hotkeys</li>
<li>iWork &#8216;09 en iLife &#8216;09</li>
<li>Software updates (10.6.1)</li>
<li>Textmate</li>
<li>Latest flash version since <a href="http://www.macrumors.com/2009/09/03/snow-leopard-installation-downgrades-flash-player-to-vulnerable-version/">Snow Leopard ships with an unsafe one.</a></li>
<li>MacTex</li>
</ul>
<p>And to tweak some.</p>
<ul>
<li>Copied my old <code>~/Music</code> directory, iTunes starts with my good old library. Hurray</li>
<li>Copied my old <code>~/Photos</code> directory, iPhoto cannot open (made with a newer version). Running another software update was the key to success.</li>
<li>The first sync with my iPhone authorizes my computer with the iTunes store and gives me all my contacts back. Nice!</li>
<li>Uncomment the line <code>LoadModule php5_module        libexec/apache2/libphp5.so</code> in <code>/etc/apache2/httpd.conf</code> to enable php5. Fortunately for me, snow leopard provides me with <code>pdo_mysql</code> which Leopard did not (and it wasn&#8217;t possible to just add that module).</li>
</ul>
<p>And to get stuck at some.</p>
<ul>
<li>System clock, going to <em>System preferences &gt; International &gt; Formats &gt; Times (customize button)</em> and changing the medium format doesn&#8217;t work anymore :(</li>
</ul>
<p>My ToDo list also has some.</p>
<ul>
<li>mail multicolumn</li>
<li>mail imap subfolder check</li>
<li>spark firewall status scripts</li>
<li>adium</li>
</ul>
<h2>More Tweaks</h2>
<h3>Firewall scripts</h3>
<p>I take my laptop everywhere so I want to keep the built-in firewall fully closed at all times. I do, however, sometimes take it down if some sharing/program/game doesn&#8217;t work, and I almost always forget to enable it again afterewards. Thats what the following script is for. I use the cron daemon to run it every 5 minutes and it checks the firewall status and gives me a growl notification if it&#8217;s disabled.</p>
<pre class="brush: bash;">
#!/bin/sh
if [ `defaults read /Library/Preferences/com.apple.alf globalstate` -eq &amp;quot;0&amp;quot; ]; then
  echo Firewall is currently disabled | /usr/local/bin/growlnotify -a /Applications/System\ Preferences.app -t Warning;
fi
</pre>
<p>I also added an applescript to a global hotkey in Spark to change the firewall status. It checks the status, displays it with the options to change it with a timeout of 5 seconds.</p>
<pre class="brush: applescript;">
# brings the dialog window to front
delay 1
tell me to activate

set fw_status to (do shell script &amp;quot;defaults read /Library/Preferences/com.apple.alf globalstate&amp;quot;)

if fw_status is equal to &amp;quot;2&amp;quot; then
  set dlg_result to display dialog &amp;quot;Allow only essential services&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;All&amp;quot;, &amp;quot;Specific&amp;quot;, &amp;quot;Essential&amp;quot;} default button 3 cancel button 3 with icon note giving up after 10
  set res to button returned of dlg_result
else if fw_status is equal to &amp;quot;1&amp;quot; then
  set dlg_result to display dialog &amp;quot;Set access for specific services&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;All&amp;quot;, &amp;quot;Specific&amp;quot;, &amp;quot;Essential&amp;quot;} default button 2 cancel button 2 with icon caution giving up after 10
  set res to button returned of dlg_result
else if fw_status is equal to &amp;quot;0&amp;quot; then
  set dlg_result to display dialog &amp;quot;Allow all incomming connections&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;All&amp;quot;, &amp;quot;Specific&amp;quot;, &amp;quot;Essential&amp;quot;} default button 1 cancel button 1 with icon stop giving up after 10
  set res to button returned of dlg_result
end if

if res is equal to &amp;quot;All&amp;quot; then
  do shell script &amp;quot;defaults write /Library/Preferences/com.apple.alf globalstate 0&amp;quot;
  display dialog &amp;quot;Set to 'Allow all incomming connections'&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;OK&amp;quot;} default button 1
else if res is equal to &amp;quot;Specific&amp;quot; then
  do shell script &amp;quot;defaults write /Library/Preferences/com.apple.alf globalstate 1&amp;quot;
  display dialog &amp;quot;Set to 'Set access for specific services'&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;OK&amp;quot;} default button 1
else if res is equal to &amp;quot;Essential&amp;quot; then
  do shell script &amp;quot;defaults write /Library/Preferences/com.apple.alf globalstate 2&amp;quot;
  display dialog &amp;quot;Set to 'Allow only essential services'&amp;quot; with title &amp;quot;Firewall Status&amp;quot; buttons {&amp;quot;OK&amp;quot;} default button 1
end if
</pre>
<p>And now I can easily change the status of my firewall</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/09/snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What is up with Bing?</title>
		<link>http://www.rchu.nl/2009/09/what-is-up-with-bing/</link>
		<comments>http://www.rchu.nl/2009/09/what-is-up-with-bing/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 12:58:43 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=380</guid>
		<description><![CDATA[I only just learned about Bing, watched a screencast and played around with it. I was hoping to be impressed by the nifty features demonstrated in the screencast, but everything I enter in Bing just gives me a plain old search result. I even read the help documents and entered the examples they gave, but [...]]]></description>
			<content:encoded><![CDATA[<p>I only just learned about <a href="http://www.bing.com/">Bing</a>, watched a <a href="http://d7.allthingsd.com/20090528/d7-video-steve-ballmer-introduces-bing/">screencast</a> and played around with it. I was hoping to be impressed by the nifty features demonstrated in the screencast, but everything I enter in Bing just gives me a plain old search result. I even read the <a href="http://help.live.com/help.aspx?project=wl_searchv1&amp;market=nl-NL&amp;querytype=keyword&amp;query=hcraesbew&amp;domain=www.bing.com:80#toc">help documents</a> and entered the examples they gave, but none of those examples gave any special result.</p>
<p>So I am puzzled. Why would Microsoft launch a new product, show off its great features and then put a website live that doesn&#8217;t do any of the promised features? Looks to me like they have just doomed Bing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/09/what-is-up-with-bing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lekker plat</title>
		<link>http://www.rchu.nl/2009/06/lekker-plat/</link>
		<comments>http://www.rchu.nl/2009/06/lekker-plat/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 08:31:52 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=348</guid>
		<description><![CDATA[
Sommige dingen zijn dusdanig banaal dat een genie ze echt niet meer aan kan.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="iTunes Genius - Dikke lul drie bier" href="http://www.rchu.nl/wordpress/wp-content/uploads/photo.jpg"><img class="size-medium wp-image-349 aligncenter" title="iTunes Genius - Dikke lul drie bier" src="http://www.rchu.nl/wordpress/wp-content/uploads/photo-200x300.jpg" alt="iTunes Genius - Dikke lul drie bier" width="200" height="300" /></a></p>
<p style="text-align: center;">Sommige dingen zijn dusdanig banaal dat een genie ze echt niet meer aan kan.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/06/lekker-plat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeekTool</title>
		<link>http://www.rchu.nl/2009/06/geektool/</link>
		<comments>http://www.rchu.nl/2009/06/geektool/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:59:00 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=306</guid>
		<description><![CDATA[The past couple of days I&#8217;ve been playing around with GeekTool a nifty litlle application that can show text files, unix commands output (including scripts), or images (local and from the internet) on your desktop.  There are many sites with examples out there which inspired me to create a GeekTool setup of my own.
I started [...]]]></description>
			<content:encoded><![CDATA[<p><a title="My GeekTool powered desktop" href="http://www.rchu.nl/wordpress/wp-content/uploads/picture-3.png"><img class="size-medium wp-image-337 alignright" title="GeekTool Desktop" src="http://www.rchu.nl/wordpress/wp-content/uploads/picture-3-300x187.png" alt="GeekTool Desktop" width="300" height="187" /></a>The past couple of days I&#8217;ve been playing around with <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> a nifty litlle application that can show text files, unix commands output (including scripts), or images (local and from the internet) on your desktop.  There are many <a href="http://www.paulpeelen.com/2009/05/27/geektools-desktop-enhancing/">sites</a> <a href="http://www.macosxhints.com/article.php?story=20090326125916351">with</a> <a href="http://www.keynote2keynote.com/2007/04/10/ultimate-geektool-setup-pimp-your-desktop-part-2/">examples</a> out there which inspired me to create a GeekTool setup of my own.</p>
<p>I started playing around with several scripts and GeekTool because it looked cool at first and it was fun to do some shell scripting. As the amount of information displayed on my desktop grew I started wondering why I was creating a lot of small processes taking up a little CPU time. I hardly ever look at my desktop because of all the windows in front of it. But the stats now on my desktop are easily accesable with one key (F11), and some starts are already displayed in either the menu bar or my <a href="http://www.islayer.com/apps/istatpro/">iStat Pro</a> widget. Removing it there gives me more room in the menu bar (which is starting grow full of icons) and saves some resources used by the widget.</p>
<p>Now I shall explain the GeekTool entries I created more detailed.</p>
<p><span id="more-306"></span></p>
<h2>Battery</h2>
<p>You can get a lot of information about your battery with the <code>ioreg</code> command. I found a <a href="http://www.mitt-eget.com/software/macosx/">battery status script </a>which doesn&#8217;t work on leopard but with plenty of comment in the code to use it as a reference for the output of <code>ioreg</code> and write a little script of my own which prints the status, charge and time remaining. The code should be pretty self-explanatory.</p>
<pre class="brush: bash;">
#! /bin/sh
#
# Battery status script, writen by Ronald Chu for GeekTool usage. Free to
# use as you please.
#
# Prints the current charge, time remaining on battery power or the AC
# power status

# Create an array (Capacity, Voltage, Flags, Current, Amperage, Cycle Count)
# in 10.6 the order has changed to (Amperage, Flags, Capacity, Current, Voltage, Cycle Count) so we need to re-order
if [ -n '`sw_vers |grep ProductVersion:.10.6`' ]; then
  status=(`ioreg -w0 -l|grep LegacyBatteryInfo|sed -e 's/[^1234567890]/ /g'|awk '{print $3&quot; &quot;$5&quot; &quot;$2&quot; &quot;$4&quot; &quot;$1&quot; &quot;$6}'`)
else
  status=(`ioreg -w0 -l|grep LegacyBatteryInfo|sed -e 's/[^1234567890]/ /g'`)# Fix Amperage (convert large number to negative one)
  status[4]=$(expr ${status[4]} + 0)
fi

# if charger connected
if [ $((${status[2]} &amp; 1)) == 1 ]; then
  #if battery is charging
  if [ $((${status[2]} &amp; 2)) == 2 ]; then

    # Calculate minutes until  fullycharged
    if [ ${status[4]} -lt 0 ]; then
      mins=''
    else
      mins=`echo &quot;(${status[0]}-${status[3]})*60/${status[4]}&quot;|bc`
      if [ $mins -gt 59 ]; then
        mins=`printf &quot;, %d:%02d until full&quot; $(( mins / 60 )) $(( mins % 60 ))`
      else
        mins=`printf &quot;, 0:%02d until full&quot; $mins`
      fi
    fi
    echo `echo &quot;${status[3]}*100/${status[0]}&quot;|bc`&quot;% (charging$mins)&quot;
  else
    perc=`echo &quot;${status[3]}*100/${status[0]}&quot;|bc`
    if [ $prec -lt 100 ]; then
      echo &quot;$perc% (not charging)&quot;
    else
      echo &quot;100% (charged)&quot;
    fi
  fi

# if charger not connected
else
  # Calculate minutes until empty
  if [ ${status[4]} -ge 0 ]; then
    mins=''
  else
    mins=`echo &quot;- ${status[3]}*60/${status[4]}&quot;|bc`
    if [ $mins -gt 59 ]; then
      mins=`printf &quot;(%d:%02d remaining)&quot; $(( mins / 60 )) $(( mins % 60 ))`
    else
      mins=`printf (0:%02d remaining)&quot; $mins`
    fi
  fi

  echo `echo &quot;${status[3]}*100/${status[0]}&quot;|bc`&quot;%$mins&quot;
fi
</pre>
<h2>Hard disk</h2>
<p>I only care about the free space on my main hard disk and not at all in what other drives, shares, disk images and so forth are mounted. So I filter and reformat output of <code>df</code> to show just that.</p>
<pre class="brush: bash;">df -h | grep 'disk0s2' | awk '{print $4&quot; free (&quot;$5&quot; of &quot;$2&quot; used)&quot;}'</pre>
<h2>Memory</h2>
<p>Calling <code>top</code> and extracting the memory usage is pretty simple. I am planning to extract much more information from top (like the load en processes using the most CPU time) later.</p>
<pre class="brush: bash;">top -l 1 | awk '/PhysMem/ {print $8 &quot; used, &quot; $10 &quot; free&quot;}'</pre>
<h2>Network</h2>
<p>I&#8217;ve written a bash script that takes the name of a network interface as a parameter and returns its status, IP address, the SSID if it is an airport connection and last but not least the amount of data sent and recieved. The comment in the code should explain everything.</p>
<pre class="brush: bash;">
#! /bin/sh
#
# Network status script, writen by Ronald Chu for GeekTool usage. Free to
# use as you please.
#
# Prints status, ip, trafic and (if aplicable) SSID name of the airport and
# ethernet connection. Network IO is stored with timestamp in milliseconds
# in a text file so with the difference in time and bytes the IO in bytes
# per second can be calculated.

workdir=&quot;/Users/ronaldchu/Applications/Scripts/GeekTool/&quot;

# parameter is a number of bytes * 100 (for float precision)
function formatBytes()
{
  if [ $1 -lt 102400 ]; then echo `echo &quot;scale=2; $1/100&quot;|bc` b; else
    if [ $1 -lt 104857600 ]; then echo `echo &quot;scale=2; $1/102400&quot;|bc` Kb; else
      echo `echo &quot;scale=2; $1/104857600&quot;|bc` Mb;
    fi
  fi
}

# The script takes the name of the interface as a parameter
if [ $# -lt 1 ]; then
  echo &quot;Parameter missing&quot;
  exit 1
fi

# Check if interface exists
ifconfig $1 &gt; /dev/null 2&gt;&amp;1
if [ $? -ne 0 ]; then
  echo &quot;Interface \&quot;$1\&quot; does not exist&quot;
  exit 2
fi

#Extract ip adress
ip=`ifconfig $1 | grep &quot;inet &quot; | grep -v 127.0.0.1 | awk '{print $2}'`

if [ $ip ]; then

  # Make IO info string &quot;
  IO_now=&quot;`${workdir}milliseconds` `netstat -ib | grep -e &quot;$1&quot; -m 1 | awk '{print $7&quot; &quot;$10}'`&quot;

  # If there is an old IO info file
  if [ -f &quot;${workdir}NetworkStatus_$1_IO.txt&quot; ]; then
    IO_old=`cat ${workdir}NetworkStatus_${1}_IO.txt`

  # else create one and sleep for a second
  else
    echo $IO_now &gt; ${workdir}NetworkStatus_${1}_IO.txt
    IO_old=$IO_now
    sleep 1
    IO_now=&quot;`${workdir}milliseconds` `netstat -ib | grep -e &quot;$1&quot; -m 1 | awk '{print $7&quot; &quot;$10}'`&quot;
  fi

  #calculate IO trafic in Kb/s
  IO_in=`echo $IO_old $IO_now|awk '{print &quot;scale=0; (100*(&quot;$5&quot;-&quot;$2&quot;))/(&quot;$4&quot;-&quot;$1&quot;)&quot;}'|bc`
  IO_out=`echo $IO_old $IO_now|awk '{print &quot;scale=0; (100*(&quot;$6&quot;-&quot;$3&quot;))/(&quot;$4&quot;-&quot;$1&quot;)&quot;}'|bc`

  # Write current IO info
  echo $IO_now &gt; ${workdir}NetworkStatus_${1}_IO.txt

  # Echo network status (with SSID iff the network interface is the airport)
  if [ $1 == &quot;en1&quot; ]; then
    SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I|grep '[^B]SSID' |sed -e 's/^[^:]*: //'`
    echo &quot;$ip ($SSID) `formatBytes $IO_in`/s down `formatBytes $IO_out`/s up&quot;
  else
    echo &quot;$ip `formatBytes $IO_in`/s down `formatBytes $IO_out`/s up&quot;
  fi

else
  echo &quot;Disconnected&quot;
fi
</pre>
<p>To obtain the timestamp for the network data readings using <code>date</code> isn&#8217;t accurate enough, so I use the following little C program to get a more accurate timestamp.</p>
<pre class="brush: cpp;">
#include &lt;stdlib.h&gt;
#include &lt;sys/time.h&gt;

main()
{
  struct timeval tv;
  gettimeofday(&amp;tv, NULL);
  printf(&quot;%d.%d\n&quot;, tv.tv_sec, tv.tv_usec);
}
</pre>
<h2>Twitter</h2>
<p>What else can I do? Well, whenever you want add something fancy you can always do something with Twitter! It makes you modern and Web 2.0, and stuff like that. Also it was extremely easy to add the latest tweets from my friends to my desktop with only one single command.</p>
<pre class="brush: bash;">
curl -u username:password http://twitter.com/statuses/friends_timeline.rss?count=20| \
grep title|\
tail -n 20 |\
sed -e 's/.*\(.*\)&lt;\/title&gt;/\1/'
</pre>
<h2>iTunes</h2>
<p>For information on the track currently playing in iTunes I&#8217;ve combined several scripts and ideas from others and myself to create an applescript which extracts the album art and returns the artist, title and album of the current song. Add another entry in GeekTool to show the image, which is a PNG file in a fixed location. In my case, this is located at <code>file:///Users/ronaldchu/artwork.png</code></p>
<pre class="brush: applescript;">
# iTunesCurrentSong.scpt
#
# An applescript which returns the title, artist, album and player
# status of iTunes and writes the current album art (or blank if
# iTunes not running, or a default image if no art available) to a
# png file
#
# Network status script, writen by Ronald Chu for GeekTool usage. Free to
# use as you please.

# folders specs
set artworkFolder to ((path to home folder) as text) &amp; &quot;Applications:Scripts:GeekTool:&quot;
set artworkFile to artworkFolder &amp; &quot;artwork.png&quot;
set artworkiTunes to artworkFolder &amp; &quot;artwork.pict&quot;
set artworkBlank to artworkFolder &amp; &quot;blank.png&quot;
set artworkDefault to artworkFolder &amp; &quot;default.png&quot;
set unixArtworkFile to the quoted form of POSIX path of artworkFile
set unixArtworkiTunes to the quoted form of POSIX path of artworkiTunes
set unixArtworkBlank to the quoted form of POSIX path of artworkBlank
set unixArtworkDefault to the quoted form of POSIX path of artworkDefault

# Check if iTunes is running
tell application &quot;System Events&quot;
	set powerCheck to ((application processes whose (name is equal to &quot;iTunes&quot;)) count)
	if powerCheck = 0 then
		# If there's no iTunes running use the Blank Arwork
		do shell script &quot;cp &quot; &amp; unixArtworkBlank &amp; &quot; &quot; &amp; unixArtworkFile
		return &quot;&quot;
	end if
end tell

tell application &quot;iTunes&quot;

	# Get current track name and status
	try
		set playerstate to (get player state)
	end try
	if playerstate = paused then
		set trackPaused to &quot;
&quot;
	else
		set trackPaused to &quot;&quot;
	end if
	if playerstate = stopped then
		# If there's iTunes use the default Arwork.
		do shell script &quot;cp &quot; &amp; unixArtworkDefault &amp; &quot; &quot; &amp; unixArtworkFile
		return &quot;

&quot;
	end if

	set trackID to the current track
	set trackName to the name of trackID
	set artistName to the artist of trackID
	set albumName to the album of trackID

	(* Is there any Artwork? *)
	if (count of artwork of trackID) ≥ 1 then
		set artworkData to data of artwork 1 of trackID
		set fileRef to (open for access artworkiTunes with write permission)
		try
			set eof fileRef to 512
			write artworkData to fileRef starting at 513
			close access fileRef
		on error errorMsg
			try
				close access fileRef
			end try
			error errorMsg
		end try

		tell application &quot;Image Events&quot;
			launch
			set theimg to open artworkiTunes
			scale theimg to size 100
			save theimg as PNG in artworkFile with replacing
			close
		end tell

	else
		(* If there's no Artwork use the default artwork. *)
		do shell script &quot;cp &quot; &amp; unixArtworkDefault &amp; &quot; &quot; &amp; unixArtworkFile
	end if

	return trackPaused &amp; &quot;
&quot; &amp; artistName &amp; &quot;
&quot; &amp; trackName &amp; &quot;
&quot; &amp; albumName
end tell
</pre>
<p>For some reason the code contains html code for special character like &lt; and &amp;. I&#8217;ll look into this later, for now you just have to change that when copying the code. Also I&#8217;m having lot&#8217;s of difficulty with getting syntax highlighting working right, damnit&#8230;</p>
<p><em><strong>Update 07/06/09:</strong> Changed the battery script so it will show &#8220;100% (charged)&#8221; instead of &#8220;100% (not charging)&#8221;.</em></p>
<p><em><strong>Update 23/06/09:</strong> Please leave a comment if you like my scripts, or if you don&#8217;t. I&#8217;d love to get some feedback and know how many of the visitors google analytics reports to me are actualy using the scripts</em></p>
<p><em><strong>Update 24/08/09:</strong> Updated the battery script, changed &gt; to -gt to actualy do a greater-than comparisation instead of dumping into a file called 59.</em></p>
<p><em><strong>Update 27/11/09: </strong>Added a version check to the BatteryStatus script because the order of the battery info has changed since 10.6<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/06/geektool/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Errors</title>
		<link>http://www.rchu.nl/2009/06/errors/</link>
		<comments>http://www.rchu.nl/2009/06/errors/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 07:36:08 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=295</guid>
		<description><![CDATA[
Some error messages just do not display the way the developers intended them to.

And sometimes being right is wrong after all.
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-296" title="Marbleblast Error" src="http://www.rchu.nl/wordpress/wp-content/uploads/picture-11.png" alt="Marbleblast Error" width="466" height="234" /><br />
Some error messages just do not display the way the developers intended them to.</p>
<p><img class="alignnone size-full wp-image-297" title="Twitterfon - not an error" src="http://www.rchu.nl/wordpress/wp-content/uploads/picture-2.png" alt="Twitterfon - not an error" width="313" height="170" /><br />
And sometimes being right is wrong after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/06/errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The day the Apples fell from the tree</title>
		<link>http://www.rchu.nl/2009/05/the-day-the-apples-fell-from-the-tree/</link>
		<comments>http://www.rchu.nl/2009/05/the-day-the-apples-fell-from-the-tree/#comments</comments>
		<pubDate>Sun, 17 May 2009 21:42:47 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=293</guid>
		<description><![CDATA[I&#8217;m no fanboy per se, I just happen to like my MacBook and iPhone a lot. But not today, as today the battery of my MB broke down and my phone just crashed while making a photo. Also while rebooting I held both keys down to power down the thing which it didn&#8217;t respond to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m no fanboy per se, I just happen to like my MacBook and iPhone a lot. But not today, as today the battery of my MB broke down and my phone just crashed while making a photo. Also while rebooting I held both keys down to power down the thing which it didn&#8217;t respond to until after booting up and showing my background and asking for my passcode just for a second. Of course the timing could also just be a coincidence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/05/the-day-the-apples-fell-from-the-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mosh pit</title>
		<link>http://www.rchu.nl/2009/05/mosh-pit/</link>
		<comments>http://www.rchu.nl/2009/05/mosh-pit/#comments</comments>
		<pubDate>Wed, 06 May 2009 08:31:07 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[wheelchair]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=272</guid>
		<description><![CDATA[The fifth of May is liberation day in the Netherlands. I realy like the liberation festivals because there is always a realy unique atmosphere, a bit more relaxed and friendly than other festivals because everybody is celebrating their freedom. Perhaps this is only the case because I am celebrating my freedom and thus experience the [...]]]></description>
			<content:encoded><![CDATA[<p>The fifth of May is liberation day in the Netherlands. I realy like the liberation festivals because there is always a realy unique atmosphere, a bit more relaxed and friendly than other festivals because everybody is celebrating their freedom. Perhaps this is only the case because I am celebrating my freedom and thus experience the festival different, but that doesn&#8217;t realy matter to me. I had a great time <a href="http://en.wikipedia.org/wiki/Moshing">moshing</a> around at <a href="http://www.heideroosjes.com/">de Heideroosjes</a> concert, but when the band announched we were going to peform an old eighties tradition I realy had no chance to escape to the back (mostly because of all the people going to the front) and was literaly run over in the circle pit. Great fun for me, I just hope nobody got hurt whilst marching over my hard metal wheelchair :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/05/mosh-pit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
