Windows Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 28 February 2011

MSIEXEC Error Codes

Posted on 05:50 by Unknown
I think that the two most common questions I get on a given day are one (or both) of the following:

1. Can you write me a script to _______?
2. What does msiexec error ____ mean?

Actually, number 3 would be "can you look at my script and tell me why it's not working?" which often takes over the number 2 spot.  As for msiexec error codes, the holy grail is this...

http://support.microsoft.com/kb/229683

As I would often quote from Fast Times at Ridgemont High during my construction days: "Learn it.  Know it. Live it." or something close to that.  The most common errors are 1602, 1603, 1619, and every now and then 1624, but I'm sure you can encounter any one of them at some point.  By the way, 1602 is interesting because it can happen when no one is logged on.  A common source for that is an overzealous anti-virus application.  1619 is usually due to fat-fingering the MSI filename in whatever place is trying to launch it (SCCM package definition, Altiris, Prism (eewe!!), script or GPO), or it can be permissions.

There.  That's your Monday MSIexec tip of the, uhhhh, hour?  Enjoy!
Read More
Posted in applications, installation, packaging, software deployment | No comments

Sunday, 27 February 2011

IBM and Watson

Posted on 07:48 by Unknown

I apologize if this offends anyone, but I'm pretty much anti-IBM.  I have been since the 1980's.  At almost every turn of business execution they've made a focused decision to hand the ball to the other side and let them score.  Or even worse: they've set the ball down and walked away from it.

So when I hear people commend the virtues of Watson and what "it did" on Jeopardy, I want to puke.  Why is it that a company that blew it with mass-market mainframe dominance, the short-lived stewardship of the PC platform, the blunder of OS/2 and the continued erosion of Lotus platforms, is now suddenly an amazing source of "decision making automation" via Watson?  This is like Dr. Kevorkian coming out with a longevity elixir.

Don't get me wrong. I applaud the innovative history of IBM.  They've been no less than amazing throughout the past fifty years, when it comes to R & D.  It's the marketing and support side that sucks.  I'm sure Watson can do amazing things.  The history of IBM has always had two distinct faces: Business and R&D.  But if Watson was programmed to "think" by the Business group minds that "think" up their marketing strategy, well, I'm not asking it to recommend a dinner menu.

It's also a little more than ironic that Thomas Sr. adamantly refused to believe computers would (or could) ever be of use to the general public.  His quotes to Jr. are legendary in the textbook examples of short-sightedness.  So I'm just a little confused as to whether their latest uber-cruncher is named after Sr. or Jr.

Read More
Posted in business, marketing, technology | No comments

Thursday, 24 February 2011

Consulting Rules

Posted on 14:30 by Unknown

1 - If you have to ask a consultant how to run your business: it's time to quit

2 - If you ask a consultant to help mediate employee conflicts: it's time to fire some employees

3 - If you have to ask a consultant what you need to get accomplished: it's time for you to quit.

Read More
Posted in business, consultants | No comments

Wednesday, 23 February 2011

How to Make Better Drivers

Posted on 14:08 by Unknown
I've given up on the dream of self-driving vehicles. Humans are determined to kill themselves and kill others with their own bad driving habits for eternity, regardless of having the means to avoid it. So, focusing on error-prone humans for now, I have discovered some solutions.

