Scripting a DRS Replacement Using PowerCLI

One of the things that I LOVED about having an evaluation copy of vCenter (other than Storage vMotion) is the use of Distributed Resource Scheduler (DRS). I loved the fact that I could let my VMs live on their own and vCenter would intelligently balance the load across all the VM hosts (and shut them down if they weren’t needed). When I finally had to move from the eval mode to a licensed server I felt a little let down because some of my VM hosts would be at 30% memory utilization while others would be at 70% memory utilization. Maybe it’s just me but that seems like a real waste of resources. 🙂

I recently found out it’s really bad when you need to power off a host for maintenance and then need to move the VMs back to the original host. To make my life a lot easier I created the following script. It balances memory usage across all the hosts to about 10% of the average. I also make certain specific VMs always placed on certain hosts (my vCenter server is always on the first host and my SQL servers are always on different hosts). This feature is enabled if a CSV is located in the same directory as the script (named balanced.csv) with a Name column and a host column that have the name of the VM and the host it should be placed on respectively. The script assumes you already have a connection to your vCenter server (using Connect-VIServer).
Continue reading

Add Another Twitter Client to the Pile

One of my hopes for this year is that I would finally write some software that saw more broad usage. Because of this, I have been looking at options for what I could create with the limited time I have right now. This wasn’t a rash decision and for about a month I have been thinking and have slowly come to the conclusion that I’m going to write a twitter client from the ground up in C#. While doing this I can learn several things like how to interact with a webservice, how to use a distributed version system (I’m leaning toward Mercurial), and how to create something others can use.

I want to use this as a way to learn things about programming so while this version of the system is written in C# (because I already know the language well) future versions might come out for other platforms and in different languages.

My plan is to follow the release soon release often mantra and have a version out every month or so. The first version will just allow for posting twitter messages(v2008-02) and the next version(v2008-03) will allow for you to view your feed. After that it’s on to smart groups and more advanced features…

How to Find A File’s Extension in C#

Every time I think I’m going to need to write some quick function to do some simple task in a .NET application I shocked to find that the function already exists. Case in point. Today I needed to find the extension of a file and it turns out all you need to do is call this function:

[code language=”c#”]

Enough said.

Finding Changes For a Date Range in CVS

One of the things that I need to do every week is submit a progress report for the past week. It’s really easy to generate this by pulling the commit messages from CVS. That way I just have to copy/paste them into a new Word doc and reformat it. In case you were wondering how the following command will generate all the changes that occurred between the first and the eighth of June.

cvs log -S -d '2008-06-01<2008-06-08'

Interesting Podcast About UI

The guys over at .NET rocks have a really interesting interview about user interface design. If you have time I would recommend it. They actually get into some concrete examples and history regarding things like shortcut keys, the design itself, and even how people “see” things on a screen.

Why Don’t Open Source Projects Take Improvements From Their Users?

Jeff Atwood at Coding Horror has an interesting post today about how WordPress can max out the CPU of a server ( In the article he discusses how WP is really slowed down by the fact that it generates every page dynamically each time they are accessed (which in hindsight makes sense). But by just adding a caching plug-in it can really improve performance. During the course of the article he gets into the fact that WP should just roll this functionality into the base install given the increased performance.

This isn’t the first time I have heard this about an open source project. Firefox could be picking the top 10 plug-ins and integrate them into the next version. That way there would be official support for the features people want.

I had problems earlier this year with TinyXML not exporting very small floating point numbers in scientific notation. After trolling the internet I found that someone had already submitted a patch for that same problem over a year ago. I’m not sure why the TinyXML patches aren’t being integrated but I wonder how many other people have had the same problem. It makes me feel bad because the community involvement is really what sets open source apart and some projects just don’t take advantage of that.

What is the Market For High Quality Code

I just started reading Daily WTF and it’s really scary. Occasionally, they publish an article about someone’s experience at some business that handles money (bank, market trader, etc) where they have some mission critical piece of software that barely functions. The current year is hard coded, there are individual tables for each fiscal year, and the problems go on and on. Often we have experience with software that doesn’t work properly or crashes constantly on a daily basis.

A lot of self taught programmers and “classically” trained (if such a thing exists in our field) that don’t know their goto’s from a hole in the ground. The question needs to be asked: How many of these kinds of people end up starting their own consulting or software development business? When a businesses needs to have some custom code written for their in-house order tracking/billing/”add extra feature here” software they pick the cheapest bid and get what they paid for. It’s too bad we don’t have some kind of website where normal businesses can review contract programmers before they are hired.

This does explain why my credit card information has been stolen THREE times over the last year…

A Picture Box That Remebers It’s Path In C#

I started messing around with C# earlier and I thought that I would look at porting some of my code. It’s actually really easy to just start writing C# code after knowing a little bit of .NET and Java. From what I have seen so far it’s kind of like the bastard child between the two. I’m still picking up on the small changes but hopefully the book I ordered will fill in the gaps.
Continue reading

Create An RSS Feed From a Site

One of the things I really like about is their Image of the Day Gallery. The thing I don’t like about it is that there isn’t an RSS feed so I occasionally have to go through the gallery and view what I haven’t seen. But as I become more and more dependent on RSS feeds to bring me the information I found it harder to get to these site (mostly because of my hectic schedule) so I decided I should write my own RSS feed. (For anyone who is interested the feed can be found at

Continue reading

Learning C#

It’s funny how programmers never seem to be done learning. Over the years I have learned a lot of programming languages (BASIC, C++, Perl, PHP, Javascript, Java, etc.) and it doesn’t look like I will ever stop. I might be involved in a project over the summer where I will have to learn C#. I looked at C# a while ago just after it came out but I didn’t have the money to put into purchasing the IDE for it. From what I’ve read so far it’s a really neat programming language that has some interesting functionality.

It’s basically a .net programming language. Because of that everything is a class so I don’t know what that does to the memory footprint. I can’t imagine that it’s too bad or else nobody would use it for memory intensive programs like video games.

If I do have to learn it I will start posting tutorials on what I’m learning. 🙂