Debian – The best Linux distro

When one of my friend introduced me to Ubuntu Linux I was impressed by its user friendliness. Till that day I had used Red Hat Linux, Fedora and Knoppix. They were not cut out for an average PC user. In my opinion a geek using Linux doesn’t make Linux popular. Its an average PC user who will make it popular. The guy who introduced me to Linux was not a software guy in fact he is a doctor, oncologist to be precise. Ubuntu replaced Red Hat as my preferred Linux distro. Then came Compiz and shiny effects on Ubuntu made me a die hard fan. Till then I didn’t know Ubuntu was based on Debian. Then for more than 2 years, I didnt boot into Windows, when I needed Windows I ran it in a VM environment in Ubuntu. But Ubuntu was for an average user and this year I decided to switch to Debian. It turns out that I made a correct decision.  According to TuxRadar, Debian is the the best Linux distro of 2011! If that wasn’t all, Debian was favoured by Linux.com as their choice of production server.

Use WordPress Update Services to automatically create static XML feeds

WordPress blogs server Atom and RSS feeds by default. One can outsource this job to a 3rd party services like feedburner. The existing built-in system in WP serves XML feeds on-the-fly. What that means is a if a feed reader/consumer requests your feed then WP is actually querying MySQL, doing all the back-end server side job and serves a hot, out of the oven, feed every time even if the posts are days or months old. This should not bother a very low traffic blog. But then you can set up WP to create physical static feed files using a plugin. This works for most of the scenarios. But I had a requirement that wanted a remote server to fetch and display those feeds. So even if I had set up a plugin to create static XMLfeeds to avoid server hits, the remote server would still need to query my server introducing network latency. There is a way out. WP has a built in update service that tells remote servers as soon as there is a change in blog. This service is known as “WP update service“. This is a sort of RPC service. You can provide WP a remote URL that should be notified as soon as a change in blog occurs. Now its up to that remote service to take an action on it. On my remote server I set up an action which as soon as receives this update message contacts my blog, fetches a feed and caches it locally. Now the remote server doesn’t need to look at my blog until and unless there is a change, of which it will be notified. One can take this a step further. In update services set up the url to a script on same blog that will connect to your blog and create XML feeds along side your blog files in feedsfolder. Use this code in your in wp-content/themes/{your theme}/functions.php

remove_action( 'wp_head', 'feed_links_extra', 3 ); // Removes the links to the extra feeds such as category feeds
remove_action( 'wp_head', 'feed_links', 2 ); // Removes links to the general feeds: Post and Comment Feed

This will stop printing the default URLs for feed in HTML source and in wp-content/themes/{your theme}/header.php add the URLs for actual feed files that now your script is creating. No need to install a plugin. The only drawback I see here is when you update your skin you loose this particular customisation. Other than that its a pretty good way to create static XML feed files and save your server some hassles.