Skip to content

Instantly share code, notes, and snippets.

🦀
wranglin' Cow<T>'s

Kristofer Rye rye

🦀
wranglin' Cow<T>'s
View GitHub Profile
@rye
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
1.55.17.162
1.186.45.250
1.245.61.144
2.136.131.36
2.139.199.51
2.152.111.49
2.228.149.174
3.92.185.11
3.94.79.149
3.133.90.152
View keybase.md

Keybase proof

I hereby claim:

  • I am rye on github.
  • I am krstfrye (https://keybase.io/krstfrye) on keybase.
  • I have a public key ASC7DhUX31cMaKAPn_s5ZWQ2HZVfBik5EhE_2h-_8V-bWwo

To claim this, I am signing this object:

View run_benchmarks.sh
#!/bin/bash
for i in raid{5,6,10};
do
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
rye / check_machine_status.sh
Created Jun 12, 2017
Checks the status of a list of machines using SSH blank firing.
View check_machine_status.sh
#!/bin/bash
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
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
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('https://larsenwork.com'))
@base_uri = base_uri
end
@rye
rye / defunct.sh
Created Jun 15, 2015
Print out a list of PID's that are defunct
View defunct.sh
#!/bin/sh
ruby -e "\"`ps -ef|grep \<defunct\>`\".split(/$/).each{|l|puts(l.match(/^(?<user>\w+)\W+(?<pid>\d+)\W+(?<ppid>\d+)/)[:pid])}"
@rye
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.
MIN_EPISODE_NUMBER = 001
MAX_EPISODE_NUMBER = 417
FORMAT = ".ogv"
You can’t perform that action at this time.