First off, the reason there are so many bad drivers is that most of them simply don't care. They don't care about stop signs, red lights (unless there's a camera around), speed limits, using turn signals, tailgating, staying in their lane, yielding properly, and so on. And why is it they don't care? Because they don't perceive any value to having the privilege of driving. To most Americans, anyway, they feel its a God-given (or Constitutionally-assigned) right.

I haven't even brought up how they don't care enough to keep their trash and cigarette butts inside their vehicles.

Why don't they see value in this privilege? Because it all comes to easily:

- A Driver's license is as easy to obtain as a drink from a vending machine. They're cheap. The tests are simple. If you disagree, ask yourself "how hard can it be?" every day you're in traffic during rush hour. If that doesn't convince you, just park in a Walmart parking lot and watch the scenery for a few hours.

- The possession of a driver's license is difficult to separate from the driver. Suspend: seldom. Revoke: rarely. Most drivers are allowed a rather high number of infractions before any meaningful penalty is levied. Usually it results in a fine, a safety course and maybe a higher insurance premium (if they even have insurance). There are scores of incidents where drivers have committed five or six DUI infractions before anything serious is done.

Solutions:

1. Raise the price

2. Make the test more difficult

3. Make the penalties more sever

When you give someone something "free" they usually don't assign value to it as they would for things they had to earn with hard work. That's just a fact. It's human nature. Lose a license at $15 in a bar? Buy a new one. Lose a license at $500 in a bar? Not as likely.

The tests are stupid simple and allow the dumbest of the dumb to get on the road and operate dangerous heavy machinery at high speeds with minimal skills. Make them as hard to pass as a school exam. Gee. That's a shocker.

Speeding? Fine. Failing to stop at a stop sign? Fine. Speeding? Another fine. Running a red light? Yet another fine. DUI? First-time: fine. Second time? Fine and safety course. Kids not in belts or safety seat? Fine. Shitty condition of car (fender hanging off, duct tape holding hood down): another fine. Fuck that. First penalty of ANY kind: $500 or a week in jail (or trade for two weeks of public service manual labor). Second offense: Suspend license for two months. Third: jail time and revocation.

If people sweat their behavior more they'll be more careful. More careful means more patient drivers, more safe drivers, more courtesy. Courtesy and civility equate to a better commute and a better society.

Thank you.

Now, why won't this ever happen? That's simple: car companies won't allow it. Check into it yourself and you will see that automotive lobbyists work hard convincing politicians to keep things as pleasantly agreeable as possible towards making it easier for idiots to obtain and keep a license, buy or lease a car and so on. It feeds a huge industry that includes repair shops, customizing, insurance, oil and gas, and so on. They are not going to let anyone put a leash on that beast. Big money wins.

Read More
Posted in | No comments

Launch IE and Wait for it to be Closed

Posted on 11:26 by Unknown
I really thought this was going to be easier than it turns out to be.  First off, the Wscript.Shell RUN() method is useless with IE when it comes to specifying Wait = True.  It ignores it.  If you make one script call another (via Wscript.Run or Execute, doesn't matter) it works, but not if you deploy the script "per-user" via SCCM, in which case, again, the Wait = True is ignored in the parent script.  So, script A launches script B, but instead of waiting for B to complete, script A just continues on while B is still working.  NOT what I want to happen.  The net result is crap and breaks the workflow entirely.  The solution is WMI and the Win32_ProcessStartup class (and a little scripting and some coffee).


The way this works is that it assumes the web page (running on a trusted intranet server) takes user input via a form and then evokes some sort of modification to the user account in Active Directory via an LDAP expression.  As an example, I'm using an account attribute called "customAttrib" and checking if it is empty (is-null or empty-string) or contains a string value (more than one character).  If the value is empty, the web form is launched and the script waits until the user closes the IE session.  It doesn't matter how many other IE windows or tabs are open.  It fetches the processID for the one it launches and watches to see when it vanishes from the process stack (using a do-while loop).  When the process is closed, the script continues and simply re-checks the attribute to see if it was modified.  The end-game being that it checks if the user successfully completed the form, or simply closed it and tried to ignore it (bad news for the user).  Enjoy!


'****************************************************************
' Filename..: IE_Wait.vbs
' Author....: skatterbrainz.blogspot.com (you know who)
' Date......: 02/23/2011
' Purpose...: launch web page and wait for it to close
'****************************************************************
' comment: check for previous attrib in AD (LDAP query)
' comment: launch ie and navigate to the web page
' comment: check AD again to see if user completed the form
' comment: if not, force a logoff
'****************************************************************


Const enableLogoff = True
Const dndc = "LDAP://DC=contoso,DC=msft"


'----------------------------------------------------------------
' comment: DO NOT MODIFY ANY CODE BELOW THIS POINT!!!
'----------------------------------------------------------------


Const ADS_SCOPE_SUBTREE = 2
Const SW_HIDE = 0
Const SW_NORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3


Const wbemFlagForwardOnly = 32
Const wbemFlagBidirectional = 0
Const wbemFlagReturnImmediately = 16
Const wbemFlagReturnWhenComplete = 0
Const wbemQueryFlagPrototype = 2
Const wbemFlagUseAmendedQualifiers = 131072


Const osLogoff = 0
Const osForcedLogoff = 4
Const osShutdown = 1
Const osForcedShutdown = 5
Const osRestart = 2
Const osForcedRestart = 6


Const strCommand = "C:\Program Files\Internet Explorer\iexplore.exe http://intranet.contoso.msft/stuff"


Dim wshNetwork, uid, objShell, groupPriority, wmi_flags


wmi_flags = wbemFlagForwardOnly + wbemFlagReturnImmediately


Set wshNetwork = CreateObject("Wscript.Network")
Set objShell   = CreateObject("Wscript.Shell")


uid = wshNetwork.UserName
Set wshNetwork = Nothing


custVal = GetAttribute(uid, "customAttrib")


If IsNull(groupPriority) Then   
    LaunchWebForm()


    custVal = GetAttribute(uid, "customAttrib")


    If IsNull(custVal) Then
        MsgBox "Form was not filled out properly!" & _
            vbCRLF & "You will now be logged off...", vbOkOnly+vbCritical, "Web Form"
            
        If enableLogoff = True Then
            Logoff()
        End If
        
    End If
End If


Sub LaunchWebForm()
    Dim objWMIService, objStartup, objConfig, objProcess
    Dim intReturn, query, colItems, objItem, intProcessID
    Dim colMonitoredProcesses, objLatestProcess, processEnded
    
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\.\root\cimv2")


    ' comment: configure the new process as visible
    Set objStartup = objWMIService.Get("Win32_ProcessStartup")
    Set objConfig = objStartup.SpawnInstance_
    objConfig.ShowWindow = SW_NORMAL


    ' comment: create a new process (iexplore.exe)
    Set objProcess = objWMIService.Get("Win32_Process")
    intReturn = objProcess.Create(strCommand, Null, objConfig, intProcessID)


    If intReturn <> 0 Then
        'wscript.echo "fail: unable to launch process!"
        wscript.quit(1)
    End If



    'wscript.echo "info: process id is " & intProcessID


    Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") 


    query = "SELECT ProcessId FROM Win32_Process WHERE ProcessId='" & intProcessID & "'"


    Set colItems = objWMIService.ExecQuery(query,,wmi_flags) 
    For Each objItem in colItems
        intProcessID = objItem.ProcessId
    Next
        
    If intProcessID <> "" Then
        'wscript.echo "info: waiting for process terminate..."
        
        Set colMonitoredProcesses = objWMIService.ExecNotificationQuery _
            ("Select * From __InstanceDeletionEvent Within 1 Where TargetInstance ISA 'Win32_Process'")


        Do Until processEnded = True
            Set objLatestProcess = colMonitoredProcesses.NextEvent
            If objLatestProcess.TargetInstance.ProcessID = intProcessID Then
                processEnded = True
            End If
        Loop


        If processEnded = True Then
            'wscript.echo "info: process was terminated"
        End If
    Else
        'wscript.echo "fail: unable to obtain process id..."
    End If
End Sub


'----------------------------------------------------------------
' function: get LDAP user attribute from AD
'----------------------------------------------------------------


Function GetAttribute(uid, att)
    Dim query, objConnection, objCommand, objRecordSet, retval
    On Error Resume Next
    
    query = "SELECT " & att & " FROM '" & dndc & "' " & _
        "WHERE objectCategory='user' AND sAMAccountName='" & uid & "'"
    
    Set objConnection = CreateObject("ADODB.Connection")
    Set objCommand    = CreateObject("ADODB.Command")
    
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"
    
    Set objCommand.ActiveConnection = objConnection
    
    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
    
    objCommand.CommandText = query
    
    Set objRecordSet = objCommand.Execute
    
    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
        retval = objRecordSet.Fields(att).value    
        objRecordSet.MoveNext
    Loop
    GetAttribute = retval
End Function


'----------------------------------------------------------------
' function: force logoff from local computer
'----------------------------------------------------------------


Function Logoff()
    Logoff = -1
    wscript.Echo "Logging off..."
    On Error Resume Next
    Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
    Set colOs = objWMI.ExecQuery("Select * from Win32_OperatingSystem")
    If err.Number = 0 Then
        For Each objOs in colOs
            ' See: http://msdn.microsoft.com/en-us/library/aa394058(VS.85).aspx
            Logoff = objOs.Win32Shutdown(osForcedLogoff,0)
            ' WScript.Echo objOs.Name
        Next
    End If
End Function

Read More
Posted in active directory, internet explorer, ldap, programming, scripting, vbscript | No comments

Another Interview, part 2

Posted on 05:00 by Unknown

This is the long promised (or long threatened?) follow-up to the last interview of myself. This time I was interviewed by Malcom X. Yes. The same one you've read about. He's not dead, but working at a Burger King, with Elvis. He had a few minutes during a shift change and decided to sit down with me. Enjoy!

Thank you for allowing me to interview you.  So, how are you doing?

Great. Never better. Never more broke, but at least I'm alive.

Tell me about it. I'm kidding. Please don't. - so, let's get back to the interview... You've been writing code for over two decades. Billions of lines of code. So let me ask you: Scripts or Group Policy?

Yes.

Yes?

That's right. Yes.

Is it really billions of lines?

I doubt it, but if that impresses you, well, then yes.

Is that a good thing?

Not really.  The most impressive number would be one.  If I could have solved all my tasks in the past thirty years with one line of code - THAT would kick ass to Jupiter and back again.

(rubs his scruffy chin)

So, you feel there's a place for Scripting and Group Poliy in 2011?

Doesn't Microsoft?

Good point. When would it make sense to use one versus the other?

Well, Malc... You don't mind me calling you Malc?

Sure. Just don't call me Little.

No sweat. Even Cassius prefers Ali. Anyhow, Malc, I'm a consultant. We are Pavlovian conditioned to respond to every question with "it depends". Go ahead, try me?

Ok. What four legged animals would you have sex with?

(Long pause; Blank stare) Next question?

You didn't answer my first.

Oh yeah. The answer is "it depends".  Next question?

(Long pause with blank stares) A lot of American kids today seem to be conditioned to believe that the IT field is a dead end. No point in studying it.  Why is that?

I don't know. Probably because every IT publication and every corporate CEO, CFO, CIO, CTO and whatnot spent an enormous amount of time and effort repeating the mantra of outsourcing and offshoring. They got what they wanted: a reason to push for more H1B approvals.  Then they can hire foreign labor for half the price to write dozens of cute little iPhone and Android apps in little sweatshops behind every Jiffy Lube.

H1B?  Is that like H1N1?

You've been dead way too long.

Is Nixon still president? Next question: Where do you see the future of IT going in the next decade?

I can't see that far ahead. Nobody can.

Nobody?

If you pick up an issue of almost any IT publication, in fact ANY publication, from 1990 to 2000 and read the predictions they made for the next ten years, they are all so horribly wrong they should fold up and close. Oh wait, they did.

Wow!

I know! It's sooooo ridiculous how arrogant those ass clowns are.

No, I meant "wow: that's the most words you've spoken since we started"

Just for that I'm calling you Mr Little.

F*** you.

Point taken. What's your next question?

So after I left this ball of dirt, what did I miss?

A string of idiotic and utterly worthless presidents, and politicians posing as defenders of the public, a string of cheesy action movies, romantic comedy movies, plastic hairspray rock bands and more movies with Jude Law…

Who?

Never mind… You also missed a steroidfest of sports recordbreakers, a bad o-ring on a space shuttle, the microwave oven, velcro, condom commercials on TV, and the advent of MTV, or Music TeleVision.

What's that?

A channel that only shows teenage dramaqueen scripted "reality" shows about drunken, screwing derelicts, insanely wealthy mansion tours, and trailer park teenage pregnancies.

Oh.  We had in Detroit back in '66.

I know.

Anything good?

There's Tosh.O, Family Guy, South Park, The Daily Show and The Colbert Report.  Discovery Channel, History Channel and Travel Channel are pretty good sometimes.  Disney and GE bought the main networks so you can guess how shitty those are.

Eeeew!

They also have Pay-Per-View porn, sports and wrestling (not to be confused with real sports). Here, have a tissue.

(blows nose) Thanks!

Don't mention it.

Where was I?

Is that a question?

(blank stare)

How did a guy like you end up in the IT field?

I don't really know.  I got really drunk, passed out, and woke up with a pocket protector on.  It's been a strange ride ever since.

(rubs chin and nods)

UNIX or Windows?  And what the hell is Windows?

Is that the best you can do?  Why not unscrew your brain and toss in the woodchipper so you can think up a question like "OSX or Windows?"?

Well?

Well what?

OSX or Windows?

Is that the best you can do?

Who's giving the interview here?

I lost track of who's talking.  Who's the black guy here?

I can't tell.  Are the lights turned down?

I hear that a lot.

Read More
Posted in humor, interviews, stupidity | No comments

Upgrades and Downgrades

Posted on 03:34 by Unknown

I was having a rather interesting chat with someone about our experiences and views about upgrading software.  In particular, the feelings and views we've had about both the approach to an upgrade as well as the aftermath.

On the approach, it's really a philosophical aspect.  Some people like the idea of keeping up with the current goings-on.  Some like the bleeding edge (that would be me).  Some avoid it like a root canal and prefer to stay on the old stuff because "it just works" or "if it ain't broke, don't fix it".  I can understand those sentiments very well, but for myself, personally, I prefer to see what's around the corner rather than wait for it to run me over.  There are also more diverse views within that area, such as rationale for "staying ahead", but I'll leave that stuff for Dr. Phill.

The "afterwards" part was most interesting.  The question was/is this:

Of all the upgrades you've been involved with, which were the most rewarding and which were the most painful?

Rewarding:

  • Windows NT 4.0 to Windows 2000 (workstation and server)
  • Microsoft SQL 7.0 to SQL 2000
  • AutoCAD R13 to R14
  • Windows XP to Windows 7 (and Server 2008 R2)
  • Novell to Active Directory

Painful:

  • Windows 95 to 98
  • Windows XP to Vista
  • AutoCAD R14 to 2000 (mainly the plot feature changes)
  • Novell to Active Directory

Notice any repeats?

Read More
Posted in active directory, autocad, computers, software deployment, updates, windows 7, windows server | No comments

Tuesday, 22 February 2011

New Zealand

Posted on 15:44 by Unknown

Over the years I've heard from people in New Zealand via my blog or other places online, and I've always felt that New Zealand must be a land of "nice people".  Never once have I been acosted or even mildly angered by anyone there (or Australia or Tasmania).  Most of the angry readers I encounter are from America actually.  Go figure.  In any case, my thoughts and prayers are with those affected by the recent Earthquake.  I hope they are able to put their lives together and move on as quickly as possible.

Read More
Posted in news | No comments

Monday, 21 February 2011

Group Policy Horrors

Posted on 15:33 by Unknown

I'm reviewing a client's environment to assess the root causes for reported "slow logins".  I do my usual quick-pass analysis of the AD environment, the connectivity, DNS, blah blah.  Then I do a second pass with DCDIAG, NETDIAG, REPADMIN, event logs, nslookup, and gpresult, etc.  Three words: Oh My God.  They don't have a log of GPO's in their environment, but after 30 minutes of intense scrutiny of what each GPO has "enabled" or "disabled" and I had to look around to find where my jaw bone had fallen off.

People.

Please.

If you tinker with GPO's…

TEST THEM in an ISOLATED environment BEFORE you ever put them into PRODUCTION.

I beg you.  Please.

Apparently, the sysadmin dudes (I haven't yet met them so I will withhold judgement until I do) had found quite a few (translation: hundreds) of settings they thought interesting enough to modify their setting.  Aside from the DNS errors, the replication errors, the DHCP errors, the roaming profiles (oh holy geez, I haven't yet begun to digest that part, ugh), and the WINS/NetBIOS master browser bullshit flying around like gnats at carcas party in the Sahara, I would say that at least a good portion of the "slowness" is from having to process a (excuse my technical term here…) shitload of Group Policy settings at every login, every 90 minutes thereafter, as well as at every startup, login, logoff and shutdown.  Yes.  I'm not kidding.  They enabled or disabled things for all of those events. Wonderful.

How can I compare this to something tangible in life?…. hmm…. finger's tapping…. stares into space pondering a suitable analogy or metaphor…. hmm….

Ok.

It's like this:  Group Policy is powerful and insanely useful.  It is fire.  Fire can cook food.  It can provide warmth in a harshly cold environment.  It can dry things.  It can also burn the absolute living shit out of you if you don't treat it with respect.  Yes.  I mean that absolutely.  GPO's are not something to tinker with unless you've studied them, tested them and tested them again.  Jeremy Moskowitz has some great info out there to read up on, as do many other sites, blogs, etc.

One word to keep in mind at all times with GPO's is "tattooing".  Undoing a GPO change in a large environment can often be a daunting and difficult task.  It's not always a matter of changing a setting from "Enabled" to "Not Configured".  Many times you have to "double-smack" it by setting it to the opposite, and then back to "Not Configured".  It's messy.  In some instances things can get broken so bad that the only pragmatic "fix" is a new environment.  Yep.  I've seen that.

My wife is cooking something that smells so f-ing good I'm ready to eat my own shirt sleeve in response to uncontrollable hunger.  Gotta go - cheers!

Read More
Posted in group policy, network administration, windows | No comments

Standards Needed

Posted on 09:47 by Unknown
Argue all you want, my ears are plugged on this one. Even my "smaller/less government" friends agree on this. Of all the things that governments stick their noses in, there are some places where they don't, but they absolutely should:



- Credit Card Swiper Boxes: No two are the same! Grocery store, gas station, movie theater, book store, auto parts, fast food. Hit the cancel button. Hit the red button. Hit the green button. Hit the credit button. Touch with finger. Point with pen. Sign. Don't sign. Can we have a f***ing standard please?!!!



- Insurance Forms: Holy shit! When you have kids (I have four) and you go to a doctor's office, a dentist, eye doctor, sports med, whatever, NO TWO have a similar form. Why?! Its the same f***ing information being asked for on all of them, yet they can't use the same form?



- Spark Plugs: Yes, I know each vehicle has different needs for spark intensity and energy level, but do they need to be different sizes? Really?!



In all of these cases, "free market" has failed miserably to establish a common, even a dominant, platform of any kind. I'm all for free market, but sometimes the kids need an adult in the room to make sure they stop goofing around.
Read More
Posted in | No comments

Sunday, 20 February 2011

My Eyes are Permanently Damaged

Posted on 06:37 by Unknown

Have you ever been privvy to a horrific accident?  I'm talking about the kind where you see something happen to another human that shouldn't' happen to a human being.  Limbs lost.  Gaping wounds.  Internal organs becoming externalized, and that sort of thing.  Go ahead and gasp in horror, but when I see such things I usually follow them up with "anyone up for a plate of spaghetti?"… "…with extra meat sauce? … anyone?"  I'm probably a candidate for desensitization studies.

Well, I invited a challenge that I couldn't refuse, but it may have cost me my eye site.

Photos of the results of a suicide bomb attack on an open market?  Nope.  Video of cats being inserted into wood chippers?  Nope.  Video of Dave England puking into a frying pan, scrambling the puke on high heat and eating it again?  Not even close.

WARNING: This link may cause permanent brain damage and loss of eye sight…

It was this: http://sheltonsgrill.com/site/home.html

Yes.  I'm afraid there are people getting paid to damage the eyes and minds of Internet users with some of the most God-aweful trash to ever grace a web browser.  I don't even know where to begin.  The color scheme?  The over-sized imagery for the visually impaired?  The Stevie Wonder layout?

The hamburger phone is a nice touch though.

More?

Here's some runner-ups to enjoy (wear your welding goggles to prevent eye damage):

Doumar's (as close to a Braille site as you'll get without being blind)

Animal Care Clinic of Holland Road (FrontPage never dies)

MBH (anyone up for gumbo?)

ECPI (hello? 1990's calling… wants their web site back)

Norfolk Wire & Electronics (stare into the shotgun and hold still for a moment)

Oceana Sensor (hoooo boy! Them panels are a bitchin!)

ComSec LLC (when Xbox and toilets are merged to make a web site)

Boulevard Screen & Sign (in two words: dark salmon)

Read More
Posted in hampton roads, thoughts, web, web development, web sites | No comments

AutoCAD Performance Tips

Posted on 06:06 by Unknown

What's going to slow down the performance of a drawing more:

  • A ****-load of Lines, Arcs, Circles
  • A ****-load of Text, Mtext
  • A ****-load of Dimensions and Leaders

In my experience, it's a toss-up between #2 and #3, but the variable is the font type being used: standard or TrueType®.  The fancier the font styling the more overhead incurred as well.  At least try to put the italicized scrolled Gothic serif text on a separate layer and freeze it before saving and closing, so it doesn't grow a beard on the next person waiting to open it.

When inserting other DWG content, if you don't explode the insertions, be sure that someone has taken the time to open the original DWG and cleaned it up.  If you do explode them, be sure to run at least two PURGE operations afterwards.  It might also help to run AUDIT and fix any corrupt garbage as well.  Don't forget that there's still a lot of DWG content being reused from R12 days.

One more thing about DWG libraries:  If you're still inserting crap from 2002, 2003, or even from back in the 1980's or 1990's, take a day or two and do NOTHING else but open, clean up, and save those in the current version.  Past versions of RECOVER, PURGE and AUDIT are known to have missed a lot of corrupted or incomplete drawing data for which the newer versions can easily detect and repair.  Why repeat the same break-fix cycle for every subsequent reuse when you can "fix" it once and be done with it?

Layers

Layers.  Do you REALLY need to max out the number of layers in your drawing?  Ask yourself if there's a reason besides someone thinking it would be "logical" to put every thread on every bolt onto its own unique layer, separate from the bolt and the bolt head as well.  I mean: Really?

And while I'm on the subject of layers: It's always nice to use descriptive layer names like "borders" or "interior walls", rather than the 1980's method of "1", "2" and "3", but let's not go overboard?  Layers like "Interior walls with blue paint and red trimming for guest rooms only" is kind of stupid, and yes, it does add a bit of drag on performance, especially when you have 254 others with equally verbose names.

While this is technically not a performance issue, the use of long filenames is quite often reason to have someone beaten with a coffee pot.  I've seen names like "Door bracket for main machinery space on the northeast side of the upper level - part 4, stage 3.dwg".  The person that chose to use that name should be dunked in a tank of sulfuric acid, then their skeletal remains should be mounted at the front door entrance as a warning to others not to behave stupidly.  Oh, and if they use this same pea-sized brain thinking when naming folders and nested folders, maxing out the Windows string limit, it's time to hang a douche bottle on a string around the neck bone of that skeleton.

Saving Backward Versions

We've all had to save back to an earlier format in order to help out our customers who can't afford to upgrade.  Quite often I've seen people set the default SaveAs option to that earlier release, making the default process one that converts on every save and also has to convert on every open as well.  Don't do it!  Repeatedly converting drawings like that, especially large drawings, is asking for trouble and adds a ton of overhead for no real benefit.  Keep your drawings in the current format.  When it comes time to send deliverables in earlier formats, do the conversion at that point only.  You will eliminate performance drags as well as reducing the potential for corrupting drawing data or crashing the application (aka "fatal error / unhandled exception" events). 

One more thing: Don't overwrite the production drawing with the conversion to the earlier format!  Place the converted files in their own folder.  When it comes time to reopen the drawing and make additional changes (or insert it into yet another drawing), use the current format file, and do another conversion only when necessary.

If you're nodding at any of this, chances are you've encountered it before.  If you're upset by any of this, chances are you are a major part of the problem.

Read More
Posted in autocad, cad, technical support, thoughts | No comments

Shitty Web Sites of The Week

Posted on 05:30 by Unknown

After having tripped over some real crappy "local" web sites, I thought I'd do a segment focusing on them.  This is limited to web sites representing businesses and organizations within this little speck of land affectionately known as "Hampton Roads".  I've already described what the unofficial name "Hampton Roads" refers to, so if you need to see the list of municipalities that make up the collective monicker just Google it.

Sports Venues

Today's crappy/shitty/poorly-designed site is the Virginia Beach Field House.  I should have said "Sports Venue" since this is about the only one, well, aside from the sleepy Virginia Beach Sportsplex site.

On the surface, it will seem like a decent web site.  But the more you dig, you find things difficult to dig up.  Things that should take a single click, instead, require multiple clicks.  Much of the event information for which they've booked are jumps to other sites (bad for search engine marketing).  The "mobile" site is horrendously bad.  Trying to find even information is painful.  The layout is clunky and inefficient for a mobile device.  The link to view the "non-mobile" site renders like a bad 1960's action movie, replete with black text on dark blue background. 

Rating/Desktop Version (scale: A,B,C,D,F):

  • Accuracy of information:  B+
  • Navigation: D
  • Color Scheme: F
  • Visual Appeal: D
  • Layout: D
  • HTML Code Structure: C
  • SEO optimization of code: D

Rating/Mobile Version (same scale):

  • Accuracy of information: C
  • Navigation: F
  • Color Scheme: D
  • Visual Appeal: F
  • Layout: F
  • HTML Code Structure: B
  • SEO optimization of code: who cares

News Stations

WVEC, ABC affiliate, Channel 13 (local)

The color scheme and layout look like a 1980's purple passion bathtub pukefest.  Not the color scheme itself.  I'm referring to the infusion of stupid-looking ads whose themes do not match the site at all.  Yep, it's a purple passion puke performance.  I'm talking about AFTER the drinking has commenced and the party dude/chick staggers back to the bathtub to refill their cup, only to realize that leaning forward invokes the regurgitation stimulus and the previous consumption has returned to the pool from which it came.  THEN, the next party-er walks in, fills their cup with the previously consumed beverage substances and begins chugging.  THEN when they realize it's already been consumed and puked back into the tub, they too add their puke offering into the same tub.  This is what the WVEC web site looks like.  Major grade reduction goes to the shitty heading ads that cheapen the respectability of their brand image.

If you get bored, try counting all the ads on their home page and then count the "news" stories.  Now, tell me which has the greater count?

WTKR, CBS affiliate, Channel 3

Red. White. Blue. Red. White. Blue. Red. White. Blue. Red. White. Blue. Red. White. Blue. Red. White. Blue.  Ok, we get it: you're f***ing patriotic.  So much so that you devote a significant amount of time reporting on the failings of our local government (to be fair, all of the local news outlets despise all forms of local government and love to report as such).  After all, nothing says "I'm a proud American" like repeatedly waving a red-white-and-blue flag while you bad mouth the government.  Awesome.  Oh, and by the way, you're only missing a Bail Bonds ad on your home page.  The rest of the ads look like a 1970's New York subway prop from The Warriors.

WAVY, NBC affiliate, Channel 10

Of all the local station web sites, this has the cleanest and simplest layout and navigational structure.  However, it gets a lower grade on performance due to slow page rendering.  While this site has roughly as many gawdy advertisements as the others, they had the sense to avoid putting them in the heading like WVEC.

FOX43, Fox affiliate, Channel 43

This site is a clone of NBC affiliate WAVY-10 so the same rating applies.  Points off for that.  At least show that you have SOME level of imagination.

Next Time: The Verizon Wireless Virginia Beach Amphitheater… Oh wait, never mind.  They don't really have their own web site.  They freeload on the LiveNation ticket sales web site, which is technically not from Hampton Roads but still qualifies as one of the ugliest pieces of crap sites to click on.

Read More
Posted in hampton roads, virginia beach, web, web development, web sites | No comments

Saturday, 19 February 2011

The %ProgramFiles% Bug, Part 2 / Distrust & Uncertainty

Posted on 08:14 by Unknown

So I already mentioned the bug with VBscript reading the "ProgramFiles" environment variable from Windows Vista and Windows 7 (and corresponding server platforms as well).  Well, I've done some more tinkering and found that it is due to WSH reading environment properties from a different place than CMD, PowerShell and KiXtart read from.  This is still pertaining to 64-bit operating system versions, not 32-bit.  This is very odd and very concerning for anyone still working with VBscript.  After all: If this is looking in the wrong place, what else is?

Examples?

In PowerShell, try both of the following and observe the output…

> dir env:"ProgramFiles"

> dir env:"ProgramFiles(x86)"

In a CMD console, try both and observe the output…

> echo %programfiles%

> echo %programfiles(x86)%

Then create a .VBS script file and drop the following code in and run it…

Set objShell = CreateObject("Wscript.Shell")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles(x86)%")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles%")

Yep - this is f***ed up.  Microsoft should release a patch to correct this, but I doubt they will.  Asking everyone to stop what they're doing and convert all of their legacy scripts to PowerShell is not only a bong-smoking delusion, it's also like drinking the bong water and then eating the bong!  I can see this causing a silent havoc on lots of systems around the world that use that environent variable in path resolution and path concatenation operations.  As I said earlier: something this esoteric and fundamental belies a worrisome distrust for VBscript in general.  How could you trust flying in an aircraft if you learn one of the key instruments has a known malfunction but is never going to be fixed?

Given that PowerShell is still not suitable for login scripting, and is still TOO DAMN SLOW to initialize, I will probably start shifting back towards KiXtart for the time being until this is either resolved (not likely) or until Microsoft beats PowerShell into a leaner, meaner execution machine.  (as an aside: my guess is that due to the significant .NET stack that has to be awoken each time the shell is initialized, their "solution" will be to autorun it in the background like so many bloatware vendors do already).

The results of this unchecked bug could be very bad.

uncertainty

Read More
Posted in cmd, microsoft, network administration, powershell, scripting, vbscript, windows 7, x64 | No comments

Microsoft: Too Early, Too Late

Posted on 07:47 by Unknown
After two decades of dealing with technology, one thing that has struck me as interestingly ironic, is how Microsoft has waded into the various markets. Often too early for mass acceptance, often too late to gain a lead.



Examples of "too early" are easy to find: WebTV, Passport, and Tablets. Examples of too late are also aplenty: Zune, Search, Cloud Apps. Maybe I shouldn't say "too late", but rather, and more appropriate: simply "late". Zune may be a candidate for retaining the former however, possibly Bing as well. Cloud Apps however may prove to be a winner for them, but it's still too early (pardon the pun) to know for sure.



I suppose the operative word for the Redmond evil empire would be "bad timing". I do have to say that overall, they've timed most things correctly. Its just that the projects that missed the mark happened to be the one where they spent considerable time and funding to market heavily. Sinofsky is probably the saving grace for them, as it pertains to keeping quiet. If only they could shut up until the debut moment, but that would be too Apple-ish of them.
Read More
Posted in | No comments

Friday, 18 February 2011

So far today...

Posted on 11:32 by Unknown
What a Friday...



Working MS premier support to diagnose client's IIS issues



ASP and SQL code updates for another client



Troubleshooting VBscript issues for same client



Mining SCCM database views to correlate to inventory systems



Troubleshooting MSI install problems with an Oracle app



Met with another client on upcoming Windows 7 upgrade deployment



Met with another client on GPO troubleshooting issues



Met with another client on converting roaming profiles



I need a beer
Read More
Posted in | No comments

Script of the Day - Open IE on Login (Just One Time)

Posted on 05:27 by Unknown
There may be a situation where you need to launch a web page upon login and have it go "full screen", in order to satisfy some legal person who says it's a good idea.  And then they say, "but they only need to see it once (per user)".  So you could do this any number of ways, but here's just ONE way it could be done:

  • Script that checks for a custom registry key/value under HKCU
  • If the key exists, skip the browser launch and move on
  • If the key is not found, open the browser and create the registry key/value
'****************************************************************
Dim objIE, objShell, keyval
Const delay  = 5000
Const regkey = "HKCU\Software\MyCustomKey\PageViewed"

Set objShell = CreateObject("Wscript.Shell")
keyval = ""
On Error Resume Next
keyval = objShell.RegRead(regkey)
If keyval = "" or IsNull(keyval) Then
    'wscript.echo "registry key was not found - opening browser"
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate("http://mysite/legal")
    objIE.Visible = True
    objIE.FullScreen = True
    objShell.RegWrite regkey, Now, "REG_SZ"
Else
    'wscript.echo "page already viewed"
End If

Set objShell = Nothing

Read More
Posted in internet explorer, network administration, scripting, vbscript | No comments

Happy Friday

Posted on 03:47 by Unknown

I couldn't think of anything more interesting to post right now.  For those on the other side of the planet: Happy Saturday!  If anything interesting happens today I'll try to post something about it.  In the meantime: enjoy!

Read More
Posted in | No comments

Thursday, 17 February 2011

IT Jobs

Posted on 03:01 by Unknown

I don't have a crystal ball, but it seems that the IT sector has fared much better than other careers during this recession.  I'm not saying it wasn't impacted.  I was on the front line of the IT impact when the consulting firm I was working for decided to close the local branch and I was on the street - and at the worst possible time: The beginning of the crash.  For three months I searched and found nothing.  Friends, family, colleagues, all tried to help, but employers were just too risk-averse to hire anyone in early-mid 2008.  While other areas like construction, sales, real estate, automotive, transportation services and tourism were taking a heavy hit - layoffs - the IT market was holding tight.  And I mean VERY tight.  While other areas were tossing out the babies with the bath water, IT, for the most part, was spooning out just the specific amount of water and leaving the babies alone.

But over the past year, I've seen a significant rebound in the IT job market.  Particularly along the east coast of the U.S.  The number of contract, temp, temp-to-hire, and full-time offers streaming in from recruiters has grown from one or two per week to one or two per day.  That's a good sign.

It's a great time to get moving on your IT career plans.  Opportunities are growing, jobs are opening up, and the projects are becoming much more interesting.  For years we've been faced with plugging holes.  Most shops are maturing and the types of projects are shifting from damage control into forward planning and optimization.  Bridging gaps, leveraging heterogenious systems, and automation are becoming key project goals across the industry.  Conversations are shifting from "I can't work on that project right now because I have to fix these five other broken things" to "things are working pretty well now, let's work on making our processes work better".

After a decade of mindless, boneheaded blabbering by IT shops that "outsourcing" and "offshoring" were the wave of the future, the net result has been a decrease in interest in working in the IT field for most high school kids in the U.S.  Ask around and you'll see.  Many still think it's a dead-end career.  Mostly because they've heard from others that jobs were being moved to cheaper countries.  Thanks to almost every big-ticket U.S. corporation for spreading that mantra - not!  The opportunities are actually very good, and it appears there are serious shortages of IT applicants in many areas. Recruiters are facing a tough challenge finding U.S. citizens to fill job openings, and are, ironically, having to turn to foreign applicants to fill them.  Reality follows hype, it seems.

By the way, if you know anyone looking for IT work in the Southeastern region of Virginia, there are plenty of IT jobs.  The City of Virginia Beach is looking for a good Systems Engineer.  Some of the skills they're looking for include:

  • Windows Server 2008 and 2008 R2
  • Active Directory
  • SharePoint 2010
  • Exchange 2007 and 2010
  • System Center VMM (Hyper-V)
  • System Center Data Protection Manager
  • System Center Configuration Manager
  • Lefthand and NetApp storage
  • WebSense
  • Citrix

If you, or someone you know, is interested, go to http://www.vbcareers4gov.com and click on "Search Postings" to find available positions.

Read More
Posted in business, city government, employment, industry, infrastructure, jobs, work | No comments

Wednesday, 16 February 2011

Software Licensing

Posted on 17:35 by Unknown

I strained as hard as I could but I simply could not come up with one of my usually clever and humorous (read: stupid and boneheaded) titles for this subject matter.  It is the blood from a Turnip.  The silk purse embedded into the sow's ear.  You get the picture.  And rather than frame this gently, I'm going to drop in like a turd from a seagull in a parking lot.  The names are entirely made-up…

Question: "Hey! Can I wrap this application in App-V and stream it to every desktop?"

Answer: "Hey!  Read the EULA"

Question: "Ummm, can we install this application on all four desktops that Mr. Stinkfist uses so he can have it on all his computers?  And can we redirect the AppData folder so the config data follows him around?"

Answer: "Ummm, it depends.  First: Read the EULA.  Second: Determine how the software is "registered" with respect to per-machine, per-user, per-CPU, per-machine AND per-user, per hard disk, per NIC, pur kitty (ok, I made that one up), and so on.  Some applications (no names) will break if you redirect the AppData folder, or if you use Roaming profiles and float the appdata content.  Many vendors void your support or will outright prohibit such practice (again, stated in the EULA or addendum material)."

Question: "What's the worst that could happen if we install more copies than we legally own?"

Answer: "You don't want to know.  The BSA (that's Business Software Alliance) is an ugly, forty-headed beast with deadly claws.  They call their claws "attorneys".  They rarely, and I mean RARELY, ever lose a legal case (go researc that if you don't believe me).  The penalties for inappropriate licensing, be it malicious or negligent, is harsh.  How harsh?  Like getting a prostate exam by an ape with welding gloves on.  In fact, seriously, if you read into the penalty structure you will need to locate your jaw, which will have fallen off and slid across the floor."

Question: "Why are the terms of licensing so confusing?"

Answer: "Attorneys."

Question: "What if the software vendor is in a different country?"

Answer: "Does that country do business with your country?  Do they have ANY trade agreements?"

Question: "What if I want to remove a license from one computer and install it on another computer?"

Answer: "Read the EULA.  Then contact the vendor and ask them.  The terms vary so widely you'd think they were written by a team of mushroom-swilling monkeys on a day at Disney World."

Question: "Can I host this application on a Citrix or Terminal Server host?"

Answer: "Read the EULA *(AND)* contact the vendor.  Seriously, I have encountered quite a few that EXPLICITLY disallow this for their products."

Question: "I want to write my own network/concurrent license management solution."

Answer: "Bravo for you.  Start by researching the existing patents (www.uspto.gov) where you may likely find most of the intellectual property locked up in patents owned by Rainbow/Globetrotter/Macrovision/InstallShield/Acresso/Flexera, IBM, Sun or Microsoft."

Question: "Why is software licensing so confusing again?"

Answer: "Attorneys"

Read More
Posted in application virtualization, applications, legal, licensing, network administration, software development, software packaging | No comments

Mixing Gravy with Lumps

Posted on 14:37 by Unknown
What do you get when you turn on roaming profiles for all users, AND enable folder redirection via Group Policy for their entire profiles as well? :)
Read More
Posted in | No comments

Tuesday, 15 February 2011

What Goes Up…

Posted on 16:48 by Unknown

Like cell phones, hard drives, wireless routers, thumb drives, GPS devices, digital cameras and pizza delivery, eventually their prices comes down due to competition and lower demand related to anticipation of the next release.  Just like those things, my book have also come down in price…

The AutoCAD Network Administrator's Bible, 2011 Edition
for Amazon Kindle and Kindle Reader apps….   Now only $7.99

The Visual LISP Developer's Bible, 2011 Edition
for Amazon Kindle and Kindle Reader apps….   Now only $7.99

Packager's Pocket Reference
for Amazon Kindle and Kindle Reader apps….   Now only $2.99

For those of you that read any of these books, please rate them on Amazon and let others know what you think of them.  Be honest. But please keep it civilized. :)

Read More
Posted in applications, autocad, autodesk, books, flexnet, network administration, programming, software deployment, visual lisp | No comments

Tenuous Linking

Posted on 14:10 by Unknown
There is a rather obscure issue that I've seen arise in project planning meetings over the years.  It has to do with feasibility versus risk, but also risk versus payoff.  The word "tenuous" has several definitions, but in general it refers to something being "thin", "delicate" or "weak".  The word "linking" in this context pertains to physical or logical establishment of specific relationships between two distinct realms of information or services.  In other words: establishing a link between two database tables, or between an employee and a physical asset, such as a computer.  Putting these two words together then should render an obvious meaning.

