« December 2007 | Main | February 2008 »

January 25, 2008

Off

Things have not been good this past month.

My oldest kid got chicken pox, and a couple of days later I got it. And a week later the youngest got it.

It hit me pretty bad, and only last week I was able to start working again, but still felling a bit strange. This week I've been on and off with fever and body aches, weird.

So a lot of downtime, and given that I'm laptop-less until I can get the LCD fixed, I have "the shakes" like a good addict.

Thinks seem to be getting better now and I hope to forget the last 45 days soon.

In the meantime, I have about 20 posts in the draft folder so somethings cooking.

Bug of the day

In a project for a client:

# remove duplicate raw lines
my $dups = $self->dups;
return if $dups->{raw}++;

Should have been:

# remove duplicate raw lines
my $dups = $self->dups;
return if $dups->{$raw}++;

No wonder all lines except the first where dups...

January 17, 2008

Hello ICQ/AIM!

Welcome aboard!

xmpp.oscar.aol.com:5222 seems to work. Login with your AIM/ICQ credentials.

Via Mickael and jdev.

Update: the service has been on and off as expected from an unofficial test service. The AOL engineers did a pretty good job for a alpha version.

So far this works:

  • connect with both AIM and ICQ accounts, using ICQ_UIN@aol.com or AIM_SCREENNAME@aol.com;
  • talk to any AIM, ICQ and .Mac accounts;
  • typing notifications work fine;
  • you can join ICQ chat-rooms.

Things that I could not make it work:

  • file transfers;
  • avatars.

All in all, its a great first version, and I can only hope that AOL starts talking about this publicly, because I think all the XMPP community is eager to help out.

Right now, we only have client-to-server via XMPP, so any XMPP client can connect to the ICQ/AIM servers but requires a ICQ/AIM account. Of course, the final destination is server-to-server connectivity, so that I can chat with AIM/ICQ buddies without a ICQ/AIM account.

When GTalk appeared, it took them about 6 months to open up server-to-server, so its normal to show up with client-to-server and move up to server-to-server.

So lets give them some time.

Congrats to all at AOL. Welcome!

Software projects management and code review tools

In the past day or so, I came across with a couple of tools that are worth mentioning.

First, FogBugz is now at version 6, and its better than ever. They have a small screen-cast online about the new version. If you just need to see one feature, I suggest you fast forward to 4:00 and see the part about estimates and how they use it to calculate delivery dates. If you can afford it, its worth the price.

The second set of tools is about code review. I'm testing these two I found online and they seem very nice, but its too soon to pick one. The contenders are:

Sun is buying MySQL

Whoa....

My first reaction was "Nooooo....", but I'm more on "Let's see how this goes" now.

January 16, 2008

Small and light

The new Macbook Air is really small and light. The pictures are very impressive.

Anyway, not my kind of laptop. I could live with the soldered-to-the-logic board memory, but the non-replacable battery is not a good trade-off.

The Apple TV upgrades are much more important to me, mainly because they are all available on the current hardware. But until we get proper content in Europe, it's still sort of a half-product. And if you look through the specs and check that Apple does not provide, or easily allow the installation of the Perian codecs with it, at a time that all the consoles are supporting DivX, well, it just gets sadder. All this means that I will not upgrade my Apple TV until its properly hacked.

For those who want to watch the Keynote on your Apple TV, and don't want to wait for the update to the "official" Macworld Keynote Podcast on iTMS, you can download the mp4 file.

January 11, 2008

PHP bashing and PHP prase

For my PHP friends out there:

Even if you are not a PHP user (left that wagon around PHP4), the setup wizard bundled with the Simplicity framework is very cool, an extjs-based application to create the application, including designing your database schema.

Help.pm

Amazing article by Mark Dominus, explaining the code of a simple but very useful class Help.pm.

January 10, 2008

Network Mafia

In a stunning move, Network Solutions renamed it self as Network Mafia.

I wonder if they also do this if I query the whois database from another registrar website.

MacFUSE.framework and the first strange FS

Yesterday, Amit Singh announced a new version of MacFUSE at the Google Mac blog.

The major new feature is the MacFUSE.framework, and today, I already found a strange filesystem built with it: the Objective-C runtime FS.

Objective-C has a very cool runtime, that allows you to dynamically discover available classes, methods and other information. So now you can cd NSString if thats your kind of thing.

I wonder how long is going to take to implement execution of specific methods directly from the shell...

January 09, 2008

NetNewsWire 3.1 is out and its free

Wow... The latest version of NetNewsWire, 3.1, is out. And its now a free download.

I'm was a paying customer and I can only say, congratulations to Brent and Newsgator for this bold move.

I expect that they plan on charging you for the Newsgator Online service, which I don't use, but its a cool move. Update: It turns out that the online version and the sync services are also free. Excellent value. (via comments).

BTW, this applies to all NewsGator client software.

Related posts:

January 08, 2008

DTrace'ed perl

Cool. Bleadperl runs without delays with dtrace enabled.

I wonder if this will make it to 5.10.1, hope so.

Yahoo + Flickr + OpenID?

