Wednesday, October 20, 2010

A Prayer For My Son

Recently, thanks to some former students from the Liceo Naval Almirante Gullermo Brown, I came across this poem from General Douglas MacArthur, I found it really amazing and I can surely identify myself with the feeling.

I Hope you like it as much as I do.

A Prayer For My Son

Build me a son, O Lord, who will be strong enough to know when he is weak, and brave enough to face himself when he is afraid; one who will be proud and unbending in honest defeat, and humble and gentle in victory.

Build me a son whose wishes will not take the place of deeds; a son who will know Thee — and that to know himself is the foundation stone of knowledge.

Lead him, I pray, not in the path of ease and comfort, but under the stress and spur of difficulties and challenge. Here let him learn to stand up in the storm; here let him learn compassion for those who fail.

Build me a son whose heart will be clear, whose goals will be high; a son who will master himself before he seeks to master other men; one who will reach into the future, yet never forget the past.

And after all these things are his, give him, I pray, enough of a sense of humor, so that he may always be serious, yet never take himself too seriously. Give him humility, so that he may always remember the simplicity of true greatness, the open mind of true wisdom, and the meekness of true strength.

Then I, his father, will dare to whisper, “I have not lived in vain.”
General Douglas MacArthur

Sunday, July 04, 2010

A very special 4 of July

I'm writing from "washington rock park", in green brook, NJ
I'm here watching the end of the firework celebration of july 4th, 2010, for me this is a very special 4 of july.

This is not my first independence day firework. My first was back in 1990, when Stella (rest in peace) took her younger daughters, Melissa, Jennifer and Pamela to a 4th of july picnic at a park in the outskirts of Chicago. I'm not sure if she invited me or I invited myself :-), the thing is that I went along.
I still remember the hundreds of people, the countless blankets on the grass, the live music band, the food carts (yeah, I like food), and the stands selling chemical lights, blinking wands, american flags and pins.
This was also the first time I've seen such a wonderful firework display coordinated with the live music. Certainly something that I will never forget.

As I look around tonight, I can see new york, Staten Island and a few dozen NJ townships and most of them have set up their our fireworks, and while the are quite far away, the view is breath taking.

But this is certainly not the greatest firework show I've seen.
I think that the best one was back in 2005, when we (Nahuel, Nicolla, Paola, and me) drove 9 hours each way to spend independence weekend at the Niagara Falls.
That night was AMAZING, the number of fireworks, the music in the speakers (recorded music, but sounded really nice), and the illumination "coloring" the waterfalls was really nice. Laying there watching the show with friends by my side, and a drink on my hand, was really awesome.

I remember many other 7/4 celebrations, flipping burgers with friends, watching illegal fireworks, drinking beers on the porch, etc.

Yet, today is the most special one, because today is the first time I watch it as a US Citizen, today I'm celebrating MY country's birthday.
Happy birthday USA !!!!!

Friday, February 19, 2010

Convert Registry file to ADMX Policy file

Many times we need to apply a registry file (.reg)  to our many systems (1400+), and it's a real pain ... specially that we really like using Group Policies for everything.
if it's just a few values we create an ad-hoc registry policy and set the values thru GPO, but when we have a large .REG file with a lot of settings things become a lot harder, and we have to start dancing around figuring out how to best deploy this settings.
To make things worse, after a while, we would look at the policy and trying to figure out what those registry setting meant and where they came from ... like I've said: a real Pain ...

In the past, I attempted to create an ADM file for a couple of our most common application, but I gave up due to the complexity of the ADM syntax.

Last weekend I was thinking about this again and I decided to give it another try. I did not want to use and "old" standard, so I decided to research the ADMX policies. I opened the ones I found in my systems and it seemed pretty simple to understand.
So I downloaded the ADMX samples and the schema/syntax definition from MS and got to work.

Luckily for me, the syntax is really simple, XML simple, and I quickly realized that instead of creating a new ADMX to apply the setting of my problematic .REG file, I could create a tool to parse any registry file into a corresponding ADMX policy definition.
It took me the whole weekend but by 2 AM Monday I had a functional (and much debugged) tool.

I did not had any development tool installed on my system so I decided to use good-old VBScript to write the tool. This has the added bonus that anyone can read it and update it without much requirements.

What it does
Reads a registry file (.reg) and creates the corresponding ADMX and ADML files that would allow to set the registry values detail led in the original .reg file.
in order to create the GUI definition required by the GPMC, it makes a few assumptions:
a) the "name" of the value is also used as the caption for all displays.
b) all dwords values are assigned a numeric textbox for data entry
c) all other value types are treated as strings and assigned a textbox for data entry.

@ or (Default)
The tools will not handle correctly the "@" or unnamed valuename. This is the one that in the registry editor shows as (Default).
The reason for this is that I have not been able to find the correct way to define this in ADMX/L.

WORKAROUND: For now it's assigning the value to a "(Default)" value, but as you can see in the examples bellow, windows does not recognize this "(Default)" value as the real "(Default)" value.
I will need to find an existing ADMX that sets this kind of values and read it's XML in order to learn how it's done. OR maybe someone can let me know so I can correct the tool.

Hex, Hex(0) ...
This is another example of things that I was not able to learn from the ADMX files that I have available.
We have several cases of registry files that assing a value composed of several 2 char Hexadecimal values, but I have not find any ADMX file that applies this kind of settings to to policies.
WORKAROUND: For now, and until I can find the way to do it correctly, the script will make this hexadecimal values into a text.
I will need to find an existing ADMX that sets this kind of values and read it's XML in oder to learn how it's done. OR maybe someone can let me know so I can correct the tool.

CSCRIPT REG_2_ADMXL.vbs registry-file language [name]

registry-file is the name and path of the registry file to be converted.
language is the language and culture to be used, ie: en-US, sp-AR, etc.
name Display Name to show in the GPO. if omited "REG_2_ADMXL Generated Policy" will be used.

The output file will be named after the .REG file (if the input is myfile.REG, the output will be myfile.ADMX and myfile.ADML.
The ADMX output file will be saved in the same folder the input .REG file is located, while the ADML output file will be saved in a subfolder of the one the .REG file is located. The subfolder will be named after the language specified.
So, if the reg file is C:\myapp\myfile.reg and the lang is en-US, then the ADMX file will be as in C:\myAPP\myfile.ADMX and the ADML file will be saved as C:\myAPP\en-US\myfile.ADMX


I converted the following .reg file into ADMX/L
Windows Registry Editor Version 5.000

@="default value of the key"


So I ran the following command:
CSCRIPT REG_2_ADMXL.vbs c:\temp\myregfile.reg en-us

(the last parameter basically defines the language and culture to use, in this case US English)

The tool generated 2 files c:\temp\myregfile.ADMX and c:\temp\en-us\myregfile.ADML

Once you have the ADMX and the ADML files you can use them in the Group Policy Management Console to edit your GPOs more confortably.

The following 4 images show the test GPO created from the .REG file above

Notice that the diferent registry keys (the Path) became nodes on the tree, and that the "Config" Key is correctly subordinated to the "MyApp" key.
Also notice that in order to help the people that might be using this ADMX file in the future, the tool will add a description to each one of them detailling what keys is being affected.

Here one of the values was selected.
Notice that the "@" from the .reg file was replaced with (Default).
Also notice that the tool has added a comment to each setting detailling what registry value will be affected, what was the datatype reported in the .reg file and what was the value assigned in the original .reg file.

Same for the MYAPP\CONFIG node.
Notice that there are 4 values, but only 3 are enabled (only this 3 will be applied to the targets).

In this screen you can see one being edited.
Once again you can see the description/help that was created by the tool based on the .reg file.
Also notice that the value that was assigned in the original .reg file has become the default value for the field.

This is the report from the Group Policy Management

This is a millon times more readable than the mess of registry keys and setting that the GPM would be showing if we did not have the ADMX/L files inplace.
Notice that only 3 values are listed under the CONFIG section, that it's because the fourth is still disabled.

Now, after the GPO was applied to the user/workstation, we can see the registry:

Notice the issue I was mentioing before with the (DEFAULT) valuename. There are 2 of them one without data and the other witht he data we were trying to assign.
Had I imported the registry file into this system the first one would have a value ("default value of the key"), but this is not happening.

Here is the Config folder, notice that the fourth value does not show, just as expected.

WOW, that was a long post :-) ... sorry, but I'm really exited about this work :-)
if you want it, feel free to download it from my site