jeroen.se
by jnieuwen
avoiding mistakes with numbering
Last week I thought a little about naming volumegroups on SANs, logical volumes, hosts and (micro)SD cards. They all have one thing in common, if you have a lot of them you hardly can avoid numbering them. The only problem with this is of course small typos that can lead to disasters. Fortunately there are of course solutions for this.
After some thinking I thought about using checksums in the numbering, which makes it harder to create a disaster with just one typo. The best scheme I could find to work for this was using the ISBN numbering scheme.
So i.e. I now number my (micro)SD cards as follows: As you probably can see the first number is the checksum digit. A number is valid if and only if the checksum digit + 2 times the second number + 3 times the third number + 4 times the fourth number ... modulo 11 = 0. Note that the checksum digit can also be X to indicate a value of 10.
If you look at the jni-60001 number. The checksum is 6. And the 1 is multiplied by 5. Summarized this makes 11, which modulo 11 is of course 0. So this is a correct number. But what if we make a typo i.e.:
Of course I created a script for this that does all the hard work. It can be found here.
0 comments

Nick:
Email:
Make your own addition with integers (needed to make sure you aint a spambot):
+ =
Categories
Cycling (2)
Gadgets (3)
Misc (22)
Scripting (23)
Travel (7)
Unix (24)
Archive
April 2010 (2)
January 2010 (1)
December 2009 (1)
November 2009 (2)
May 2009 (1)
April 2009 (1)
March 2009 (1)
February 2009 (7)
January 2009 (3)
December 2008 (1)
November 2008 (4)
October 2008 (5)
September 2008 (1)
August 2008 (3)
July 2008 (2)
June 2008 (2)
May 2008 (3)
April 2008 (1)
March 2008 (1)
February 2008 (1)
January 2008 (4)
December 2007 (1)
November 2007 (7)
October 2007 (4)
September 2007 (1)
August 2007 (2)
June 2007 (6)
May 2007 (8)