Skip to content

Instantly share code, notes, and snippets.

View stenehall's full-sized avatar
🧗‍♂️

Johan Stenehall stenehall

🧗‍♂️
View GitHub Profile
@stenehall
stenehall / _stackdriver-log-to-goaccess.md
Last active March 30, 2020 12:03 — forked from DemonGiggle/_stackdriver-log-to-goaccess.md
stackdriver log converts to goaccess format
  1. Use gcloud logging read to pull logs
  2. Convert it to csv style via json2csv.rb
ruby json2csv.rb
  1. Use goaccess to generate html output
@stenehall
stenehall / new-wireguard-peer.sh
Last active April 2, 2024 13:50 — forked from robinlandstrom/new-wireguard-peer.sh
Script to automatically add configration for a new peer to a wireguard server. It will then print a QR code to the console that can be used to add the config to the Android or OS X wireguard client.
#!/bin/bash
readonly INTERFACE="wg0"
# Generate peer keys
readonly PRIVATE_KEY=$(wg genkey)
readonly PUBLIC_KEY=$(echo ${PRIVATE_KEY} | wg pubkey)
readonly PRESHARED_KEY=$(wg genpsk)
# Read server key from interface
@stenehall
stenehall / README.md
Last active September 7, 2018 18:07 — forked from tdack/README.md
Custom handlebars helpers for Ghost, as an app
var Game = function Game() {
this.marks = [];
};
Game.prototype.add_mark = function add_mark(pins) {
this.marks.push(pins);
};
Game.prototype.score = function score() {
@stenehall
stenehall / README.markdown
Created June 3, 2012 14:54 — forked from Yavari/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things (fixing the RegExp for diverdude so that search works with [)

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string