Skip to content

Instantly share code, notes, and snippets.

View caius's full-sized avatar
👻

Caius Durling caius

👻
View GitHub Profile

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)
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
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
#!/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
#!/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.
# 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
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
a = -> { raise "ZOMGERR" }
begin
nom = a.()
rescue => e
nom # => nil
e # => #<RuntimeError: ZOMGERR>
end
@caius
caius / gist:73f794a8f40d41cfa0a64f2ca25d33e5
Created October 27, 2017 14:08
Twitter hashtags used by @caius as of 2017-10-27
#10HoursBlissfulSleep
#10yearsago
#21stC
#24frames
#25InNov
#38degrees
#3confessions
#4sq
#4th
#4yearsago
<%-
# Here be hax - we find all values that are integers masked as strings and
# turn them into actual integers. Thanks puppet.
numerify = lambda do |obj|
case obj
when lambda { |o| o.respond_to?(:to_i) && o.to_i.to_s == o.to_s }
begin
Integer(obj)
rescue ArgumentError
obj