Skip to content

Instantly share code, notes, and snippets.

View caius's full-sized avatar
👻

Caius Durling caius

👻
View GitHub Profile
# Unique headers
GNU "Terry Pratchett", Terry Pratchett
GNU #1
GNU Aaron Swartz
GNU Aaron Swartz, Boris Floricic, Wau Holland, Stephen Hawking
GNU Arthur William Bell III, Natalie Nguyen, Terry Pratchett, Chris Long, Howard Gobioff
GNU Douglas Adams, Terry Pratchett, Lester Haines
GNU GNU: Terry Pratchett, Jon Postel, Dennis Ritchie, Evi Nemeth, Ray Tomlinson, Evelyn Berezin
GNU Jerry Jackowski, Natalie Nguyen
GNU John Dearheart
| backup1 | RUNNING | 10.0.0.99 (eth0) | 2a02:8010:62f1:2:216:3eff:fe50:6cec (eth0) | PERSISTENT | 0 |
| | | 10.0.0.98 (eth0) | | | |
| | | 10.0.0.95 (eth0) | | | |
| | | 10.0.0.93 (eth0) | | | |
| | | 10.0.0.92 (eth0) | | | |
| | | 10.0.0.90 (eth0) | | | |
| | | 10.0.0.9 (eth0) | | | |
| | | 10.0.0.89 (eth0) | | | |
| | | 10.0.0.88 (eth0) | | | |
| |
@caius
caius / shadowing.rb
Last active November 15, 2018 13:55
@things = [1]
def foo
@things.first
end
foo # => 1
unless foo
foo = 2
module ToInt
def to_int
return unless self
i = to_i
i if self == i.to_s
end
end
String.include(ToInt)
NilClass.include(ToInt)
require "benchmark/ips"
Benchmark.ips do |r|
r.report("block argument, not yielded") do
m = Module.new do
def foo(&block)
end
module_function :foo
end
# Content-Length, Worker index, Worker total count
length, index, count = ARGV.first(3).map(&method(:Integer))
slice, remainder = length.divmod(count)
min = index * slice
max = if index == (count - 1)
# Final slice finishes on total size
length
else
# One less than next slice starting point
((index + 1) * slice) - 1
# On a mac
# Double check the README that these are still accurate instructions
git clone git://github.com/arekinath/piv-agent
cd piv-agent
make
# enter password when prompted
make install
# Stick the bit in your profile that it asks you to
#!/usr/bin/env bash
exit 1 # don't run as a script y'idiot
# Bootstraps an ubuntu server on HP microserver to run lxd/terraform
# Expects to be run as root by hand. Copy/paste yo!
apt update
apt dist-upgrade -y
root@mc1:~# time bonnie++ -d /tmp -r 512 -u root
Using uid:0, gid:0.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
module FetchDup
def fetch(*)
super.dup
end
end
html_options = {
:class => "one",
}