Skip to content

Instantly share code, notes, and snippets.

View bkiahstroud's full-sized avatar

Kiah Stroud bkiahstroud

View GitHub Profile
@bkiahstroud
bkiahstroud / clear_disk_space_softserv.sh
Last active May 4, 2024 19:47
Clear disk space on Linux server
#!/bin/bash
current_disk_usage() {
df -h | awk '/\/$/ {print $5}'
}
percent_disk_usage_before=$(current_disk_usage)
if ! [ -x "$(command -v journalctl)" ]; then
echo 'Warning: journalctl is not installed.'
@bkiahstroud
bkiahstroud / pre-commit
Last active April 19, 2024 19:19
Run rubocop via Docker Compose as a git pre-commit hook
#!/bin/sh
# Get a list of all staged Ruby (.rb) files
RUBY_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.rb$')
# If there are no Ruby files, skip the check
if [ -z "$RUBY_FILES" ]; then
exit 0
fi
@bkiahstroud
bkiahstroud / opensaysme
Created June 9, 2022 16:14
opensaysme script (generic)
#!/usr/bin/env ruby
require 'date'
# Exit it script has already been run this boot session
return if File.exist?('/tmp/opensaysme_switch.lock')
# Create lock file to "turn off" script until next system boot
File.open('/tmp/opensaysme_switch.lock', 'w')
WEEKDAYS = %i[
class AdaptAndOvercome < RTanque::Bot::Brain
NAME = 'Adapt&Overcome'
include RTanque::Bot::BrainHelper
WALL_MARGIN = 100
ACCEL_TICKS = 62
CHANGE_DIRECTION_PROBABILITY = 0.002
RAND_PRECISION = 2000000
RADAR_PRECISION_RANGE = 0.1
MIN_SHOT_DIST_PER_TICK = 5
### Keybase proof
I hereby claim:
* I am bkiahstroud on github.
* I am bkiahstroud (https://keybase.io/bkiahstroud) on keybase.
* I have a public key ASBzq6-2MtriWMWEFRjyZmDP8koCJo74XW2TtwiUlqxJcwo
To claim this, I am signing this object: