An Elegant Concept in Scripting   Leave a comment

The scenario:
Students use our equipment. They break things, for a variety of reasons. We need to harden the surfaces as much as possible, so the next student to use the equipment can start in a useable environment.

Cisco equipment (must have copied this from Microsoft) often needs to be power cycled in order to configure it properly. We are presenting all of these labs remotely so we have serially controlled power strips that are flipped via short cuts on the student desktop.

Shortcuts are inherently insecure. If the users can edit them, they can kill them. Plus we had to pass parameters to our script, and you wind up with ‘’ “’’What?’”” very confusing sets of quotes. So how can we securely pass a parameter to our script from the desktop and not depend on the user, nor allow the user to change it?

The Solution:
1) Encode the vbs script with Screnc.exe
2) Save the script in a folder on which the user only has read & execute rights, and point the shortcut there (no quotes necessary)
3) Place the parameters in the name of the encoded script, and parse them out in the script
4) Use Rename from windows explorer to change the parameters, copy as needed

———

‘ POWER CYCLE ROUTER
‘ Author: Roger Brandt,  2007
‘ The name of the file determines the message and which outlet to power cycle.
‘ PowerCycle-S1-302-R.vbe
‘ Ex : PowerCycle-NN-Ooo-P[-M].vbs
‘ NN : Name of equipment
‘ Ooo : Outlet O=Powerstrip/ComPort; oo = Outlet number
‘ P : Prompt Style. R=Router; S=Switch; N=No Prompt
‘ : Prompt Style can be overwritten to N with a N command line argument
‘ M : Message Optional NoRouterUtils disables check for path for testing

Option Explicit

ON error Resume Next

‘PARSE FILE NAME FOR PARAMETERS
Dim sPath,sDir,sFile,tokens
Dim sEqName,sEqOutlet,sPrompt,sNoRouterUtils,sPowerCycle

sPath = WScript.ScriptFullName
sDir = Left(sPath, InStrRev(sPath, “\”))
sFile = right(sPath,len(sPath)-len(sDir))
sFile = left(sFile,len(sFile)-4)

tokens = Split(sFile, “-“)
sPowerCycle = UCASE(tokens(0))
sEqName = UCASE(tokens(1))
sEqOutlet = UCASE(tokens(2))
sPrompt = UCASE(tokens(3))
sNoRouterUtils = UCASE(tokens(4))

If UCASE(sPowerCycle ) “POWERCYCLE” Then WScript.quit

If sNoRouterUtils “NOROUTERUTILS” Then
If UCASE(sDir) “C:\WINDOWS\ROUTERUTILS\” Then WScript.quit
End If

If sEqName = “” OR sEqOutlet = “” OR sPrompt = “” THEN Wscript.quit

If WScript.Arguments.Count > 0 Then ‘Override Prompt at command line
If UCASE(WScript.Arguments(0)) = “N” Then sPrompt=”N”
End If

‘PROMPT FOR CANCEL
Dim sTitle,sText,oShell,intButton

If sPrompt = “R” Then
sTitle = “Power Cycle Router ” & sEqName
sText=”Selecting OK will unplug router ” & sEqName & ” and plug it back in 1 second later.” & _
vbcrlf & vbcrlf & “It may take a few seconds for the router to initialize.”
Else
sTitle = “Power Cycle Switch ” & sEqName
sText =”Selecting OK will unplug switch ” & sEqName & ” and plug it back in 1 second later.” & _
vbcrlf & vbcrlf & “It may take up to 1 minute for the switch to initialize.”
End If

If sPrompt “N” Then
Set oShell = CreateObject(“WScript.Shell”)
intButton = oShell.Popup(sText, 20, sTitle, vbOKCancel)
If intButton = vbCancel Then WScript.quit
End If

——–

The guts of the specific script followed, which would be compromising to share.  So when you need to change the parameters, you just rename the script, and when you need to make a shortcut, you can right click and send it to the desktop.  It is that easy.  Enjoy!

Posted December 14, 2011 by geekography in Tech Gems

Tagged with , , , ,

The Best Day of Bad Fishing Ever   Leave a comment

You have probably heard or seen the little statement “A bad day of fishing beats a good day at the office.”   Well, I love my job, but I love to fish and get outside too.   This was a beautiful September day in 2005 and the salmon were running at Port Washington, WI.

I got my spot on the pier early that morning amongst the many who had the same idea as me that day and we were all staked out about 20 feet apart or so on the docks that line the harbor just south of the boat launch.   A young retiree from the electric plant nearby sat down next to me that morning and we traded first names and some stories until about noon as we soaked our spawn sack bait, and tended a pair of poles each with one suspended, and one on the bottom.   His poles were just laying on the deck as he looked at me and said “You know, they just aren’t biting like they were yesterday.”

He no more than got that out of his mouth when one of his poles jumped into the water.  “Oh!! there’s a hit!!  Oh! It was my good pole too!”    I got my caster out with a little cleo and started to drag the bottom with casts out in front of where he was, to no avail.   Cast after cast and nothing happened.

