Skip to content

Instantly share code, notes, and snippets.


Colten Krauter coltenkrauter

  • Stevensville, MT
View GitHub Profile
coltenkrauter /
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 /
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
mkdir merged
for x in *.zip ; do unzip -d merged -o -u $x ; done
zip -r merged
coltenkrauter /
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 /
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 /
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 /
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 /
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 /
Last active December 28, 2022 05:47
AWS CLI Route53 – Transfer domain name from one account to another
# 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 /
Created October 4, 2022 05:14
Git SSH config and adding secret key to Apple Keychain for use with Sublime Merge
User coltenkrauter
Port 22
IdentityFile /users/coltenkrauter/.ssh/id_ed25519_github
# ssh-add --apple-use-keychain ~/.ssh/id_ed25519_github
coltenkrauter /
Last active September 23, 2022 16:47
Internet speed test via terminal (Linux/ubuntu/bash/sh/zsh)
# Do a speed test
curl -s | python3 -
# Add speedtest alias to your Z Profile
echo 'alias speedtest="curl -s | python3 -"' >> ~/.zshrc
# Add speedtest alias to your Bash Profile
echo 'alias speedtest="curl -s | python3 -"' >> ~/.bashrc