• Excel sort by length of string

    I received a question today on how to sort a list of strings which was actually rather simple to accomplish.

    The following list is the original sorting:

    • caca
    • cocacola
    • ca
    • cacacacacola
    • c
    • cacacacacacacaac
    • cacaa

    The requested list after sorting should look like this:

    • c
    • ca
    • caca
    • cacaa
    • cocacola
    • cacacacacola
    • cacacacacacacaac

    What I first did was to create a separate column to contain the length of each cell. There is a function in Excel which easily calculates the length of a string: LEN(). Now I had two columns, the first unsorted string column and the second length (of the first column string) column. As you probably have realised by now it was a simple matter of sorting the second column instead of the first for the strings to sort by length.

    If interested in seeing it I have attached the test sheet for you to play around with:

    Length String Sorting

  • What is a Kill-Bit?

    After booting up Windows XP I encountered an automatic update notification. During the progress I noticed an update named something like “…kill-bit ActiveX…” which I could not identify what was for and therefore looked it up.

    The Kill-Bit appears to be something as simple as a registry entry to disable vulnerable ActiveX controls or COM objects so they can no longer be loaded in Internet Explorer or other applications based on the MSHTML rendering engine.

  • Virtualmin scheduled backups strftime usage

    I have been using Virtualmin for several years which is one of the greatest modules for Webmin allowing simple set-up and management of virtual hosts. Inside the “Scheduled Backup” feature I came across the “Do strftime-style time substitutions on file or directory name” check box but never actually properly made use of it:

    Virtualmin Scheduled Backup

    I came across a project which required very frequent backups and to distinguish each backup from another I decided to give it a shot. The strftime function uses standard POSIX conversion specifications which very easily lets you build powerful combinations of date and time.

    As an example you can use the following string:

    /backup_%Y_%m_%d_%H.%M

    which would leave a directory with the following name:

    Now each backup will be created with a different name instead of simply overwriting the previous one.