Quick Excel formula

I found a lovely Excel formula that we can all use based on the comments below the line of a blog post by Excel Tactics.

=SUBSTITUTE(RIGHT(SUBSTITUTE(TRIM(A1), "\", REPT("\", 99)), 99),"\","")

This fab formula find the leaf folder name from a path.  For example, it extracts “New Folder” from “C:\windows\system\WoW64\bin\New Folder”.  The best thing being that it does it in an elegant way.
There is also the equally elegant version that works for spaces only and uses TRIM.

=TRIM(RIGHT(SUBSTITUTE(TRIM(A1), " ", REPT(" ", 999)), 999))

Microsoft DFS Replication staging area calculation

When implementing Microsoft Distributed File Services Replication, Microsoft provides variations on the following Powershell command.  The goal is to find out the 32 largest files (Windows Server 2008 and later) in a file system and report it.  The admin then creates the DFSR staging area to this size. Continue reading

ZoneMinder 1.26.5 on a Raspberry Pi

Following a short spate of thefts, I decided to get an IP camera to cover the front of my house.  I would use my lab, or better still, my Pi to monitor the camera and record the thief of my milkman-delivered milk and take a record of everyone who thinks it’s okay to turn their car around on my drive.  It’s not okay, by the way, it bothers me irrationally. Continue reading

vmWare vSphere swap

In a vSphere / vCenter / ESXi infrastructure there are two types of memory swapping.  In this example, I will focus on Windows Server 2012 swap files (although this doesn’t really change much) and the vSphere vswp swap file.  Both of these files take up the same amount of disk space as RAM so can turn into a large commitment of disk space across multiple virtual servers, especially now that RAM requirements are getting larger.  The last generation of Microsoft server software thought disk was now ‘cheap’ and the latest generation adds memory to this list. Continue reading

Very quick Exchange 2010 mailbox queries

It’s a very quick Powershell blog.  Mount Points are such a pain in the bum.  They’re great but just are not supported for easy querying.

The powershell get-mailboxdatabase | select name,edbfilepath,logfolderpath,servers gives you the name, location of the mailbox database and which servers it’s on.

Get-WMiObject -computer . Win32_Volume | Sort-Object name | format-table name,label,@{Label=”SizeGB”;Expression={ “{0:f2}” -f $($_.Capacity/1GB) } },@{Label=”FreeGB”;Expression={ “{0:f2}” -f $($_.FreeSpace/1GB)} },@{Label=”PctFree”;Expression={ “{0:f2}” -f $(100-(([double]$_.Capacity-[double]$_.FreeSpace)*100/[double]$_.Capacity))}}

This lists the df -H information: Disk mount point or drive letter, capacity (GB) and free space in GB and as a percentage to two decimal places.  Between the two, you can easily work out what is where.

I have to admit the latter looks better as a script, but I’m going back to my early days of UNIX scripts to manipulate data.  Every script had to fit onto as few, long lines as possible.

Change the “.” after -computer to run it on a remote computer.

VMware whiteboxes can exceed the HCL limitations

If you are building an ESXi whitebox, or considering building a whitebox, you’ll find that there are lots of great motherboards out there that have a network card chipset that isn’t supported by ESXi.  I have two exactly like that.  The perceived wisdom is to purchase a PCIe NIC that is on the HCL – but how easy is it to add a driver to the Linux based ESXi kernel?  Very easy.  A bit of research and it took me 30 minutes to get an Intel motherboard with an Intel 82579 Gigabit LAN controller running ESXi 5.1. Continue reading

VMware datastores can hide many misdemeanours

vCenter datastores can secretly hold vast quantities of unwanted data: virtual machines removed from inventory but not deleted from disk.  Deleted disks on virtual machines that just hang around on the data store eating up space.  I’ve found this can, over time, reduce your expensive storage capacity and leave you buying more storage unnecessarily, but i couldn’t find anything to identify these files, except in VSphere Orchestrator. Continue reading