Skip to content

Instantly share code, notes, and snippets.

View brndnmtthws's full-sized avatar
🌈
Happy

Brenden Matthews brndnmtthws

🌈
Happy
View GitHub Profile
@brndnmtthws
brndnmtthws / aws_nvme-cloud-init.yml
Last active January 23, 2021 19:15 — forked from aussielunix/aws_nvme-cloud-init.yml
simple cloud-init for mounting an ephemeral nvme store in AWS. This is to be used as user-data.
#cloud-config
repo_update: true
repo_upgrade: all
package_upgrade: true
bootcmd:
- test -z "$(blkid /dev/nvme0n1)" && mkfs -t ext4 -L scratch /dev/nvme0n1
- mkdir -p /mnt/tmp
- mount /dev/nvme0n1 /mnt/tmp
@brndnmtthws
brndnmtthws / route53-to-tf.py
Last active March 2, 2023 18:43
A python script for converting existing AWS Route53 records into Terraform HCL
#!/usr/bin/env python3
#
# Copyright (c) 2020 Brenden Matthews <brenden@brndn.io> under the MIT license
# at https://opensource.org/licenses/MIT
#
# This script converts existing Route53 records into Terraform HCL. I created
# this for a one-off job. The script uses the AWS CLI to fetch Route53 info,
# and prints the corresponding TF code to stdout.
#
# Example usage:
@brndnmtthws
brndnmtthws / macos-randomize-mac-address.sh
Created February 28, 2024 19:01
Randomize MAC on macOS
#!/bin/sh
# run with sudo
# Change this if your interface is not en0 (check with `ifconfig`)
if="en0"
# Will disassociate WiFi
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
ifconfig $if ether `openssl rand -hex 6 | sed 's/\(..\)/:\1/g; s/^.\(.\)[0-3]/\12/; s/^.\(.\)[4-7]/\16/; s/^.\(.\)[89ab]/\1a/; s/^.\(.\)[cdef]/\1e/'`