View bootstrap-ts-project.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
View merge-zip-files.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View format-ext4-disk-ubunutu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View format-exfat-disk-ubunutu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View python-pretty-print-dict-as-json.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
View python-filter-list-of-dicts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pets = [ | |
{ | |
'id': '5460b046-5ed4-11ed-9b6a-0242ac120002', | |
'group': 'dog', | |
'type': 'German Shepherd', | |
'large': True, | |
}, | |
{ | |
'id': '90c5b2ca-5ed4-11ed-9b6a-0242ac120002', | |
'group': 'cat', |
View rotate-headless-ubuntu-output.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View aws-cli-route53-transfer-domain-name.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View ssh-config.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host github.com | |
Hostname github.com | |
User coltenkrauter | |
Port 22 | |
IdentityFile /users/coltenkrauter/.ssh/id_ed25519_github | |
# ssh-add --apple-use-keychain ~/.ssh/id_ed25519_github |
View internet-speed-test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do a speed test | |
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 - | |
# Add speedtest alias to your Z Profile | |
echo 'alias speedtest="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -"' >> ~/.zshrc | |
# Add speedtest alias to your Bash Profile | |
echo 'alias speedtest="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -"' >> ~/.bashrc |
NewerOlder