English

TOP

Parallel DNS lookups using AnyEvent

Perl has a great asynchronous library: AnyEvent. (There may be even more great asynchronous libraries, but it decided to use AnyEvent.) I recently had to lookup a lot of different hostnames and didn't want to do it sequentially (because every single DNS server might be down or wait until the reply is received).

Weiterlesen
TOP

Perl -M-A-C tests

Perl supports various tests for file and directory states. Most are identical to their bash test siblings, but some additional are supported, like -M, -A and -C.

Weiterlesen
TOP

Setting up DKIM email signatures with Perl

DKIM may be called as PGP successor: PGP has been used by many people for signing their emails at a time when mostly technical related people had been using the internet. Today, few people still use PGP to sign their emails, but email servers took over this part using a technology called DKIM.

Weiterlesen
TOP

Hiding files with Apache

Not all files on a webspace should be accessible by anybody on the Internet. There are many tutorials for protecting directories or files with a password using a .htaccess file, but some files need to be on a webspace, which shouldn't ever be served by the webserver. This is a simple how-to-protect them tutorial.

Weiterlesen
TOP

The five faces of a Perl hash item

PHP calls it associative array, JavaScript calls it object and - in the eyes of other (older) languages like C, BASIC, Pascal or Perl - all of them are wrong. An array has some items which may be addressed using their position in the list, but only a Perl hash has named keys. A hash is basically an (unordered) list of items where each item has a key and a value - but that value may have one of many different states.

Weiterlesen
TOP

HTTP 303 Redirect

Everybody working with web technologies knows 200, 302, 404 and 500 - the most famous HTTP status codes. Many people also heard of 301, the permanent brother of 302, but there's another child in the 3xx family which is rarely known or used: The magical 303.

Weiterlesen
TOP

Did you know GROUP BY ... ORDER BY NULL?

Here are three SQL queries and one simple challenge: Order them by speed assuming that city has an index.

1. SELECT city, SUM(inhabitants) FROM population GROUP BY city
2. SELECT city, SUM(inhabitants) FROM population GROUP BY city ORDER BY city
3. SELECT city, SUM(inhabitants) FROM population GROUP BY city ORDER BY city DESC
Weiterlesen
TOP

Speed up RAID5/RAID6 write speed

I'm currently upgrading from Ubuntu 9.04 to Ubuntu 12.04, a long process as every upgrade does only one step. This is the price you pay for skipping all updates of the last years. It's even slower since I moved my root filesystem to a RAID6.

Weiterlesen
TOP

Hier weg und da hin

Drei Tage ohne neue Posts obwohl mehr als genug bloggenswertes passiert ist. Wie kommts?

Three days without new posts - what happend? A lot of things happend and many of them want to be blogged, but they aren't.

Weiterlesen
TOP

Remote debugging Perl scripts without SSH access

I'm used to use dedicated or at least virtual servers for projects, but currently, I'm working on two projects which are using simple webspace instead without SSH access. A cgi-bin directory is all you need for Perl, but what happens, if a script dies without an error message?
Weiterlesen
TOP

Converting a WordPress theme to MovableType

This blog is moving from WordPress to MovableType (at least, I'm working on it) but I don't want to miss my nice, red theme. There is no "RedBel" for MovableType, so I had to convert my WordPress Theme to a MovableType theme.
Weiterlesen
TOP

Multiple mt-static folders for MovableType on a shared webspace

MovableType requires all websites and blogs to access one global mt-static directory and also cgi-bin must be accessible if a search or comment function should be used. But MT doesn't support multiple mt-static folders - at least, I didn't find anything about this on Google. Here is some way to share a global mt-static and cgi-bin folder without access to the Apache config.
Weiterlesen
TOP

Retry failed Gearman jobs

Gearman is a great tool for farmed or distributed work. It's some kind of basic cloud handling: Many Worker processes (usually running on many different servers) are waiting for jobs to process and there's (hopefully) always another worker taking over if one worker (server) should ever die. But what happens, if a single job dies and should be repeated?
Weiterlesen
TOP

Setting up MovableType on a basic webspace

A MovableType installation isn't that easy like a WordPress upload, but it has many advantages. This is a little tutorial for setting up MovableType on a basic webspace without SSH access.
Weiterlesen
TOP

Quick JSON pretty reformatter / JSON-tidy

JSON is a commonly used format for data transmission, especially with Ajax calls. It's more structured and easier to process then XML, but could be just a wall of text depending on the creator. This oneliner reformats JSON to look pretty and human-readable.
Weiterlesen