Most projects in the IT world that demand a "planning meeting" involve complicated issues.  Logistics, resources, technical issues, budgets, and my favorite aspect of all: politics.  Sometimes these are born from CxO meetings and are dropped onto the heads of the IT minions like a brick on an ant colony.  Sometimes they're born from departmental or divisional meetings, where they want to achieve greater collaboration and reach.

Where this term "tenuous linking", which I completely made up all by myself, out of thin air, tenuously, comes into play here is with respect to how such projects are fleshed out.  The process usually starts with one party saying that they'd like to accomplish "X" but need to somehow link system "A" to system "B" in order to connect the dots.  Suits often use "connect the dots" as a means to convey hipness with the younger IT slaves, rather than big, confusing terms like "synergy" and "economies of scale" and so on.  Then the other party says something like "you can't access system 'B' because that's OURS, and WE control that, so YOU can't have any.  Nah nah nee nah nahhhh...", followed by an awkwardly long silence.

Once the political/rice-bown/mini-kingdom crap is ironed out, then it usually gets into the technical aspects.  Once into this phase issues are identified with how feasible specific types of links are, or will be, with respect to different data types, formats, access methods, authentication methods, and the king of all project dooming catastrophies: the upgrade.  That's right.  Off in the distance, over the mountains of project planning, hidden behind the clouds of quarterly projections, in the valleys of stupidity, there lives the "big upgrade" project.  The one that's never going to happen, or at best may not be initiated for another six to twelve months.  This is where the "risk versus payoff" part comes in.

