Skip to content

Instantly share code, notes, and snippets.

View spencershepard's full-sized avatar

Spencer Shepard spencershepard

View GitHub Profile
@spencershepard
spencershepard / batchinstaller.cmd
Created March 28, 2025 19:04
(Windows) Automatically run all installers in a folder with elevated permissions
Echo OFF
REM The next command sets the working directory to the directory of the script (ie instead of C:/Windows/System32 when run as admin)
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy Bypass -File "batchinstaller.ps1"
PAUSE > NUL
@spencershepard
spencershepard / install-zsh.sh
Last active April 26, 2025 16:30
Install zshell and auto-suggestions (Ubuntu)
#!/bin/bash
ZSHRC_FILE="$HOME/.zshrc"
echo "Installing packages..."
apt update && apt install -y zsh zsh-autosuggestions zsh-syntax-highlighting
# Check if the .zshrc file exists
if [[ ! -f "$ZSHRC_FILE" ]]; then
echo "$ZSHRC_FILE not found. Creating..."
touch "$ZSHRC_FILE"
@spencershepard
spencershepard / gist:05bc6e9f0bff01e4486793e0136eb73c
Created July 30, 2025 03:42
Init Terraform with AWS Backend (bash)
TF_STATE_BUCKET="your-bucket-name"
TF_STATE_TABLE="your-dynamodb-table"
BUCKET_FOLDER="terraform"
AWS_REGION="your-aws-region"
aws s3api create-bucket --bucket $TF_STATE_BUCKET --region $AWS_REGION || echo "Bucket already exists"
aws dynamodb create-table \
--table-name $TF_STATE_TABLE \
--attribute-definitions AttributeName=LockID,AttributeType=S \
@spencershepard
spencershepard / gist:70610283a92e33713cca010b2caf88af
Created July 30, 2025 03:43
Init Terraform with AWS Backend (PowerShell)
$TF_STATE_BUCKET = "your-bucket-name"
$BUCKET_FOLDER = "terraform"
$TF_STATE_TABLE = "your-dynamodb-table"
$AWS_REGION = "your-aws-region"
aws s3api create-bucket --bucket $TF_STATE_BUCKET --region $AWS_REGION
if ($LASTEXITCODE -ne 0) { Write-Host "Bucket already exists" }
aws dynamodb create-table `
--table-name $TF_STATE_TABLE `