Front Page

Merry Christmas!

Thu Dec 24 12:48:39 +0100 2009

Santa spanking

Frohe Weihnachten, ein schönes Fest, und einen guten Rutsch ins neue Jahr wünscht euch Christian Neukirchen

Merry Christmas and a Happy New Year!

NP: Neutral Milk Hotel—The Fool

A nasty Android bug

Sat Dec 19 19:01:45 +0100 2009

When your Android phone shows the following symptoms:

  • Upon power on, some configuration (e.g. date/time format) is lost.
  • The “hang up” button doesn’t lock the screen.
  • “Airplane mode” and “Silent mode” don’t show up in the shutdown menu.
  • The “home” button doesn’t work.
  • The “call” button doesn’t work.
  • Incoming calls don’t work. (Don’t know for sure.)

…then your phone probably destroyed some configuration, likely because the battery was empty before it fully shut down. A possible fix:

  • Get the application “Any Cut”.
  • Create a shortcut to the activity “Setup Wizard” (there are three items of it, try them all).
  • Run the Setup Wizard that looks like the initial Android setup (the one where you have to click the robot first), and follow the wizard.
  • Your phone should now work again.

This worked for me on firmware version 1.6 (And I think I hit the same problem on 1.5 too, but back then had no other idea than to wipe it).

Many people seem to be affected by this, and above solution is based on this thread.

Clearly, this is a thing that should not happen, corrupting configuration due to low power.

NP: Neutral Milk Hotel—The Fool

Zum Advent

Sun Dec 06 14:22:52 +0100 2009

Vorweihnachtliche Stimmung beschreibt Lydia eh besser als ich.

Ausserdem kann ich einfach nicht wiederstehen, diesen Klassiker nochmal zu posten:

Inhalt des Gefrierschanks

wrongcards hat neue Weihnachtspostkarten: Christmas Deer, Someone Undermines Christmas, Everything is Fantastic, und natürlich Adequate Substitute for a Gift.

Sonst gibts noch eine kreative Weihnachtsdeko, und ein schönes Bild von Lichtern in Berlin.

Sterneschnippeln steht noch aus.

Ich wünsche einen frohen Advent.

NP: Tom Waits—Who Are You Cut

Back from Curucamp 2009

Mon Sep 28 23:55:37 +0200 2009

I just came home from Vienna where I attended Curucamp 2009, the probably most unconference ever. ;-) We were about thirty people, and there was a fair share of interesting talks. Of course, there was a lot of socializing, too. We had real luck with the weather. And there even was a head measuring contest!

If you are interested in my slides about Simplicity in Code, you can find them at the usual place.

NP: Pearl Jam—Unthought Known

Latest discoveries in hard disk archaeology

Sat Sep 19 20:07:12 +0200 2009

Recently I dug up an old hard disk (to be used in my Sun Blade 1000), and I found an old copy of my home directory on it. Even better, I found an even older backup of a thing I thought that was lost already: my first web site.

I could not resist putting it up, so here it is. I don’t think it ever went live, actually.

I made it in 2000/2001, so please bear with the bad English and table layouts. I also didn’t know of .png files, I guess.