Typical projects where you may find this to be relevant include links between things like employee management systems, asset inventory systems, procurement tracking systems, regulatory compliance systems, manufacturing process systems, CRM systems, BIM systems, and so on.  Each of these often overlaps significant portions of the other in terms of data, features and functionality.  While the interfaces may appear obvious, these other aspects I've described often interfere or obstruct the path towards joining them for a greater purpose.

How do you assess the practicality and feasibility of each tenuous link?

You break it down in to the smallest components that impact the risk, and each that impact the potential benefit.  Some of the most common road bumps (risks):

- The systems have completely different authentication and access schemes (too difficult or expensive to overcome)

- The systems have completely different data formats (too difficult or expensive to overcome)

- One of the systems will "soon" be replaced with a newer/different system (waste of time to attempt)

How do you trump these obstacles?  Easy: You carefully assess the value of the potential benefit of the desired outcome.  Then you insist the ney-sayers cough up specific numbers pertaining to the level of effort and costs incurred with overcoming the obstacles.  Then match the numbers up.  When the CxO is told that his cute little baby project won't fly because the numbers just don't jive, and he/she drops their Martini glass in a panic, you can point straight at the numbers, and then point directly at the folks who gave you the numbers.  While the CxO is busy beating the evil-doers with his/her favorite Gold-plated Driver, you can sit back and prepare for the bruised clowns to come back to the table with a more cooperative attitude.

