<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>planbnet.org - Felix Rotthowe</title>
 <link href="http://www.planbnet.org/feed.xml" rel="self"/>
 <link href="http://www.planbnet.org"/>
 <updated>2012-02-22T15:46:24+01:00</updated>
 <id>http://www.planbnet.org</id>
 <author>
   <name>Felix Rotthowe</name>
 </author>

 
 <entry>
   <title>Static HTML rocks</title>
   <link href="http://www.planbnet.org/blog/2012-02-10-static-html-rocks"/>
   <updated>2012-02-10T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/static-html-rocks</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m not a blogger. I&amp;#8217;m not a good writer and I don&amp;#8217;t have any interesting stories or insights to share. But I always wanted to have a blog. Maybe just because everyone has one. So, even though I didn&amp;#8217;t write much, I have tried numerous blogging engines over the years. I even wrote my own (which was used by me and my friends partly like those kids today are using facebook: to post funny pictures and party invitations). I also tried wordpress and several hosted solutions such as posterous and tumblr. But it never felt right.&lt;/p&gt;

&lt;p&gt;This time it feels better: I&amp;#8217;m using &lt;a href='http://jekyllrb.com/'&gt;Jekyll&lt;/a&gt; to build static HTML pages out of HTML templates and markdown formatted text. I can use vim to edit posts and quickly update the whole page. This fits my simple needs perfectly, unlike those huge piles of php scripts. And I have full control over the HTML code that gets generated, so if you look into the source of this page, you&amp;#8217;ll see nicely indented code (except for whatever the markdown parser generates).&lt;/p&gt;

&lt;p&gt;This whole system feels so efficient and lean that I started thinking about how to further improve load times of the page. After all, there&amp;#8217;s nothing to do on the server side but accepting requests and streaming the contents of static files to the clients. The Apache server running on my virtual server does this blazingly fast, especially (which I find a bit confusing) when turning &lt;em&gt;Keepalive off&lt;/em&gt; in the config, but there is still something that can be improved: The page won&amp;#8217;t be displayed by the browser before all css and javascript files have been fetched. This means a few extra requests and kb before the user sees anything on the screen. To prevent this, I&amp;#8217;m using the &lt;a href='http://www.modernizr.com/docs/#load'&gt;modernizr load&lt;/a&gt; plugin, which loads the scripts asynchronously in the background. Of course, you can not use deferred loading for scripts that must run before the page has been fully loaded, but in my case it doesn&amp;#8217;t matter if jQuery, the fancybox plugin and the google analytics script are executed a few ms after the user sees the page.&lt;/p&gt;

&lt;p&gt;This makes the page load really fast:&lt;/p&gt;
&lt;ul class='imglist'&gt;
  &lt;li&gt;
  &lt;a href='/blog/2012-02-10-static-html-rocks/pingdom1.png' class='fancybox' rel='pingdom'&gt;&lt;img src='/blog/2012-02-10-static-html-rocks/pingdom1_thumb.jpg' alt='pingdom response time test' /&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;a href='/blog/2012-02-10-static-html-rocks/pingdom2.png' class='fancybox' rel='pingdom'&gt;&lt;img src='/blog/2012-02-10-static-html-rocks/pingdom2_thumb.jpg' alt='pingdom response time test' /&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, I have enabled sending cache expiry headers in .htaccess, so that each subsequent request will only need to fetch the pure HTML (which will be sent compressed for clients that support it by the way). This means that all further links the user visits will be rendered within under 100ms - given a fast enough client connection of course.&lt;/p&gt;

&lt;p&gt;I hope you noticed this when visiting this article&amp;#8230;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Zenburn everywhere</title>
   <link href="http://www.planbnet.org/blog/2011-12-06-zenburn-everywhere"/>
   <updated>2011-12-06T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/zenburn-everywhere</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m a big fan of the &lt;a href='http://slinky.imukuppi.org/zenburnpage/'&gt;Zenburn&lt;/a&gt; color scheme. It&amp;#8217;s easy on the eyes and very readable despite not providing too much contrast. Besided that, I just like the colors. That&amp;#8217;s why I&amp;#8217;m using it everywhere I can. To keep a reference to all the different config files and snippets, I&amp;#8217;m creating this list:&lt;/p&gt;