The time stamp shows 2009, but that’s because I had to regenerate the site from its sources. It already used amazing technology: RCS-backed, make(1)-driven, and using cpp(1) for HTML generation is a hack I’m still proud of (well, except for the occasional <!-- ' --> to close an uneven number of quotes :-P).

NP: Pearl Jam—The End

Hiking in Fassa Valley

Fri Sep 11 20:38:31 +0200 2009

The last few days I spent in the Dolomites and we did some hiking trips that I recorded with My Tracks:


View Tag #1 in a larger map


View Tag #4 in a larger map

(I forgot to stop recording at the end, thus I don’t have exact statistics.)


View Tag #7 in a larger map

Unfortunately I see no way to export the elevation graphs, which would have been interesting to compare.

Google Maps doesn’t have much detail for this terrain, I recommend looking at the larger maps and enabling photos for a rough idea.

NP: The Magnetic Fields—I Can’t Touch You Anymore

Why I use the MIT license

Sat Aug 22 22:28:15 +0200 2009

The internet probably is the closest thing to working anarchy mankind ever had. I don’t want to, and I don’t see any point in restricting other peoples’ freedom. Since 2004, I therefore license all my new code under the terms of the MIT license or comparable licenses (notably the Ruby license).

I do this for pragmatic reasons. I’d prefer to do it like Bernstein, but this is unfortunately a lot more hassle for non-private users of my software. Using MIT is also easier than creating my own licenses. The MIT and the ISC license fit my idea of software licensing best. I mainly use MIT because it’s more popular and well known.

I have evaluated putting some works into the public domain (or license them as CC0), but I can’t do this easily for various reasons: First, I live and code in Germany, where you can’t place things into the public domain without already being dead for a long time. Second, I do not want to give up all my moral rights, because then the code can actually be used against myself (mainly “any distortion, mutilation or other modification of, or other derogatory action in relation to the said work”, I don’t care about the rest). I do not know if this matters in real life, and I hope it does it not, but I don’t want to risk it. (Still, I think CC0 is the most important recent addition to the license landscape.)

(In general, I’d even prefer if my code was regarded authorless—which does not mean I don’t care about it. But neither I don’t care at all what you do with the code, and I’ll not endorse it nor want to be identified with it in other ways—especially if you distribute modified copies! I’ve been considering anonymous or pseudonymous releases for these reasons. Again, pragmatism strikes: apart from murky and inconvenient ways to release and ensure archival, it is problematic for others that depend on the legal system to use my works.)

I consider it unfortunate that we spend so much energy on licensing debates, clarification of terms and persecution of violation. Rather, let’s code. As long as there is a single available copy of free code, its freedom is kept and can be multiplied at no cost. For code that is worth anything, it will.

I realize “bad guys” don’t cease to exist—whether they “steal”, don’t share, lock up code, or have business models in mind you don’t like. But it’s not my fault they are that way, and neither it is my job to “teach them lessons”. Good deeds have to come from yourself, and why should I not give anyone the possibility to do so.

Thus, more power to you! Now go forth and do whatever you think is right.

NP: Danger Mouse—Revenge

22, 026, 0x16

Sun Aug 16 11:40:38 +0200 2009

Der wahre Nihilist aber lebt ewig; in jeder Sekunde hinterlässt er Milliarden von Paralleluniversen, in denen er just gestorben—und verdient so weder Mitleid noch Trauer. — Was ist der Tod eines Regentropfen im Ozean seiner selbst? (10oct2007)

NP: Pearl Jam & Ben Harper—Another Lonely Day

SchützaBlog 2009

Sun Jul 26 14:59:37 +0200 2009

Ist es wirklich Schützen, wenn man nur zwei Nächte da ist?
Wenn man keinen Umzug gesehen hat?
Man nicht mal weiß, als was sich die WG-Trommler verkleidet haben? (Schweinegrippe)
Nur rasch über den Berg gelaufen ist?
Und irgendwie nie das Schützenfestlied erklang?
Man vorm Tweety eh fast keinen mehr kennt?

Schützen, ja du bist’s!
Dich hab ich vernommen.

Bis nächstes Jahr,
Scheene Schütza!

NP: Elvis Perkins—The Night & The Liquor

Devil's RailsConf 2009 Dictionary

Sun May 10 22:32:24 +0200 2009

[This seems to be an appropriate literary device to reconstruct an event which makes it hard to remember in which order things happened. Also, it’s easy to be silent on certain things I have nothing to say of as well as just rant a bit here and there.]

888 Noodle Bar: has good and comparatively cheap lunch at ☞Las Vegas Hilton.

A Hat Full of Tricks with Sinatra: Blake Mizerany shows how to make a really good tutorial: By knowing your stuff well and being an eloquent speaker, you can nicely adapt to the speed of the audience. No preparation required.

Barry Manilow: the superstar of ☞Las Vegas Hilton. Use Barry Manilow key cards to open your door. Buy Barry Manilow water and Barry Manilow energy drinks at the hotel’s own Barry Manilow shop.

Bellagio: less tasteless hotel with a nice buffet and fountains.

Box Lunch: euphemism for serving cold sandwiches every day.

CabooseConf: a room where people read their email.

Carpet: The only thing not carpeted in ☞Las Vegas are the roads. One wonders why.

Continental Breakfast: euphemism for toasted bagels and cream, along with empty coffee containers.

Envy: excellect place to have Steaks at.

Keynote: Chris Wanstrath’s keynote reads so well I regret having missed it.

Las Vegas: The paradise of ADHD patients, the land where neon grows outside, the most tasteless city of the world. Not found here: dogs, birds and people reading books. Also, anything to not make you spend money.

Las Vegas Hilton: an off-strip hotel with that vintage 80’s porn feeling that the eponymous daughter lacks. Full of ☞Barry Manilow.

Mist: Place to be smoking a hookah if you need to wake up 6 hours later to get your flight.

Nobu: excellent place to have Sushi at. It was just perfect.

Rack: the hottest thing at the Conference. Not these. Really, I didn’t see a single talk that did not mention Rack.

Rails 3 and the Real Secret to High Productivity: DHH makes me go “I told you so” non-stop for an hour.

Rails Core Panel: Are you guys letting Yehuda turn Rails into Drupal?

SOCKS over SSH: Way to surf when the Conference ☞WiFi HTTP proxy goes down. On one occasion I had 500kb/s for myself.

Sexy Blackjack: good luck trying to find it in ☞Las Vegas.

Smacking Git Around – Advanced Git Tricks: Scott Chacon shows how to make a fast-paced and really comprehensive presentation where everyone can learn something.

SpaceQuest Bar: at the heart of ☞Las Vegas Hilton, this is where I made $123.50 out of $7.50 with Video Poker.

Speakers Lounge: a room where people read their email, not always out of coffee.

Superbook Deli: serves ice cream at 4am, just in time when you return from downtown ☞Las Vegas after a few bottles of Jägermeister and ☞Sexy Blackjack.

Tempo: Bar at ☞Las Vegas Hilton that serves a nice Old Fashioned.

The 4-hour Workweek: EPIC FAIL by Timothy Ferriss. I wish I logged #railsconf during that talk, it was the best part (mail me your logs, if you have them, please).

The GitHub Panel: best panel, all questions answered (and pre-collected) and fun to listen to.

What Killed Smalltalk Could Kill Ruby Too: Finally a good (standing-ovation!) keynote, by Robert Martin. Even if I don’t agree with all points, allowing to make a mess easily is a problem in most languages I like.

What Makes Ruby Go: An Implementation Primer: Charles Nutter and Evan Phoenix go into relevant implementation details and lighten a few dark corners: Who knew super was that weird?

WiFi: inexistant for free outside, and highly limited at the Conference. (Seriously, if you do a tech conference for over 1000 people, why do you only get a 20mbit line?!)

Finally, I’d like to tell everyone at the conference, whether they paid lunch, dinner, drinks or the whole trip as well as everyone I spent nice hours with: thank you very very much! I had a great time, and I’m looking forward to meet you at a less crazy place.

NP: Sheryl Crow—Leaving Las Vegas

Off to RailsConf 2009

Fri May 01 19:29:25 +0200 2009

RailsConf 2009

Tomorrow I’m flying to Las Vegas to attend RailsConf 2009.

If you’d like to meet up, feel free to contact me.

Also, you should visit the panel I’ll speak at: Tuesday, May 5th, 2009: The Future of Deployment, “This panel is a chance to get forward thinkers from all the different parts of the Ruby web stack in one room.”

There likely will be a Rack hackfest (half the core team is there), maybe as part of CabooseConf or even more informally. Stay tuned and watch out for tweets.

NP: Bob Dylan—It’s All Good

Rack 1.0 has been released!

Sat Apr 25 15:55:50 +0200 2009

Today we are proud to release Rack 1.0, which was close to almost be codenamed MiddleWarem4Ever.

See the full release announcement with change log.

Thanks to everyone that helped development!

NP: Bob Dylan—Chimes Of Freedom

Programming for Android with Scala

Tue Apr 14 17:02:11 +0200 2009

Since I recently ordered a HTC G1 smartphone that runs Android, I wanted to be able to code for it as well. But since I’m a bit allergic to Java, I decided to figure out how to use the nice language Scala on it.

This turned out not to be very hard, but it was frustrating enough that I shall explain how I think to best do it. (Please notice that I don’t really know Java, barely know Scala, had no clue about Android, and generally avoid “the Java way”, so please bear with me, and report any mistakes I did.)

In theory, we can just use scalac to compile our .scala files to ordinary JVM .class-files and they would interoperate without problems. In practice, this approach should be avoided, since Android does things a little bit differently: it does not run Java byte code, but Dalvik byte code, and you need to convert the .class files to .dex files to make them run on the phone, a task I call dexing.

So you can try to dex your .class files together with scala-library.jar, and after figuring how to give dx (the dexing tool) more heap space (dx -JXmx512m), it will happily munch that, think a rather long time, and spit out a not-very-compact ~800kb Android .apk application that does nothing yet.

After doing that a dozen times, you run out of coffee. And swap, maybe. Now, don’t try to “pre-dex” the scala libraries, because in a .dex, everything is mangled into one file, and there are no tools to combine these files.

Instead, you should “treeshake” the application such that only the required Scala classes end up in the Android binary. I’ll use ProGuard for this.

To make things short, here is a step-by-step guide:

  1. Create the application skeleton (I use the Android SDK 1.1r1 for OS X):

    % activitycreator --out helloscala com.example.helloscala.HelloScala
    % cd helloscala
    
  2. Download Scala (I used version 2.7.3) and ProGuard (I used version 4.3), and extract them somewhere ($SCALA, $PROGUARD).

  3. Import the tools:

    % mkdir tools
    % cp $SCALA/lib/scala-{compiler,library}.jar tools
    % cp $PROGUARD/lib/proguard.jar tools
    
  4. Modify the Ant file. For your reference, this is the modified build.xml.

    Add inside the compile task:

    <taskdef resource="scala/tools/ant/antlib.xml"
       classpath="tools/scala-compiler.jar:tools/scala-library.jar" />
    <scalac force="changed" deprecation="on"
            srcdir="${srcdir}" includes="**/*.scala"
            destdir="${outdir-classes}">
        <classpath>
             <pathelement location="${android-jar}"/>
            <fileset dir="tools" includes="*.jar"/>
        </classpath>
    </scalac>
    

    Modify the dex task to look like this (“proguard” as dependency, changed fileset)

    <target name="dex" depends="proguard">
        <apply executable="${dx}" failonerror="true" parallel="true">
            <arg value="--dex" />
            <arg value="--output=${intermediate-dex-ospath}" />
            <fileset dir="${outdir}" includes="*.min.jar"/>
        </apply>
    </target>
    

    Add the proguard task:

    <target name="proguard" depends="compile">
      <taskdef resource="proguard/ant/task.properties"
               classpath="tools/proguard.jar" />
      <proguard>
        -injars ${outdir}/classes:tools/scala-library.jar(!META-INF/MANIFEST.MF,!library.properties)
        -outjars ${outdir}/classes.min.jar
        -libraryjars ${android-jar}
        -dontwarn
        -dontoptimize
        -dontobfuscate
        -keep public class * extends android.app.Activity
      </proguard>
    </target>
    
  5. Now, rewrite the .java file in Scala (don’t forget to remove the HelloScala.java file):

    package com.example.helloscala
    
    
    // we need these _root_ because com.android exists,
    // and we are in com.example.helloscala.
    import _root_.android.app.Activity
    import _root_.android.os.Bundle
    
    
    class HelloScala extends Activity {
      override def onCreate(savedInstanceState: Bundle) {
        super.onCreate(savedInstanceState)
        // use a bit of Scala's stdlib, just to show off
        setContentView(List(R.layout.main) first)
      }
    }
    

Done! Now you can build it by running ant.

If the build succeeded, check bin/HelloScala-debug.apk:

% du bin/HelloScala-debug.apk
20  bin/HelloScala-debug.apk

Nice and small (well, a pure-Java app only has 4k, but its a lot better than 800kb unstripped Scala standard library)! You can check which Scala libraries this uses with:

% jar tvf bin/classes.min.jar

Now start up the emulator, and when it has booted, install your application:

% adb install -r bin/HelloScala-debug.apk

Then, you can select it in the emulator, and you should see the default “hello world” screen.

Congratulations, you are running Scala on Android!

NP: Love—Laughing Stock

Upcoming talks

Mon Mar 30 21:11:08 +0200 2009

It’s kind of conference season again! You can see me speaking at these events:

RailsConf 2009

I’m looking forward to meet you at these events.

All material will be posted on my talks page of course.

NP: De los Muertos—This Changes Everything

Review: Lighttpd

Thu Feb 19 16:14:08 +0100 2009

Lighttpd
by Andre Bogus.
Packt Publishing, Birmingham 2008.
223 pages.

[Full disclosure: I have received a copy of the book in exchange for this review.]

The web server Lighttpd has become rather popular in the last few years and thus it was just a matter of time someone wrote a book about it. Packt published Andre Bogus’ book in October 2008. I review the first edition.

After a short overview of what Lighttpd is, the book starts with a chapter about installing Lighttpd. It is fairly detailed and contains installation instructions for many Linux distributions as well as how to install from source. It explains which configure options there are and which dependencies one needs to take care of.

Chapter 2 deals with basic setup of Lighttpd. After a quick overview of how to run Lighttpd the book dives into the configuration files. This chapter includes a short tutorial into regular expressions (PCRE style) as well as they are essential for rewriting/redirecting URLs and configuring specific parts of your site.

Chapter 3 explains how to set up CGI and virtual hosts. It gives an overview of the three modules for virtual hosting and explains how to use each one (mod_simple_vhost, mod_evhost, mod_mysqlvhost). Then, it shows how to setup and configure CGI, FastCGI and SCGI backends. While the setup is explained pretty well, I missed a section on debugging CGI, especially since this can be quite tricky at times. While not really part of Lighttpd, I’d also have expected a quick explanation on how to setup virtual hosts in the domain name system.

Chapter 4 is about serving and streaming static files, a task which Lighttpd really was made for. Traffic shaping, securing downloads with tokens and FLV streaming are addressed here.

Chapter 5 explains logging and log formatting as well as user tracking. Again, it would have been nice to mention more tools: there is a whole section on click stream tracking but the reader wont learn about any tool he can use to make sense of this data.

The next chapters are about security: Chapter 6 shows how to setup SSL with self-signed keys, an own CA, or by buying a certificate. This chapter is a bit too short and doesn’t detail debugging SSL, either. Chapter 7 tells how to secure parts of the site with passwords and the various authentication backends as well as how to avoid DDOS attacks by using mod_evasive. Chapter 8 explains how to run Lighttpd in a chroot, possibly separated from the backends.

Chapter 9 is about optimizing Lighttpd. The author uses http_load to benchmark the web server and shows a few options that can be configured in Lighttpd and the underlying OS (Linux and BSD are addressed) to make it faster. Elementary caching is explained as well. This chapter ends with an rather useless section on how to profile Lighttpd with gprof but doesn’t explain how this would help you to speed up your web server.

Chapter 10 (available online) is about migration from Apache. The reader should have no problems moving simple to medium complex Apache setups to Lighttpd, given that he can workaround the lack of .htaccess in Lighttpd. This section also tells how to use Lighttpd as a reverse proxy to forward requests it cannot (yet) take care of to different web servers.

Chapter 11 shows how to setup a few common web applications: Ruby on Rails with mod_fastcgi, Wordpress, phpMyAdmin, MediaWiki, Trac, AWStats and AjaxTerm. Apart from the last, they all use mod_fastcgi, which makes this chapter not very exciting.

Chapter 12 and 13 contain really original content that is not found easily on the net: Extending Lighttpd with Lua scripts (Chapter 12) and with C modules (Chapter 13). The author gives a short introduction to Lua and provides a few examples of using it to script Lua with mod_magnet: a random file server and a shoutbox are implemented. Chapter 13 introduces the Lighttpd API and shows how to write the random file server as a Lighttpd module. There also is an example of a module that adds proper doctypes to HTML pages.

The book concludes with an overview of HTTP status codes and a list of all Lighttpd configuration options.

Conclusion: The book is pretty compact and therefore occasionally too shallow. But it is well researched (I found no serious technical errors and just the few typographical goofs that are especially annoying in source code but seem to be unavoidable in modern technical books) and documents all aspects of the actual Lighttpd configuration. It includes many well-commented examples and code snippets. I would have wished it provided more detail on debugging configurations, setting up web servers beyond the actual Lighttpd configuration and modern application deployment (reverse proxying, load balancing…). Also, I found the index of the book rather lacking (for example, there is no mention of “Content type” in it). The stressed administrator may rather straight turn to Google or the Lighttpd wiki (which explains all options as well) than trying to find them in the book. Last but not least, I’d like to remark that the book is part of the “Packt Open Source Project Royalties” and the Lighttpd project gets “some of the money” Packt makes from each sale.

I can recommend the book to administrators and web developers that are new to Lighttpd but already have some experience in setting up web servers/web applications and who would like to get a good overview of the possibilities Lighttpd provides. Due to the last two chapters, the book also can be interesting for people that want to extend Lighttpd.

Rating: 4 of 5 points.

NP: Crash Worship—Bajo la Piel