Getting rid of the ‘www’ prefix

[lang_de]Dieser Eintrag ist nur auf Englisch verfügbar.[/lang_de]

You may or may not have heard about the no-www movement. All my sites have always been reachable with and without the www prefix, and I personally never use the www prefix if I can avoid it. I won’t get into the details of why it is a bad idea, but consider this: no one calls the web ‘WWW’ anymore, and this ‘abbreviation’ is a lot longer than the expansion (‘double-you double-you double-you’ vs ‘world wide web’). If anything, the prefix should be ‘web’.

Starting today, I’m having all my domains permanently redirect to the non-www version of the hostname.

Here’s a simple mod_rewrite recipe that should work for any domain:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L,NS]

Put it inside a <Location "/"> block in the appropriate VirtualHost block, or inside a .htaccess in the document root of your site (it doesn’t seem to work in a VirtualHost block in the server config, any ideas why?).

It’s like magic.

MasterCard [lang_en]r[/lang_en][lang_de]R[/lang_de]ebranding

[lang_de]
MasterCard rebranden. Von ihrem bekannten, zwei-farbige-verzahnte-Kreise-Logo zu einem neuen, das grundsätzlich sehr ähnlich ist, aber gerade unterschiedlich genug, um eine schlechte Idee zu sein.

Neues und altes MasterCard-Logo

Das neue Logo behält die zwei bewährten Kreise bei, rückt sie aber weiter auseinander und verkleinert sie. Die Verzahnung wird durch ein einfaches Überlappen mit Farbwechsel ersetzt, die Teile greifen also nicht mehr ineinander, sondern … invertieren sich? (Welche Message steckt hier bloß dahinter?) Als Zuckerguss auf dem Ganzen liegt dann ein dritter Kreis aus halbtransparenten Farbverläufen, so dass das Logo am Ende meiner Meinung nach eher nach einem Unfall beim Vektorzeichnen aussieht als nach einem passenden Image für eines der größten Kreditkartenunternehmen der Welt.

Zwei wichtige Punkte, die mir auf Anhieb einfallen:

  • Brand Awareness: Das MasterCard-Logo ist von überragender Bekanntheit. Zufällig ausgewählte Versuchspersonen konnten das Logo auf Anhieb fast immer recht genau wiedergeben. Sowas sollte man nicht leichtfertig aufs Spiel setzen.

  • Einfachheit: Das alte Logo benutzte drei Farben: Rot, gelb, und schwarz, konnte also mit nur zwei Schmuckfarben einfach wiedergegeben werden und skalierte auch gut “nach unten”, z.B. für zwei- oder einfarbigen Druck. Die Linien sind klar definiert und “easy on the eyes”.
    Das neue Logo hingegen klotzt gleich mehrere Farbverläufe in die Mitte des Logos und wird wohl immer nach Rasterung und Offsetdruck verlangen. Es ist auch schwer, sich das neue Logo z.B. einfarbig auf Textilien vorzustellen.

Letzlich entgeht mir wohl der Sinn des Rebrandings. MasterCard sagt dazu:

[die drei Kreise] reflect the company’s unique, three-tiered business model as a franchisor, processor and advisor

Ich schätze nur, dass es dem weit größeren Teil der Welt völlig Schnuppe ist, wie viele Geschäftsbereiche MasterCard hat – und dass der Teil, den es interessiert, es auch ohne das neue Logo wusste.

[/lang_de]
[lang_en]
MasterCard are rebranding. From their old, well-known, two-color interlocked circles logo to a new one which is basically the same, but just different enough to make the move stupid.

New and old MasterCard logos

The new logo keeps the two well-known circles, but moves them further apart and sizes them down. The interlocking is replaced by simply drawing the overlapping part in a different color, so the parts don’t intertwine anymore, instead they… invert? (What message are they trying to convey here?) The icing on top of it – literally – is a third circle filled with half transparent gradients, which results in the logo looking more like an accident in a vector graphics program than a fitting new image for one of the largest credit card issuers world wide.

Two important points that come to mind immediately:

  • Brand Awareness: The MasterCard logo is outstandingly well-known. Randomly selected persons could almost always reproduce the logo at first go. That’s not something one should risk lightly.

  • Simplicity: The old logo used three colors: Red, orange, and black, and could thus be reproduced using two spot colors. It also ‘scaled’ well to two color or even single color printing. The lines are well defined and easy on the eyes.
    The new logo instead uses multiple gradients in the middle of the logo and will always require rasterization and offset printing. It’s hard to imagine the new logo on fabric, for example.

Maybe I’m just missing the whole point of the rebranding. MasterCard state:

[the three circles] reflect the company’s unique, three-tiered business model as a franchisor, processor and advisor

I suppose, though, that the larger part of the population is completely uninterested to the number of business tiers of MasterCard – and that the part that is actually interested knew anyway.

[/lang_en]

MasterCard® is a registered trademark of MasterCard Worldwide.

IP to country: ip2countryd using hostip.info data

[lang_de]Dieser Eintrag ist nur auf Englisch verfügbar.[/lang_de]

hostip.info is a free GeoIP service. Unfortunately their webservice is slow and they are in the middle of a backend change (from 256 ip_X tables to one table listing all /24 nets…). However, their information is more exact than that of countries.nerd.dk.

To convert the data from hostip.info’s format into something remotely sane usable, you have to merge the ranges into CIDR-blocks per country. If you don’t do that, you’ll get a 160MiB result file which will take ages for ip2countryd to process. With proper optimization and merging, though, the resulting file is barely 4MiB in size and ip2countryd loads like a breeze.

  • ip2countryd-r3.tgz 12KiB
    Revision 3 of ip2countryd, minor changes, includes a script to convert hostip.info CSV dumps to rbldnsd format.
  • hostip-data.tgz 1.1MiB
    The current dump from hostip.info in rbldnsd format, including the cached version.

The test service at udp://ubermutant.net:8000/ has been updated to r3 with the hostip.info db.

Now, for the rant. Continue reading “IP to country: ip2countryd using hostip.info data”

IP to country

[lang_de]Dieser Eintrag ist nur auf Englisch verfügbar.[/lang_de]

If you need to find out what country an IP is in, but are forced to use PHP or some other language without proper DNS querying features (but which can do UDP), here’s a little something for you.

ip2countryd-r2.tgz 344KiB – ip2countryd revision 2
Includes the required data file (~2MiB) and the cached data (~432KiB).

Runs a daemon on UDP port 8000 (by default) that responds to an input IP address with the ISO country code of the IP’s country, or ‘error’ if anything goes wrong (no mapping, not an IP, etc.). There is a test server at udp://ubermutant.net:8000/.

$ nc -u ubermutant.net 8000
207.13.77.53
us
212.227.57.11
eu

Idea from WP-ShortStat and the associated ip2country service. I wrote this just for the fun of it and because I wanted to see how long it would take me.

Total time required: ~1 hour.

[lang_en]WordPress Statistics[/lang_en][lang_de]WordPress-Statistiken[/lang_de]

[lang_en]
I recently installed WP-ShortStat to gather blog statistics, and especially to make them more easily accessible (compared to webalizer). WP-ShortStat claims that one should just drop it in the plugin directory and enable it and it would work. Well, guess what happened.
[/lang_en]
[lang_de]
Ich habe vor kurzem WP-ShortStat installiert, um mal einfach verfügbare und lesbare (im Gegensatz zu Webalizer) Blog-Statistiken zu haben. WP-ShortStat behauptet, man müsses nur einfach nur ins Plugin-Verzeichnis legen, das Plugin anschalten, und es würde funktionieren. Ratet, was statt dessen passiert ist.
[/lang_de]
Continue reading “[lang_en]WordPress Statistics[/lang_en][lang_de]WordPress-Statistiken[/lang_de]”

UX UX UX (in multiple languages)

You are HP-UX. You're still strong despite the passage of time.  Though few understand you, those who do love you deeply and appreciate you.
Which OS are You?

[lang_de]
Hurrah. Hat irgendwie was von Horoskopen.

Eigentlich teste ich nur das Polyglot-Plugin. Es funktioniert, aber der Code schreit eigentlich nach einem Rewrite… später.

Augen nach oben rechts wenden, lustige kleine Flaggen sehen, ausprobieren, und hoffentlich keine Fehler finden… jetzt. 😉
[/lang_de]

[lang_en]
Huzzah. Feels a little like horoscopes.

Actually I’m just testing the Polyglot plugin. It works, but the code is literally screaming for a rewrite… later.

Look to the upper right corner, see the nifty little flags, try them, hopefully don’t find any bugs… now. 😉
[/lang_en]

Vegetarische Drogenkuh

Pfefferminz darf ja seit einer Weile raus. Jetzt habe ich beobachtet, dass er eigentlich immer sofort zur Treppe läuft, sich halb hinlegt – und Gras frisst.

Mögliche Erklärungen:

  • er hat eine Abhängigkeit von Gras entwickelt;
  • er ist in Wirklichkeit eine kleinwüchsige Kuh mit verstärktem Haarwuchs;
  • er ist Vegetarier;
  • all of the above.