&lt;h2 id='gnome_terminal'&gt;Gnome Terminal&lt;/h2&gt;

&lt;p&gt;Based on the install script for &lt;a href='https://github.com/sigurdga/gnome-terminal-colors-solarized'&gt;gnome-terminal-colors-solarized&lt;/a&gt; I have created a simple script that modifies an existing terminal profile and sets up the zenburn color scheme. You can download it here: &lt;a href='/blog/2011-12-06-zenburn-everywhere/gnome-terminal-zenburn.sh'&gt;gnome-terminal-zenburn.sh&lt;/a&gt;&lt;/p&gt;

&lt;h2 id='mac_os_lion_terminal'&gt;Mac OS (Lion) Terminal&lt;/h2&gt;

&lt;p&gt;I couldn&amp;#8217;t find a configuration for Terminal.app on Mac OS X that replaces the default ansi colors, so I created one myself. You can find it here: &lt;a href='/blog/2011-12-06-zenburn-everywhere/Zenburn.terminal'&gt;Zenburn.terminal&lt;/a&gt;&lt;/p&gt;

&lt;h2 id='eclipse'&gt;Eclipse&lt;/h2&gt;

&lt;p&gt;I use the excellent &lt;a href='http://www.eclipsecolorthemes.org/'&gt;Eclipse Color Schemes&lt;/a&gt; plugin which includes Zenburn. In fact that&amp;#8217;s how I became aware of it.&lt;/p&gt;

&lt;h2 id='vim'&gt;Vim&lt;/h2&gt;

&lt;p&gt;Zenburn is included in the &lt;a href='https://github.com/flazz/vim-colorschemes'&gt;vim-colorschemes package&lt;/a&gt; that I installed using &lt;a href='https://github.com/gmarik/vundle'&gt;vundle&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>My .vimrc</title>
   <link href="http://www.planbnet.org/blog/2011-12-02-my-vimrc"/>
   <updated>2011-12-02T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/my-vimrc</id>
   <content type="html">&lt;p&gt;Over the last weeks, I have heavily customized (and commented) my .vimrc and thought it might be useful for someone else if I publish it here. I&amp;#8217;m not putting it under version contol with git like many others seem to do, because I would always forget to commit and push it (and I don&amp;#8217;t need a versioned history), but I keep it synced using Dropbox. If you want to download the version posted here, you can do so &lt;a href='https://gist.github.com/gists/1422486/download'&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Maybe I will add some comments on some keymappings or why I&amp;#8217;m using &lt;a href='https://github.com/gmarik/vundle'&gt;vundle&lt;/a&gt; for package management later, but for now I&amp;#8217;m just dropping it here:&lt;/p&gt;
&lt;script src='https://gist.github.com/1422486.js?file=.vimrc'&gt;


&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Pinging the Apple Store using node.js</title>
   <link href="http://www.planbnet.org/blog/2011-11-30-pinging-the-apple-store-using-node.js"/>
   <updated>2011-11-30T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/pinging-the-apple-store-using-node.js</id>
   <content type="html">&lt;p&gt;Every once in a while, Apple decides to take down their online store for a few hours to release some new shiny stuff. I&amp;#8217;m not sure if they have to close the whole website because of the archaic WebObjects framework they&amp;#8217;re still using or just to generate hype, but the yellow post-it note is well known across the Internet.&lt;/p&gt;

&lt;p&gt;So, when there&amp;#8217;s a new iPhone or iPad ready for sale, people keep hitting the refresh buttons of their browsers to be the first to place an order. I have to admin that I have also participated in this procedure once. But because I&amp;#8217;m lazy (and I was at work at the time the sale started) I created a litte script that pings the Apple Store every few seconds and sends me a push notification using the great &lt;a href='http://boxcar.io/'&gt;Boxcar&lt;/a&gt; service.&lt;/p&gt;