Then I got a hit on my bottom rig right under the dock, so I reeled in quickly and set my caster down to see if I couldn’t hook that fish.  Lots of the guys around were starting to pay attention with this small bit of possible action after a long unproductive day.  After several seconds that may have dragged on to around a minute, but which seemed much longer, and feeling nothing on the end of my line, I finally decided that I better check my bait.  I began to reel it in slowly giving due diligence to the possibility that there might be something there.  I had thought a couple times that maybe there was something on here, but it didn’t really feel like a fish.   I have to yell, “Hey Look at this!!”  And you guessed it – a moment later a rod appears – SCORE!   Everyone along the piers gives a hoot of good cheer.  I hand the rod back to my new very appreciative buddy… And he asks “Can I buy you a beer or something?”   I shrug “Nah, that’s ok… ”

“Hey the fish is still on here – you want the fish?”

Well, now.  How could any fisherman pass that up?  I said “Sure!”

I spent the next 30 minutes fighting that fish on a walleye rod set with 10# test.   The fish literally fought himself to death.  Lacking the power to pull him in, I just had to play him where ever he went; with my new friend following and coaching me up and down the docks trying to get this fish landed.  Every time he would appear near the surface he would dive again.  Until at last he surfaced long enough to be netted and brought up to the dock.  He had a little cleo stuck in in dorsal fin, just to sweeten the whole deal.

He turned out to be a 20# buck chinook salmon, the biggest fish I have ever caught, my first salmon and the catalyst that turned a longish day into an extraordinary day.

But the story doesn’t end there.  You see, fishermen and women in Wisconsin tend to be some of the nicest folks you will ever meet. I was trying to decide what to do with this huge fish, and I was torn pacing back and forth, because, A) I scrounged around through my stuff only to discover that my camera was missing; B) t was my first salmon, and I have never cleaned one before; C) my wife would not appreciate this fish coming home whole.

Another gentlemen saw me working through my truck and asked me what was going on… “I can’t find my camera.  This is the biggest fish I have ever caught. ”  He said, “I’ll take your picture and send it to you.”  And he did.  And then he cleaned it for me at the cleaning station, which made my wife happy.

So, not only did the day turn out to be well spent, it also showed the kind of folks we have here in Wisconsin.  It makes this true fish story one that must be told.   I hope I can pay it forward many times and I hope it inspires you to help someone who crosses your path when you have the opportunity.

The best day of bad fishing ever.

Posted March 31, 2011 by geekography in Outdoors

Creation of Light   1 comment

We are discussing the story of creation in our small group, and I have submitted some questions on http://www.reasons.org/blogs/reflections/welcome-reflections#comment-2227 Looking forward to musing over these questions this week.

Genesis 1:3 – 5

.3 Then God said, “Let there be light”; and there was light.4 God saw that the light was good; and God separated the light from the darkness.

5 God called the light day, and the darkness He called night. And there was evening and there was morning, one day.

Why was separating the light from the darkness necessary? What did this entail in the physical universe?

What is the nature of light?

At this point in the creation, there is an evening and a morning of the first day, but there were no sun, moon or stars that marked the day / night until day 3. So my the point of my question is this: is the light we perceive today from sun/moon/stars the same as what we find in 1:4?

———–

Sounds like a fun discussion… I wish I could have been there… but can’t sit by without adding a ripple.

When you talk Old-earth, young-earth, gap theory between Gen 1:2 and 1:3 or whatever, one of the major causes for the discussion is the measuring of time and then distance from our sun, other stars, etc.  All of this measuring and observations are based on a perceived “constant” – the speed of light.   I always find it interesting that God’s first specific act of creation (after a water-covered earth and “the heavens”) was light– and then He separated it from darkness.    Anybody ever give any thought what this separation actually was in the physical universe?   Why this second act on that day necessary?  There were no sun/moon/stars when God created light… is the light that we perceive today the light that was created in 1:4, or is it something else?   Anybody ever notice that there was an evening and a morning twice before there was a sun?

Ask a scientist “What is the nature of light?”  and you will get a range of answers from electro-magnetic radiation to particles to photons, to massless energy, that acts like it might have some mass.  The truth is, we don’t really know.  It is like wind – we can only see its effects and manipulate some of it to our purposes.  Two slot theory is really interesting to me.

Anyway, whichever side you land on – old earth or young earth… you have to grapple with this question as well: If God created light, is He not well beyond all of the laws of physics, time and space?   What could prevent Him from creating everything with appearance of age?  How old did Adam look when he was 1 minute old?

God bless your musings on His wondrous works this week…

Posted February 28, 2011 by geekography in Faith

Tagged with

Virutal Machines Windows 2008 deactivating   Leave a comment

It has been a frustrating time for us creating new Virtual Machines for use in our Online Techlabs at work. It seems that every time we created a new Windows 2008 virtual machine, and prepared it to be distributed among our online hosts, it would often deactivate.

Users first run of a virtual machine would present them with an activate now or later message and it was confusing students, and annoying the administrators and education managers. Well students were annoyed too.

