Skip to content

Instantly share code, notes, and snippets.

View bil9000's full-sized avatar

bil9000 bil9000

View GitHub Profile
@bil9000
bil9000 / install-code-server-ubuntu.sh
Created November 19, 2022 04:07
install-code-server-ubuntu.sh
#!/bin/bash
wget -O- https://aka.ms/install-vscode-server/setup.sh | sh
code-server
@bil9000
bil9000 / eksctl.sh
Created June 23, 2022 02:12
eksctl-with-graviton-nodes
eksctl create cluster --node-type=t4g.large
@bil9000
bil9000 / oidc.py
Created January 12, 2022 03:14
create oidc provider in boto3
import boto3
oidc_uri = "https://oidc.eks.us-west-2.amazonaws.com/id/STRING_GOES_HERE"
thumbprint = "THUMBRPRINT_GOES_HERE"
audience = "sts.amazonaws.com"
tag_key0 = "ApplicationShortName"
tag_value0 = "foo"
print(oidc_uri)
@bil9000
bil9000 / rds-to-s3-backup.sh
Last active August 20, 2021 05:11
rds-to-s3-backup
#!/bin/bash
DT=$(date +%Y-%m-%d)
PASS=$(aws secretsmanager get-secret-value --secret-id testdb01-password --query SecretString --output text)
for DB in $(mysql -h db1-DBNAME-instance-1.INSTANCEID.us-east-1.rds.amazonaws.com -uadmin -p$PASS -e 'show databases' -s --skip-column-names); do
mysqldump -h db1-DBNAME.cluster-INSTANCEID.us-east-1.rds.amazonaws.com -uadmin -p$passwd $DB > $DB.sql
echo "$DB database dumped"
tar -zcvpf $DB.sql.tar.gz $DB.sql
@bil9000
bil9000 / chis-s3.sh
Last active August 17, 2021 23:31
chia-s3.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt install s3fs -y
sudo apt-get install awscli -y
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
cd chia-blockchain
sh install.sh
. ./activate
chia init
@bil9000
bil9000 / bootstrap.sh
Last active August 26, 2021 03:49
bootstrap to set up ubuntu
#!/bin/bash
wget https://gist.githubusercontent.com/bil9000/9d655d4851bf87ac85b4c13b53d1ed11/raw/97bba5771db75b8550937ee7dc5770e3a019f779/ubuntu-bootstrap.sh
chmod +x ubuntu-bootstrap.sh
./ubuntu-bootstrap.sh
@bil9000
bil9000 / aliases
Last active January 31, 2022 04:16
aliases
alias k="kubectl"
alias kc="kubectl config"
alias kcgc="kubectl config get-contexts"
alias kcuc="kubectl config use-context"
alias kg="kubectl get"
alias kgp="kubectl get pods"
alias kgpa="kubectl get pods --all-namespaces"
alias kgi="kubectl get ingress"
alias kgia="kubectl get ingress --all-namespaces"
@bil9000
bil9000 / ubuntu-bootstrap.sh
Last active October 1, 2021 21:06
ubutnu-bootstrap.sh
#!/bin/bash
# This files is to bootstrap an ubuntu ec2 instance (non-arm)
# with a lot of the tools that are necessary for kuberentetes and
# devops tasks.
sudo apt-get update
sudo apt-get upgrade -y
@bil9000
bil9000 / truckin-4-jesus.sh
Last active June 30, 2021 08:10
truckin-4-jesus.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install awscli -y
sudo apt-get install jq -y
aws configure
export REGION=us-gov-east-1
export ACCOUNT_NUMBER=$(aws sts get-caller-identity | jq -r ".Account|.")
aws s3 mb s3://trucking-for-jesus
@bil9000
bil9000 / .zshrc
Created June 30, 2021 07:35
my pesonal .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/bil9000/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes