Skip to content

Instantly share code, notes, and snippets.

View bunchc's full-sized avatar

Cody Bunch bunchc

View GitHub Profile
@bunchc
bunchc / install_adfs.ps1
Created May 9, 2018 21:20
Install and configure adfs with powershell
$domainName = "{{ windows_domain_info['dns_domain_name'] }}"
$password = "{{ windows_domain_info['domain_admin_password'] }}"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$fqdn = [System.Net.Dns]::GetHostByName(($env:computerName)) | FL HostName | Out-String | %{ "{0}" -f $_.Split(':')[1].Trim() };
$filename = "C:\$fdqn.pfx"
$user = "{{ windows_domain_info['dns_domain_name'] }}\{{ windows_domain_info['domain_admin_user'] }}"
$credential = New-Object `
-TypeName System.Management.Automation.PSCredential `
-ArgumentList $user, $securePassword
@bunchc
bunchc / Dockerfile
Last active May 3, 2025 03:22
Using custom golang plugins with the Kong Ubuntu image
# To build and load custom GO plugins into the Kong Ubuntu image
# we use a multistage docker build. The first stage uses the golang
# image to build the plugin. The second stage then copies that plugin
# into the Kong Ubuntu image.
# Build the golang plugin
FROM golang:alpine as build
WORKDIR /plugin
COPY go-plugins/* ./
@bunchc
bunchc / user_data_hardening.sh
Last active May 3, 2025 03:21
Script for hardening a box via user-data
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch (bunchc@gmail.com)
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
email_address="userdata@mailinator.com"
@bunchc
bunchc / custom.ipxe
Created May 5, 2021 13:32
Custom ipxe menu for netboot.xyz
#!ipxe
###
### codybunch.lab custom menu example
###
:custom
clear custom_choice
menu ESXi
item --gap Boot ESXi Installer
item esxi_70_kickstart ${space} 7.0 Automated Install
@bunchc
bunchc / kickstart.ks
Created May 5, 2021 12:59
ESXi Kickstart file
#Accept the VMware End User License Agreement
vmaccepteula
# clear paritions and install
clearpart --firstdisk --overwritevmfs
install --firstdisk --ignoressd --overwritevmfs --novmfsondisk
#set the root password
rootpw VMware1!
@bunchc
bunchc / script_custom.ps1
Last active December 10, 2021 18:47
Windows 10 customization script
# Install chocolatey & boxstarter
Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
# Basic setup
Write-Host "Setting execution policy"
Update-ExecutionPolicy Unrestricted
###########################################
# Update Windows and reboot if necessary #
0.0.0.0 0.0.0.0
0.0.0.0 2game.com
0.0.0.0 3games1box.com
0.0.0.0 5games1box.com
0.0.0.0 account-public-service-prod03.ol.epicgames.com
0.0.0.0 account.ubisoft.com
0.0.0.0 accountportal-website-prod07.ol.epicgames.com
0.0.0.0 accounts.ea.com
0.0.0.0 accounts.epicgames.com
0.0.0.0 accounts.launcher-website-prod07.ol.epicgames.com
@bunchc
bunchc / ssh.conf
Created September 24, 2020 13:17
Start tmux on ssh connect
Host dethkopter
Hostname dethkopter.mordhaus
User toki.wartooth
Port 22
RequestTTY yes
RemoteCommand "tmux new-session -s metalocalypse || tmux attach-session -t metalocalypse"
@bunchc
bunchc / tasks.json
Created September 3, 2020 16:04
Join a zoom call from within VSCode
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Join meeting",
"type": "shell",
"windows": {
"command": "C:\\Program Files (x86)\\Zoom\\bin\\Zoom.exe",
@bunchc
bunchc / userdata-hardening-ufw
Created August 20, 2017 15:40
UserData Hardening script with UFW
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch (bunchc@gmail.com)
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
email_address="userdata@mailinator.com"