Friday, October 07, 2011

PLEASE Stop donations to JAPAN

In the middle of March 2011 the world was astonished by the images of the earthquake and the tsunami that desolated Japan.
Millions of people around the world prayed for the victims of this natural tragedy.
Donations of different types started flowing into japan from all over the world to help the affected people.

This week, Japan astonished us again, when the Agriculture and Fishing Minister Michihiko Kano announced that they will resume their bloody Whale hunt. Once again, the ships from the country of the "Raising Sun" will try again to hunt, kill and dismember “1000 whales" to feed the internal market (the whale meat is sold at upscale restaurants for over 100 dollars a pound … about 220 dollars a kilo)

As if this weren't enough, the Japanese government has committed 74 million dollars (in posteriors press declaration they promised 40 million dollars, still a ridiculous amount of money) to help equip the Whaling fleet, and promised to send a patrol ship to protect the whale murderers (last year they were unable to fulfill their governmental quota due to the interference imposed by the ecologist group “SEA SHEPHERD”).

According to the information from several sources (wikipedia,JE&SR, Yahoo , and others), after the March disaster the Republic of JAPAN has received about 200 million dollars in cash and another 200 in material goods, now the Japanese government plans to use between 10 y 20 percent of it in order to kill whales.

If the Japanese government can waste many like this, is pretty evident that they do not need any kind of donations.

An old Scuba diver told me once that the red disk in the Japanese flag is not due to the "Raising Sun" but to the blood of the whales they have killed.
I leave you my visualization of that concept.





Finally, I invite you to visit the wonderfull "Secretos del Mar", by Tito Rodriguez (who was my scuba diving instructor and a real passionate of the sea).

El nombre de la ballena
La pesada carga de la ballena
Discutir lo indiscutible
Azul esperanza
Fantasma
Orejas y colas




Thursday, August 25, 2011

TiVo Redux


One of gadgets that fascinated me in the USA is the TiVo, a device that can be described as a VCR without tapes, but TiVo is much more than that.


How would you like being able to watch live TV and then pause it to go bathroom? Or rewind it to see again details that you might have lost? TiVo allows you to do this and more.



If you live in a country in which TiVo CORP has activities, your TiVo will connect every night to one of their servers and download the TV programming guide for the following the 2 weeks.



With this information allows the device to do some really cool things: you can forget about specifying the channel and the time in order to record a program just browse the programming guide and select the program to record. Or just ask it to record all programs with “Star Wars” in the title, or any comedies staring “Jim Carey”, and TiVo will do it automatically.







The TiVo on the inside

Beyond the user interface, TiVo is just a computer.

It has a processor (RISC or MISP, depending on the model), a video interface, a power source, a hard drive, several serial ports, and a modem; some models include USB ports, and even a Network connector. The only thing missing is a keyboard! 

But this is not an ordinary computer. Every TiVo has an integrated TV tuner (similar to those found one any VCR), a MPG coder (turns the Video into MPG-2 files) and a MPG decoder (turns MPG-2 files into video).



One of the limitations of these units is the processor, which is old and slow. Since the unit contains dedicated circuits to handle the Audio and Video conversion, there was no reason to include a more powerful (and therefore expensive) processor.

Besides storing Video, the hard drive contains the operating system (a version of Linux). And this is one of the greatest news for computer geeks.



By using Linux OS, TiVo Corp. it is forced to freely share all the improvements that they make and distribute, and that greatly benefits the community.

TiVo has fulfilled that commitment (although they usually take their time), but have also generated a great debate by refusing to share those programs and libraries that they developed “from scratch”; some interpret that all improvement (including new libraries or programs that implement existing libraries) must be shared freely, whereas others maintain that only improvements to existing elements must be shared.



If this was not enough, TiVo Corp. restricts (by digital signatures) the software that can run on this equipment; Once again, some people interprets that this goes against the rules of GNU GPL (the license that regulates the use of Linux and other programs), while others interpret that it’s perfectly OK.



This is called Tivoization and a great debate has grown around it, to the point so that the Free Software Foundation has decided to publish an updated version of the GPL that clearly prohibits this activity.



TiVo is a not the only product of its kind, ReplayTV and the new DirecTV+ have similar characteristics. You can even grab a regular PC, add a TV or Audio/Video capture card and a specialized software (Windows' Media Center, and MythTV are some of them), and you have a DIY product with similar characteristics.

But TiVo was first to have a massive presence in the market, and one of simplest to use.



Cue the hackers.

As with most technological products, user groups soon formed, sharing knowledge, and trying to add functionality, discover hidden options, or simply to learn how things works. There are several such TiVo groups, but the 2 best known are TiVo Community (http://www.tivocommunity.com/) and Deal Database (http://www.dealdatabase.com/), this sites became forums for knowledge transfer and sharing, and the community soon started to adapt some common Linux applications to work on TiVo, and developed techniques to avoid the restrictions that TiVo CORP implemented to avoid external programs.

Soon a large number of applications were available for TiVo: FTP clients and servers, email readers, RSS clients, Caller ID, games, websites showing the recorded programs, and even tools to transfer recorded programs from TiVo to a PC.

One of the premises on “TiVo Hackers” communities is that their work should not be used to undermine TiVo Corp.’s income in countries where they offer service. We believe that TiVo is a magnificent product and nobody wants to damage TiVo Corp., for that reason we try to ensure that the information we share will not be used to use the product without paying in the markets that TiVo covers.


iVo's Internationalization:

Friday, January 21, 2011

POWERSHELL: Accessing the internet thru a Proxy

Today I needed to make this script work behind a proxy, something that I have found in the past but was not able to find a good set of instructions.
I got it working and I wanted to share it with you, in case someone else is looking for it.

all you need to do is add the following 4 lines anytime before downloading the data (I prefer to do it right after instancing the WebClient object):


$proxyObject = new-object System.Net.WebProxy("MyProxyServer", 8080)
$proxyObject.BypassProxyOnLocal = $true
$proxyObject.Credentials = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.GlobalProxySelection]::Select = $proxyObject


I hope it helps.
Best regards, Marianok.

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.

Caveats
@ 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.


Usage:
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




EXAMPLE

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

[HKEY_CURRENT_USER\Software\Marianok\Myapp]
@="default value of the key"
"MyAppName"="SuperApp123"
"MyAppServer"="SomeServer"

[HKEY_CURRENT_USER\Software\Marianok\Myapp\Config]
"bottom"=dword:00000000
"left"=dword:00000000
"right"=dword:00000000
"top"=dword:00000000
"color"="red"



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

Friday, October 16, 2009

Windows 7 on my Tablet

A few months ago I bought an old but nice (Pentium M, 1.5GB RAM, 30GB drive, wireless, Bluetooth) tablet to experiment and to use it as an eBook (in my opinion something far better than Kindle, the Amazon’s eReader).

One of the things I wanted to test were the new features of Windows 7, but the machine has no CD / DVD, and I have no USB-DVD.

I had read, long ago, that it was possible to create a version of XP that fit in (and boot from) a USB, so I decided to investigate whether it was possible to use a USB drive to install Windows 7.

It seems that my idea was not original, because I found a dozen blogs and articles describing how this was done.

After reading “ Install Windows 7 from a USB Flash Drive " and "Windows 7 on LE1600 - Installation from pen drive ", I decided to give it a try.

I downloaded Windows 7 Professional from Microsoft.com and I borrowed a Sony USB 5 GB from work.

I followed the instructions to the letter, but every time I tried to boot from the USB, the light blinked a couple of times and then it would just remain ON while the display only showed a blinking cursor.

Evidently, this was a boot issue. I tried doing a bootsect / nt60 , but this did not help ...

I thought that maybe the computer was slow to access the USB and it might only be a matter of patience. It was already 1 am, so I decided to call it the night and to leave the system running, but the next morning everything was unchanged.

The next day, I borrowed the USB drive, and decided to try again ...

Researching a bit more I found that " How To: Install Windows 7 Beta from a USB Key! " recommends formatting the disk as NTFS rather than FAT.

I gave it a try, this time the system started to boot, but it stopped with an error:

File:\Boot\BCD
Status: 0xc0000001
Info: An error occurred while trying to read the boot configuration data


I Google it and Bingil , but did not find a convincing solution...
I decided to try again from scratch, and sure enough, it failed again (as Einstein would say: "only a fool does the same thing over and over and expecting different results").

There I remembered that a few days ago, while updating the firmware of a system at work, a vendor insisted about not booting from a USB over 2 GB. I figured there might be a connection.
I had a 2GB USB, the issue is that the installation DVD of Windows 7 has more than 2 GB and therefore had not tried.

I decided to test, at least to help determine the problem.
Copied the whole disc except for a single file (\sources\install.wim), I knew that that file is the most important of the installation process, but I decided to continue, after all this was just a test to see if I could boot.

I placed the USB on the table, and rebooted, and lo and behold! The Windows 7 Setup began to run. Of course, as soon as I clicked install, the program complained that he could not find the file.

OK, one step forward and a new challenge...

I Connected the USB 5 GB (still had the image of my previous attempts) and clicked install, the 5 GB USB was not accessed even once and the installation failed just as before ...

I Rebooted the system to try again. This time, the 5GB USB was read, but the installation failed as before.

Looking around, I found a way to access the CMD, and I began to investigate.

My hard drive was there, in the good old C: my 2GB USB was seen as D: and the 5GB as E:, the system was running from a virtual drive X: (later determined that it was based on information from \sources\boot.wim ).

Last year we created the images for the 1200+ Windows Vista machines at work, and I became quite knowledgeable of the Windows installation process. I knew that the installation program can told from where to take install.wim information.
This option is primarily for organizations to put the file on a centralized server, or a modified version of the OS, but it should be fine for my needs.
As far as I remembered, there were two ways to specify this setting to the installer process: through an “unattended installation file” (what we had done in at work to configure the VISTA machines), or through a parameter to the executable.

I did not have an "unattended file" (nor the time or the desire to create one), so I decided to use the parameter InstallFrom for the executable.

Once again, I went to CMD, and run " setup.exe /InstallFrom:e:\sources\Install.wim ", the installer ran, but gave me the same error than before. I tried a few variations (without the file name, from different locations, adding the directory path, etc), but none worked.

I started to check the virtual disk X:, and navigated to the “Phanter” directory witch, I remembered my experience with VISTA, has the log and records of the installation process.

After a while of reading those files (very entertaining, especially when using only TYPE MORE ), I realized what my problem was: The installation and was already running.
This CMD window in which I worked had been launched from the installer and was running within the environment of the installation program, so every time I executed the setup command, the installer was restarted in memory instead of a new one being executed. That is why it was ignoring my parameters.
The program was set to find the installers in D:\Sources, and there no convincing him otherwise.

Thus, I had two choices: to create an automated installation file (unattended XML file), or tricking the system to use the USB 5GB instead of 2GB.
I needed to replace an existing disk (D:) with another disk (E:), I knew the E: drive had all the same information from the D:, so if I could replace then I should have no problem even if the system tried to look for files in the old location.

Had I have access to the disk manager I would had simply changed the drive letters, but this was not the case.

Then remembered an old DOS 3.11 command SUBST which lets you assign a drive letter to a directory.
It was a very useful command when, back in my PC-XT, we copied the games to the HD diskettes, sometimes a game would complain if it was ran from a directory, in those cases we used SUSBST to give it a drive letter and played the game from that “drive”.

I wasn’t sure if the command was still available, particularly in the reduced CMD console of the installer, but turned out to be there.

I gave it a “dry test”: SUBST R: E:\ ran smoothly, and DIR R: returned the expected result.
I knew that SUBST cannot use a drive letter that is already in use, thus I needed to eliminate the D: in order to replace it with the E:, but if I boot without the 2GB USB I would not be able to reach the installer. Catch 22

After a bit of thinking, I realized that the installer was running on Windows (a reduced version but still Windows), and I knew that the plug-and-play was working (it had detected my keyboard as soon as I plugged in).
With a little luck, if I removed 2GB USB the system would release the drive letter ... or it would hang completely:-P

I crossed my fingers and removed the USB 2GB ... the system continued to operate, good sign. :-)
I ran SUBST D: E:\ and it executed without errors, I did a DIR D: I got the expected results.
It was time for the ultimate test: I clicked on install and hold my breath until the system started to install my new OS ...

A few minutes later my tablet joined the Windows 7 family !!!! :-)

Lessons learned:
"Never retreat, never surrender"
It took me 3 days and many attempts, but finally achieved what I wanted!

"Long life to DOS!"
Most of the troubleshooting I did was using 2 very old commands TYPE and MORE , and also the solution was an old command: SUBST .