As this is a personal blog, let’s get personal for a little while, if you’ll permit me.
November 2010 will definitely be known in my books as a month of Change with a capital “C”. First I was diagnosed with Type II Diabetes. Not completely shocking (with both parents having Type II as well), but still quite a wake-up call. Although I have been improving my diet over the past few years and attempting to excercise a bit, heredity has caught up with me, clamoring “too little, too late.”
Now I live a regulated life. No more late-night or all-night programming/gaming/surfing sessions, no more living on impulse and eating whenever my stomach rumbles, none of that. Up on time, pills on time, food on time, to bed on time. God it’s boring, but it’s good for me. I know very well that Diabetes can be quite manageable as long as you lead a healthy life, but I’ve always balked somewhat against outside force on my life. Yet now I must accept the new regulations on bended knee. I’ll be okay, just like the 171 million other diabetics.
The other shock to the system, but most definitely a very good one, is my new job.
As of February 1st I’ll be joining the Grafisch Lyceum Rotterdam (GLR), the largest specialised vocational college in the field of media, design and technique in the Netherlands, as an instructor. Starting at the bottom rung in the teaching profession at this level I’ll also finally start work towards my college degree, something I foolishly skipped when I was younger and a whole lot dumber more inexperienced. Loads of work, new experiences and without doubt countless gaffs and blunders await me, but I am very, very, very excited to finally get to be a teacher after all. I love teaching, and pray that I can live up to the expectations. I will absolutely give it my best.
After a long time pondering whether or not do do it, I’ve started building a new website about web development and design, Stacked Bits, officially launched today.
The site uses a basic blogzine format and will contain articles on PHP, XHTML/CSS, and basically anything to do with web development and design I come up with.
I do realise that I have published on this subject here before, but this blog is moving more towards general IT infrastructure business and a lot of personal stuff, so I thought it’d be a fun idea to build a blog separately just for web work.
The content is somewhat limited right now, but will steadily grow as time goes on. Why not have a browse?
I know there are several scripts floating around out there that do this, but I still decided to make one from scratch. This script (for ESX servers or ESXi servers managed through a VMA) will find any VMs that are powered on on the server, try a “soft” shutdown, wait a while and then retry a “hard” shutdown on VMs that are still up.
# Set the field separator to a line break to correctly process VM names with spaces
OLDIFS=$IFS
IFS=$'\n'
# Read the list of VMs
VMLIST=`/usr/bin/vmware-cmd -l`
# Cycle through the list of VMs
for VM in $VMLIST
do
# Read the power state of the VM
VMSTATE=`/usr/bin/vmware-cmd "$VM" getstate -q`
# If the VM is powered on, try a soft stop
if [ "$VMSTATE" == "on" ]
then
/usr/bin/vmware-cmd "$VM" stop trysoft
# Wait a bit for the command to process before moving on
sleep 5
fi
done
# Wait for 2 minutes to give the VMs time to shut down
sleep 120
# Read the list of VMs again (to account for possibly moved VMs)
VMLIST=`/usr/bin/vmware-cmd -l`
# Cycle through the list of VMs
for VM in $VMLIST
do
# Read the power state of the VM
VMSTATE=`/usr/bin/vmware-cmd "$VM" getstate -q`
# If the VM is powered on, try a hard stop (poweroff)
if [ "$VMSTATE" == "on" ]
then
/usr/bin/vmware-cmd "$VM" stop hard
# Wait a bit for the command to process before moving on
sleep 5
fi
done
# Reset the field separator to its old value
IFS=$OLDIFS