&lt;p&gt;While this would have probably worked just as well in any other language, I chose node.js to implement this little script. Maybe someone else wants to use it, too, so I&amp;#8217;m publishing it here. Please note that you may have to adjust some URLs to it works for your country (it&amp;#8217;s currently set up for the German Apple Store)&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;sys&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;require&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;util&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
&lt;span class='nx'&gt;fs&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;require&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;fs&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
&lt;span class='nx'&gt;http&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;require&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;http&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
&lt;span class='nx'&gt;https&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;require&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;https&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;BOXCAR_USER&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;BOXCAR_USERNAME&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;BOXCAR_PASSWORD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;BOXCAR_PASSWORD&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;BOXCAR_AUTH&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;Basic &amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nx'&gt;Buffer&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;BOXCAR_USER&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;:&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;BOXCAR_PASSWORD&lt;/span&gt;&lt;span class='p'&gt;).&lt;/span&gt;&lt;span class='nx'&gt;toString&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;base64&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

&lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='nx'&gt;notify&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;app&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;title&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;url&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;http://store.apple.com/de&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;icon&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;http://images.apple.com/euro/iphone/built-in-apps/images/nav_icon_app_store.png&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;uniqueid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;notify&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;+&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nb'&gt;Date&lt;/span&gt;&lt;span class='p'&gt;().&lt;/span&gt;&lt;span class='nx'&gt;getTime&lt;/span&gt;&lt;span class='p'&gt;());&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;params&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
      &lt;span class='s2'&gt;&amp;quot;notification[message]&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;title&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='s2'&gt;&amp;quot;notification[from_screen_name]&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;app&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='s2'&gt;&amp;quot;notification[from_remote_service_id]&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;uniqueid&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='s2'&gt;&amp;quot;notification[source_url]&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;url&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='s2'&gt;&amp;quot;notification[icon_url]&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;icon&lt;/span&gt;  
  &lt;span class='p'&gt;};&lt;/span&gt;

  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;dataArr&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[];&lt;/span&gt;
  &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;obj&lt;/span&gt; &lt;span class='k'&gt;in&lt;/span&gt; &lt;span class='nx'&gt;params&lt;/span&gt;&lt;span class='p'&gt;){&lt;/span&gt;
    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;params&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;obj&lt;/span&gt;&lt;span class='p'&gt;]){&lt;/span&gt;
      &lt;span class='nx'&gt;dataArr&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;push&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;obj&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;=&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;params&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nx'&gt;obj&lt;/span&gt;&lt;span class='p'&gt;]);&lt;/span&gt;  
    &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;postdata&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;dataArr&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;join&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;&amp;amp;&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;headers&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;Host&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;boxcar.io&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Authorization&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;BOXCAR_AUTH&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='s1'&gt;&amp;#39;Content-Length&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;postdata&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;length&lt;/span&gt;&lt;span class='p'&gt;};&lt;/span&gt;

  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;options&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='nx'&gt;host&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;boxcar.io&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nx'&gt;port&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='mi'&gt;80&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nx'&gt;path&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;/notifications&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nx'&gt;method&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;POST&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nx'&gt;headers&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='nx'&gt;headers&lt;/span&gt;
  &lt;span class='p'&gt;};&lt;/span&gt;
  
  &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Sending request to boxcar: &amp;quot;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;title&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;req&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;http&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;request&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;options&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;res&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
      &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Sent notification for &amp;quot;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;title&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='p'&gt;});&lt;/span&gt;
  &lt;span class='nx'&gt;req&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;write&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;postdata&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='nx'&gt;req&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;end&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='nx'&gt;refreshPage&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;

  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;headers&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Accept&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Accept-Charset&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;ISO-8859-1,utf-8;q=0.7,*;q=0.3&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Accept-Language&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Cache-Control&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;max-age=0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Connection&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;close&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;Host&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;store.apple.com&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='s1'&gt;&amp;#39;User-Agent&amp;#39;&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1&amp;#39;&lt;/span&gt;
  &lt;span class='p'&gt;};&lt;/span&gt;

  &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Refresh &amp;quot;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nb'&gt;Date&lt;/span&gt;&lt;span class='p'&gt;());&lt;/span&gt;
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;client&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;http&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;createClient&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;80&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;store.apple.com&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt; 
  &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;request&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;client&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;request&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;GET&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;/de/&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;headers&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='nx'&gt;request&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;end&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
  &lt;span class='nx'&gt;request&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;response&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;

    &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;statusCode&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mi'&gt;200&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
      &lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;pagedata&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;setEncoding&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;utf8&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;

      &lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;data&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;chunk&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='nx'&gt;pagedata&lt;/span&gt; &lt;span class='o'&gt;+=&lt;/span&gt; &lt;span class='nx'&gt;chunk&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;});&lt;/span&gt;

      &lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;end&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='nx'&gt;pagedata&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;match&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;title_backsoon1.gif&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
          &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;success!&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
          &lt;span class='nx'&gt;notify&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Apple Store online!&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;GOGOGO!!!!&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
          &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;nothing...&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='p'&gt;});&lt;/span&gt;

    &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
      &lt;span class='nx'&gt;console&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;STATUS: &amp;#39;&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='nx'&gt;response&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;statusCode&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;

  &lt;span class='p'&gt;});&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='nx'&gt;refreshPage&lt;/span&gt;&lt;span class='p'&gt;();&lt;/span&gt;
