pilif.ch is back

It has been a while since I lost pilif.ch. Two years to be exact.

Fortunately, it looks like the domain grabber who took pilif.ch after that unfortunate accounting incident has since lost interest, so now pilif.ch belongs to me again. About bloody time!

Aside of the fact that my online identity has always been pilif (despite lipfi sounding much friendlier when pronounced in swiss german), there are other reasons for me wanting the domain back:

  • it’s in my MSN-ID (passport@pilif.ch)
  • various other @pilif.ch addresses are registered at various services I’ve since forgotten the password for.
  • it was the very first domain I bought – ever.

So it’s back to the roots for me. MX, Web and DNS are already configured (the zone file is actually symlinked to lipfi.ch – I have no idea whether this is a legal thing to do, but it works).

Home – sweet home!

Old URLs fixed

I have just added two rewrite rules to automatically translate most of the old s9y-URLs to something WordPress understands.

The first one was easy and could be done in WP’s .htaccess-file:

RewriteRule ^archives/([0-9]+)/([0-9]+).html$ /$1/$2 [R=permanent,L]

This handles the s9y-style archive URLs for monthly archives – something that got quite the amount of hits apparently – at least that’s one of the 404 errors I’ve encountered the most in my logfiles.

The second one is the direct link to old posts. While this could be done in a PHP/.htaccess-only solution, I took the opportunity and learned how to do custom url maps for mod_rewrite which, of course, only work in the httpd.conf, so this isn’t probably something everyone can do on their hosting plan:

RewriteEngine On
RewriteMap s9yconv prg:/home/pilif/url-s9y2wp.php

After defining this, I could use the map in WP’s .htaccess:

RewriteRule ^archives/([0-9]+)-(.*).html$ /${s9yconv:$2} [R=permanent,L]

The script is very simple as you can see here:

while (($line = fgets(STDIN)) !== false){
    $line = preg_replace('#.html$#', '', $line);
    $line = sanitize_title_with_dashes(preg_replace('#^[0-9]+-#', '', $line));
    echo "$linen";

While WP is configured to create permalinks containing the date, you can usually just feed it the URL-ized title and it’ll find out the correct entry to use. This has the advantage that the script, which is long-running per the specification of prg-rewrite maps, is kept as simple as possible, which is needed as PHP doesn’t always free all allocated memory – something you don’t want to have in long-running processes like this one. This is why I redirect to something WP still has to do some work on: It spares me to do all the database-handling and stuff.

If I had to do this without the ability to change httpd.conf, I would use a rule like this:

RewriteRule ^archives/([0-9]+)-(.*).html$ /s9y-convert.php/$2 [L]

and then do above logic in that script.

Both approaches work the same, but I wanted to try out how to do a dynamic rewrite map.

Another new look

It has been a while since the last redesign of gnegg.ch, but is a new look after just a little more than one year of usage really needed?

The point is that I have changed blogging engines yet again. This time it’s from Serendipity to Word Press.

What motivated the change?

Interestingly enough, if you ask me, s9y is clearly the better product than WordPress. If WordPress is Mac OS, then s9y is Linux: It has more features it’s based on cleaner code, it doesn’t have any commercial backing at all. So the question remains: Why switch?

Because that OSX/Linux-analogy also works the other way around: s9y is an ugly duckling compared to WP. External tools won’t work (well) with s9y due to it not being known well enough. The amount of knobs to tweak is sometimes overwhelming and the available plugins are not nearly as polished as the WP ones.

All these are reasons to make me switch. I’ve used a s9y to wp converter, but some heavy tweaking was needed to make it actually transfer category assignements and tags (the former didn’t work, the latter wasn’t even implemented). Unfortunately, the changes were too hackish to actually publish them here, but it’s quite easily done.

Aside of that, most of the site has survived the switch quite nicely (the permalinks are broken once again though), so let’s see how this goes :-)

External blogging tools

Ever since I started blogging, I have been using different tools to help me do my thing.

At first, I was using the browser to directly write the articles in the MT interface, but after losing a significant amount of text that way, I quickly migrated to writing my entries in a text editor (jEdit back then) and pasting them into the MT interface.

Then I learned about the XML-RPC interface to MT and began using w.bloggar to do my writing, but stagnation and little quirks made me to back to a real text editor which is what I was using for a long time (though I migrated from MT to s9y in between).

