Skip to content

Instantly share code, notes, and snippets.

View jackroper's full-sized avatar

Jack Roper jackroper

  • Saint Louis, MO
View GitHub Profile
@jackroper
jackroper / smtp-test.sh
Last active September 21, 2016 19:43
Send test email from command line, to / from any email address
echo "test body" | mail -s "test subject" user@recipient.com -- -f user@sender.com
@jackroper
jackroper / esx_list-vms-and-power-state.sh
Created September 21, 2016 14:38
ESX 4.1 - List VM's and Power States
#!/bin/sh
VMS=`vim-cmd vmsvc/getallvms | awk '!/Vmid/{print $1}'`
for VM in $VMS ; do
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "$name - $PWR"
done