Skip to content

Instantly share code, notes, and snippets.

View c0dyhi11's full-sized avatar
🙈
Don't look too closely...

Cody Hill c0dyhi11

🙈
Don't look too closely...
View GitHub Profile
@c0dyhi11
c0dyhi11 / rysync_data_migration.sh
Created July 13, 2022 23:20
This script will use rsync to keep data in sync on a loop, and then notify you via a Slack webhook how long each iteration took, and how much data was copied.
#!/bin/bash
rsync_source="198.51.60.10:/mnt/tank/dataset/"
rsync_dest="/mnt/tank/dataset/"
slack_token="UYHJ5E74J/B03QSDR6598/8pW72Fl5OOUoFlj53sIccOi6"
get_space="df | grep `echo ${rsync_dest::-1}` | awk '{print \$3}'"
export BLOCKSIZE=1024
while true; do
before_space=`eval "$get_space"`
time_passed=`{ time rsync -aAHX $rsync_source $rsync_dest; } 2>&1 | grep real | awk '{print $2}'`
after_space=`eval "$get_space"`
@c0dyhi11
c0dyhi11 / diamond.py
Created February 4, 2022 21:52
Draw a diamond on the screen the size that the user wants
def is_number_input(user_input):
if not user_input.isnumeric():
print("You must input a whole number!")
return 0
user_input = int(user_input)
if user_input > 35:
print("Your number must be smaller than 35!")
return 0
elif user_input < 2:
print("Your number must be larger than 1!")
@c0dyhi11
c0dyhi11 / install_tinkerbell.sh
Last active April 1, 2024 21:44
Ubuntu 20.04 Tinkerbell deployment
#!/bin/bash
# Become the root user because I didn't verifiy sudo for every command.
# Install Tinkerbell
sudo apt-get update -y
sudo apt-get install -y apt-transport-https \
ca-certificates \
curl \
gnupg-agent \