Skip to content

Instantly share code, notes, and snippets.

Brian Onn brianonn

Block or report user

Report or block brianonn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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) {
brianonn / 00_timestables_test.txt
Last active Jun 10, 2019
test print out times tables in golang and erlang
View 00_timestables_test.txt
This is a test gist to try out times tables in golang and erlang
brianonn /
Created May 5, 2019
Calculates the Shannon entropy of a string
import math
def entropy(string):
"Calculates the Shannon entropy of a string"
# get probability of chars in string
prob = [ float(string.count(c)) / len(string) for c in dict.fromkeys(list(string)) ]
# calculate the entropy
entropy = - sum([ p * math.log(p) / math.log(2.0) for p in prob ])
brianonn / cf-nop-worker.js
Created Apr 25, 2019
NOP Cloudflare Worker
View cf-nop-worker.js
addEventListener('fetch', event => {
async function bulkRedirects(request) {
// this does nothing but return what you asked for
return fetch(request);
git init
git add
git commit -m "first commit"

## push to remote
# the remote repository must already exist 
git remote add origin
git push -u origin master
brianonn / Vagrantfile
Created Nov 4, 2018
vagrant with ansible
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config| = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", "1"]
vb.customize ["modifyvm", :id, "--memory", "768"] = "novoansible"
brianonn /
Last active Oct 30, 2018
make an ethereum address
#!/usr/bin/env python3
import os
import gnupg
from pywallet import wallet
# OS X hack fixed in a newer release of gnupg
You can’t perform that action at this time.