<?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>Shizzle</title>
	<atom:link href="http://lenni.info/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://lenni.info/blog</link>
	<description>My little notebook</description>
	<lastBuildDate>Wed, 09 May 2012 16:46:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Installing Ruby 1.9.3 on Ubuntu 12.04 Precise Pengolin (without RVM)</title>
		<link>http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/</link>
		<comments>http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/#comments</comments>
		<pubDate>Wed, 02 May 2012 15:51:27 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=683</guid>
		<description><![CDATA[The new Ubuntu release has just rolled around and with it a slew of new packages. Personally, I&#8217;m tracking the development of Ruby quite closely but the default Ruby on Ubuntu ist still the 1.8 series which I can&#8217;t recommend. Ruby 1.9 has some performance improvements and 1.9.3 in particular a lot of them compared [...]]]></description>
			<content:encoded><![CDATA[<p>The new Ubuntu release has just rolled around and with it a slew of new packages. Personally, I&#8217;m tracking the development of Ruby quite closely but the default Ruby on Ubuntu ist still the 1.8 series which I can&#8217;t recommend. Ruby 1.9 has some performance improvements and 1.9.3 in particular a lot of them compared to 1.9.2.</p>
<p>However, as I have elaborated out in a <a title="Installing Ruby 1.9.2 on Ubuntu 11.10 Oneiric Ocelot without using RVM" href="http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/">previous post</a> getting the Ruby 1.9 series on Ubuntu without using RVM instead of 1.8 isn&#8217;t all that easy. Please read the post if you are interested in the details.</p>
<p>The short version is: You can get Ruby 1.9.3-p0 by installing the <code>ruby-1.9.1</code> package. (The package is called 1.9.1 because that is the ABI version.)</p>
<p>If you want to make Ruby 1.9 the default do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby1.9.1 ruby1.9.1-dev \
  rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
  build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--install</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby ruby <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby1.9.1 <span style="color: #000000;">400</span> \
         <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>ruby.1.gz ruby.1.gz \
                        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>ruby1.9.1.1.gz \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ri ri <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ri1.9.1 \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>irb irb <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>irb1.9.1 \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rdoc rdoc <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rdoc1.9.1
&nbsp;
<span style="color: #666666; font-style: italic;"># choose your interpreter</span>
<span style="color: #666666; font-style: italic;"># changes symlinks for /usr/bin/ruby , /usr/bin/gem</span>
<span style="color: #666666; font-style: italic;"># /usr/bin/irb, /usr/bin/ri and man (1) ruby</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> ruby
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> gem
&nbsp;
<span style="color: #666666; font-style: italic;"># now try</span>
ruby <span style="color: #660033;">--version</span></pre></div></div>

<p>If you want to make this your exclusive Ruby and get rid of Ruby 1.8 follow the <a title="Installing Ruby 1.9.2 on Ubuntu 11.10 Oneiric Ocelot without using RVM" href="http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/#uninstall">uninstallation instructions</a>.</p>
<p><strong>Edit</strong>: I found out today that there also is a package called <a href="http://packages.ubuntu.com/precise/ruby1.9.3">ruby1.9.3</a> however that is just a proxy package that doesn&#8217;t have any files itself and only depends on ruby1.9.1. Aptitude confirms this:</p>
<blockquote><p>Ruby uses two parallel versioning schemes: the `Ruby library compatibility version&#8217; (1.9.1 for this package), which is similar to a library SONAME, and the &#8216;Ruby version&#8217; (1.9.3 for this package). Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely. This package depends on the ruby1.9.1 package, and provides compatibility symbolic links from 1.9.3 executables and manual pages to their 1.9.1 counterparts.</p></blockquote>
<p>There doesn&#8217;t seem to be a rubygems1.9.3.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Backing up your Gmail account with on a Synology NAS using getmail</title>
		<link>http://lenni.info/blog/2012/04/backing-up-your-gmail-account-with-on-a-synology-nas-using-getmail/</link>
		<comments>http://lenni.info/blog/2012/04/backing-up-your-gmail-account-with-on-a-synology-nas-using-getmail/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 11:10:46 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[getmail]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[synology]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=646</guid>
		<description><![CDATA[Recently, I had a bit of a data loss scare where I couldn&#8217;t access my Google Account for a few hours. In the end it turned out to be a well-meaning Google protection mechanism that kicked in because I tried to access my account while on holiday on the Canary Islands. I have heard horror [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I had a bit of a data loss scare where I couldn&#8217;t access my Google Account for a few hours. In the end it turned out to be a well-meaning Google protection mechanism that kicked in because I tried to access my account while on holiday on the Canary Islands. I have heard horror stories of people loosing their email histories stored in Gmail and this little incident got me scared enough to investigate backing up my email history outside of Gmail.</p>
<p>I use a Synology NAS at home which has plenty of storage left to keep my roughly 2GB of email many times over. It has a variant of Linux installed and besides a nice web-based UI it has also the very handy ability to ssh into the box and install additional software through a package manager called ipkg.</p>
<h3>The setup</h3>
<p>Login to your NAS as root and install getmail with these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ipkg update
ipkg <span style="color: #c20cb9; font-weight: bold;">install</span> python
ipkg <span style="color: #c20cb9; font-weight: bold;">install</span> py25-getmail</pre></div></div>

<p>Now that your have the software in place pick a place where the email should be stored. I chose <code>/volume1/Gmail</code> but any folder that is accessible to your ordinary user will do. Still logged in as root issue these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>volume1<span style="color: #000000; font-weight: bold;">/</span>Gmail
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>volume1<span style="color: #000000; font-weight: bold;">/</span>Gmail
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> cur new tmp</pre></div></div>

<p>The last one is necessary for the storage format (Maildir) and getmail doesn&#8217;t create these folders itself. Maildir stores each email in a separate file on the disk. If you want another storage format, read the getmail documentation.</p>
<p>Then create a file called <code>/volume1/Gmail/getmailrc</code> with the following content, using your own username and password:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>retriever<span style="">&#93;</span></span>
<span style="color: #000099;">type</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> SimpleIMAPSSLRetriever</span>
<span style="color: #000099;">server</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> imap.gmail.com</span>
<span style="color: #000099;">mailboxes</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="">&#40;</span></span><span style="color: #933;">&quot;[Gmail]/All Mail&quot;</span>,<span style="">&#41;</span>
# if you have a German account, use <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Google Mail<span style="">&#93;</span></span> like this
# mailboxes <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="">&#40;</span></span><span style="color: #933;">&quot;[Google Mail]/All Mail&quot;</span>,<span style="">&#41;</span>
<span style="color: #000099;">username</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> USERNAME@gmail.com</span>
<span style="color: #000099;">password</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> USERPASS</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>destination<span style="">&#93;</span></span>
# save each email in a separate file
<span style="color: #000099;">type</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Maildir</span>
<span style="color: #000099;">path</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /volume1/Gmail/</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>options<span style="">&#93;</span></span>
<span style="color: #000099;">verbose</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 2</span>
<span style="color: #000099;">message_log</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /volume1/Gmail/log</span>
&nbsp;
# retrieve only new messages
# if set to true it will re-download ALL messages every time!
<span style="color: #000099;">read_all</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> false</span>
&nbsp;
# do not alter messages
<span style="color: #000099;">delivered_to</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> false</span>
<span style="color: #000099;">received</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> false</span></pre></div></div>

<p>Now everything is in place for getmail to do its work. Do a test run with the following command to test if it will run into any problems.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">getmail <span style="color: #660033;">--getmaildir</span>=<span style="color: #000000; font-weight: bold;">/</span>volume1<span style="color: #000000; font-weight: bold;">/</span>Gmail</pre></div></div>

<p>This will start downloading your messages but depending on the size of your email history will take up to a few hours. There is the distinct probability that your ssh connection will time out and drop due to your inactivity. That&#8217;s why I ran the first go with nohup so that me logging out wouldn&#8217;t stop the process.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nohup</span> getmail <span style="color: #660033;">-q</span> <span style="color: #660033;">--getmaildir</span>=<span style="color: #000000; font-weight: bold;">/</span>volume1<span style="color: #000000; font-weight: bold;">/</span>Gmail <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>volume1<span style="color: #000000; font-weight: bold;">/</span>Gmail<span style="color: #000000; font-weight: bold;">/</span>nohup.out</pre></div></div>

<h3>Cron</h3>
<p>Lastly, we obviously want to run getmail periodically and fetch the newest message so open up <code>/etc/crontab</code> with a text editor like vim (you probably need to install it with ipgk first) and add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span>       <span style="color: #000000;">3</span>       <span style="color: #000000; font-weight: bold;">*</span>       <span style="color: #000000; font-weight: bold;">*</span>       <span style="color: #000000;">3</span>       root    <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;/opt/bin/getmail -q --getmaildir=/volume1/Gmail&quot;</span> admin</pre></div></div>

<p>
(It is important so separate the individual parts of the crontab with a tab not a space as otherwise the Synology will delete your entry when you reboot.)
</p>
<p>
This will run getmail every Wednesday at 3AM when you&#8217;re sound asleep. The <code>/bin/su</code> complication is necessary because it appears that the Synology cron can&#8217;t run jobs as non-root.
</p>
<p>Also, on my Synology you have to restart the cron daemon for it to pick up the changes with a</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">synoservice <span style="color: #660033;">--restart</span> crond</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/04/backing-up-your-gmail-account-with-on-a-synology-nas-using-getmail/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Git releases RSS feed</title>
		<link>http://lenni.info/blog/2012/03/git-releases-rss-feed/</link>
		<comments>http://lenni.info/blog/2012/03/git-releases-rss-feed/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 18:13:35 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=634</guid>
		<description><![CDATA[I&#8217;ve been following the git releases quite closely lately but I haven&#8217;t been able to find a RSS feed for the release notes. To scratch this itch I have written a little Ruby script that scrapes the git homepage and puts the release notes in an RSS feed ready for consumption. If you want to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been following the git releases quite closely lately but I haven&#8217;t been able to find a RSS feed for the release notes. To scratch this itch I have written a <a title="Script on Github" href="https://github.com/lenniboy/git-releases-feed">little Ruby script</a> that scrapes the git homepage and puts the release notes in an RSS feed ready for consumption.</p>
<p>If you want to subscribe to the feed add this URL to your feed reader: <a href="http://lenni.info/git-releases.rss.xml">http://lenni.info/git-releases.rss.xml</a></p>
<p>The feed is updated every 8 hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/03/git-releases-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experiment: Does Googlebot index dynamic content from a JS app?</title>
		<link>http://lenni.info/blog/2012/03/experiment-does-googlebot-index-dynamic-content-from-a-js-app/</link>
		<comments>http://lenni.info/blog/2012/03/experiment-does-googlebot-index-dynamic-content-from-a-js-app/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 15:40:21 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[googlebot]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=610</guid>
		<description><![CDATA[I&#8217;ve started a new job and we are evaluating whether we would still like to use a server-side framework for HTML generation or whether we should go for a client-side DOM manipulation/JS-templates-only-approach where the browser calls into the API directly. One of the drawbacks of the latter is that the conventional wisdom not so long [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started a new job and we are evaluating whether we would still like to use a server-side framework for HTML generation or whether we should go for a client-side DOM manipulation/JS-templates-only-approach where the browser calls into the API directly.</p>
<p>One of the drawbacks of the latter is that the conventional wisdom not so long ago was that Googlebot would not execute any JavaScript and hence the content would be invisible to it. However, some people started to notice that Facebook comments, which are created dynamically on the fly by a JS widget, are being indexed by Google. This was confirmed by Matt Cutts in a <a title="Matt Cutts tweet about Googlebot and AJAX" href="https://twitter.com/#!/mattcutts/status/131425949597179904">tweet</a>. There is also an <a href="http://googlewebmastercentral.blogspot.com/2011/11/get-post-and-safely-surfacing-more-of.html">official blog post</a> by Google about this topic but both are pretty sparse on any details. There is a certain amount of <a href="http://news.ycombinator.com/item?id=3182579">speculation floating around</a> that Googlebot could in reality be some modified version of Chrome.</p>
<h3>The experiment</h3>
<p>Therefore I have decided to put up a <a href="http://lenni.info/backbone-googlebot-test/">small Backbone demo page</a> with the opening lines of  Richard III. &#8211; this is sure to be a pretty unique string that won&#8217;t show up anywhere else on my website. The actual content is being pulled in by an Ajax call and then inserted into the DOM. Using jQuery, underscore and Backbone is of course overkill for such a small site but I wanted to simulate realistic conditions.</p>
<p>I&#8217;m going to wait a few days and then update this blog post. In the meanwhile you can keep checking the <a href="https://www.google.com/search?q=site:lenni.info%20%22Now%20is%20the%20winter%20of%20our%20discontent%20Made%20glorious%20summer%20by%20this%20sun%20of%20York%22">unique search query for the dynamic content</a> and see if something shows up over the next few days.</p>
<p>The page has some content already present in the HTML (the Macbeth part) which will help comparing the Google results. You should be able to find that part on Google with a another <a href="https://www.google.com/search?q=site:lenni.info%20%22Thunder%20and%20lightning.%20Enter%20three%20Witches%22">specially crafted search query</a>.</p>
<h3>Edit 15/03/12: The results</h3>
<p>Well, that was a bit of an anti-climax. I&#8217;ve been waiting for 10 days now and Google didn&#8217;t index <a href="https://www.google.com/search?q=site:lenni.info%20%22Now%20is%20the%20winter%20of%20our%20discontent%20Made%20glorious%20summer%20by%20this%20sun%20of%20York%22">the dynamic content</a> at all! The <a href="https://www.google.com/search?q=site:lenni.info%20%22Thunder%20and%20lightning.%20Enter%20three%20Witches%22">static content</a> is in their index so that means that it managed to crawl the page successfully.</p>
<p>This obviously has repercussions for people wanting to write indexable JavaScript apps. To be honest I&#8217;m a little deflated that this didn&#8217;t work. I didn&#8217;t expect Google to randomly click on buttons in the app but I thought they would at least run the initial JavaScript and then add the content of the DOM into their index.</p>
<p>Does anybody know more?</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/03/experiment-does-googlebot-index-dynamic-content-from-a-js-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My first iPhone app</title>
		<link>http://lenni.info/blog/2012/01/my-first-iphone-app/</link>
		<comments>http://lenni.info/blog/2012/01/my-first-iphone-app/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 16:15:48 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=604</guid>
		<description><![CDATA[In the recent months or so I have written my first iPhone app and Apple has approved it last night! It works only in Germany and will find the nearest cash point for Cash Group, which is an association of Deutsche Bank, Commerzbank, Postbank and a few others. As someone not living in Germany you [...]]]></description>
			<content:encoded><![CDATA[<p>In the recent months or so I have written my first iPhone app and Apple has approved it last night!</p>
<p>It works only in Germany and will find the nearest cash point for Cash Group, which is an association of Deutsche Bank, Commerzbank, Postbank and a few others. As someone not living in Germany you may ask Why? Well, if you use a cash point from another bank you will have to pay fees for withdrawing cash, sometimes as high as €6.</p>
<p>So, without further ado:</p>
<div class="wp-caption aligncenter" style="width: 330px"><img title="Screenshot" src="https://lh6.googleusercontent.com/-vagzuzd5WSE/TxhB36YqI6I/AAAAAAAAAFM/8grWWMWqvJE/w333-h500-k/cashgroupfinder.jpg" alt="" width="320" height="480" /><p class="wp-caption-text">Screenshot</p></div>
<h3>App Store links</h3>
<ul>
<li><a href="http://itunes.apple.com/us/app/cash-group-finder/id492498061?mt=8">English</a></li>
<li><a href="http://itunes.apple.com/de/app/cash-group-finder/id492498061?mt=8">German</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/01/my-first-iphone-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Yeah! I&#8217;m a Vim contributor!</title>
		<link>http://lenni.info/blog/2012/01/yeah-im-a-vim-contributer/</link>
		<comments>http://lenni.info/blog/2012/01/yeah-im-a-vim-contributer/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 20:31:11 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=599</guid>
		<description><![CDATA[Well, it&#8217;s not really that much but I&#8217;m proud nonetheless. I modified the ssh and sshd config syntax files and Bram has applied the patch to the vim source tree on Google Code. Have a look!]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s not really that much but I&#8217;m proud nonetheless. I modified the ssh and sshd config syntax files and Bram has applied the patch to the vim source tree on Google Code. <a href="http://code.google.com/p/vim/source/browse/runtime/syntax/sshconfig.vim">Have a look</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2012/01/yeah-im-a-vim-contributer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ruby 1.9.2 on Ubuntu 11.10 Oneiric Ocelot without using RVM</title>
		<link>http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/</link>
		<comments>http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 16:36:51 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=582</guid>
		<description><![CDATA[It seems installing Ruby 1.9 on Ubuntu without the use of RVM isn’t all that trivial. I had to poke around the system for quite a while before I got it running. Why not RVM? Well, I tried RVM but compiling Ruby took 3 hours on my EC2 micro instance and was eating all my [...]]]></description>
			<content:encoded><![CDATA[<p>It seems installing Ruby 1.9 on Ubuntu without the use of RVM isn’t all that trivial. I had to poke around the system for quite a while before I got it running.</p>
<h3>Why not RVM?</h3>
<p>Well, I tried RVM but compiling Ruby <strong>took 3 hours</strong> on my EC2 micro instance and was eating all my CPU so that my webserver was basically not available anymore. To me that isn&#8217;t acceptable. Besides, I think it is highly wasteful to compile packages from source when there are precompiled versions available. I admit that apt is too slow to keep up with the rapidly moving gems ecosystem but for the Ruby interpreter itself I strongly prefer the OS to handle the installation.</p>
<p>Besides I don&#8217;t really want to use different versions of Ruby at the same time. I just want something that isn&#8217;t Ubuntu&#8217;s default 1.8.7, which in Ruby years is ancient.</p>
<h3>The steps</h3>
<p>The good news is that as of writing this, Ruby 1.9.2 is available without any PPAs straight from the official Canonical package repos. The bad news is that information about how to get it is thin on the ground.</p>
<p>For starters the package for Ruby 1.9.2 is called ruby1.9.1 and Googling around, it wasn&#8217;t immediately obvious that any version of Ruby 1.9 is even possible on Ubuntu.</p>
<p>Anyway, here it goes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby1.9.1 ruby1.9.1-dev \
  rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
  build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--install</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby ruby <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby1.9.1 <span style="color: #000000;">400</span> \
         <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>ruby.1.gz ruby.1.gz \
                        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/</span>man1<span style="color: #000000; font-weight: bold;">/</span>ruby1.9.1.1.gz \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ri ri <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ri1.9.1 \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>irb irb <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>irb1.9.1 \
        <span style="color: #660033;">--slave</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rdoc rdoc <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rdoc1.9.1
&nbsp;
<span style="color: #666666; font-style: italic;"># choose your interpreter</span>
<span style="color: #666666; font-style: italic;"># changes symlinks for /usr/bin/ruby , /usr/bin/gem</span>
<span style="color: #666666; font-style: italic;"># /usr/bin/irb, /usr/bin/ri and man (1) ruby</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> ruby
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> gem
&nbsp;
<span style="color: #666666; font-style: italic;"># now try</span>
ruby <span style="color: #660033;">--version</span></pre></div></div>

<p>This installs Ruby 1.9.2 and sets that to be the default ruby on your system. Crucially, it also installs rubygems for that interpreter and sets that to be the default. (Thanks for the initial snippet to <a href="http://michalf.me/blog:make-ruby-1-9-default-on-ubuntu-9-10-karmic-koala">Michał Frąckowiak</a>. His version got me most of the way there.)</p>
<h3 id="uninstall">Uninstalling Ruby 1.8</h3>
<p>If you, like me, ran a Rails app on 1.8 you probably have a bit of stuff hanging around the file system. Lets clean that up.</p>
<p>First uninstall all gems from the 1.8 installation with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem1.8 list <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem1.8 uninstall <span style="color: #660033;">-aIx</span></pre></div></div>

<p>Secondly, remove the ruby packages with apt.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove libruby1.8 ruby1.8 ruby1.8-dev rubygems1.8</pre></div></div>

<p>After you have done that you may want to check if there is anything else hanging around with a quick:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> ruby</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to find out if you are running Apache mpm-prefork or mpm-worker</title>
		<link>http://lenni.info/blog/2011/12/how-to-find-out-if-you-are-running-apache-mpm-prefork-or-mpm-worker/</link>
		<comments>http://lenni.info/blog/2011/12/how-to-find-out-if-you-are-running-apache-mpm-prefork-or-mpm-worker/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 09:17:24 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=574</guid>
		<description><![CDATA[I struggled with this today whilst trying to figure out Apache&#8217;s config options. On Ubuntu you can do the following: $ dpkg --get-selections &#124;grep apache apache2 install apache2-mpm-prefork install apache2-prefork-dev install apache2-utils install apache2.2-bin install apache2.2-common install libapache2-mod-php5 install libapache2-mod-wsgi install This tells me that I have mpm-prefork.]]></description>
			<content:encoded><![CDATA[<p>I struggled with this today whilst trying to figure out Apache&#8217;s config options.</p>
<p>On Ubuntu you can do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> apache
apache2						<span style="color: #c20cb9; font-weight: bold;">install</span>
apache2-mpm-prefork				<span style="color: #c20cb9; font-weight: bold;">install</span>
apache2-prefork-dev				<span style="color: #c20cb9; font-weight: bold;">install</span>
apache2-utils					<span style="color: #c20cb9; font-weight: bold;">install</span>
apache2.2-bin					<span style="color: #c20cb9; font-weight: bold;">install</span>
apache2.2-common				<span style="color: #c20cb9; font-weight: bold;">install</span>
libapache2-mod-php5				<span style="color: #c20cb9; font-weight: bold;">install</span>
libapache2-mod-wsgi				<span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>This tells me that I have mpm-prefork.</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2011/12/how-to-find-out-if-you-are-running-apache-mpm-prefork-or-mpm-worker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing LESS and CSS3 with Vim</title>
		<link>http://lenni.info/blog/2011/10/editing-less-and-css3-with-vim/</link>
		<comments>http://lenni.info/blog/2011/10/editing-less-and-css3-with-vim/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 21:27:32 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=555</guid>
		<description><![CDATA[A thought or two about CSS precompilers I had heared of Sass repeatedly for a while now but so far I had always mentally filed CSS precompilers under &#8220;Interesting concept, but probably not all that useful for me&#8221;. I thought that CSS is fine as it is and after all it&#8217;s just a bunch of [...]]]></description>
			<content:encoded><![CDATA[<h3>A thought or two about CSS precompilers</h3>
<p>I had heared of Sass repeatedly for a while now but so far I had always mentally filed CSS precompilers under &#8220;Interesting concept, but probably not all that useful for me&#8221;. I thought that CSS is fine as it is and after all it&#8217;s just a bunch of style definitions, right?</p>
<p>On the other hand I grew to actively dislike handling CSS files. I didn&#8217;t quite understand at the time that this had mostly to do with their great redundancy and repetition.  When you&#8217;ve been used to something&#8217;s mediocrity for so long you don&#8217;t really noticed those weaknesses anymore.</p>
<p>When a coworker suggested using a CSS precompiler to help our <a href="http://stackoverflow.com/questions/2253110/how-to-manage-css-explosion">CSS explosion</a>, I was pretty sceptical. But I like learning new things so we went ahead and introduced <a href="http://lesscss.org/">LESS</a> in our current project.</p>
<p>What a difference! I may end up sounding like a used-car salesman but it really is a difference like day and night. I&#8217;d love to tell you lots of reasons why these precompilers are great, but unfortunately Jason Z. from 37 signals has done a <a href="http://37signals.com/svn/posts/3003-css-taking-control-of-the-cascade">much better job</a>.</p>
<h3>Wasn&#8217;t this post suppossed to be about Vim?</h3>
<p>Lets talk business then. I&#8217;m using Vim to edit LESS and it looks like this:</p>
<div class="wp-caption aligncenter" style="width: 460px"><img class="   " src="https://github.com/lenniboy/vim-less/raw/master/screenshot.png" alt="Vim with vim-less, vim-css3-syntax, vim-css-colors" width="450" height="349" /><p class="wp-caption-text">Vim with vim-less, vim-css3-syntax, vim-css-colors</p></div>
<p>I can recommend a trio of plugins for LESS and general CSS3 editing:</p>
<h4><a href="https://github.com/groenewege/vim-less">vim-less</a></h4>
<p>This plugin&#8217;s syntax highlighting was fairly feature-rich to begin with but I have added a few extra features including indenting and autocompletion and the original author has merged them back to his branch. The plugin&#8217;s compatibility has led me to check out vim-css-colors.</p>
<h4><a href="https://github.com/skammer/vim-css-color">vim-css-colors</a></h4>
<p>This great plugin visualises a color expressed in hex, RGBa or HSLa and paints the background underneath it in the corresponding color. If you&#8217;re not sure what I mean, here&#8217;s screenshot:</p>
<p><img class="aligncenter" src="https://github.com/skammer/vim-css-color/raw/master/Screen%20shot%202010-07-04%20at%200.19.46.png" alt="" width="455" height="292" /></p>
<p>This may look like a toy to some, but LESS lets you have a file with just the colour palette of your app/website and seeing them all visualised is very nice. It also helps you to reuse the same variable name for each colour rather than re-introducing new ones.</p>
<h4><a href="https://github.com/hail2u/vim-css3-syntax">vim-css3-syntax</a></h4>
<p>This has a very complete syntax file for CSS3 and I have  added support for this plugin in vim-less. That works pretty well and those fancy new CSS3 properties are then also displayed with correct syntax highlighting applied.</p>
<h3>Improvements for the future</h3>
<p>The current autocomplete (hit Ctr-X, Ctrl-O if you&#8217;ve never used it) that ships with standard Vim is pretty complete for CSS2. However there is no autocomplete script for CSS3. Looking at the <a href="http://code.google.com/p/vim/source/browse/runtime/autoload/csscomplete.vim">CSS2 version</a>, it shouldn&#8217;t actually be too hard to parse the syntax highlight files and add the new properties to the existing script.</p>
<p>I&#8217;d also like to implement a syntax checker but looking the the source of lessc, LESS&#8217; command line compiler, there doesn&#8217;t seem to be a validating phase that I could use.</p>
<p>I also saw that some web-based CSS prettifyiers can order CSS properties alphabetically. Wouldn&#8217;t that be a neat feature for Vim?</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2011/10/editing-less-and-css3-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing a single gitconfig between your work and home computers and taking care of user.email</title>
		<link>http://lenni.info/blog/2011/06/sharing-a-single-gitconfig-between-your-work-and-home-computers-and-taking-care-of-user-email/</link>
		<comments>http://lenni.info/blog/2011/06/sharing-a-single-gitconfig-between-your-work-and-home-computers-and-taking-care-of-user-email/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 14:03:12 +0000</pubDate>
		<dc:creator>Leonard</dc:creator>
				<category><![CDATA[Mixed]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[sharing]]></category>

		<guid isPermaLink="false">http://lenni.info/blog/?p=510</guid>
		<description><![CDATA[I just started a new job where git is being used and since I had accumulated some stuff in mit .gitconfig, I wanted it to be on my work computer too. I use a git repository for all my dotfiles, which I then clone on the machine and symlink files like .gitconfig or .vimrc to [...]]]></description>
			<content:encoded><![CDATA[<p>I just started a new job where git is being used and since I had accumulated some stuff in mit <code>.gitconfig</code>, I wanted it to be on my work computer too. I use a git repository for all my dotfiles, which I then clone on the machine and symlink files like <code>.gitconfig</code> or <code>.vimrc</code> to the home directory. This means if I add something to those files at work and want to use the configuration at home too I just need to commit, push and pull the changes at home.</p>
<p>Well, this works pretty good until you realise that there are <em>some</em> config entries you want to be different in the two environments. Git&#8217;s <code>user.email</code> is obviously such a case.</p>
<h3>The solution</h3>
<p>Git does not allow you to to include other configuration files in your <code>.gitconfig</code> but you can use the environment variable <code>$EMAIL</code> in order to overwrite <code>user.email</code>.</p>
<p>What I have done is to add the following to my <code>.bashrc</code> (which is also in the dotfiles repo):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> .host-specific.sh <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">source</span> .host-specific.sh
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>This loads a host-specific bash file (if it exists). In this file you&#8217;ll stick your email address like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EMAIL</span>=lenni<span style="color: #000000; font-weight: bold;">@</span>work.com</pre></div></div>

<p>(Obviously this file needs to be recreated on each host and can&#8217;t be shared across computers through the dotfile repository.)</p>
<p>Now you can safely share your <code>.gitconfig</code> between the two computers without having to worry about the email settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://lenni.info/blog/2011/06/sharing-a-single-gitconfig-between-your-work-and-home-computers-and-taking-care-of-user-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

