Skip to content

Instantly share code, notes, and snippets.

View jeffgreenca's full-sized avatar

jeffg jeffgreenca

  • Greater Seattle Area, WA
View GitHub Profile
### Keybase proof
I hereby claim:
* I am jeffgreenca on github.
* I am jeffgreenca (https://keybase.io/jeffgreenca) on keybase.
* I have a public key ASB53mfLk0H_ZlubFd9z_6Y0y8eb4GeT6s40DsGoeR6iIAo
To claim this, I am signing this object:
Verifying my Blockstack ID is secured with the address 13SqyE7wADfDf1veyn1nYFhXqzB1mSXzqg https://explorer.blockstack.org/address/13SqyE7wADfDf1veyn1nYFhXqzB1mSXzqg
@jeffgreenca
jeffgreenca / capture-vm-traffic.sh
Last active October 31, 2022 03:03
Capture traffic for a particular VM on an ESXi host, using pktcap-uw. Assists with finding the PORT-ID and most common interesting capture points.
#!/bin/sh
#Manage packet capture of a particular VM running on this ESXi host
#How to use, on an ESXi host:
# Download the script to /tmp and make it executable.
# $ chmod +x capture-vm-traffic.sh
# $ ./capture-vm-traffic.sh start your-vm-name
# Do stuff you want captured, then
# $ ./capture-vm-traffic.sh stop
# You get three files containing the in, out, and drops for the VM's vnic
#Tested on ESXi 6.5.0 build 5224529
@jeffgreenca
jeffgreenca / template-config-win2016.txt
Created December 5, 2017 16:51
windows 2016 config steps for template
#Basic checklist for Windows 2016 Server template with GUI
Build new VM shell Template-Windows-Server-2016-DataCtr-GUI
2 vCPU / dual socket, 4GB RAM, 60GB HDD, removed floppy drive, VMXNET3
Installed Windows Server 2016 Datacenter GUI
Administrator / <default password>
Activated Windows Server 2016 Datacenter 2016 MAK JNVR2-7TVH7-8TT94-CCKBW-DGQDH
Installed VMware tools
Leave firewall on (will turn off via GPO)
Created C:\Utilities folder
@jeffgreenca
jeffgreenca / template-config-centos.txt
Created December 5, 2017 16:49
hacked together centos template configuration script for VM provisioning
#References
https://lonesysadmin.net/2013/03/26/preparing-linux-template-vms/
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/sect-Guest_virtual_machine_disk_access_with_offline_tools-Using_virt_sysprep.html
http://everything-virtual.com/2016/05/06/creating-a-centos-7-2-vmware-gold-template/
#Installed using latest CentOS 7 minimal media (June 6th)
#Enabled SELinux to the second option (default policies, minimum basically)
yum update -y
#Install these packages:
@jeffgreenca
jeffgreenca / train.ino
Created December 4, 2017 01:21
Arduino code driving a custom LEGO train integration
/*
Train.ino
Jeff Green, December 2017
Software control for LEGO PowerFunction Train
Uses motion sensor HC-SR501, OLED display, and custom
adapter circuit for LEGO PowerFunction control on pin 3.
See loop() for the program info
@jeffgreenca
jeffgreenca / arduino-garage-parking-assist.ino
Created September 3, 2017 23:19
Arduino Garage Parking Assistant
/*
Arduino Garage Parking Assistant
By Jeff Green
Sept 3rd, 2017
Simple parking assist using HC-SR04 for distance measurement
and MAX7219 8x8 LED grid for visual feedback.
Place at the front of your garage, and it will help you park
while ($true) { start-sleep 0.1; Get-Date -Format "mm:ss:ffff" }
@jeffgreenca
jeffgreenca / main.yml
Last active August 13, 2017 15:53
Trivial Ansible example
---
- hosts: localhost
roles:
- { role: geerlingguy.nginx }
vars:
nginx_vhosts:
- listen: "80"
server_name: "*"
return: "301 https://www.jeffgreen.io/"
# Split Brain DNS Stupidly Simple
# Edit the script and run it, point your DNS client to 127.0.0.1 or whatever
from twisted.internet import reactor, defer
from twisted.names import client, dns, error, server
class DynamicResolver(object):
#List of custom domain names and their associated DNS server
_custom = [ ('yourdomain.local', '1.2.3.4'),