1. dpkg version sorting

    Use this as you would use | sort | to sort package names according to dpkg versioning logic:

    #!/usr/bin/perl
    sub dpkgcomp
    {
      return 1 if(system("dpkg --compare-versions $a lt $b"));
      return -1 if(system("dpkg --compare-versions $a gt $b"));
      return 0;
    }
    @l = <>;
    chomp(@l);
    @s = sort dpkgcomp @l;
    print join ...
    read more
  2. SQL debugging tip

    When you’re using a lot of SQL from a programming language (be it PHP or C++), put comments inside all your queries indicating which function executed them. That way, logging becomes much more useful, like this:

    sqlite3_trace: SELECT /* createobject uniquecontext */ content FROM objects WHERE id=4

    (I did not ...

    read more
  3. computers plotting against humans!

    Technically I’m a glorified notepad. My ancestors were little keypads with basal unintelligent storage capabilities and names like Sharp and Casio. By pressing their keys you could call up telephone numbers and short messages on impossible-to-read little LCD screens. I’ve searched the histories and studied examples, and I ...

    read more
  4. SSL certificate expiration

    A simple oneliner that I’ve had to look up three times now, so I’m blogging it:

    openssl s_client -connect secure.gay.nl:443 | openssl x509 -noout -dates

    read more
  5. putty URL selection

    Double-clicking in Putty selects what Putty considers to be a word. However, URLs are not considered words, which is very annoying.

    The fix turns out to be simple: in settings > Windows > Selection, assign `:’ (ASCII 58) to class 2.

    Don’t forget to save your settings.

    read more
  6. DST bugs

    various trains delayed by exactly one hour

    Sunday morning, a few hours after we went into DST, I noticed this while checking for train delays: the international train was -exactly- one hour late.

    I’m just assuming that’s a conversion error somewhere :)

    In related news, people parking their cars during the switchover paid one hour too ...

    read more
  7. A plea for favicon

    tabs with favicons

    Everybody should have a favicon! It doesn’t have to be beautiful or anything, just have one! I find that favicons make tabbed browsing (I’m using Firefox) so much easier. Imagine all tabs in the image to have the same default ‘piece of paper with a folded corner’-look ...

    read more

« Page 3 / 3

blogroll

social