Skip to content

Instantly share code, notes, and snippets.

View jawi's full-sized avatar

Jan Willem Janssen jawi

View GitHub Profile
@jawi
jawi / bhole.sh
Last active August 11, 2016 08:52
Creates a black hole of hosts, based on the work of pi-hole.
#!/usr/bin/env bash
#
# bhole.sh - creates a black hole of hosts, based on the work of pi-hole, <https://pi-hole.net>.
#
# Licensed under Apache License v2.
#
# (C) Copyright 2016 - JaWi - j.w.janssen@lxtreme.nl
#
# Usage: change WORK_DIR and DEST_FILE variables to your liking and run the script. If you want, you can create and
# change the WHITELIST_FILE as well to whitelist certain hosts.
@jawi
jawi / jwt.html
Created June 2, 2016 12:48
JWT decoder
<!DOCTYPE html>
<html lang="en">
<head>
<title>JSON web token decoder</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="content-language" content="en-us" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="description" content="JWT decoder" />
<meta name="author" content="J.W. Janssen" />
@jawi
jawi / wm5102cfg.sh
Last active August 29, 2015 14:18
Unified script for configuring WM5102 playback (as used in Wolfsson/CirrusLogic audio card for RPi)
#!/bin/sh
#
# wm5102cfg.sh - unified script for configuring WM5102 playback.
# based on scripts in <https://github.com/CirrusLogic/wiki-content/blob/master/scripts/*.sh>
#
# (C) 2015 - J.W. Janssen <j.w.janssen@lxtreme.nl>
# Licensed under Apache License v2.
AMIXER="/usr/bin/amixer"
AMIXER_ARGS="-Dhw:sndrpiwsp"
@jawi
jawi / docker-build.sh
Created January 14, 2015 16:20
Shell script to build, tag and push docker images to a (local) docker registry
#!/bin/bash
#
# Usage: ./docker-build.sh </dir/to/dockerfile> <remote-registry-prefix>
#
# Example: ./docker-build.sh node-agent-service 10.0.1.16:5000/inaetics
#
# needs docker command (v1.3 or later) in order to work.
#
# (C) 2015 - jawi - licensed under Apache Public License v2.
@jawi
jawi / purge_etcd_discovery.sh
Created December 17, 2014 12:47
Shell script using jshon to purge the state information of an existing Etcd discovery service.
#!/bin/sh
#
# Usage: ./purge_etcd_discovery.sh <TOKEN>
#
# needs both `curl` and `jshon` (http://kmkeen.com/jshon/) in order to work.
#
# (C) 2014 - jawi - licensed under Apache Public License v2.
# check whether our preconditions are met...
curl --version 1>/dev/null 2>&1 || { echo "No curl binary found?!"; exit 1; }