&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;polling&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nx'&gt;setInterval&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt; &lt;span class='nx'&gt;refreshPage&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='mi'&gt;30000&lt;/span&gt; &lt;span class='p'&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s it, without much comment. It&amp;#8217;s not very efficient and has to manually stopped when the store is back online, but it did help me to order my iPhone 4S without any lags (a minute later, the site went slow as hell). If you have questions, don&amp;#8217;t hestitate to contact me.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Replacing the optical drive in a 2011 MacBook Pro 13&quot; with a SSD</title>
   <link href="http://www.planbnet.org/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook"/>
   <updated>2011-03-11T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/replacing-the-optical-drive-in-a-2011-macbook</id>
   <content type="html">&lt;p&gt;After five long years with my original white MacBook and given the fact that
Lion won't support its 32 bit Core Duo processor, I decided it was time for a
new laptop. As I was really pleased with the form factor of my old 13&amp;quot;
MacBook (after all, I have a big screen iMac upstairs) I ordered the new
13&amp;quot; MacBook Pro. Now there was one thing that really bothered me: I had
this nifty fast 64GB SSD (Supertalent Ultradrive ME) in my old MacBook that I
really didn't want to give up and I couldn't bear anything in my new laptop
being slower than in the old one. On the other hand, 64GB on a new machine
seemed far to little (and larger SSDs are still not really affordable). So the
only solution was to order an adapter for the optical drive bay to keep the
320GB HDD while adding the SSD as a fast drive for the system and applications.
Here's how I did it.&lt;/p&gt;

&lt;p&gt;At first, the SSD needed a fresh start. To really erase all data and reset
the internal block allocation tables (i.e. to bring it back to full speed), you
need to to a security erase on the device. There exist a lot of ugly windows
tools for that, but I went the following way: Using an Ubuntu boot CD, I booted
Linux on my old MacBook (by holding c on startup) and went to the console.
&amp;nbsp;The following commands should have been enough to reset the SSD:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;hdparm --security-set-pass NULL /dev/sda
hdparm --security-erase NULL /dev/sda
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;However, all I got was an Input/Output error. That's because something
(probably the EFI) locks the internal drive on boot and prevents this kind of
commands for it. The solution sound dangerous, but works without a problem:
Just pull the SSD out while the computer is still running, then plug it back in
and it won't be locked anymore so you can fire up those hdparm commands.&lt;/p&gt;

