<?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!</title>
	<atom:link href="http://www.rchu.nl/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>Fri, 05 Feb 2010 14:12:48 +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>The mystery of the blue light</title>
		<link>http://www.rchu.nl/2010/02/the-mystery-of-the-blue-light/</link>
		<comments>http://www.rchu.nl/2010/02/the-mystery-of-the-blue-light/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 14:12:48 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[LJ Crosspost]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=422</guid>
		<description><![CDATA[A couple of months ago I purchased a router/wifi accesspoint which has been running smoothly, as expected, until a few weeks ago. After I installed an extra electrical outlet and some cable channels for the power and ethernet cables it suddenly stopped working. After a frustrating evening where I at first thought I damaged some [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rchu.nl/wordpress/wp-content/uploads/DLink-DIR-615.JPG"><img class="alignright size-medium wp-image-423" title="D-Link DIR-615" src="http://www.rchu.nl/wordpress/wp-content/uploads/DLink-DIR-615-300x299.jpg" alt="D-Link DIR-615" width="300" height="299" /></a>A couple of months ago I purchased a router/wifi accesspoint which has been running smoothly, as expected, until a few weeks ago. After I installed an extra electrical outlet and some cable channels for the power and ethernet cables it suddenly stopped working. After a frustrating evening where I at first thought I damaged some of the cables I got it working again. Until yesterday.</p>
<p>This time the diagnoses was simple. I couldn&#8217;t figure out how to fix it and the D-Link support desk (which was very easy to reach and provided excellent service, to my surprise) told me it was broken and I should return it to the shop where I bought it. Thats bad, but not at all difficult or complicated. After all, it&#8217;s just the wifi accesspoint that is broken so we can still hook up to the internet with the ethernet cables we have in most rooms (I installed those for gigabit access to the local fileserver).</p>
<p><a href="http://www.rchu.nl/wordpress/wp-content/uploads/DLink-DIR-615-WPA-Button.JPG"><img class="alignleft size-thumbnail wp-image-424" style="margin: 6px;" title="DLink DIR-615 WPA Button" src="http://www.rchu.nl/wordpress/wp-content/uploads/DLink-DIR-615-WPA-Button-150x150.jpg" alt="DLink DIR-615 WPA Button" width="150" height="150" /></a>So what about the mystery then? Well, there is a button on the side of the device which is not mentioned in the manual and when I press it it lights up in blue for a while. No idea what it does, so I just ignored it. Until today, because all the device does now is lighting up that blue button. No other lights, no other activity. A search on the internet for &#8220;dir 615 blue light&#8221; brought me to <a href="http://www.dslreports.com/forum/r19642027-DIR615-Button-on-right-side-Flashes-Blue">some</a> <a href="http://forum.notebookreview.com/showthread.php?t=235529">forums</a> where I learned that it was for <a href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Setup">WPS</a> and that it is mentioned once in version 2.20 of the manual. Well then, another mystery solved.</p>
<p>Overall I was impressed with the support desk. There were no wainting lines, they promised to call me back and did withing a few hours, and, as opposed to the technical support mentioned on this forum the technical guy I got on the phone was fully capable to explain to me what this button was for. More points scored for D-Link&#8217;s support desk in the Netherlands.</p>]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2010/02/the-mystery-of-the-blue-light/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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[General]]></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>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>
<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 <acronym title="Universal Serial Bus">USB</acronym>/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 <acronym title="Pre-Hypertext Processing">PHP</acronym> installation shipped with <acronym title="Operating System">OS</acronym> X by default only pdo_sqlite is enabled. I do not want to compile my own Apache or <acronym title="Pre-Hypertext Processing">PHP</acronym> 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 <acronym title="Pre-Hypertext Processing">PHP</acronym> 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"><acronym title="Pre-Hypertext Processing">PHP</acronym> download page</a>). Both yield the same result, namely that it compiles, installs and won&#8217;t start.</p>
<p><code> <acronym title="Pre-Hypertext Processing">PHP</acronym> Warning:  <acronym title="Pre-Hypertext Processing">PHP</acronym> 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 <acronym title="Pre-Hypertext Processing">PHP</acronym> 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>OS X, Apache and symbolic links</title>
		<link>http://www.rchu.nl/2009/09/os-x-apache-and-symbolic-links/</link>
		<comments>http://www.rchu.nl/2009/09/os-x-apache-and-symbolic-links/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 10:55:58 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=399</guid>
		<description><![CDATA[I use my laptop a lot for web developement, and for some projects I have more files than just the web documents that Apache needs to see. For those I have a directory in my ~/Documents with (amongst other things) a httpdocs directory. I&#8217;d like to just see that in my browser by creating a [...]]]></description>
			<content:encoded><![CDATA[<p>I use my laptop a lot for web developement, and for some projects I have more files than just the web documents that Apache needs to see. For those I have a directory in my ~/Documents with (amongst other things) a httpdocs directory. I&#8217;d like to just see that in my browser by creating a symbolic link in my ~/Sites directory. This proved to be somewhat difficult in <acronym title="Operating System">OS</acronym> X 10.5 and also in my fresh installation of 10.6.</p>
<h2>Creating a web symlink in 10.6</h2>
<h3>Configure Apache</h3>
<p>The installation of Apache that ships with <acronym title="Operating System">OS</acronym> X I use doesn&#8217;t allow symlinks by default, so I&#8217;ve added <code>Options +FollowSymLinks</code> in the Apache configuration. These are located in <code>/private/etc/apache2</code> and while you could enable this in <code>httpd.conf</code> I like to keep the system-wide configuration as clean as possible and edited the  (ronald is my username) instead. I&#8217;ve also added <code>AllowOverride All</code> there to be able to use <code>.htaccess</code> files, but thats another topic.</p>
<p>Restart Apache by disabling and enabling &#8220;Web Sharing&#8221; in the sharing preference pane</p>
<h3>Create a symlink</h3>
<p>That&#8217;s just a matter of executing<code> "ln -s ../Documents/website ." </code> in the <code>~/Sites</code> directory. Alas browsing to <code>http://localhost/~ronald/website</code> gives a 403 (forbidden) page. Inspecting the serverlog tells me that either apache is not allowed to follow symlinks (which it is) or the _www user hasn&#8217;t got enough rights to access <code>~/Documents/website</code>.</p>
<h3>It&#8217;s all about permissions</h3>
<p>Well, that&#8217;s just stupid because the directory is readable/executable for everyone. Changing my <code>~/Documents</code> folder to be world readable/executable did the trick. Apparently every directory in the path needs to be accessable. Damn me and my inferior UNIX permissions knowledge!</p>
<p>So it&#8217;s either making my entire Documents directory world readable, which I don&#8217;t really like, or adding the _www user and myself to some group and change ownership of my Documents directory to that group to make my entire Documents folder readable for myself and the _www user, which is slightly less bad. So chmodding everything except the directories linked for web access inside the Documents folder 700 seems the right way to go.</p>
<p>In 10.5 the holy grail was to mess around with the<a href="http://www.red-sweater.com/blog/427/out-of-my-access-control"> Access Control List</a> but that wasn&#8217;t needed in 10.6, so I suggest leaving that part alone.</p>]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/09/os-x-apache-and-symbolic-links/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.
Installation
I&#8217;ve decided not to upgrade my existing installation of Leopard but to go [...]]]></description>
			<content:encoded><![CDATA[<p>Once again I&#8217;ve installed some new <acronym title="Operating System">OS</acronym> 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.</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 <acronym title="Operating System">OS</acronym> 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 <acronym title="Digital Versatile Disc">DVD</acronym> 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>
<p><code>#!/bin/sh<br />
if [ `defaults read /Library/Preferences/com.apple.alf globalstate` -eq "0" ]; then<br />
echo Firewall is currently disabled | /usr/local/bin/growlnotify -a /Applications/System\ Preferences.app -t Warning;<br />
fi</code></p>
<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.<br />
<code># brings the dialog window to front<br />
delay 1<br />
tell me to activate<br />
# read status<br />
set fw_status to (do shell script "defaults read /Library/Preferences/com.apple.alf globalstate")<br />
# check status, show dialog<br />
if fw_status is equal to "2" then<br />
set dlg_result to display dialog "Allow only essential services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 3 cancel button 3 with icon note giving up after 10<br />
set res to button returned of dlg_result<br />
else if fw_status is equal to "1" then<br />
set dlg_result to display dialog "Set access for specific services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 2 cancel button 2 with icon caution giving up after 10<br />
set res to button returned of dlg_result<br />
else if fw_status is equal to "0" then<br />
set dlg_result to display dialog "Allow all incomming connections" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 1 cancel button 1 with icon stop giving up after 10<br />
set res to button returned of dlg_result<br />
end if<br />
# Check dialog result and set firewall accordingly<br />
if res is equal to "All" then<br />
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 0"<br />
display dialog "Set to 'Allow all incomming connections'" with title "Firewall Status" buttons {"OK"} default button 1<br />
else if res is equal to "Specific" then<br />
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 1"<br />
display dialog "Set to 'Set access for specific services'" with title "Firewall Status" buttons {"OK"} default button 1<br />
else if res is equal to "Essential" then<br />
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 2"<br />
display dialog "Set to 'Allow only essential services'" with title "Firewall Status" buttons {"OK"} default button 1<br />
end if</code></p>
<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[General]]></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[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>#! /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" "$5" "$2" "$4" "$1" "$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 "(${status[0]}-${status[3]})*60/${status[4]}"|bc`
            if [ $mins -gt 59 ]; then
                mins=`printf ", %d:%02d until full" $(( mins / 60 )) $(( mins % 60 ))`
            else
                mins=`printf ", 0:%02d until full" $mins`
            fi
        fi
        echo `echo "${status[3]}*100/${status[0]}"|bc`"% (charging$mins)"
    else
        perc=`echo "${status[3]}*100/${status[0]}"|bc`
        if [ $prec -lt 100 ]; then
            echo "$perc% (not charging)"
        else
            echo "100% (charged)"
        fi
    fi

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

    echo `echo "${status[3]}*100/${status[0]}"|bc`"%$mins"
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>df -h | grep 'disk0s2' | awk '{print $4" free ("$5" of "$2" used)"}'</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>top -l 1 | awk '/PhysMem/ {print $8 " used, " $10 " free"}'</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, <acronym title="Internet Protocol">IP</acronym> 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>#! /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="/Users/ronaldchu/Applications/Scripts/GeekTool/"

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

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

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

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

if [ $ip ]; then

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

    # If there is an old IO info file
    if [ -f "${workdir}NetworkStatus_$1_IO.txt" ]; 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="`${workdir}milliseconds` `netstat -ib | grep -e "$1" -m 1 | awk '{print $7" "$10}'`"
    fi

    #calculate IO trafic in Kb/s
    IO_in=`echo $IO_old $IO_now|awk '{print "scale=0; (100*("$5"-"$2"))/("$4"-"$1")"}'|bc`
    IO_out=`echo $IO_old $IO_now|awk '{print "scale=0; (100*("$6"-"$3"))/("$4"-"$1")"}'|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 == "en1" ]; then
        SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I|grep '[^B]SSID' |sed -e 's/^[^:]*: //'`
        echo "$ip ($SSID) `formatBytes $IO_in`/s down `formatBytes $IO_out`/s up"
    else
        echo "$ip `formatBytes $IO_in`/s down `formatBytes $IO_out`/s up"
    fi

else
    echo "Disconnected"
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>#include
#include
main()
{
    struct timeval tv;
    gettimeofday(&amp;tv, NULL);
    printf("%d.%d\n", 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>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 <acronym title="Portable Network Graphics">PNG</acronym> file in a fixed location. In my case, this is located at <code>file:///Users/ronaldchu/artwork.png</code></p>
<pre># 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; "Applications:Scripts:GeekTool:"
set artworkFile to artworkFolder &amp; "artwork.png"
set artworkiTunes to artworkFolder &amp; "artwork.pict"
set artworkBlank to artworkFolder &amp; "blank.png"
set artworkDefault to artworkFolder &amp; "default.png"
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 "System Events"
	set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
	if powerCheck = 0 then
		# If there's no iTunes running use the Blank Arwork
		do shell script "cp " &amp; unixArtworkBlank &amp; " " &amp; unixArtworkFile
		return ""
	end if
end tell

tell application "iTunes"

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

"
	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 "Image Events"
			launch
			set theimg to open artworkiTunes
			scale theimg to size 100
			save theimg as <acronym title="Portable Network Graphics">PNG</acronym> in artworkFile with replacing
			close
		end tell

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

	return trackPaused &amp; "
" &amp; artistName &amp; "
" &amp; trackName &amp; "
" &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>NetNewsWire</title>
		<link>http://www.rchu.nl/2009/06/netnewswire/</link>
		<comments>http://www.rchu.nl/2009/06/netnewswire/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 23:07:12 +0000</pubDate>
		<dc:creator>ronald</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[LJ Crosspost]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.rchu.nl/?p=288</guid>
		<description><![CDATA[There are a lot of RSS readers out there, but since I have little requirements I just stick with reading my RSS feeds in Apple Mail. A few weeks ago the products of Newsgator got my attention.
The application for the Mac looks pretty standard. Multiple feeds organisable in folders, three panes, the usual. The two [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.newsgator.com/individuals/"><img class="alignright size-full wp-image-289" style="border: 1px solid black;" title="NewsGator Logo" src="http://www.rchu.nl/wordpress/wp-content/uploads/picture-1.png" alt="NewsGator Logo" width="289" height="176" /></a>There are a lot of <acronym title="Really Simple Syndication">RSS</acronym> readers out there, but since I have little requirements I just stick with reading my <acronym title="Really Simple Syndication">RSS</acronym> feeds in Apple Mail. A few weeks ago the products of <a href="http://www.newsgator.com/individuals/">Newsgator</a> got my attention.</p>
<p>The application for the Mac looks pretty standard. Multiple feeds organisable in folders, three panes, the usual. The two things I like a lot after using it for a few weeks are the a build-in browser so you don&#8217;t have to switch back and forth between your browser and news reader and the support for <a href="http://en.wikipedia.org/wiki/Digest_access_authentication"><acronym title="HyperText Transfer Protocol">HTTP</acronym> digest authentication</a> which is used by <a href="http://www.livejournal.com/">Livejournal</a> to gain access to the <a href="http://www.livejournal.com/support/faqbrowse.bml?faqid=149">feeds of livejournals</a> including the protected posts (if your LJ account has access to those).</p>
<p>The iPhone application is okay, haven&#8217;t used it that much.</p>
<p>But the good part is, besides the fact that these are both free applications, that they sync with each other via a free account at newsgator, so when I read a post on my mac the same post isn&#8217;t marked as unread anymore on my iPhone and vica versa. They also provide a web-based RS reader when you login to Newsgator which is a nice extra which I probably won&#8217;t use. It only seems usefull when I have some time to kill somewhere when I&#8217;m around a computer with internet access and without both my laptop and phone. But it&#8217;s a nice extra.</p>]]></content:encoded>
			<wfw:commentRss>http://www.rchu.nl/2009/06/netnewswire/feed/</wfw:commentRss>
		<slash:comments>0</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>
	</channel>
</rss>
