Welcome to my blog.  Hopefully here you will find some interesting and detailed articles relating to Windows Home Server, Home Computing and General IT.

Show used and provisioned disk sizes in ESX

Some simple powershell to show the used and provisioned size of disks in VMware

$report = @() foreach ($vm in Get-VM){ $view = Get-View $vm $row = ’’ | select Name, Provisioned, Actual, Thin $row.Name = $vm.Name $row.Provisioned = [math]::round($vm.ProvisionedSpaceGB , 2) $row.Actual = [math]::round(($vm.UsedSpaceGB ) , 2) $row.Thin = $view.config.hardware.Device.Backing.ThinProvisioned | Out-String $report += $row } $report | Sort Actual

Setting up vim for Puppet

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

git clone git://github.com/rodjek/vim-puppet.git ~/.vim/bundle/puppet

# ~/.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
```

Uploading and updating an Image to Confluence using the REST API

If you have automated systems sometimes it is useful to have them interact with your documentation from time to time.  Using the Confluence REST API you can upload an image as an attachment to the page and later update it if required.  If you follow the Atlassian documentation you end up getting a denied request for the update as it wishes for the new file to have a different filename. Below are the curl lines to post and then update the image.  Change your page ID and attachment ID as required:``` curl -D- -k -u $user:$pass -p -H “X-Atlassian-Token: nocheck” -X POST \ -F [email protected] https://confluence.domain.tld/confluence/rest/api/content/$page_id/child/attachment

[Read More]

Getting the latest Vagrant & VirtualBox working together

Having trouble getting the latest Vagrant and VirtualBox working together because the ssh key is not acceptable to Vagrant?  Well it turns out that the ownership on authorized_keys is not 600 so it fails in operating systems like Centos.  The trick is to modify one of the files to add a chmod 0600 after the authorized_keys file has been updated.  Full information in the link: https://github.com/mitchellh/vagrant/issues/7610

Upgrading a VMware 6.0 ESXi host fails with the error: Cannot run upgrade script on host

I had a problem in that updates were not successful on the cluster.  Many reports for the error message “Upgrading a VMware ESXi host fails with the error: Cannot run upgrade script on host” point to removing the FDM installation using the uninstall.sh

/opt/vmware/uninstallers/VMware-fdm-uninstall.sh

However I didn’t have the uninstallers directory on my ESX boxes. My solution was to enable HA on the cluster then removed HA on the cluster and after that updates worked fine.

[Read More]

Using a Private GIT Repo with Buildroot

Buildroot is pure awesomeness for maintaining the build of a GNU/Linux based operating system.  However, during my ventures I’ve had to keep private code private so use a git repo behind ssh.  There is a way to achieve this with Buildroot but it is undocumented:

LIBFOO_SITE_METHOD = git
LIBFOO_SITE = ssh://[email protected]/group/repo.git
LIBFOO_VERSION = v1.01.a

On the first line we have to set the method to git as the auto detect won’t work on SSH
The second line contains the git repo as it would be defined if using git via ssh accept prepended with ssh:// and the the colon that is normally between the end of the FQDN and the location is replaced with a slash.
Line 3 can be a tag, branch or commit hash.

[Read More]

Setting up EX490 LEDs in Ubuntu

Download the software

wget https://github.com/merelin/mediasmartserverd/archive/master.zip
unzip master.zip
cd mediasmartserverd-master/
make
cp mediasmartserverd /usr/bin/

Create a new startup script in /etc/init/mediasmartserverd.conf

#
# This task is run on startup to set the mediasmartserverd LEDs
#
description     "set MediaSmart Server LEDs"

start on startup

task
exec /usr/bin/mediasmartserverd -D