Skip to content

Instantly share code, notes, and snippets.

benjojo / bpf-gen.c
Created May 26, 2019
very useful for quick IPtables, don't want to lose it again
View bpf-gen.c
* BPF program compilation tool
* Generates decimal output, similar to `tcpdump -ddd ...`.
* Unlike tcpdump, will generate for any given link layer type.
* Written by Willem de Bruijn (
* Copyright Google, Inc. 2013
* Licensed under the GNU General Public License version 2 (GPLv2)
benjojo / gist:4f4776d354a4f871018fe83ddf659612
Last active May 3, 2018
Zero BS Yubi Key as SSH Agent
View gist:4f4776d354a4f871018fe83ddf659612
sudo apt-get install -y gnupg2 gnupg-agent pinentry-curses scdaemon pcscd yubikey-personalization libusb-1.0-0-dev
mkdir -p ~/.gnupg/
echo "enable-ssh-support" >> ~/.gnupg/gpg-agent.conf
# then in your bashrc
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
View routedumps.txt> show bgp ipv6 unicast regexp 206924
BGP table version is 0, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 2a07:1500:a4a::/48
2001:d98::19 0 18106 6939 206924 i
* 2001:1620:1::203
benjojo / cyberglobe.go
Last active Jul 16, 2017
View cyberglobe.go
package main
import (
benjojo / main.go
Last active Apr 26, 2017
DNS TTL blogpost
View main.go
package main
import (
benjojo / config.boot
Last active Apr 19, 2017
Ubiquiti edge routers don't actually work with v6 sessions, they setup v4 sessions over v6 and then confuse upstream
View config.boot
ben@edge# show protocols bgp
bgp 206924 {
address-family {
ipv6-unicast {
network 2a07:1500:4663::/48 {
neighbor 2001:470:11:a::1 {
description "HE BGP tunnel fucking pos"
cd ~
stdbuf -oL ioping -i 1 -P 10 -W -q . | while read -r line
min=$(echo $line | awk '{print $5}')
benjojo / StatStream.go
Created Nov 12, 2015
Publish collectd stats over a websocket, with a grep option too for scripts, Could be used for any kind of publishing of data over websockets
View StatStream.go
package main
import (
benjojo / icmp4.c
Created Oct 11, 2015
How to trigger SNMP counter bug
View icmp4.c
/* Copyright (C) 2011-2015 P.D. Buchan (
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
import pygtk
import gtk
class FirstWin:
def __init__(self): = gtk.Window(gtk.WINDOW_TOPLEVEL)
color = gtk.gdk.color_parse('#6495ED'), color)
# To change the color again, just modify it again