Last year, I caught the buzz about Windows Live Writer, which was kind of nice, but generally, I need more freedom in writing HTML than what a WYSIWYG editor can provide me with – especially as I have my special CSS rules for code for example that I prefer to just manually setting the font.

So I was back to the text editor (which went from jEdit to TextMate in between).

And then I noticed the blogging bundle.

The blogging bundle for TextMate allows me to keep writing my blog entries in the tool of choice, while being able to post the finished entries direct from within TextMate.

Basically, you configure some basic settings for your blogs and then you write a colon-separated list of values at the beginning of the document which TextMate uses to post your entry.

It can fetch categories, configure pings and comments, set tags – whatever you want. Directly from your editor where you are doing your writing. Of course you can also fetch older postings and edit them.

So this provides me with the best of both worlds: Direct posting to the blog with one key press (Ctrl-Command-P) while writing in the editor of my choice that is very stable and provides me with the maximum flexibility at laying out my articles.

I love it.

Prewritten content

You may have noticed that last week had postings on nearly every day – and all the postings seem to have happened around 8:30am.

The reason for that is that I had a lot of inspiration on last Monday, allowing me to write two or three entries at once. I made Serendipity queue them up and post one on each day.

And as time progressed, I was adding more entries which I could schedule to the future too, thus keeping the illusion up that I was actually posting at 8:30 in the morning – a thing I’m certainly not thinking about doing.

While I’m awake at 8:30, I am most certainly not in the mood to post anything not to speak about the lack of inspiration due to not having surfed the web yet.

Writing content ahead of time has some advantages like allowing for better editing (much more time to read before the entry is posted) and it helping keeping the blog alive (a post for every day), but it also has some disadvantages: For one, the entries may not be as deep as one I’m writing for the moment.

After writing down an entry or two, I’m feeling a bit of a burnout, which certainly has negative effects on the entries length and depth.

And even worse: s9y insists on sending pings when the entry is submitted – not when it’s published.

This means that I’m sending out pings for non-existing entries (bad thing) or I’m not sending out pings at all (slightly better).

So in retrospect, I’m going to do both: Posting ahead and posting in real-time.

An insider trick to find out if the posting is pre-written or not would be to look at the posting time: If it’s 8:30 in the morning, it’s prewritten.

Correlation between gnegg.ch and WoW

If you take a look at the archive (a feature I’ve actually only discovered just now), you’ll notice quite an interesting distribution of posts here on gnegg.ch

2002 was where all started. November was still a bit slow, but in December I really got into blogging only to let it slip a bit during 2003.

2004, I began subscribing to tons of RSS feeds which provided me with a lot of inputs for my own articles. You’ll notice a significant increase of posts during the whole year.

Then, in 2005, my WoW-time began. My first WoW-related posting was from February 21st, 2005 and makes a reference to when I bought WoW, which would be – provided I’m calculating correctly – February 15th 2005.

