ian's blog

Removing old JAVA installs

Scenario

First off, Java.com has a Java applet to do this very thing.
http://java.com/en/download/uninstallapplet.jsp

However, if you need to run this on many computers using a login script, or patch management system, here is my alternative.
It may not be complete, but it removes several versions of java using the command line uninstall method and a little brute force execution.

Batch Move files

Scenario

I needed to move files in batches that would put no more than 600 files in a folder at any time. I wrote the batch file to count the files in the target directory,

Prerequisites

Tested on Windows 2008 R2.

Command line should be compatible with Windows 2000 or newer.

Backup Shell Script for Linux Web Host

Scenario

Backup multiple web sites stored on a Linux server. Sites are stored in a single folder as sub-folders.

I run a web host that is a custom fault tolerant solution on Amazon AWS t1.micro hosts. The primary host should be backed up daily, but a historic backup was necessarily. My goal was to have two weeks of daily backups. The sites databases are backed up separately, so my primary concern was the folder contents.

Clone multiple virtual machines to a different datastore as a backup

Scenario

Clone multiple virtual machines to a different datastore as a backup.

All of my virtual servers, and ONLY virtual servers in a specific folder in vcenter, needed to be cloned to a backup datastore weekly, so I wrote a powershell script to clone them. I then added a Scheduled Task on my vCenter server to execute the script on Saturday evening.

https://github.com/willisiw/ShellScripts/blob/master/vm-bulk-clone.ps1

Reboot Virtual Machines by name wildcard

Scenario

Reboot multiple Virtual Machines on a single vCenter server based on a name with a wildcard.

All of my Virtual Desktops, and ONLY virtual desktops are prefixed by the characters vm- or vm7-, so I wrote a powershell script to reboot these. I then added a Scheduled Task on my vCenter server to execute the script.

https://github.com/willisiw/ShellScripts/blob/master/reboot-vm-bulk.ps1