View active_zfs_holds.rb
# Pipe `zfs history` into this script, it will output holds
# which have not yet been released.
holds = []
ARGF.each_line do |line|
next unless line[/zfs (hold|release) (\S+) (\S+)/]
kind = $1
tag = $2
snapshot = $3
View client.rb
require_relative "./shared"
seen_ids = []
$q.subscribe(:block => true, :manual_ack => true) do |delivery_info, metadata, payload|
data = JSON.parse(payload)
p "Got #{data["id"]} (#{data["nack"]})"
if seen_ids.include?(data["id"])
raise "Dup! Already seen this message"
View feed server.md

Feed Server

Fetcher

  • Reads file containing feed URLs on each line
  • Has a feedstore directory it places data into
  • feedstore is structured
    • {{feed}}.json - file, metadata about the feed, name consistently generated from URL
    • {{feed}} - folder, name consistently generated from URL
      • {{guid}}.json - file, one per item, JSON format, contains item details (optionally .json.gz)
View gist:01947972115c0969bd47ac477cebdb03
TalkTalk: Connecting to host public.srv-9w8cz.gb1.brightbox.com, port 5201
TalkTalk: [ 4] local 2.98.147.132 port 44742 connected to 109.107.37.171 port 5201
TalkTalk: [ ID] Interval Transfer Bandwidth Retr
TalkTalk: [ 4] 0.00-1.04 sec 1.75 MBytes 14.1 Mbits/sec 0 (omitted)
TalkTalk: [ 4] 1.04-2.07 sec 1.75 MBytes 14.2 Mbits/sec 0 (omitted)
TalkTalk: [ 4] 0.00-1.03 sec 1.75 MBytes 14.3 Mbits/sec 0
TalkTalk: [ 4] 1.03-2.03 sec 1.88 MBytes 15.7 Mbits/sec 6
TalkTalk: [ 4] 2.03-3.03 sec 1.50 MBytes 12.6 Mbits/sec 0
TalkTalk: [ 4] 3.03-4.03 sec 1.62 MBytes 13.6 Mbits/sec 0
TalkTalk: [ 4] 4.03-5.03 sec 1.62 MBytes 13.6 Mbits/sec 0
View gist:71e13bc31e87dee0102b324e2918faad
caius@earl:~$ iperf3 -c ping.online.net -p 5205 -B TalkTalk -f m
Connecting to host ping.online.net, port 5205
[ 4] local 2.98.147.132 port 50146 connected to 62.210.18.40 port 5205
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-1.02 sec 2.12 MBytes 17.4 Mbits/sec 2
[ 4] 1.02-2.02 sec 2.12 MBytes 17.8 Mbits/sec 0
[ 4] 2.02-3.03 sec 2.12 MBytes 17.8 Mbits/sec 1
[ 4] 3.03-4.05 sec 2.12 MBytes 17.4 Mbits/sec 1
[ 4] 4.05-5.02 sec 2.12 MBytes 18.3 Mbits/sec 0
[ 4] 5.02-6.05 sec 2.12 MBytes 17.4 Mbits/sec 1
View mdinlinedot2mdpng
#!/usr/bin/env ruby
require "pathname"
require "kramdown"
plan = Pathname.new("../plan.md").expand_path(__dir__)
output_dir = Pathname.new("../output").expand_path(__dir__)
output_dir.rmtree if output_dir.exist?
output_dir.mkdir
View octodns-order-diff
#!/usr/bin/env bash
#
# Diffs the order of octodns zone files on disk against what order they
# are expected to be in by octodns. Fills in a gap with octodns-valiate
# output to make it easier to write correct config files by hand.
#
# Expects a number of arguments, each being a path to a yaml config file.
#
# Outputs a diff for a file path if there are changes required, otherwise
# outputs nothing.
View a_2.4ghz.txt
# 2.4Ghz ping to unifi AP
64 bytes from 192.168.1.96: icmp_seq=22 ttl=63 time=7.887 ms
64 bytes from 192.168.1.96: icmp_seq=23 ttl=63 time=3.055 ms
64 bytes from 192.168.1.96: icmp_seq=24 ttl=63 time=1.699 ms
64 bytes from 192.168.1.96: icmp_seq=25 ttl=63 time=11.296 ms
64 bytes from 192.168.1.96: icmp_seq=26 ttl=63 time=1.889 ms
64 bytes from 192.168.1.96: icmp_seq=27 ttl=63 time=1.430 ms
64 bytes from 192.168.1.96: icmp_seq=28 ttl=63 time=8.541 ms
64 bytes from 192.168.1.96: icmp_seq=29 ttl=63 time=5.398 ms
64 bytes from 192.168.1.96: icmp_seq=30 ttl=63 time=87.632 ms
View gist:c04742317715aa23306f147c3b6e3020
caius@earl:~$ show load-balance watchdog
Group WLB
pppoe0
status: Running
pings: 17235
fails: 1
run fails: 0/3
route drops: 0
ping gateway: 8.8.8.8 - REACHABLE
View rescue_var.rb
a = -> { raise "ZOMGERR" }
begin
nom = a.()
rescue => e
nom # => nil
e # => #<RuntimeError: ZOMGERR>
end