Going back to the archive, you’ll immediately notice something happening to the post count: It’s steadily going down. From a good 9 entries in January (pre-WoW) down to one entry in October which is more or less when I got my first character to level 60. In November I was affected by my first fed-up-ness of WoW which lasted till January 2006 (post count coming up again – despite having christmas and all which was keeping me away from computers.

Then, in January, I was playing again, getting closer to 60 with my second character in February (just one posting).

March was WoW-less again due to my feeling of not having anything to do any more.

In mid-April, I began playing again and started my third character… (posts going down) – which I got 60 with at the end of May.

June was playing at 60 and before the end of the month, I began feeling fed-up with WoW. And burned out. I clearly felt to have wasted way too much of my life. And I felt like I was truly addicted to WoW. So I used the emergency break and stopped playing.

As you can see, I was back to 16 posts in July which also was due to my “Computers under my command”-series which was easy to do due to the topics being clear in advance.

August is interesting. Have a look at the month calendar and guess when I took my lv60 character out again!

More or less regular postings here until August 10th. Then nothing.

September is better again because I put my WoW to a deep-freeze again – especially after having seen what WoW does to my other hobbies. gnegg.ch is a very nice indicator in that regard.

So I’m coming to all the same conclusion as Adam Betts who also stopped playing WoW due to noticing his real life being severely affected by WoW.

World of Warcraft is highly addictive and I know of no person who could say not being affected by this. Once you start to play, you play. Even worse: Even if you think that you got it behind you and that you can control it, it just takes over again.

So for me it’s clear what I have to do: I will stop playing. For real this time. No taking out my character again. No-more-playing. I won’t delete my characters as they are the result of a lot of work, but I will cancel my subscription.

I’m really grateful for the archive function of gnegg.ch as it was a totally clear indicator of my addiction and it still is a perfect way to prevent me from going back as everyone will know I have due to the post count going down again.

Where have I been?

Long time no see. Where did yours truly go? Back to World of Warcraft (which was the reason for the lack of postings during 05)? Or something even worse?

I’m pleased to say that the WoW-times are more or less over. Granted: I still log on to the game here and then, but the pleasure I was getting out of playing the game is more or less gone.

There are more fun things to do than playing WoW and I’m currently enjoying them. WoW finally has regained the state of standard evening leisure as one of many alternatives of how to waste my time.

But back to the reason for my absence:

Since april this year I know that I will move into my very own flat. Back in April, it was a date far off with lots of things still needed to be done – things I didn’t bother about yet back then.

But now, November 1st is getting closer and closer by the day. And stuff still needs to be done.

And this is precisely why I somewhat lack the time to blog.

Writing an entry here on gnegg.ch consists of many tasks: First there’s inspiration. I browse the web, live through my day at work or just talk to colleagues of mine. Sooner or later something will happen about which I want to talk.

Then, I think about the subject and try to serialize my thoughts to create an entry that’s (hopefully) interesting to read.

And then I sit down and write the thing. This is the task that actually takes the least amount of my time (inspiration is the hardest for me – often times, I think the subjects are too obvious or too uninteresting to blog about).

The final thing is the proofreading – a task I’m not really good at.

So an average entry here takes about two to four hours to do – time I currently rather use for planning where to put existing furniture, where to buy new furniture (and where to put it of course), who to hire to install a new bathtub and so on.

This is a big thing for me. When I moved to my current flat back in 2001, it was more or less a “getting away from my parents” (don’t get me wrong: I love my parents). I moved more or less into the first available flat – also because it was hard as hell to get one in Zürich back then. So I took the opportunity.

Now it’s different. For one, this is my flat. Yes. I bought it. It’s mine. Then it’s more than three times as big as my current one. And it’s beautiful. Just filling it with my current furniture doesn’t give it the credit it deserves.

So, this is what’s keeping me absorbed.

Still, work is very, very interesting currently and I have lots of interesting stuff to write about in the pipeline (so inspiration is there) and I’m looking forward to post these entries. Today and in the near future.

Blogroll is back – on steroids

I finally got around to adding an excerpt of the list of blogs I’m regularly reading to the navigation bar to the right.

The list is somewhat special as it’s auto-updating: It refereshes every 30 minutes and displays a list of blogs in descending order of last-updated-time.

Adding the blogroll was a multi step process:

At first, I thought adding the Serendipity blogroll plugin and pointing it to my Newsgator subscription list (I’m using Newsgator to always have an up-to-date read-status in both Net News Wire and FeedDemon) was enough, but unfortunately, that did not turn out to be the case.

First, the expat module of the PHP installation on this server has a bug making it unable to parse files with the unicode byte order mark at the beginning (basically three bytes telling your machine if the document was encoded on a little- or big-endian machine). So it was clear that I had to do some restructuring of the OPML-feed (or patching around in the s9y plugin, or upgrading PHP).

Additionally, I wanted the list to be sorted in a way that the blogs with the most recent postings will be listed first.

My quickly hacked-together solution is this script which uses a RSS/Atom-parser I took from WordPress, which means that the script is licensed under the GNU GPL (as the parser is).

I’m calling it from a cron-job once per 30 minutes (that’s why the built-in cache is disabled on this configuration) to generate the OPML-file sorted by the individual feeds update time stamp.

That OPML-file then is fed into the serendipity plugin.

The only problem I now have is that the list is unfairly giving advantage to the aggregated feeds as these are updated much more often than individual persons blogs. In the future I will thus either create a penalty for these feeds, remove them from the list or just plain show more feeds on the page.

Still, this was a fun hack to do and fulfills its purpose. Think of it: Whenever I add a feed in either Net News Wire or FeedeDemon, it will automatically pop up on the blogroll on gnegg.ch – this is really nice.

On a side note: I could have used the Newsgator API to get the needed information faster and probably even without parsing the individual feeds. Still, I went the OMPL-way as that’s an open format making the script useful for other people or for me should I ever change the service.

One day with Serendipity

Here we go: Everything migrated. Every link (hopefully) fixed. Worked around (I think) some problems with images uploaded from MT clashing with Serendipity’s (s9y from now on) mod_rewrite handling and re-categorized every entry: the new gnegg.ch is up and running.

So, how is life with s9y?

Fist of all: I got no single comment SPAM. This is due to the better SPAM countermeasures and due to all URLs changing. I’ll have to see how good the SPAM prevention will work, though I have an idea it can’t be that bad (see below).

While s9y is slower than MT in delivering pages (understandable considering MT is generating static pages), it’s more feature-rich compared to MT – at least if you consider s9y to be a blogging engine, not a framework to create blogging-engine-like tools.

I love the plugin system: There’s nothing you can’t write a plugin for and people seem to have noticed that – at least considering the wealth of plugins available for you to download and install (directly from the administration interface).

Also, because I’m using a premade template and because s9y is a bit more intelligent in reusing templates, the whole site finally has a consistent look. No more usage of outdated templates when commenting or displaying error messages.

The most interesting thing though is the SPAM prevention: When you post a comment, it will go through the following procedure:

  • Is it exactly the same comment as another posted before? If so, reject it. This prevents a spammer that got through once from getting through again. And it prevents you from double-posting by accident.
  • Is your IP-Address posting a comment within 2 minutes after posting another one, the comment will be rejected. I know proxy servers and NAT routers exist and I will tweak the time if I should ever get more popular. A cookie-based approach obviously doesn’t work to flood-protect the blog from malicious spammers.
  • Does the comment point to an URL listed on SURBL, it’ll be rejected. I’m sorry, but this is a sacrifice I must ask for.
  • If you post a comment to an entry older than 30-days, it’ll be insta-moderated. I promise to activate it as soon as possible.
  • If you post to a comment older than 7 days, you’ll have to solve a captcha, just to be sure. If you cannot solve it, feel free to contact me via Email
  • After you post a comment with more than 3 links, I’ll have to approve it first. If you post more than 20 links, it’ll be rejected.
  • A word-filter is active aswell, though I think all these measures stop the spam before even getting here.
  • If all this fails, I’m sure the SPAM will be detected by Akismet

While I know that some restrictions may hurt you, please believe me that the restrictions are in place to both increase the overall quality of content here and to make my life a bit easier.

Serendipity really is a nice blogging engine. Go ahead and try it!

New face, new engine, new everything

Management Summary of this longer entry: 1) Comments are back, 2) I’m using Serendipity instead of Movable Type and 3) This layout – though premade – is going to stay.

