Skip to content

Instantly share code, notes, and snippets.

nerding out on bash and k8s

Code Monk sean9999

nerding out on bash and k8s
View GitHub Profile
sinclairtarget / bernoulli.c
Created Aug 17, 2018
Lovelace's Note G Program in C
View bernoulli.c
#include <stdio.h>
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th
* Bernoulli number.
int main(int argc, char* argv[])
// ------------------------------------------------------------------------
// Data
ebidel / feature_detect_es_modules.js
Last active Jun 17, 2020
Feature detect ES modules: both static import and dynamic import()
View feature_detect_es_modules.js
Complete feature detection for ES modules. Covers:
1. Static import: import * from './foo.js';
2. Dynamic import(): import('./foo.js').then(module => {...});
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
WebReflection / json-channel.js
Last active Oct 14, 2018
A GJS WebKit JSON Communication Channel Example
View json-channel.js
const JSONChannel = (Private => class JSONChannel {
// (c) Andrea Giammarchi - @WebReflection (ISC)
crypto.getRandomValues(new Uint8Array(8))
).map(i => i.toString(36)).join('')) {
const listener = e => this.emit('message', null, e.detail);
document.addEventListener(`${secret}:gjs`, listener);
Private.set(this, {
secret, listener,
fn: Object.create(null)
gvlx /
Last active Oct 5, 2018 — forked from tvlooy/
Bash test: get the directory of a script
# Following stackoverflow discussion, from (rev7)
function test(){
local __MESSAGE__="$1"
local __RECEIVED__="$2"
local __EXPECTED__="$3"
if [ "${__RECEIVED__}" == "${__EXPECTED__}" ]; then
Genovo /
Created Sep 13, 2017
Bash "Strict Mode"
set -euo pipefail
jexp / neo_datatable.js
Last active Jan 30, 2017
Bookmarklet to zoom and pan Neo4j graph viz and query plans, Hold "Alt" to zoom & pan.
View neo_datatable.js
javascript: (function() {
var createTable = function() { $("neo-table >").addClass("datatable").DataTable(); };
if ($("#style-datatable").length == 0) {
$("body").append($('<link id="style-datatable" rel="stylesheet" type="text/css" href="">'));
} else {
ryzy / haproxy.cfg
Created Mar 13, 2016
HAProxy conf with SSL termination and HTTP/2 support
View haproxy.cfg
chroot /var/lib/haproxy
user haproxy
group haproxy
pidfile /var/run/
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
kmassada /
Last active Jul 27, 2020
Vagrant and KVM(QEMU) on Centos7


yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
wunki /
Created Oct 14, 2015
Run Ubuntu with iohyve

Setup new server

  • iohyve create ubuntuguest 8G
  • iohyve set ubuntuguest loader=grub-bhyve
  • iohyve set ubuntuguest os=debian
  • iohyve set ubuntuguest ram=512M
  • iohyve set ubuntuguest cpu=2
  • iohyve set ubuntuguest con=nmdm1
  • iohyve install ubuntuguest ubuntu-14.04.3-server-amd64.iso
  • Drop in the console: iohyve console ubuntuguest
f1sherman /
Last active Jun 23, 2020
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"
You can’t perform that action at this time.