I'm starting a new series on this blog, called Useful Tips, where I... hum... will try to give what I consider to be... useful tips? (damn, I'm really bad at words).

This one I'm stealing from an email I just got from Doug Moran, our big data buddy at pentaho, and it provides a way to configure the big data shim throughout one or many platforms

-------

Hey guys,


You may find this little script useful for setting shims. It will look in all folders below the folder it is running in and set the shim to to a specific value. I have several versions of Pentaho and sometimes only want to set one at a time so I added a directory flag. Other than that, it’s just stuff I ripped off from Matt B.


Works on the Mac, should work on linux. Windows users are out of luck (but you knew that already, unless they use something like cygwin, that makes windows at least bearable...)

Sets or displays the value for shims from folder on down


setshim.sh [-h] [-d folder] [shim]


-h display usage help
-d the directory path to use or current if not set
shim the shim to set as active hadoop config. If not set, display which shim is active


setshim.sh - Displays the current value for all shims in current folder and below
setshim.sh hdp20 - sets hdp20 as active shim from the current folder and below
setshim.sh -d 5.1 cdh50 - sets cdh50 as active shim from the folder named "5.1" and below
setshim.sh -d 5.1 - Displays the current value for all shims in folder named "5.1" and below
setshim.sh -d / - Displays the current value for all shims on the entire filesystem



And here's the scrip. Have fun!

More...