Aside from the numbers aspect, there is always the issue of third item.  This requires a bit more savvy and patience.  You need to carefully assess the realistic time frame as opposed to the stated time frame.  A lot of times, party "B" will be to resist efforts to bridge the gaps until they get their new system.  This is most often used as ammunition to keep pressure on higher-ups to continue funding and supporting the plan to get to the "new" system.  The fear they see is that if they allow linking to the status quo, it will negate the need for upgrading or replacing the system, at the very least it could delay their plans.  This is bad.  But if you remain vigilant, you can work with party "B" to make everyone happy.  How?

Devise the plan such that you take into account the interface aspects of the status quo, as well as the expected interfaces to the new system.  Identify any gained advantages with the interfaces to the new system.  Make sure to state in your plan that phase 1 can be done now, but phase 2 (using the new system) will yield even more robust results.  This can help to allay fears and suspicions and possibly draw party "B" over to your side of the effort, which can only help push the momentum towards accomplishing the links sooner.

Tenuous links exist everywhere.  We rarely identify them.  We rarely document them beyond stating their existence, since the "tenuous" nature is often intangible or subjective.  NEVER take "it can't be done" for an answer until you've ferreted out every bit of technical assessment.  In most cases, the biggest obstacle to accomplishing a technological goal is the human aspect.
Read More
Posted in business, management, projects, software development | No comments

Sys Admin Tips, Part 1

Posted on 06:56 by Unknown
- Avoid putting spaces and special characters into folder names and share names which are used for deploying software installations

- Avoid discussions about which operating system is the best

Read More
Posted in | No comments

Observations

Posted on 04:25 by Unknown
Some people's powers of deductive reasoning are running on a dead watch battery.
Read More
Posted in | No comments

Sunday, 13 February 2011

Grammy's Get it Right

Posted on 19:58 by Unknown

I was so happy to see Esperanza Spalding win tonight.  Coming from a musical background, ok, a long long time ago, in a galaxy far far away, I can appreciate real talent when I see/hear it.  This past year there have been some amazing new artists coming into the spotlight, and many others still waiting to be discovered by the masses.  Esperanza has now crossed the threshold into the public eye.  Hopefully Tal Wilkenfeld will get her moment soon.  Enjoy…

Esperanza Spalding

Tal Wilkenfeld

Read More
Posted in entertainment, music, people | No comments

What a slob I am

Posted on 11:21 by Unknown
Ok, raise your hand if you have ever in your life "washed" portions of your vehicle with Windex while starting out with the intention of cleaning only the windows. I'll admit that I have. In fact, I did so just this afternoon. Fred Sanford would be proud of me.
Read More
Posted in | No comments

Saturday, 12 February 2011

Repeat After Me: Beer is Tasty

Posted on 21:37 by Unknown

Chimay Blue / Grande Reserve.  It's been way too long.  I picked up a bottle of this today as the local grocer was un-crating a new shipment.  Mmmmm… http://www.chimay.com/en/chimay_blue_220.php

Read More
Posted in beer | No comments

Programming Ka-blamming

Posted on 21:15 by Unknown

In the past whatever years I've been developing/writing/hacking/coding or whatever with software programming code, one of the most common questions I hear is this:

How do you know what language to use?

That's easy: It's usually chosen for you.  By that, I mean that forces beyond your control will, at the very least, narrow your selection, if not outright dictate the "choice".  I'm not talking about goober nerds that sit at home beating off to their own uber-awesome code.  I'm talking about the 99.99999 percent of the programmers in this world who have to answer to someone else in order to obtain a consistent paycheck.  Homeless nerds and geeks living at home (or with their buddies but not paying rent) can move on - you won't find anything useful to read here. (and besides: the PPV porn channel has a hot movie on right now I'm sure).

