Skip to content

Instantly share code, notes, and snippets.

View coltenkrauter's full-sized avatar
👩‍🌾
Husband, father of four, full-stack developer

Colten Krauter coltenkrauter

👩‍🌾
Husband, father of four, full-stack developer
  • Stevensville, MT
View GitHub Profile
@coltenkrauter
coltenkrauter / aws-cli-route53-transfer-domain-name.sh
Last active December 28, 2022 05:47
AWS CLI Route53 – Transfer domain name from one account to another
TRANSFER_DOMAIN_NAME='example.com'
ACCOUNT_A=1234567890
ACCOUNT_B=2345678901
# Setup profiles to auth with each account
aws configure --profile ACCOUNT_A
aws configure --profile ACCOUNT_B
# List the domain names registered in account a
aws route53domains list-domains --profile ACCOUNT_A
@coltenkrauter
coltenkrauter / rotate-headless-ubuntu-output.sh
Last active October 13, 2022 22:28
Rotate HDMI output to change orientation of terminal in headless Ubuntu/Linux
# rotate the current framebuffer
echo 1 | sudo tee /sys/class/graphics/fbcon/rotate
# rotate all framebuffers
echo 1 | sudo tee /sys/class/graphics/fbcon/rotate_all
# Permanantly rotate framebuffer for headless server
echo 'GRUB_CMDLINE_LINUX="fbcon=rotate:1"' | sudo tee /etc/default/grub
sudo update-grub
sudo reboot
@coltenkrauter
coltenkrauter / python-filter-list-of-dicts.py
Last active November 7, 2022 19:53
Python | Filter a list of dicts by dict field
pets = [
{
'id': '5460b046-5ed4-11ed-9b6a-0242ac120002',
'group': 'dog',
'type': 'German Shepherd',
'large': True,
},
{
'id': '90c5b2ca-5ed4-11ed-9b6a-0242ac120002',
'group': 'cat',
@coltenkrauter
coltenkrauter / python-pretty-print-dict-as-json.py
Created November 7, 2022 20:00
Python | Pretty print dict as JSON
import json
# default=str is useful since it will cast certain objects to string that otherwise aren't json parsable, such as datetime dates.
print(json.dumps(domains, indent=4, sort_keys=True, default=str))
@coltenkrauter
coltenkrauter / format-exfat-disk-ubunutu.sh
Created November 14, 2022 02:52
Format disk as exFat on Ubuntu
lsblk -f -e7 -e11 # View disk paths
sudo apt install exfat-fuse exfatprogs
sudo mkfs.exfat -n DISK_LABEL /dev/sdX # Update this with correct path
@coltenkrauter
coltenkrauter / format-ext4-disk-ubunutu.sh
Created November 14, 2022 02:55
Format disk as ext4 in Ubuntu for Plex server
# This is for a Plex server
# ext4 is better than exFat since it can deal with normal linux file/directory permission
lsblk -f -e7 -e11 # List disk paths
sudo mkfs -t ext4 /dev/sdX # Replace with correct path
@coltenkrauter
coltenkrauter / merge-zip-files.sh
Created December 10, 2022 00:04
Merge zip files into a single zip file using Bash/Zsh/Shell terminal
# Will merge all zip files in the current directory into a single zip file merged.zip
mkdir merged
for x in *.zip ; do unzip -d merged -o -u $x ; done
zip -r merged.zip merged
@coltenkrauter
coltenkrauter / bootstrap-ts-project.sh
Created March 17, 2023 23:44
Bootstrap TypeScript repository
# In the reposityroy root
npm i typescript --save-dev
npx tsc --init
# create index.ts
# Update package.json with the following,
"scripts": {
"start": "node dist/index.js",
"build": "npx tsc --outDir dist"
@coltenkrauter
coltenkrauter / prime-vpn-whitelist.md
Last active March 30, 2025 15:43
Whitelist Amazon Prime to bypass VPN

Whitelist Amazon Prime to bypass VPN

amazon.com
media-amazon.com
amazonvideo.com
aiv-cdn.net
pv-cdn.net
aiv-delivery.net
akamaihd.net
ssl-images-amazon.com

@coltenkrauter
coltenkrauter / truenas-scale-copy-all-data-from-one-pool-to-another.sh
Created June 2, 2023 02:43
TrueNAS – Copy all data from one pool to another
# The reason why I wanted to do this was because I had a striped pool (a pool with no mirroring/redundancy) and
# I wanted to convert it to a mirror pool which is not possible through the GUI (it is a bit complex via shell commands).
# My solution was to copy the data from the striped pool to a temporary holding pool (a random disk that I had lying around)
# and then recreate the pool as a mirrored pool and copy the snapshot back.
# Start a tmux session so that the shell session will persist even when you close the shell
tmux
# Create a snapshot of pool_A that contains the data that you want moved to pool_B
zfs snapshot -r pool_A@migrate