Skip to content

Instantly share code, notes, and snippets.

@berg
berg / keybase.md
Last active August 29, 2015 14:00
keybase.md

Keybase proof

I hereby claim:

  • I am berg on github.
  • I am bdb (https://keybase.io/bdb) on keybase.
  • I have a public key whose fingerprint is CFA5 E015 C2B9 BB2B 4AEA 3FB5 34D2 5DC4 2B41 0C19

To claim this, I am signing this object:

@berg
berg / gist:9142463
Last active March 14, 2016 19:32
Comcast and Netflix now have a direct adjacency

Comcast and Netflix now have a direct adjacency

Looked at the host serving my Netflix streams today and noticed something new.

No clue if money is changing hands or not, and the return path is what actually matters, but it appears that Comcast and Netflix have reached some sort of agreement regarding direct interconnection.

$ traceroute -a 198.45.63.164
traceroute to 198.45.63.164 (198.45.63.164), 64 hops max, 52 byte packets
    (hops 1-2 redacted)
@berg
berg / stream-dump.py
Last active December 13, 2015 21:48
Dump an App.net stream to the console. Useful for debugging.
import sys
import time
import json
import requests
endpoint = sys.argv[1]
while True:
r = requests.get(endpoint, stream=True, timeout=600)
import os
import time
import requests
# export ADN_PROD_TOKEN="<your access token>"
token = os.environ['ADN_PROD_TOKEN']
s = requests.Session()
s.headers['Authorization'] = 'BEARER ' + token
@berg
berg / photo.md
Created July 25, 2012 01:00
Sketch of App.net image schema
@berg
berg / poll-snmp.py
Created May 14, 2012 05:28
Script to poll SNMP counters
#!/usr/bin/env python
#
# Script to poll Ethernet interface counters from a SNMP host
# requires pysnmp and the handy snmpclient library from
# https://github.com/seveas/python-snmpclient
#
# licensed under creative commons CC0 (public domain)
#
@berg
berg / gist:2651626
Created May 10, 2012 07:13
iptables rules
# iptables rules created
# flush forward rule
iptables -t mangle -F FORWARD
# match/count synthetic traffic
iptables -t mangle -A FORWARD -d 192.168.1.3
# match/count xbox traffic
@berg
berg / log.sh
Created May 10, 2012 07:08
Script to poll iptables counters
#!/bin/sh
# iptables counter poller
# released under CC0 (public domain)
while true; do
((date +%s; \
iptables -t mangle -x -L FORWARD -vvv -n \
| tail +3 \
| awk '{print $2}') \
@berg
berg / gist:2651577
Created May 10, 2012 07:05
Arris TM702G counter polling script
#!/usr/bin/env python
#
# Script to poll DOCSIS downstream channel counters
# on Arris TM702G cable modems and similar
#
# licensed under creative commons CC0 (public domain)
#
import functools
#!/usr/bin/python
import urllib2
import json
import pprint
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
register_openers()