&lt;p&gt;Next was preparing the optical drive bay. This step was quite easy: The SSD
just needs to be plugged in. To fix it, I used a small strip of tape and two
hair ties (don't ask).  &lt;/p&gt;

&lt;p&gt;Now to the exciting part - voiding the warranty on day one. First, I got
something to collect all those little screws. I used a milk tooth jar (again,
don't ask). Then I removed all the screws on the back side of the macbook.&lt;/p&gt;

&lt;ul class=&quot;imglist&quot;&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step1&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1786.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1786_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step1&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1794.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1794_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step1&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1787.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1787_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After removing the back cover, you can directly see the optical drive and
the 3 flat cables which need to be unplugged first. To prevent electrostatic
discharge, during the whole procedure, I touched a grounded spot every few
seconds.&lt;/p&gt;

&lt;p&gt;To remove the optical drive, a small plastic part carrying the wifi chip and
the speaker needs to be lifted a bit. Fortunately, no antenna cables have to be
removed, just 3 screws. This part needs to be shifted to the right just enough
to unscrew one of the 3 screws that hold the optical drive. The other two
screws are easy to find and reach. After they have been removed, the drive can
be carefully lifted out.&lt;/p&gt;

&lt;ul class=&quot;imglist&quot;&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step2&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1790.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1790_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step2&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1793.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1793_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; That's it for the hard part, I thought, but unfortunately the optical drive
adapter I bought wasn't really suited for the 13&amp;quot; MacBook Pro. Using a saw
and a file, I needed to remove some of the plastic on the front side of the
&quot;drive&quot; before it fit (see the image below).  I was a bit supprised that the
drive bay didn't need any screws, but as it's not a moving part and the little
plastic thing with the wifi chip and the speaker on it presses it into its
position, it seems quite stable.&lt;/p&gt;

&lt;ul class=&quot;imglist&quot;&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step3&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1796.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1796_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;a class=&quot;fancybox&quot; rel=&quot;step3&quot; href=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1799.JPG&quot;&gt;&lt;img src=&quot;/blog/2011-03-11-replacing-the-optical-drive-in-a-2011-macbook/IMG_1799_thumb.JPG&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After assembling everything, I started up the MacBook and to my suprise,
everything still worked. I then used Carbon Copy Cloner to clone the original
drive to the SSD, formated the HDD and set up some symlinks (for example the
Movies and Downloads folder) to point from my home directory (which is located
on the SSD) to the HDD. Finally, I set the SSD as the startup drive and
rebooted. Voil&amp;agrave;: Super fast and not too expensive while still offering
enough space. The only drawback: There's no optical drive anymore, but I can't
remember when I used that the last time on my old MacBook...&lt;/p&gt;

&lt;p&gt;PS: Sorry for the bad image quality. I only had my iPhone 3GS at hand.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The future of Java wears a suit and tie</title>
   <link href="http://www.planbnet.org/blog/2010-11-06-the-future-of-java-wears-a-suit-and-tie"/>
   <updated>2010-11-06T00:00:00+01:00</updated>
   <id>http://www.planbnet.org/blog/the-future-of-java-wears-a-suit-and-tie</id>
   <content type="html">&lt;div&gt;Not even a year after &lt;a
    href=&quot;http://www.oracle.com/us/corporate/press/044428&quot;&gt;Oracle's acquisition of
    Sun was completed&lt;/a&gt;, they start doing what everyone expected: &lt;a
    href=&quot;http://www.computerworld.com/s/article/9194740/Oracle_raises_cost_of_low_end_MySQL_support?taxonomyId=88&quot;&gt;Pushing
    prices&lt;/a&gt; an &lt;a
    href=&quot;http://news.cnet.com/8301-30685_3-20013687-264.html&quot;&gt;killing off free
    products&lt;/a&gt;. Now they're ready for the next big step: Earn big money from
  Java. In a first step, there will be a &lt;a
    href=&quot;http://www.theregister.co.uk/2010/11/06/oracle_dueling_jvms/&quot;&gt;&quot;premium&quot;
    JVM&lt;/a&gt; besides the free one.&lt;/div&gt; &lt;p /&gt; &lt;div&gt;Let's guess what comes
  next. Many people say Oracle is destroying Java. They're both right and
  wrong. Right because moves like this kill the spirit of the community. Right
  now, there's a Java open source library for nearly every problem that can be
  solved using computers. Many of those libraries are written by individuals
  for fun or fame, not for profit. I believe those people will soon turn their
  back on Java and move on to languages where &quot;the other cool guys&quot; already are
  (ruby, python, javascript or whatever will be the next big thing).&lt;/div&gt; &lt;p
/&gt; &lt;div&gt;But that does not mean Java will die. Even today, Java is seen by many
  programmers as a boring, verbose enterprise language. Big companies move slow
  and only when they have to. They don't have. Even if at some distant point in
  the future, Oracle will stop supporting OpenJDK, someone will make a large
  Excel sheet and find that paying a few thousand bucks to Oracle every month
  is cheaper than even thinking about alternatives. There will always be enough
  Java programmers, at least as long as Schools and Universities teach it as
  the first language. And why should they stop doing so when the corporate
  world has great demand for Java programmers?&lt;/div&gt; &lt;p /&gt; &lt;div&gt;In the long
  run, Java will become exactly what the haters are calling it: Boring
  corporate stuff. Of course that was inevitable, but Oracle sure does the best
  it can to accelerate this development.&lt;/div&gt;
</content>
 </entry>
 

</feed>

