Tips &Amp; Tricks

PowerShell – Failed Host

I had the opportunity to break out a little powershell today to go grepping for some vi-events. I thought others might get a benefit out of this so here is a little code snippet for you to enjoy.

Our environment is made up of several clusters with multiple hosts in each. One of our hosts happened to die the other day and we wanted to know who was affected to send out an outage report. If you look in the events log, you’ll see a message along the lines of “Virtual Machine was restarted on since failed” Informative and pretty easy to search for. Here’s my code:

2 Things….

I’ve been really bad about keeping up with various blogs lately. I mean really bad! I’m months behind on several of my favorite blogs. So it should come as no surprise that I’m just now stumbling upon this post which I wanted to chime in on.

I’m not a stranger to stating public goals to here are my two things:

1. What do you want to get better at?

I could go on about a good dozen or so things that I am pretty horrible at. But if I had to narrow down just one thing, I would pin it on its this. I need to be better at going to bed. I know, it sounds really simple doesn’t it. You’re tired, go to bed. But I’m not that guy. Typically my wife will go to bed at 9:30/10 and I’m up still until 12, 1 and this week even 2 a few times. Sometimes it is work related (the 2AMs this week), but often times it is not. Sure dabbling with a side business can do that to you, but its not my main focus. And with a wee one due any day now, I need to get a LOT better at getting my sleep in.

SSH Timeouts

Do you work in an environment where you bounce through a bunch of firewalls? Do you hang out on idle ssh connections that often times get dropped after a certain amount of idle time? I do and it has always annoyed me. To the point that once I connect to a box that I will be coming back to, I will run top and move on. Well, not anymore. You can set your SSH client to automatically send a bit of data over your connection every X seconds. Here is how it is done for Mac and Linux boxes.

Interruptions

How often are you interrupted during the day? Do you have the new email notifier turned on? How often is that thing going off? How often are you seeing IMs coming in, both personal and professional? Twitter? facebook? Yup, those too are major enemies to productivity.

You may not have it that bad. Your company may lock down some of the social media services which eliminates a lot of the distractions. For many of us out there we are getting bombarded by interruptions. And as a programmer, it is horrible for productivity.

Priorities

If it is important enough to you, you will find a way. If it is not, you will find an excuse.

-Unknown