What we finally have determined is this: the precompactor for the virtual disk changes the installation enough to trigger the activation. So while the virtual disks will remain bloated, the annoying messages and waste of time is over. Thanks to Sue who figured this out.

The Best and the Worst of American Freedom   1 comment

Almost all of us watched. Some were anticipating the greatest national spectacle of American sport sometimes referred to as King Football.  But this was not just another game. This was THE game; the bowl of bowls; the Super bowl, you can hardly be hyperbolic in trying to describe it.  And my team happened to be playing in it, so I was riveted.

The game is clearly a glimpse of Americana.   Around the world, it is almost always referred to as American football.    It is a source of National pride – the best and greatest athletes amongst us – our young men, strongest and quickest are completing a journey at the pinnacle of their profession, and everything revolves around these few hours for several weeks prior to kickoff.  The teams have overcome individual injuries, accomplished team and personal goals and together reap the rewards of entertaining the greatest portion of our population ever to gather through a show of ultimate team work.  From the coaches and the QB down to the lowliest rookie, each played their individual role to create the team’s ultimate success.   This is the best of American freedom: None can do it completely alone, but each giving his utmost and reaching his potential for the good of the team provides each individual with a monetary reward most of the population never achieve.

In utter contrast at the same event, enter another well paid entertainer: Christina Aguilara.  Her task was to sing the National Anthem, or as some might prefer, the national hymn.   For most people, it is a challenge just to get all of the range of notes, but not for Aguilara.  The notes and range are well within her potential; perhaps they are even easy for her to accomplish.   To the notes she adds or multiplies each by three, thus excluding many Americans who would like to sing along.  Ok.  We can forgive that, there are a few freaks of nature that we have come to see, I guess we can add her to that list and give her a pass.  So having been excluded from singing or having to remember the words ourselves, we had nothing to do but stand there mouth agape watching our painted pop diva perform a rendition of our hymn most found distasteful, and some found disrespectful.  And then she laid the egg, or placed the last straw that broke the camel’s back and aroused anger and national embarrassment: to too many notes she not only added sourness, but also messed up the words for ALL to see and hear.   Under most circumstances this may be forgiven as a choke under pressure, but this was not a simple choke.

By excluding us, she hijacked our national anthem and made it all about her.  In excluding us, she made us spectators rather than participants.  She took what might be our most unifying activity that transcends all politics, all socio-economic boundaries and ethnic divisions and hacked it up for her own personal abuse.  And then with the whole world watching she showed the world the worst of what American freedom might produce: complete and utter self-absorption.

Open Skies Video featuring Bald Eagles and David Crowder music   Leave a comment

Windows Live   Leave a comment

Just linked this with my Windows Live account, and am checking out all of the windows live essentials on my Windows 7 computer.   This blog post is being written with windows live writer.

The transfer process was simple and intuitive.  I have not yet checked to see what moved from my windows live spaces account, which is now supposedly here, but I don’t think there were too many posts or information up on that site.   Perhaps with the ease that I now find, I shall post a bit more often, and with more use, will be more informed on how these all work together.   For now though, this isn’t bad.

So it put the file into my drafts and I had to go to the dashboard to publish, but I see that as a feature, not really a problem.  I think this will be a useful tool and connection.

Posted January 26, 2011 by geekography in Tech Gems

Spotlight Productions   Leave a comment

I spend quite a bit of time in the Fall with Spotlight Productions in West Bend. Every New Year’s Eve they perform a show at Cedar Ridge Community, and we get the guys together for a couple songs. This year was “My Girl” by the Temptations. Enjoy.Spotlight Productions Guys performing \”My Girl\” at Cedar Ridge Community 12/31/2010

Posted January 7, 2011 by geekography in The Arts

Choose to Love   Leave a comment

Every day we choose to love, or choose not to love. All of us have tasks that we must attend to – Work, laundry, feeding kids, cleaning up, the list could go on and on. You can look at these tasks as obligations, and in turn, be exhausted by them; or you can look at them as opportunities to serve others (love).

Choosing to love for you may be as simple as not leaving the coffee pot or the toilet paper holder empty. It is a sense of otherness – somebody is going to follow me – how will their experience be if I think of them rather than just my own interests?

Choose to love.

Posted November 11, 2010 by geekography in Uncategorized

Tagged with

Joseph and the Amazing Technicolor Dreamcoat   Leave a comment

Spotlight Productions (www.wbspotlight.com) is performing the Andrew Lloyd Weber musical October 24, 25, 29, and 30 at 8pm, and the 26 and 31st at 2pm at the Cedar Theatre, in the Cedar Community 5595 Hwy Z , West Bend 53095.

Tickets are $12 in advance and $14 at the door.

262-306-9338 is the number to reserve your tickets.

Great show, talented company; I am glad to be a part of it playing Simeon.  Hope to see you there!

The show was a smashing success by any measure.  6 of 6 Standing Ovations, 5 of 6 completely sold out.  A very fun show with a very talented cast.   It was a pleasure to be a part of that family, and I look forward to the next show!

Posted October 11, 2010 by geekography in The Arts