But now my reasoning:

As I’ve stated earlier today, I had enough comment spam arriving on gnegg.ch. Not only the blog was filled up with junk, but also my mailbox was hit (MT was sending mails for every comment).

To underline how BAD it was, notice this: During last weekend I was off the internet most of the time. In the two nights (friday to saturday and saturday to sunday), gnegg.ch was hit by 683 SPAM comments, of which MT only classified 4 as spam.

For each of these 683 comments, I got an email message. Which was especially bad as I was checking mail from my mobile phone (that was the most expensive mail checking process in my life I guess – imagine the sheer size of only the headers)

Even worse was the interface for comment removal: The biggest page size I could select was 50 comments, so I had to delete the comments in groups of 50, each time waiting for the affected pages to be rebuilt over and over again.

There is a mutliselect option in MT, but it always affects all comments per page, so chosing to display all comments and then using the “Select All” feature would not have helped as it would have deleted the legit comments too.

This just so you understand why I had to do something. I did not want to have another “fun” comment removal session next sunday evening (most of the comments get posted on the weekends – probably in the hope they will remain unnoticed for a while longer – which they did).

At first, I just wanted to turn off the comments and keep it at that.

But what is a blog without comments? Yeah. right… not much.

So I went ahead and installed Serendipity because I knew that it had some really nice SPAM-countermeasures included.

As I currently don’t have the time needed to port the old MT template over, I selected a template that comes with s9y and I have to say: It looks great, IMHO. I think I’ll keep it at this.

I’m no web designer and even if I could convince Richard to create a new layout for me (thinking that the old one just is a bit too dark and grey for my current mood), it would take AGES for me to create a Smarty version out of it, so I decided to go with premade templates.

And this one (Perun Blue) is really nice – IMHO even better than the old, custom made, one. So, I hope, you can live with this.

While the import process worked flawlessly, many links inside the site are broken and I’m currently in the process of fixing them.