This can be found on any http://flickr.com/photos/YOUR_ID/ page:

<link rel="openid2.provider" href="https://open.login.yahooapis.com/openid/op/auth" />

You cannot use that login as an OpenID yet, but it should live soon, apparently.

Another win for OpenID.

Update: more comments from Simon Wilson.

January 05, 2008

Regarding reverse proxys

Right now I use both Perlbal and Lighttpd as reverse proxy.

Lighttpd does a lot more than reverse proxy, and I also use it as a web-server for static content and mod_secdownload for certain content. But the current stable 1.4.x version is not that good reverse proxy. For example, it does not keep persistent connections to back-end servers, and sometimes he thinks all my application servers are dead when they are in perfect health.

Perlbal is a much much better reverse proxy. It keeps persistent connections up to back-end servers, and before using them for client requests, it makes sure the server is really ready to answer requests. It also caches file uploads to disk before allocating a back-end server to process the request. All this features keep the back-ends pretty busy and without stalls. But as a web server for static content, its just not as good as Lighttpd.

I've been working with three upgrade paths.

The first is use Perlbal for reverse proxy for the application servers and remap all static content to a different site. This also makes sense because if you move your static content to a CDN, your site will load a lot faster.

The second is using Lighttpd 1.5.x. The last time I tested it, it was still a bit unstable with my setup, so its in the back-burner for now.

The third is to use Varnish. Its wicked fast, extremely configurable, and it does caching. But it takes a bit to get into, so its a bigger time investment than the other two.

Right now, I think that Varnish would be the best bet of them all, but I don't have the time right now to get up to speed with it. So I'm going to use the first option, using Lighttpd 1.4.x to power my CDN server, just because I need modsecdownload.

Easy staging server setup

Before a new release of a web site, I like to give it a whirl using the production environment, including servers and database. To make the experience of the staging server as close as possible to the production server, I want to use the same hardware and server name for both.

At first I used different IPs, aliased to the same server, one for production and another for staging, and I used my local /etc/hosts file to switch between the two environments. This works but its a pain, because I have to restart the browser to pick up the new address, and also, I have to do this on every computer that wants to check the new version.

The new setup is much better.

It uses two application servers, production and staging, running on the same server, on different ports, and then use the front-end Lighttpd reverse proxy to select between the two instances based on a cookie.

The relevant part of the Lighttpd configuration is this:

# Staging server
$HTTP["cookie"] =~ "(; )?app_version=staging:" {
  proxy.server  = (
    "" => (
      ( "host" => "127.0.0.1", "port" => 7005 )
    )
  )
}

# Production server
$HTTP["cookie"] !~ "(; )?app_version=staging:" {
  proxy.server  = (
    "" => (
      ( "host" => "127.0.0.1", "port" => 7000 )
    )
  )
}

This setup uses a cookie named app_version. If app_version is set to staging, Lighttpd will use the application server at port 7005. If not, it will fallback to port 7000. This works even if we don't have any cookie.

Currently, only internal users use the staging server, so I have an option in the back-office site to select the version they wants to use.

You should notice that I don't do any security checks on the cookie, so anybody could set the cookie and use the staging version. To prevent this, my app_version cookie includes a SHA1 checksum of the content using a secret string (so its really app_version=staging:40-char-hex-sha1-checksum). Yet, I don't check the SHA1 in the front-end proxy, that would be wasteful of CPU for the vast majority of users using the production server. Instead, I have optional code to validate the checksum in the main application server. That code is only enabled on the staging version and displays an error message.

The final problem I needed to solve is identification of the current server. People got confused, they didn't had a clear indication if they where using the staging or production server. To solve that, I just enable a small HTML '<div />' and appropriate CSS in the staging server, and this will float a nice "You are using the staging server. Switch to Production"-message. The "Switch to Production" part is a link to the back-office tool that removes the cookie.

With these things in place, I can push release candidates to staging without worrying to much about it, have the other people at the office try it out, and then if all is ok, run a script on the main server and deploy the staging version to production.

Update: this also helps for rolling updates. For example, you could use this setup to keep two production versions available, and use the login process to move users from the old version to the new one.

January 04, 2008

SOAP dudes need our help

Paul Downey:

If you know someone still slipping around on the SOAP, don’t hate them, just warn them the longer they continue the sillier they look. They deserve your sympathy, not hate. Just give them lots of hugs!

in "End of an Era".

Browser-based living

So, without a Mac at home (I only have a borrowed Mac mini now, until I decide what to do with my broken Macbook Pro), I only have a Windows Laptop with a browser.

This means that all the tasks I took for granted, can only be performed now if I have a browser interface to them.

My mail does not, although I almost have Outlook configured to use my IMAP account. My RSS feeds are also out, never used the NetNewsWire synchronization to Newsgator, but I'm now back to writing a bit using Movable Type web interface.

Living in a browser really sucks, compared to all my desktop tools. Really. I don't understand how people prefer Web-based apps to real desktop ones. Granted, the synchronization problem is non-existing if you only use Web apps, but still, it feels a lousy trade-off.

Now back to bed and my next book.