Skip to content

Instantly share code, notes, and snippets.

wranglin' Cow<T>'s

Kristofer Rye rye

wranglin' Cow<T>'s
View GitHub Profile
rye / naughty_list
Last active Dec 9, 2019
A list of IP addresses that have tried (and failed) to log into my systems.
View naughty_list

Keybase proof

I hereby claim:

  • I am rye on github.
  • I am krstfrye ( on keybase.
  • I have a public key ASC7DhUX31cMaKAPn_s5ZWQ2HZVfBik5EhE_2h-_8V-bWwo

To claim this, I am signing this object:

for i in raid{5,6,10};
echo ">>> Benchmarking $i..."
sudo bonnie++ -c 1 -d /$i -s 524288 -n 1024 -m $i -u root -bf 2>&1 | sudo tee $i.out
echo ">>> Done!"
echo ">>> Cleaning up... (sync; echo 3 > /proc/sys/vm/drop_caches)"
sudo sync
rye /
Created Jun 12, 2017
Checks the status of a list of machines using SSH blank firing.
function check_user_and_host {
_ssh_result=$(ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no $1@$2 "echo \"\`who | grep -c . \`\"; true" 2>/dev/null)
function check_and_output_host {
check_user_and_host $1 $2 && echo "$2: up, $_ssh_result users logged in" || echo "$2: down"
rye / output.txt
Created Dec 8, 2016
Output from Make when I compile @shyouhei's ruby version
View output.txt
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Werror=implicit-int -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -Werror=division-by-zero -Werror=deprecated-declarations -Werror=extra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin16 -I./include -I. -I./enc/unicode/data/8.0.0
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple LLVM version 8.0.0
rye / monoid-firehose.rb
Last active Nov 26, 2015
Drink from the Monoid firehose! (Downloads the latest Monoid release)
View monoid-firehose.rb
require 'uri'
require 'net/http'
module Monoid
class Site
attr_accessor :base_uri
def initialize(base_uri = URI.parse(''))
@base_uri = base_uri
rye /
Created Jun 15, 2015
Print out a list of PID's that are defunct
ruby -e "\"`ps -ef|grep \<defunct\>`\".split(/$/).each{|l|puts(l.match(/^(?<user>\w+)\W+(?<pid>\d+)\W+(?<ppid>\d+)/)[:pid])}"
rye / bezier.rb
Created May 7, 2015
A Ruby script to calculate Bézier curves.
View bezier.rb
require "matrix"
require "pry"
class Integer
# Method to compute binomial coefficient nCk (where n is this object,
# and k is some other integer.
def choose(k)
# n! / (n-k)!
top = (((self-k)+1)..(self)).inject(1, &:*)
View railscasts_fetch.rb
require "net/http"
require "pry"
# Parameters for episode looping.
# Note that 404 seems to be reserved for whining.
FORMAT = ".ogv"
You can’t perform that action at this time.