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
#!/usr/bin/expect
# VMware tools install with expect
# Decompress tools payload
spawn /bin/tar zxf /tmp/VMwareTools.tar.gz -C /tmp
wait
# timeout needed to wait for longer tasks in the install process
set timeout 300
@trodemaster
trodemaster / wsus_client.ps1
Created December 1, 2014 19:17
Register Windows Server 2012 r2 to wsus server via registry keys
New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate"
New-Item -Path "HKLM:Software\Policies\Microsoft\Windows\WindowsUpdate\AU"
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUServer -Value "http://wsus.domain.com:8530" -Type String -force
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate" -Name WUStatusServer -Value "http://wsus.domain.co:8530" -Type String -force
Set-ItemProperty -Path "HKLM:\software\policies\Microsoft\Windows\WindowsUpdate\AU" -Name UseWUServer -Value "1" -Type DWORD -force
@trodemaster
trodemaster / punzip.ps1
Created January 1, 2015 17:55
Powershell function for unzipping files
function punzip( $zipfile, $outdir ) {
If(-not(Test-Path -path $zipfile)){return "zipfile " +$zipfile + " not found!"}
If(-not(Test-Path -path $outdir)){return "output dir " + $outdir + " not found!"}
$shell = new-object -com shell.application
$zip = $shell.NameSpace($zipfile)
foreach($item in $zip.items())
{
$shell.Namespace($outdir).copyhere($item)
}
}
@trodemaster
trodemaster / gist:94ec1f1b24711a050634
Last active August 29, 2015 14:16
tools-rhel6-latest.sh
#!/bin/sh
# Install latest vmware tools from vmware.com repo for rhel 6
# get cert
wget -P /tmp http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# install cert
sudo rpm --import /tmp/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# Setup repo
@trodemaster
trodemaster / vmx_data_post_packer-build.log
Created April 8, 2015 18:33
vmx_data_post not working build log
2015/04/08 11:12:05 [INFO] Packer version: 0.7.5 9cd66feeacbd9cb318b72eb5ed59428c5b8c37ac+CHANGES
2015/04/08 11:12:05 Packer Target OS/Arch: darwin amd64
2015/04/08 11:12:05 Built with Go Version: go1.3.3
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: amazon-chroot = /usr/local/bin/packer-builder-amazon-chroot
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: amazon-ebs = /usr/local/bin/packer-builder-amazon-ebs
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: amazon-instance = /usr/local/bin/packer-builder-amazon-instance
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: digitalocean = /usr/local/bin/packer-builder-digitalocean
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: docker = /usr/local/bin/packer-builder-docker
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: googlecompute = /usr/local/bin/packer-builder-googlecompute
2015/04/08 11:12:05 [DEBUG] Discoverd plugin: null = /usr/local/bin/packer-builder-null
@trodemaster
trodemaster / vmx_data_post_Ubuntu1504.json
Created April 8, 2015 18:35
vmx_data_post not working Ubuntu1504.json
{
"builders": [
{
"type": "vmware-iso",
"guest_os_type" : "ubuntu-64",
"output_directory": "VM/Ubuntu1504",
"iso_url": "ISO/ubuntu-15.04-beta2-server-amd64.iso",
"iso_checksum": "5cd507c09e92fae1660faf4e6e2ceb8f6cb9532d985f35ebce32a2931b73b261",
"iso_checksum_type": "sha256",
"http_directory": "http",
@trodemaster
trodemaster / vmx_data_post_Ubuntu1504.vmx
Created April 8, 2015 18:36
vmx_data_post not working Ubuntu1504.vmx
.encoding = "UTF-8"
bios.bootorder = "hdd,CDROM"
checkpoint.vmstate = ""
cleanshutdown = "TRUE"
config.version = "8"
cpuid.corespersocket = "2"
displayname = "Ubuntu1504"
ehci.pcislotnumber = "-1"
ehci.present = "FALSE"
ethernet0.addresstype = "generated"
@trodemaster
trodemaster / tools.sh
Created June 2, 2015 16:11
cenos/rhel6 tools
#!/bin/sh
# Install latest vmware tools from vmware.com repo for rhel 6
# get cert
wget -P /tmp http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# install cert
sudo rpm --import /tmp/VMWARE-PACKAGING-GPG-RSA-KEY.pub
# Setup repo
@trodemaster
trodemaster / winrmcrash.log
Created July 8, 2015 23:21
crash log for packer 0.8.1 using winrm
This file has been truncated, but you can view the full file.
2015/07/08 14:48:19 [INFO] Packer version: 0.8.1 872e78d5b0a387eb3b87ddeef210264c3199d178
2015/07/08 14:48:19 Packer Target OS/Arch: darwin amd64
2015/07/08 14:48:19 Built with Go Version: go1.4.2
2015/07/08 14:48:19 [DEBUG] Discovered plugin: amazon-chroot = /files/packer-win10/packerbin/packer-builder-amazon-chroot
2015/07/08 14:48:19 [DEBUG] Discovered plugin: amazon-ebs = /files/packer-win10/packerbin/packer-builder-amazon-ebs
2015/07/08 14:48:19 [DEBUG] Discovered plugin: amazon-instance = /files/packer-win10/packerbin/packer-builder-amazon-instance
2015/07/08 14:48:19 [DEBUG] Discovered plugin: digitalocean = /files/packer-win10/packerbin/packer-builder-digitalocean
2015/07/08 14:48:19 [DEBUG] Discovered plugin: docker = /files/packer-win10/packerbin/packer-builder-docker
2015/07/08 14:48:19 [DEBUG] Discovered plugin: file = /files/packer-win10/packerbin/packer-builder-file
2015/07/08 14:48:19 [DEBUG] Discovered plugin: googlecompute = /files/packer-win10/packerbin/packer-builder-googlecompute
@trodemaster
trodemaster / packer-0.81-winrm.log
Created July 16, 2015 21:30
tools disconnecting winrm session packer log
2015/07/15 15:43:32 [INFO] Packer version: 0.8.1 872e78d5b0a387eb3b87ddeef210264c3199d178
2015/07/15 15:43:32 Packer Target OS/Arch: darwin amd64
2015/07/15 15:43:32 Built with Go Version: go1.4.2
2015/07/15 15:43:32 [DEBUG] Discovered plugin: amazon-chroot = /files/packer-win10/packerbin/packer-builder-amazon-chroot
2015/07/15 15:43:32 [DEBUG] Discovered plugin: amazon-ebs = /files/packer-win10/packerbin/packer-builder-amazon-ebs
2015/07/15 15:43:32 [DEBUG] Discovered plugin: amazon-instance = /files/packer-win10/packerbin/packer-builder-amazon-instance
2015/07/15 15:43:32 [DEBUG] Discovered plugin: digitalocean = /files/packer-win10/packerbin/packer-builder-digitalocean
2015/07/15 15:43:32 [DEBUG] Discovered plugin: docker = /files/packer-win10/packerbin/packer-builder-docker
2015/07/15 15:43:32 [DEBUG] Discovered plugin: file = /files/packer-win10/packerbin/packer-builder-file
2015/07/15 15:43:32 [DEBUG] Discovered plugin: googlecompute = /files/packer-win10/packerbin/packer-builder-googlecompute