So, what are the forces that most often encompass our decision machinery?  Well, they are usually one or more of the following, but may be in any order based on environmental and cultural parameters.  Clear as mud?  Ok…

  • Project Guidelines - These are written by some obnoxious suit-wearing puke that read some IT crap in the seat pocket magazine during his last flight.  He/she discusses this with other suits on the golf course or at the cocktail lounge (the rest of drink at bars or at home while watching a sports game).  Then they draft up the contract and procedural crap, open your mouth, and insert the spoon repeatedly, until you loudly scream "Mmmmmmmm!" with a smile.  This little dish usually goes by another name, maybe you've heard it before: "Contract Requirements"
  • Retrofit - A secret truth to the world of programming is that a HUGE portion of all the programming work (again, the work that pays money) involves patching or modifying existing code.  You're not likely going to suggest switching to a new language to make some modifications to millions of lines of existing code.
  • Resource Availability - You like some programming language called Beatoff, but unfortunately it requires buying some special software or licensing.  Or you eat bean sprouts, wear sandals in the Winter, drink herbal tea and espouse the virtues of FOSS (that's "open source" to you Windows and Mac noobs).  Unfortunately, the attorney reminds you that indemnity risks, licensing risks, intellectual property risk are simply unknown (or undecided).  You shrug that off.  Then the CFO or CIO says, calmly: "But then we'd be dependant upon YOU to maintain this.  Hiring a replacement will be difficult.  Windows programmers are laying around in every alley, and they can easily step into an existing project - this equates to low risk, high affordability."  Game over.  Just for the record, I have been told this almost verbatim by several CxO types, even while they wore a suit and were absorbing some sort of alcoholic liquid.
  • Culture - You get hired into a company with a team of developers that have all synchronized their menstrual cycles.  You will synchronize yours as well.  It's a fact of life.

There are other forces that come into play even when the obvious, or objective, external forces do not show their face.  These are subjective, but no less influenced by prior external experience and external forces.  Call it prejudice.  Call it habit.  Call it preference.  Call it Veronica.  Whatever, we're human.  We all have habits and opinions, formed over time by happenstance situational influences.

For example, you may have worked on a particular project where you were pushed into learning a particular language.  That worked perfectly well for that project and you were able to accomplish amazing feats of amazement.  Now you come away thinking this language is not only awesome in itself, but awesome enough that it should be used on everything.

Careful.

This is like learning to use a screwdriver, and then thinking (no - wait - BELIEVING) that a screwdriver is the ultimate tool for EVERY task, bar none.

Go ahead and chuckle.  In the world of software development: THIS IS THE RULE - NOT THE EXCEPTION.  Very few programmers understand the subtle intricacies of what makes one language more viable for a set of tasks than another.  Big O factoring.  Modularity.  Refactorability.  OOP and Inheritance, and the like are low-hanging fruit for most coders.  But ask them how it actually gets parsed, recoded, digested, processed and reprocessed  - even down to machine language, considering compiler and execution derivatives - and well, they're a deer in the headlights. 

A classic example of this is to mention FORTRAN to most programmers today and watch them make stupid, anti-get-laid jokes about it, while chuckling and snorting.  They'll insist Ruby, Python, C# or F# or even C++ is the way to go.  Tell that to the folks crunching 3D seisemology data for oil exploration, or projecting multiple trajectories for interplanetary travel.  In case you're lost here: FORTRAN does nothing if not specialize in crunching numbers.  It's a math processing idiom.  In other words, it is a #2 Philips screwdriver for a #2 Philips screw head.  Same goes with AI and LISP or Scheme.  You get the picture.

Capabilities vs Ease

I haven't even gotten to the part about what the languages "can do".  As if I haven't blabbered enough already?  Oh yes.  Now comes the esoteric, aesthetic, academic part: comparing the capabilities.

The most classic of classic examples is the following question:

When should I use a BAT or CMD script instead of a VBscript?

I could dive into all sorts of propeller-head, taped-up glasses, stained t-shirt nerdish minutea, but I'll boil it down to the simplest criteria:

  • Open and Read the contents of files, especially non-ASCII files, in order to process or analyze specific things inside?
  • Read and write to the registry with at least some rudimentary error handling?
  • Read and write to the event log with the ability to filter and sort?
  • Read and write XML data?
  • Interact with relational databases?
  • Perform complicated string manipulation operations?
  • Offer complicated (or pretty-to-look-at) menus and choices?

If any of the above are true, go with VBScript (or PowerShell, etc.).  Before you blow your bongwater through your nose in disagreement, let me say this: Yes, you CAN accomplish these tasks using CMD or BAT code, but it's not as simple or as flexible in most cases as with VBScript (or other languages).  I use BAT and CMD all the time.  Actually, about half the time, and mainly for situations that only need to do things like:

  • Run commands like REG, DIR, DEL, COPY, MD, RD, REGSVR32, ROBOCOPY, FIND, FINDSTR, DSxxx, EVENTTRIGGERS, SC, NET xxx, IPCONFIG, NETSH, SCHTASKS and so on.
  • Create text files by redirecting output
  • For launching multiple scripts at once (such as multiple VBScripts or PowerShell scripts)

As a basic comparison, look at the code required to create a text file, to document environment variables or directory lists, from VBScript (using the Scripting.FileSystemObject library) as opposed to a simple CMD script.  The CMD script is dramatically simpler and easier.

Don't Lose Focus

I will do my best to avoid going off the wagon on another rant about PowerShell qualifying as being a "scripting language".  In all the years I studied at a University, and all the years working thereafter, the intention of "scripting" was to save time.  SAVE TIME.

Repeat those two words over and over for another five minutes.  I'll wait… go ahea…

mmmm, hmmmmm…. hmmmm…. finger's tapping…. hmmmmmm, hmmmmm…

ok, good?

System Administrators are NOT Developers.  Developers work with programming languages and write programs and compile them.  The focus is on complexity versus processing efficiency.  Admins work with scripting languages and write scripts.  The focus is on getting a job done quickly and keeping the learning curve short and relatively low.

Which is better?  Neither.

Doctors need plumbers.  Plumbers need doctors.  That's life.

When you're writing scripts, the goal is to accomplish the task in the least amount of time, with the least amount of effort.  Your responsibility as an Admin is to backup the databases and files, to keep the servers running, to keep connectivity running, to fix the breaks quickly and ultimately: MINIMIZE DOWN TIME.  The goal of Developers is to write programs, usually for other people to use.  They make the programs.  Admins deploy the programs to users.  Or, to put this another way…

Making the tools versus Using or Deploying the tools.

So, going back to the "focus" aspect: The goal for scripting is to solve a problem quickly, so when you have to choose between various languages - choose the one you feel will be the simplest and easiest to work with as it pertains to solving the problem at hand.  Never decide on a language because the language itself is comfortable, that should be secondary to matching it with the problem you are trying to solve.  You can modify the registry in dozens of ways.  But choosing the simplest way that meets the needs of a particular challenge, well, that's the most important perspective.

Choose wisely.

Read More
Posted in network administration, programming, scripting, software deployment, software development | No comments

Songs I Could Do Without: Forever

Posted on 20:22 by Unknown

The following songs could be locked away in a vault and never played again and I would not miss them one bit.  I've absorbed enough shitty radio heavy-rotation air play in the past 46 years to hold me until the end of time.

  • Stairway to Heaven
  • Free Bird
  • Sweet Home Alabama
  • Sharp Dressed Man
  • (Don't Fear) The Reaper
  • RADAR Love
  • Purple Haze
  • Brown Sugar
  • (You're Messin' With) A Son of a Bitch
  • Born to be Wild
  • Born in the USA
  • Uptown Girls
  • Man Eater
  • Double Vision
  • Wheels In The Sky
  • Lick It Up
  • Rock and Roll All Night
  • Danger Zone
Read More
Posted in entertainment, music | No comments

Parse and Reparse were Sitting on a Fence

Posted on 09:23 by Unknown

These two expressions do the same thing

s = "this.is.a.string.with.period.delimiters"

Expression 1

wscript.echo Join(Split(s,"."),vbCRLF)

Expression 2

For each word in Split(s, ".")
    wscript.echo word
Next

Read More
Posted in scripting, vbscript | No comments

Friday, 11 February 2011

Happy Friday: Scripting Windows Search

Posted on 06:13 by Unknown
As a small example of my previous post, here's a script that reads a search list (text strings, phrases) from a text file, and runs document searches for any that contain those phrases. It involves a few moving parts:
  • A CMD script
  • A VBScript script (sorry, redundant I know)
  • An input text file
  • A "logs" folder beneath the folder that stores the scripts and input file
To test this, drop a bunch of files with matching phrases on your C: drive using various formats like TXT, DOC, DOCX, XLS, XLSX, PPT, PPTX, PDF, CSV, LOG and whatever.  Set up the three files below, then run the scanFiles.cmd script from the computer where the files reside.

CMD script (scanFiles.cmd)

@echo off
SETLOCAL
SET logfile=%~dps0logs\%computername%_files.txt
cscript.exe /nologo "%~dps0scanFiles.vbs" >%logfile%
ENDLOCAL

VBScript (scanFiles.vbs)

'****************************************************************
' Filename..: scanFiles.vbs
' Author....: David M. Stein
' Date......: 02/10/2011
' Purpose...: generate file scan report using Windows Search queries
'****************************************************************
Option Explicit

Const verbose = False

'----------------------------------------------------------------
' comment: DO NOT CHANGE ANY CODE BELOW THIS POINT !!!
'----------------------------------------------------------------

echo "info: script initialized " & Now

Const ForReading = 1
Const ForWriting = 2

Dim objConnection, objRecordset, query, scriptPath, inputFile
Dim objFSO, objFile, strLine, searchList, itemCount : itemCount = 0
Dim filePath, phrase

Set objFSO = CreateObject("Scripting.FileSystemObject")

scriptPath = Replace(wscript.ScriptFullName, "\" & wscript.ScriptName, "")
inputFile = "searchlist.txt"
filePath = scriptPath & "\" & inputFile

On Error Resume Next
echo "info: searching for searchlist.txt input file..."
If objFSO.FileExists(filePath) Then
echo "info: reading search values..."
Set objFile = objFSO.OpenTextFile(inputFile, ForReading)
Do Until objFile.AtEndOfStream
  strLine = objFile.Readline
     If Left(strLine,1) <> ";" Then
         If searchList <> "" Then
             searchList = searchList & vbTab & strLine
         Else
             searchList = strLine
         End If
         itemCount = itemCount + 1
     End If
Loop
objFile.Close
End If

echo "info: " & itemCount & " phrases were queued"

'----------------------------------------------------------------

echo "info: initializing window search interface..."

Set objConnection = CreateObject("ADODB.Connection")

echo "info: opening windows search data connection..."
objConnection.Open "Provider=Search.CollatorDSO;Extended " & _
"Properties='Application=Windows';"
If err.Number <> 0 Then
echo "fail: connection-open failure [" & _
err.Number & ":" & err.Description & "]"
wscript.quit(2)
End If

echo "info: beginning windows search scan process..."
For each phrase in Split(searchList, vbTab)
wscript.echo "PHRASE: " & phrase

query = "SELECT System.FileName, System.ItemPathDisplay, " & _
  "System.DateCreated, System.DateModified " & _
     "FROM SYSTEMINDEX WHERE Contains('" & Chr(34) & phrase & Chr(34) & "')"
 Set objRecordSet  = CreateObject("ADODB.Recordset")
objRecordSet.Open query, objConnection

If err.Number <> 0 Then
  echo "fail: recordset-open failure [" & _
         err.Number & ":" & err.Description & "]"
     objConnection.Close
     Set objConnection = Nothing
     wscript.quit(3)
End If

If Not (objRecordset.BOF and objRecordset.EOF) Then
  objRecordSet.MoveFirst
     echo "info: iterating recordset results..."
     Do Until objRecordset.EOF
         wscript.echo "MATCH: " & _
             objRecordset.Fields.Item("System.ItemPathDisplay").value & _
             vbTab & objRecordset.Fields.Item("System.DateCreated").value & _
             vbTab & objRecordset.Fields.Item("System.DateModified").value
         objRecordset.MoveNext
     Loop
     wscript.echo
Else
  echo "info: no matching records were found"
End If
objRecordset.Close
Set objRecordset = Nothing
Next

objConnection.Close
Set objConnection = Nothing

echo "info: processing completed " & Now

Sub Echo(s)
If verbose = True Then
wscript.echo s
End If
End Sub

Input File (searchlist.txt)

; input file, prefix with semi-colon to disable lines
Dogs hate cats
Fish hate cats
Cats love fish
Read More
Posted in automation, scripting, search, windows | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Voting Time: Help Me Out?
    I need to get a better view of how I should manage this blog if I'm going to keep at it. I'd like to know how you typically discover...
  • A World Without Competition
    Try to imagine what things would be like today had there not been fierce competition in certain key parts of our world.  I’ll give you some ...
  • Book Update
    I posted some gibberish a few weeks ago about another book project.  Well, I'm getting close to wrapping it up, so I thought I'd go ...
  • Cost
    Software technology, like any technology, provides a means to solving problems.  Some big. Some small.  Some that help.  Some that hurt.  An...
  • Windows 7: Default User vs All Users
    A lot of confusion seems to occur with understanding the difference between the "Default User" profile, and the "All Users...
  • Time to Give Props
    With the ever-expanding volume and breadth of information on the Internet today, it's easy to focus on my own thoughts, experiences, ide...
  • Table of Contents (Preliminary)
    Here's the preliminary Table of Contents for my new book "The AutoCAD Network Administrator's Bible - 2013 Edition".  I...
  • The Nicest IT and IT Vendor Folks I Know
    I've ranted many times before how it's unfair to "hate" an entire company, without providing a rationale for it based on s...
  • Windows 8
    Two small, yet irritating things, that I hope Windows 8 addresses with respect to Windows 7: Being able to put the Recycle Bin in the S...
  • Stupid Assumptions
    After years of watching sci-fi TV shows, movies, etc. it's finally come to a point where even the so-called brightest of our authors and...

Categories

  • a
  • activation
  • active directory
  • advertising
  • agile
  • agility
  • amazon
  • american
  • apple
  • application virtualization
  • applications
  • art
  • articles
  • asp
  • augi
  • authors
  • autocad
  • AutoCAD Autodesk
  • autodesk
  • autolisp
  • automation
  • automotive
  • backups
  • batch
  • beer
  • beta
  • blackberry
  • blogs
  • bongloads
  • book
  • books
  • Books writing kindle amazon technology business projects
  • browsers
  • business
  • cad
  • career
  • certification
  • chrome
  • city government
  • civilization
  • cloud services
  • cmd
  • cmmi
  • comedy
  • command
  • community
  • computers
  • conferences
  • config manager
  • consultants
  • consulting
  • contracting
  • cranium drainium
  • crapware
  • culture
  • data center
  • data mining
  • databases
  • deployment
  • directx
  • DLL
  • domains
  • dumb
  • earth
  • economy
  • editor
  • education
  • election
  • elections
  • employment
  • engineering
  • entertainment
  • environment
  • error monitoring
  • events
  • exchange
  • facebook
  • family
  • firefox
  • flexnet
  • fud
  • fun
  • funny
  • games
  • gary vaynerchuk
  • gmail
  • google
  • government
  • group policy
  • hampton roads
  • health
  • history
  • holidays
  • home
  • html5
  • humor
  • hyper-v
  • iis
  • industry
  • infrastructure
  • installation
  • installshield
  • internet
  • internet explorer
  • interviews
  • jobs
  • jtbworld
  • kindle
  • kixtart
  • lab setup
  • languages
  • ldap
  • learning
  • legal
  • licensing
  • life
  • lifecycle
  • linux
  • lisp
  • logging
  • management
  • manufacturing
  • marketing
  • markets
  • mdop
  • mdt
  • medical
  • messaging
  • microsoft
  • microsoft access
  • military
  • mountains
  • movies
  • mozilla
  • music
  • nature
  • network administration
  • news
  • nook
  • nothing
  • office
  • open source
  • openoffice
  • opera
  • operating systems
  • oracle
  • osx
  • packaging
  • patches
  • people
  • photos
  • podcasts
  • policy
  • politics
  • powershell
  • predictions
  • process automation
  • products
  • programming
  • projects
  • psychology
  • publishing
  • rail
  • reading
  • registry
  • religion
  • reporting
  • reviews
  • rsat
  • rss
  • safari
  • safety
  • sales
  • satire
  • sccm
  • scheduling
  • science
  • scripting
  • search
  • security
  • servers
  • services
  • sharepoint
  • shopping
  • sms
  • social stuff
  • society
  • softgrid
  • software assurance
  • software deployment
  • software development
  • software packaging
  • sony
  • speaking
  • sports
  • sql express
  • sql server
  • statistics
  • Statistics news marketing
  • steve jobs
  • stories
  • stuff
  • stupidity
  • symantec
  • sysinternals
  • system center
  • systems architecture
  • t-sql
  • taxes
  • technet
  • technical support
  • technology
  • TED
  • ted talks
  • testing
  • textpad
  • thoughts
  • traffic
  • training
  • transportation
  • travel
  • troubleshooting
  • tutorials
  • twitter
  • ubuntu
  • unattend
  • unemployment
  • updates
  • upfront ezine
  • utilities
  • vacation
  • vba
  • vbscript
  • video
  • virginia
  • virginia beach
  • virtualization
  • visual lisp
  • vmware
  • vmware server
  • voting
  • war
  • weather
  • web
  • web browsers
  • web development
  • web sites
  • windows
  • windows 7
  • windows live
  • windows server
  • windows server 2012
  • windows8
  • winpe
  • wise
  • wmi
  • work
  • writing
  • ws08
  • wsus
  • wwa
  • x64
  • xml
  • ze frank

Blog Archive

  • ►  2013 (37)
    • ►  October (1)
    • ►  September (5)
    • ►  August (8)
    • ►  July (2)
    • ►  June (4)
    • ►  May (4)
    • ►  April (2)
    • ►  March (2)
    • ►  February (8)
    • ►  January (1)
  • ►  2012 (120)
    • ►  December (14)
    • ►  November (12)
    • ►  October (10)
    • ►  September (7)
    • ►  August (3)
    • ►  July (2)
    • ►  June (6)
    • ►  May (6)
    • ►  April (20)
    • ►  March (16)
    • ►  February (18)
    • ►  January (6)
  • ▼  2011 (343)
    • ►  December (15)
    • ►  November (23)
    • ►  October (27)
    • ►  September (35)
    • ►  August (29)
    • ►  July (17)
    • ►  June (23)
    • ►  May (20)
    • ►  April (38)
    • ►  March (61)
    • ▼  February (54)
      • MSIEXEC Error Codes
      • IBM and Watson
      • Consulting Rules
      • How to Make Better Drivers
      • Launch IE and Wait for it to be Closed
      • Another Interview, part 2
      • Upgrades and Downgrades
      • New Zealand
      • Group Policy Horrors
      • Standards Needed
      • My Eyes are Permanently Damaged
      • AutoCAD Performance Tips
      • Shitty Web Sites of The Week
      • The %ProgramFiles% Bug, Part 2 / Distrust & Uncert...
      • Microsoft: Too Early, Too Late
      • So far today...
      • Script of the Day - Open IE on Login (Just One Time)
      • Happy Friday
      • IT Jobs
      • Software Licensing
      • Mixing Gravy with Lumps
      • What Goes Up…
      • Tenuous Linking
      • Sys Admin Tips, Part 1
      • Observations
      • Grammy's Get it Right
      • What a slob I am
      • Repeat After Me: Beer is Tasty
      • Programming Ka-blamming
      • Songs I Could Do Without: Forever
      • Parse and Reparse were Sitting on a Fence
      • Happy Friday: Scripting Windows Search
      • Out of the Box and Free
      • Weekly Summary
      • LDAP / AD script stuff
      • Democracy 101
      • Stupidity
      • Food for Thought
      • Misperceptions are Often Impossible to Change
      • Right Way, and Wrong Way
      • Useful SCCM Developer Tip of the Day
      • Avoid Extremes
      • The Day After
      • Stack Overflow in a pinch
      • Attention AD Admins
      • Bugs/Annoyances: TurboTax Online
      • Windows Admin Basics: Security 101
      • Is Computer a Member of a Domain "Laptops" Group
      • Detection Deflection Reflection
      • Let's Put This Another Way
      • Top-Ranked Customer Service
      • SCCM Web Management
      • Fonts: 101
      • How to: Convert MIT Open Courseware to Kindle Reader
    • ►  January (1)
Powered by Blogger.

About Me

Unknown
View my complete profile