Remote Scripting with Powershell without Remoting. Kind of.

I am in the midst of a project at work where we are deploying NCache as a replacement for AppFabric. NCache has some tools to help automate the administrative side of things, but they all must be run locally on the server. 

I have been using the wonderful PowerShell workaround known as Invoke-WMIMethod to sneak a  process onto a remote server, allowing me to execute local commands on remote servers. Neat. (This is a great tool, and can be used for a laundry list of things, there are examples all over the internet.)

I created mine to activate the client license for NCache on all of the clients. One thing on my wishlist for NCache is a more mature central administration toolkit. Everything is designed to be done one node at a time, a little streamlining could go a long way. Anyways, this license script actually copies a bat file and runs it on the remote server, and then removes it. Fast and efficient. 

$servers = gc C:\scripts\txt\list.txt
$install = "C:\temp\NCache_Activate.bat"

forEach ($server in $servers) {
    if (test-connection $server -Count 2 -ErrorAction SilentlyContinue) {

    Copy-Item \NCache_Activate.bat -Destination \\$server\c$\temp

    $Process = Invoke-WmiMethod -class Win32_process -name Create -ArgumentList ($install) -ComputerName $server
    If($Process.ReturnValue -eq "0"){write-host  "$server - Completed successfully"}else{write-host  "$server - Completed UNsuccessfully"}

    Sleep 4

    Get-ChildItem \\$server\c$\temp\NCache_Activate.bat | Remove-Item
    else { Write-Host "$server is offline" }

And the contents of the bat file are pretty simple too: (names changed to protect the innocent.)

"D:\Program Files\NCache\bin\NActivate\NActivate.exe" /k licensekey /f firstname /l lastname /e

This alone saved me about 2 hours of work. I'll take it.


New things that don't suck are good.

Modern Jazz. It seems that as of late, there is a lot of jazz coming out that doesn't suck. Granted, I kind of tuned out of music for a good 10 years after college, but there is a lot of really amazing stuff coming out as of late. 

Two of the guys I have really been into recently are Ben Wendel and Walter Smith III. Sax players, kind of similar in style but still very different. This is an amazing video of the two of them. If you like jazz, this is primo stuff. Enjoy.

Hello 2017

As is always the case, I mean to update my blog more regularly, with the best intentions, and then life steps in, and I end up not having time (or, forgetting as some call it.)

I have, for years tried to come up with some kind of method by which to organize myself. I often tell myself I need to set a schedule to do things. I have seen this approach be effective for many. I believe Merlin Mann, the great guru of productivity himself got himself together using this concept along with some index cards. 

Things I need to schedule, are things I need, or want to, work on. 

1. I need to force myself to practice my sax at a set time at least 3 or more times a week for an hour. I have made it up the same hill a couple times since I made the switch to Tenor, and instead of repeating the same climb, it would be nice to build on that. It's such a simple goal, that it seems silly that I haven't been better at making myself do it. 

2. I want to spend some time reading. Again, I was doing this for a time, and it faded off. I have a little back collection of sci-fi that I'd love to get through. This could be accomplished again, by simply setting a schedule. I could simply say, I read from 8-9 on x days. Something like that. 

3. I want to spend more time working on adding to my professional skill set. As time goes by, I add a lot of different skills just by working. However, I often find areas where I have an opportunity to learn, and I need to do better at making myself do that.

4. On top of all that, it would be nice if I could make myself get to the gym a few times a week too. 

5. We are looking for a house. The hardest part of buying a house, I have decided, is looking for one. It seems so easy. "Oh, that one looks nice, I'll buy it!". Ha. No, because that house's taxes are high, or someone else has a better offer, or it's flat out way too expensive. It would be awesome to just build a house, but I don't have that kind of money. Those sweet 240 grand computer drawings always end up costing 450 grand when you add things you need like floors, and windows, and heat, and the upgraded porch and other such nonsense. 

So, in 2017, lets hope we find a house that we can actually buy. Lets hope I do better with time management. Lets hope its a good year. Lets hope I can find more input for this blog. 

Talk to you again soon blog. I swear. This time I will. 

How Pennsylvania Is Vaporizing Tax Revenue, and Your Tax Money Too.

There is a state tax that was recently approved (around page 51 or so it begins here) that effects working citizens in Pennsylvania in a very large way. In Short, any PA business owner who deals in vape supplies of any kind, must pay a flat 40% tax on their entire inventory on Oct. 1st, and must begin paying a 40% wholesale tax on all inventory purchased thereafter.

Forty. Percent.

The Laffer Curve (Pictured) illustrates a concept around an ideal tax rate. In the middle there, is the perfect spot. The tax rate would be considered not too high and not too low. Before this tax went through, vaping in PA would have been securely towards the top of that curve. 

Laffer Curve - Demonstrating Tax rate vs. Revenue - the approved 40% tax sends existing tax revenue straight down that hill to the right.

Laffer Curve - Demonstrating Tax rate vs. Revenue - the approved 40% tax sends existing tax revenue straight down that hill to the right.

There are stores all across PA that employ thousands of individuals, of all ages. It has been my experience that these aren't minimum wage jobs either. These employees are all paying state income taxes. The businesses are generating 6% sales tax on everything they sell. Plus property taxes for their stores, taxes paid on profits, etc. What's not to like, right?

The approved tax has been touted to make Pennsylvania an additional 13.3 million dollars in tax revenue. This is hysterical.

Look at the Laffer Curve again. As the tax rate rises, the achieved revenue goes back down. Hmmm. I wonder if a sudden 40% tax hike could achieve such a result? (that should be read with the most possible sarcasm.) And in this case, it is completely accurate. Here's why:

This 40% tax is far more than most of these small business owners operating in this state can handle. (Actually, Can you think of any business that would survive a sudden 40% tax on all assets?) Result? They will have to close. And as a result, their employees will no longer be employed. So, now we've lost sales tax, income tax, property tax... We've now lost all of that revenue. In addition, closed businesses can't pay a 40% tax on inventory that doesn't exist. Lets not forget that all of those unemployed could justifiably seek public assistance. Now this tax has started costing everyone money! This doesn't just effect the vaping world, this will impact everyone who pays taxes!

I don't know what the motivation was for passing this tax, but it is quite clear that it was malicious in nature. Maybe because it was hurting tobacco money (likely), maybe a lobbyist got their claws (cash) into the right person? I don't know. What I do know is that it was approved by a Democratic Governor, but also by a lot of Republican congressmen. Say what you will about either party, but the fact is, this was a bi-partisan effort to tax innocent people out of a livelihood. Nobody is innocent here.

If you'd like to oppose this harmful tax, I'd be grateful - more info at CASAA

Under Construction

Until I find some sort of happy place, I tend to redesign my webpage fairly frequently. I don't know if I've ever hit a particular sweet spot, but once I do, I usually hang out there for a while. For now, I'm in limbo, and it seems that I'm still working on getting to where I want to be. This of course is terribly boring for anyone else, but I find it enjoyable. 

We have started going to the gym again. Of course I did weights the first day back, and have lost the use of my arms for a few days. This always happens, and then about a week or two in, everything is fine again. It's a strange way to motivate you to either never stop going again, or, to never go back again. Either way, I will work through it, and once I hit my stride again, I'll forget this ever happened.

I am trying to get to the "shed" every chance I get. (practicing my sax. musician term.) Currently running exercises in the theory that setting limits while improvising actually forces creativity, making one essentially obligated to come up with new ideas, while using a limited palate.

I have begun to look into learning Red Hat. Linux is a skill I wouldn't say I have a strong grasp on. I'm hoping to correct that in the coming months, and would like to work my way up to possibly becoming Red Hat certified. As a career Windows guy, I notice more and more to like over in the land of the Penguin, and I have decided it's about to time to really learn it.

Nothing more to report for now, so I'll leave you with a picture of my second favorite Dog on the planet right now. (After my own of course.) Norbert - is the best: