Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Onn brianonn

  • Vancouver, Canada
View GitHub Profile
@brianonn
brianonn / multi-vagrant.sh
Created Sep 13, 2020
run a command on multiple OS'es via Vagrant on Virtualbox
View multi-vagrant.sh
#!/bin/bash
CMD="${1:-ls -l /}"
BOXES="${2:-centos/8 generic/ubuntu1804}"
PROVIDER="${3:-virtualbox}"
LOG="$PWD/commands.log"
: > "$LOG"
TMPDIR="/tmp/$RANDOM.$$"
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 = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
# Because this:https://developer.github.com/changes/2014-12-08-removing-authorizations-token/
@brianonn
brianonn / wireless-link-bonding.sh
Created Jun 20, 2020 — forked from braian87b/wireless-link-bonding.sh
Linux Interface Bonding on Wireless Link (OpenWrt / LEDE)
View wireless-link-bonding.sh
@brianonn
brianonn / testWithCapture.go
Created May 21, 2020
Run Golang tests, capturing the Uber zap() output to a memory buffer
View testWithCapture.go
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() {
zap.L().Sync()
zap.ReplaceGlobals(origLogger)
View helm_tls_wrapper.sh
#!/usr/bin/env bash
#
# this script is a helpful wrapper for Helm CLI, when using TLS enabled Tiller
# See https://github.com/helm/helm/blob/master/docs/tiller_ssl.md
#
# 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
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
brianonn / :home:brian:t.sh
Last active Jul 4, 2019
Create an OSX Mojave ISO from the downloaded (full install) Install Mojave.app
View :home:brian:t.sh
#!/usr/bin/env bash
BuildTmpDir="$HOME/tmp"
hdiutil info | \
awk target="${BuildTmpDir}/MojaveBase.cdr.dmg" '
/image-path/ {
path=$3$4$5$6$7$8$9
start=1
next
@brianonn
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) {
@brianonn
brianonn / 00_timestables_test.txt
Last active Jun 10, 2019
test print out times tables in golang and erlang
View 00_timestables_test.txt
00_timestables_test
This is a test gist to try out times tables in golang and erlang
You can’t perform that action at this time.