Skip to content

Instantly share code, notes, and snippets.


Brian Onn brianonn

  • Vancouver, Canada
View GitHub Profile
brianonn /
Created Mar 8, 2021
Setup iptables for a new client only host. Allows SSH in, DNS queries, NTP and outbound to HTTP and HTTPS only.
# flush and delete all existing rules and chains
iptables -t filter -F
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -t filter -X
iptables -t nat -X
iptables -t mangle -X
brianonn /
Created Sep 13, 2020
run a command on multiple OS'es via Vagrant on Virtualbox
CMD="${1:-ls -l /}"
BOXES="${2:-centos/8 generic/ubuntu1804}"
: > "$LOG"
View counters.go
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Config Github Settings
github_username = "fideloper"
github_repo = "Vaprobash"
github_branch = "1.4.0"
github_url = "{github_username}/#{github_repo}/#{github_branch}"
# Because this:
brianonn /
Created Jun 20, 2020 — forked from braian87b/
Linux Interface Bonding on Wireless Link (OpenWrt / LEDE)
brianonn / testWithCapture.go
Created May 21, 2020
Run Golang tests, capturing the Uber zap() output to a memory buffer
View testWithCapture.go
// testWithCapturedZapOutput runs a test and captures zap.L() outputs
func testWithCapturedZapOutput(testToRun func(t *testing.T), t *testing.T) string {
var buffer bytes.Buffer
origLogger := zap.L()
defer func() {
#!/usr/bin/env bash
# this script is a helpful wrapper for Helm CLI, when using TLS enabled Tiller
# See
# Copyright (C) 2019 Anastas Dancha (aka @anapsix)
# 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
# any later version.
brianonn / smpte test
Last active Jun 30, 2019
make a SMPTE color test pattern
View smpte test
pulsesink for Pulseaudio output
alsasink for ALSA output
osssink and oss4sink for OSS/OSSv4 output
jackaudiosink for JACK output
View Untitled-1
gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
brianonn /
Last active Jul 4, 2019
Create an OSX Mojave ISO from the downloaded (full install) Install
#!/usr/bin/env bash
hdiutil info | \
awk target="${BuildTmpDir}/MojaveBase.cdr.dmg" '
/image-path/ {
brianonn / ci_detect.awk
Created Jun 10, 2019
awk script to detect the CI/CD environment
View ci_detect.awk
#!/usr/bin/awk -f
function usage() {
print "Usage: ci_detect [ detect | get envvar | dump ]"
exit -1
function dumpargs() {
printf "ARGC = %d\n", ARGC
for (i = 0; i < ARGC ; ++i) {