Front Page

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

Goodbye weberberg.de

Thu Jan 01 15:28:20 +0100 2009

Und schon beginnt das Jahr mit gemischten Gefühlen… weberberg.de, die Bastion des oberschwäbischen Gonzo-Journalismus schließt ihre Tore. Ich werde diese Angelegenheit sicher mit einem lachenden und einem weinenden Auge sehen. Einerseits war die Bergzeitung, der blogartige Teil der Seite sicher oft zuviel des Guten, überladen von Trivialitäten und ohne Ironiedetektor kaum lesbar, andererseits war die Seite eben die einzige ihrer Art für Biberach. Hier wurden die Signale zu spät erkannt und Biberach steht zumindest im Bereich der tagesaktuellen Stadtnachrichten und -gerüchte wieder allein im Schatten der unsäglichen SchwäZ oder noch unsäglicherer Werbeblätter.

Obwohl ich wegen meines Studiums die meiste Zeit nicht mehr in Biberach bin, hätte ich da doch eine Idee. Die Leserschaft von Weberberg ist doch hoffentlich nicht ausschließlich so beschränkt und behämmert wie das Gästebuch (man könnte es das “4chan Biberachs” nennen) es scheinen lassen mag. Ich denke, ein kollaborativer Weblog, z.b. auf Scoop-Basis (vgl. Nensch) hätte sicherlich Potenzial und wäre eine Bereicherung für die Stadt. (Hierbei darf jeder Berichte einreichen, und die anderen stimmen dann ab, ob sie gut genug für die Titelseite sind. Auch gibt es eine ausgeklügelte Kommentarfunktion so dass dumme Kommentare schnell verschwinden und die lesenswerten Ergänzungen gut zu finden sind.) Ich könnte da beim Aufsetzen durchaus helfen, aber aufgrund meiner Hauptbeschäftigung eben nur passives Mitglied sein.

Bitte lasst euch schnell was einfallen.

NP: Single Gun Theory—Open the Skies (Remix)

Merry Christmas!

Wed Dec 24 01:23:57 +0100 2008

MÜNCHEN (cnpa) – In Sachen Weihnachten wird es dieses Jahr wohl zu erheblichen Verzögerungen kommen. Dies vermeldet jedenfalls das Kreisverwaltungsreferat für Kultur, Überfluss und paganische Bräuche. Nach dessen Angaben wurde der Weihnachtsmann nämlich mit einem deutlichen Hangover jüngst am Sendlinger Tor gesehen. Die Behörden gehen bisher von einer Überdosis Glühwein in Kombination mit einer Myrrhe-Bong aus.

Weihnachtsmann mit Hangover Am – statt mit – Sack: Der Weihnachtsmann.

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: Die Roten Rosen—Merry X-Mas Everbody

Zum vierten Advent

Sun Dec 21 15:21:12 +0100 2008

Nur ganz schnell:

NP: Rrrump—If You Want Me

Zum dritten Advent

Sun Dec 14 15:33:52 +0100 2008

Schon wieder Sonntag…

Bei wrongcards gibts “ecards that are wrong for every occasion!”, zum Beispiel diese:

Jetzt mal noch die Plätzchen alle machen… leider keine mit Bacon.

NP: Oceansize—Only Twin

Zum zweiten Advent

Sun Dec 07 11:21:29 +0100 2008

Erst mal paar Nachträge zur Adventskalenderliste letzte Woche:

Wer noch Geschenke sucht:

I remember Leslie Harpold.

NP: Brazilian Girls—Internacional

Zum ersten Advent

Sun Nov 30 11:34:52 +0100 2008

Die Polemik zum Christkindlesmarkt von letztem Jahr gilt immer noch, aber da ich nun die meiste Zeit in München verbringe, tangiert mich das nur wenig. In München gibts natürlich auch Weihnachtsmärkte.

An der Adventskalenderfront stehen mal wieder an:

Dieses Jahr Sterne mit Zirkel und Lineal konstruiert. 5-zackige, 17-zackige oder, wenn’s beliebt, 257- und 65537-zackige!

NP: Bearries—Explorer One

A RailsConf Europe 2008 diary... NOT

Fri Sep 05 07:39:22 +0200 2008

Around RailsConf Europe in six words.

Sunday: Arrival by train, St. Oberholz.
Then All-you-can-eat, Tacheles top floor. Yay.

Monday: St. Oberholz, Bratwurst on Rails.
Taught Geoffrey how to use zsh.

Tuesday: Vietnamese dinner with Sean O’Halpin.
Then RejectConf at Pirate Cove (Arr!),
Then to Ambulance Bar and Tacheles Garden.
To bed at about 5 am.

Wednesday: Deutsches Technikmuseum, dinner at Marx.
Then Ambulance Bar, Tacheles first floor.
To bed at about 6 am.

Thursday: Dinner at the Ständige Vertretung.
Then Ambulance Bar (See the pattern?).

Friday: Flight home, way too early.

Thanks and greetings wholeheartedly go to:
Scholle5 for the apartment and WiFi,
Members of #caboose I stayed with,
for the good time and community,
Geoffrey Grosenbach for his unhidden praise,
Sean O’Healpin for dinner and beer,
All barkeepers in previously mentioned places,
Yikes, I accidentally my whole fleshlight!

See you all in near future.

Almost overheard: Rails is getting stale.

NP: Queen Adreena—Princess Carwash

Off to Berlin

Sat Aug 30 18:20:12 +0200 2008

Busy packing my stuff to travel to Berlin where I’ll play lobbyist at RailsConf Europe 2008 (i.e. I don’t have a ticket.)

Please contact me if you want to meet up, I’m there until early Friday morning and have lots of free time.

I’ll be taking my EEE PC with me, so mail and IRC ought to be available, given I find some free WLAN (no deal).

I’m staying with Jarkko Laine, Cristi Balan, Andrei Bocan, Manfred Stienstra, Eloy Duran, and Lars Pind. Gonna have a good time.

Anarchaia will resume publishing Friday, September 5.

NP: Queen Adreena—Medicine Jar

Bookmarklets for relative navigation

Fri Aug 22 01:36:29 +0200 2008

It’s been increasingly popular to add rel="next"/rel="prev" link tags to web sites, but users of most popular browsers (and that includes me, as Safari and Firefox user) don’t have a way to access them out of the box.

Yes, there are Firefox extensions to add them, but I’d prefer not to have another toolbar sticking around. I already have a Bookmarks Toolbar, and thus decided to implement this feature as a Bookmarklet.

There you are, that wasn’t very hard, just drag these links into your toolbar: rel=prev, rel=next. You can adjust them easily if you need additional directions.

To test them, go for example here. And no, my site doesn’t support them (currently).

It rocks for dashing through blogs.

NP: Fiona Apple—Not About Love