Category: tagged

  • Home and End keys in PuTTY

    I wondered why sometimes the Home and End keys work as expected during a SSH session via PuTTY and some other times it just writes tildes (~) instead. When writing long commands it is a real annoyance having to press down the left arrow to get back to the beginning of the command.

    A simple solution which worked for me was to change the Terminal-type String under the Connection > Data tab from the default “xterm” to simply “linux”:

    PuTTY Terminal Type String

    Now you should be able to use your Home and End keys to easily move the cursor back and forth during a SSH session using PuTTY.

  • Tags vs. Categories, my ontological classification

    When writing something I usually have a hard time categorising the content as very seldom it will fit into one single category. The solution to this may simply be adding it to more categories instead but then the category hierarchy actually breaks. Instead I definitely prefer to assign tags to content which is much more specific and does not limit you in any way, as there is really no predefined containers but instead any word in the vocabulary can be used to tag your content. During my research determining if WordPress actually had improved the categorisation system I came across an interesting piece of writing about ontology on the web which I recommend you to read through in its full length.

    The latest version of WordPress does seem to handle tags fine although there is some misconception between the tag and category idea. It is somehow mingled together to actually overlap each other although still not the same. I guess the WordPress developers are worried about legacy installations and possible issues during an upgrade path, so they keep things backwards compatible somehow.

    As you can see on this site I make no use of the categories whatsoever. I am forced by WordPress to assign any content to at least one category which I left as the default “Uncategorized”. The name is really irrelevant as I make no use of categories in the display. You may notice the tags assigned to each post just below the title where before the category was displayed.

    To make this little change depending on your theme you may have to edit a couple of files. In my own case I edited three files:

    1. page.php
    2. index.php
    3. single.php

    The change required is the same in all three files, namely replace the following snippet:

    <?php the_category(',') ?>

    with this one:

    <?php /*the_category(',')*/ the_tags( ' ', ', ', ''); ?>

    That is all. Now you will have a nice list of tags instead of the irrational categories list which does not really suit written content.

  • Google Analytics XHTML compliance

    I had to add the Google Analytics code snippet to this site and had some issues with it validating as XHTML 1.1 and MIME type application/xhtml+xml which were solved at the end.

    The snippet is divided into two pieces of <script> tags and the first part is simply a feature to avoid getting warning messages from your browser if your page was server over SSL (https://). If your site serves pages in both HTTP and HTTPS then you can achieve the same through e.g. a server side scripting language such as PHP.

    The snippet needs to be changed to the following on HTTP pages:

    <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>

    and of course on HTTPS pages use this piece:

    <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></script>

    Now the second part of the code needs to be put between CDATA tags to properly isolate it. The code will now look like this except you need to introduce your own Google Analytics ID:

    <script type="text/javascript">
    //<![CDATA[
    var pageTracker = _gat._getTracker("UA-1234567-8");
    pageTracker._initData();
    pageTracker._trackPageview();
    //]]>
    </script>

    Now you can safely run the W3 Validator without any errors caused by Google Analytics.