Skip to content

Instantly share code, notes, and snippets.

# Glues 4 files into one
ffmpeg -i 1xtra.wav.mp4 -i radio1.wav.mp4 -i radio2.wav.mp4 -i radio4.wav.mp4 -filter_complex "
nullsrc=size=640x480 [base];
[0:v] setpts=PTS-STARTPTS, scale=320x240 [upperleft];
[1:v] setpts=PTS-STARTPTS, scale=320x240 [upperright];
[2:v] setpts=PTS-STARTPTS, scale=320x240 [lowerleft];
[3:v] setpts=PTS-STARTPTS, scale=320x240 [lowerright];
[base][upperleft] overlay=shortest=1 [tmp1];
[tmp1][upperright] overlay=shortest=1:x=320 [tmp2];
@benjojo
benjojo / bpf-gen.c
Created May 26, 2019 16:40
very useful for quick IPtables, don't want to lose it again
/*
* 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 (willemb@google.com)
* Copyright Google, Inc. 2013
* Licensed under the GNU General Public License version 2 (GPLv2)
*/
@benjojo
benjojo / gist:4f4776d354a4f871018fe83ddf659612
Last active May 3, 2018 12:03
Zero BS Yubi Key as SSH Agent
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
route-views6.routeviews.org> show bgp ipv6 unicast regexp 206924
BGP table version is 0, local router ID is 128.223.51.112
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
benjojo / cyberglobe.go
Last active July 16, 2017 15:19
CYBER GLOBE
package main
import (
"image/color"
"log"
"fmt"
"github.com/mmcloughlin/globe"
)
@benjojo
benjojo / main.go
Last active April 26, 2017 20:07
DNS TTL blogpost
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"strconv"
@benjojo
benjojo / config.boot
Last active April 19, 2017 21:22
Ubiquiti edge routers don't actually work with v6 sessions, they setup v4 sessions over v6 and then confuse upstream
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"
#!/bin/bash
HOSTNAME="${COLLECTD_HOSTNAME:-ardar}"
INTERVAL="${COLLECTD_INTERVAL:-10}"
cd ~
stdbuf -oL ioping -i 1 -P 10 -W -q . | while read -r line
do
min=$(echo $line | awk '{print $5}')
@benjojo
benjojo / StatStream.go
Created November 12, 2015 23:38
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
package main
import (
"flag"
"github.com/tuxychandru/pubsub"
"golang.org/x/net/websocket"
"io/ioutil"
"net/http"
"strings"
)
@benjojo
benjojo / icmp4.c
Created October 11, 2015 15:22
How to trigger SNMP counter bug
/* Copyright (C) 2011-2015 P.D. Buchan (pdbuchan@yahoo.com)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the