Skip to content

Instantly share code, notes, and snippets.

View bahorn's full-sized avatar
🏴‍☠️

B. Horn bahorn

🏴‍☠️
View GitHub Profile
@bahorn
bahorn / BGPNotes.md
Last active July 10, 2021 00:28
Playing with BGP

BGP with RPKI on KVM

Hacky setup to build a test BGP network with RPKI enabled on it.

Written from memory, does disable some security things, Not how you'd do this in production, etc.

Routers

Two Vyos Routers:

import colorsys
import random
import string
import sys
import multiprocessing
import time
import os
sys.path.append(os.path.realpath('openrgb'))
import openrgb
from openrgb.utils import DeviceType, ModeData, RGBColor, ZoneType
@bahorn
bahorn / fantasy.zsh-theme
Last active June 20, 2020 20:21
personal zsh theme. mixed cloud with evan.
# Cloud mixed with evan.
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX=$(hostname | cut -c1)
fi
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p%{$fg[green]%}%2~%{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}»%b '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@bahorn
bahorn / cmds.sh
Last active June 10, 2020 02:20
random commands
grep "^mem" UCD-SNMP-MIB.txt | cut -f 1 -d ' ' | xargs -n 1 -I {} printf "[[inputs.snmp.field]]\nname = \"{}\"\noid = \"UCD-SNMP-MIB:::{}\"\n\n" | clip
opkg update; opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
@bahorn
bahorn / timing.html
Last active May 27, 2020 20:55
turns out having devtools open makes this slower
<script>
const count = 500;
function timeFunction(fun, arg) {
var start = new Date().getTime();
fun(arg);
var end = new Date().getTime();
return (end - start);
}
version: '3'
services:
minio:
image: 'bahorn/minio:latest'
command: minio server /data
restart: always
ports:
- '9000:9000'
volumes:
@bahorn
bahorn / voice-script.py
Created February 25, 2020 18:50
https://github.com/CorentinJ/Real-Time-Voice-Cloning playing around with the demo_cli script to implement other ideas
from encoder.params_model import model_embedding_size as speaker_embedding_size
from utils.argutils import print_args
from synthesizer.inference import Synthesizer
from encoder import inference as encoder
from vocoder import inference as vocoder
from pathlib import Path
import numpy as np
import librosa
import argparse
import torch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bahorn
bahorn / hackdetails.tsv
Last active December 6, 2019 22:26
hackdetails.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 12 columns, instead of 10. in line 5.
name site location attendance start_date end_date vague_date U18 archived archived_url submissions submissions_site
HackNotts 2020 hacknotts.com University of Nottingham 200 2020-11-28 09:00:00 2020-11-29 17:00:00 TRUE http://web.archive.org/web/20190120025802/https://hacknotts.com/
DurHack 2020 durhack.com Durham University 425 2020-11-14 09:00:00 2020-11-15 17:00:00 TRUE http://web.archive.org/web/20191121083501/https://durhack.com/
Hatch 2020 hatchlondon.io/hatch-2020 University College London 100 2020-11-01 00:00:00 2020-11-30 00:00:00 TRUE TRUE https://web.archive.org/web/20191206214152/https://www.hatchlondon.io/hatch-2020
HackTheMidlands 5.0 hackthemidlands.com Millennium Point, Curzon St, Birmingham B4 7XG 2020-09-22 09:00:00 2020-12-21 17:00:00 TRUE TRUE http://web.archive.org/web/20161027181535/http://hackthemidlands.com:80/
DurHack:NextGen durhack.com/nextgen Durham University 100 2020-04-18 09:00:00 2020-04-19 17:00:00 TRUE TRUE https://web.archive.org/web/20191206184704/https://du
@bahorn
bahorn / 10x.py
Last active July 16, 2019 13:59
a One Instruction Programming language made up of only 10x and newlines. so you can claim to be a 10x developer...
import sys
# returns the next instruction to run
def oisc(ip, m):
m[m[ip+1]] = (m.get(m[ip+1], 0) - m.get(m[ip+0], 0)) & 0xFFFFFFFF
if m[m[ip+1]] > 0x7FFFFFFF or m[m[ip+1]] == 0:
return m[ip+2]
else: