Skip to content

Instantly share code, notes, and snippets.

View trodemaster's full-sized avatar
💭
Pushing buttons

Blake Garner trodemaster

💭
Pushing buttons
View GitHub Profile
@trodemaster
trodemaster / tailVCLog.ps1
Created October 11, 2013 18:29
Powershell code for tailing the latest VMware Virtual center log file. Requires PowerShell 3.
Get-Content (Get-ChildItem "C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd-[0-9]*.log" | Select FullName -Last 1 | % { $_.FullName }) -Tail 1 -Wait
dtpat1="/images/screen1image.jpg"
dtpat2="/images/screen2image.jpg"
osascript -e "tell application \"System Events\"" \
-e "set theDesktops to a reference to every desktop" \
-e "set picture of item 1 of the theDesktops to (do shell script \"echo $dtpat1\")" \
-e "set picture of item 2 of the theDesktops to (do shell script \"echo $dtpat2\")" \
-e "end tell"
@trodemaster
trodemaster / simple blacklist
Created December 1, 2013 22:40
quick hack for blacklisting a single IP on OS X 10.9
# edit the /etc/pf.conf file and add this line
# This example will drop all packets from the IP 10.100.0.1 that arrive in ethernet 0
block drop in quick on en0 from 10.100.0.1 to any
@trodemaster
trodemaster / gist:8234205
Last active January 2, 2016 01:59
Stevens Pass - download webcam images and set as both desktops
#!/bin/bash
# Download webcam image and archive
#
jpg_name_base=base`date "+%y%m%d-%H%M"`.jpg
jpg_name_sky=sky`date "+%y%m%d-%H%M"`.jpg
jpg_dirBase=/Volumes/Zen/images/StevensBase13-14/
jpg_dirSky=/Volumes/Zen/images/StevensSky13-14/
dtpat1=$jpg_dirBase$jpg_name_base
dtpat2=$jpg_dirSky$jpg_name_sky
jpg_url1=http://stevenspass.com/cams/base/
@trodemaster
trodemaster / gist:8327176
Created January 9, 2014 00:13
badpeg.sh sell script for validating jpeg files using imagemagick. Adds a hyphen to the end of the filename if the test fails.
#!/bin/sh
# rename bat jpg files
# usage with large number of files
# cd to the directory containing the images
## ls ./ | xargs badpeg.sh
for filename in "$@"
do
#lastPix=`convert $filename -format "%[pixel: u.p{699,465}]" info:`
#echo $lastPix
@trodemaster
trodemaster / packerCrash.log
Created June 9, 2014 00:25
packer Crash .DS_Store
2014/06/08 17:20:59 Packer Version: 0.6.0 12e28f257f66299e3bb13a053bf06ccd236e7efd
2014/06/08 17:20:59 Packer Target OS/Arch: darwin amd64
2014/06/08 17:20:59 Built with Go Version: go1.2
2014/06/08 17:20:59 Detected home directory from env var: /Users/blake
2014/06/08 17:20:59 Attempting to open config file: /Users/blake/.packerconfig
2014/06/08 17:20:59 File doesn't exist, but doesn't need to. Ignoring.
2014/06/08 17:20:59 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-instance:packer-builder-amazon-instance virtualbox-iso:packer-builder-virtualbox-iso parallels-iso:packer-builder-parallels-iso parallels-pvm:packer-builder-parallels-pvm null:packer-builder-null vmware-vmx:packer-builder-vmware-vmx amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot digitalocean:packer-builder-digitalocean docker:packer-builder-docker googlecompute:packer-builder-googlecompute openstack:packer-builder-openstack virtualbox-ovf:packer-builder-virtualbox-ovf vmware-iso:packer-b
@trodemaster
trodemaster / tools-win.ps1
Created August 13, 2014 21:02
Install VMware tools from \windows\temp folder. Use task scheduler to avoid windows elevation issues when running this script via cygwin/openssh
#Powershell version of install vmware tools via task scheduler
$host.ui.RawUI.WindowTitle = "tools-win.ps1"
#check if scheduled task called installvmwtools exists install VMware tools
if (get-scheduledtask -taskname installvmwtools -ErrorAction SilentlyContinue) {
Write-Host Starting VMware Tools Installation
#install vmware cert
start-process -FilePath 'C:/Windows/Temp/certmgr.exe' -ArgumentList '-add C:/Windows/Temp/vmware.cer -c -s -r localMachine TrustedPublisher' -wait -verb RunAs
#Run vmware tools installer
@trodemaster
trodemaster / packer2012r2.log
Last active August 29, 2015 14:06
packer win build timeout
2014/09/08 22:14:46 Packer Version: 0.6.1 8b24d990943ff496a3bd951cb63f5fa03cff1c2f
2014/09/08 22:14:46 Packer Target OS/Arch: linux amd64
2014/09/08 22:14:46 Built with Go Version: go1.3
2014/09/08 22:14:46 Detected home directory from env var: /home/machine
2014/09/08 22:14:46 Attempting to open config file: /home/machine/.packerconfig
2014/09/08 22:14:46 File doesn't exist, but doesn't need to. Ignoring.
2014/09/08 22:14:46 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[parallels-iso:packer-builder-parallels-iso parallels-pvm:packer-builder-parallels-pvm amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean googlecompute:packer-builder-googlecompute openstack:packer-builder-openstack vmware-vmx:packer-builder-vmware-vmx amazon-ebs:packer-builder-amazon-ebs null:packer-builder-null docker:packer-builder-docker qemu:packer-builder-qemu virtualbox-iso:packer-builder-virtualbox-iso virtualbox-ovf:packer-builder-virtualb
@trodemaster
trodemaster / crash.log
Created September 9, 2014 22:11
packer 0.7.0 crash yamux: receive window exceeded
2014/09/09 13:45:56 Packer Version: 0.7.0
2014/09/09 13:45:56 Packer Target OS/Arch: linux amd64
2014/09/09 13:45:56 Built with Go Version: go1.3.1
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: amazon-chroot = /usr/local/bin/packer-builder-amazon-chroot
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: amazon-ebs = /usr/local/bin/packer-builder-amazon-ebs
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: amazon-instance = /usr/local/bin/packer-builder-amazon-instance
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: digitalocean = /usr/local/bin/packer-builder-digitalocean
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: docker = /usr/local/bin/packer-builder-docker
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: googlecompute = /usr/local/bin/packer-builder-googlecompute
2014/09/09 13:45:56 [DEBUG] Discoverd plugin: null = /usr/local/bin/packer-builder-null
@trodemaster
trodemaster / tools-ubuntu.sh
Last active September 10, 2016 14:35
Install supported vmware tools for Ubuntu 14.04
#!/bin/sh
# run with sudo
cd /tmp
wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
apt-key add VMWARE-PACKAGING-GPG-DSA-KEY.pub
apt-key add VMWARE-PACKAGING-GPG-RSA-KEY.pub
sh -c "echo deb http://packages.vmware.com/tools/esx/5.5u2/ubuntu precise main > /etc/apt/sources.list.d/vmware-tools.list"