MGBrown.com

New Year Resolution Idea

It's that time of year again where people are trying to think of resolutions to make for the new year. So, I thought I would suggest everyone try to back up their data.

As someone that's known for being a bit techie, every so often I have a conversation like this:

Them: "Help! I've lost all my data."
Me: "Do you have a backup?"
Them: "No"
Me: "Oh dear! That's a shame."

The main calamities that occur are:

  1. The person accidentally deleted something.
  2. The person lost the storage device their data was on.
  3. The storage device the data was on had a technical failure.
  4. A malicious person hacked the computer encrypted the data and is now asking for a ransom.
  5. Acts of nature: fire, flood, lightning strikes, etc.

While it is impossible to reduce the risk to zero, a backup solution will give varying degrees of protection against all of those.

There are various ways of setting up a backup. Just copying data to an external drive is probably the easiest to set up, but it's also easy to forget to do it. Online storage services (OneDrive, Google Drive, iCloud and DropBox) can be good but can also be expensive and don't always protect well against accidental deletion. The way I do it is that I have a Network Attached Storage (NAS) device with duel hard disks that all our computers back themselves up to every hour or so. Then I periodically take a copy of the NAS to a portable hard drive and store that away from the house.

Here is a list of useful links to get you started:

Finally, if you have lost some data and don't have a backup there is still some hope. Often data that was stored on corrupted drives or files that were deleted are actually still partially there. With encrypted drives and SSDs this is less likely than with the old Hard Disks. There are tools and services which may be able to recover them, however these are a bit hit and miss and sometimes expensive. If you do the wrong thing you can make these recovery tools less effective so don't do anything without first getting advice.

RegExEditor goes open source

I originally developed the RegExEditor tool as a personal project for my own use and simply published it here as a favour to the world. As it serves my purposes well I have not had the inclination to do much further development on it.

All the time however I get requests from people for this or that feature and most of these would make the product much better. Most of the things I get asked for would be a lot of work and I just don't have the time in my busy schedule. So I decided today, after some prompting by Prados Valiente Enrique, to open source the product.

The source repository can be found on CodePlex at http://regexeditor.codeplex.com/

I have never been involved in the open source world much, other than to use the fruits of other peoples labour, so it will be an interesting experience to see how this turns out. If you have any words of wisdom for someone just starting out on their first open source project please leave them below.

C# Function for converting an Int to Roman numerals

using System;

public static class Int32Extentions
{
    public static string ToRoman(this int number)
    {
        if (-9999 >= number || number <= 9999)
        {
            throw new ArgumentOutOfRangeException("number");
        }

        if (number == 0)
        {
            return "NUL";
        }

        StringBuilder sb = new StringBuilder(10);

        if (number < 0)
        {
            sb.Append('-');
            number *= -1;
        }

        string[,] table = new string[,] {
            { "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" },
            { "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC" },
            { "", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM" },
            { "", "M", "MM", "MMM", "M(V)", "(V)", "(V)M", "(V)MM", "(V)MMM", "M(X)" }
        };

        for (int i = 1000, j = 3; i > 0; i /= 10, j--)
        {
            int digit = number / i;
            sb.Append(table[j, digit]);
            number -= digit * i;
        }

        return sb.ToString();
    }
}

Cannot dump domain hosting settings when backing up Plesk

I have been working with Parallels Plesk 9.0 control panel software to enable one of my customers to administer their web server more effectively. As part of this I set up the Plesk backup to run every night. At the end of each backup Plesk sends an email giving the status of the backup. This status email was giving the status as "Task status is: warnings". This email also has a "migration.result" file attached which gives a bit more detail in XML format. Against each of the domains on the server there was this entry:

<message code="InformationalException" severity="error">Cannot dump domain hosting settings</message>

After Googleing and searching the Parallels web site and not finding anything much I decided to contact Parallels support. It turns out that this is caused by an issue with the way Plesk interfaces with SmarterStats. If you are experiencing the same issue there is a hot fix at http://kb.parallels.com/en/6144 and this will be included in a future Plesk patch.