Skip to content

Instantly share code, notes, and snippets.

View jsnfwlr's full-sized avatar
👨‍💻
Writing code for all the things.

Jason Fowler jsnfwlr

👨‍💻
Writing code for all the things.
View GitHub Profile
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
Verifying that +jsnfwlr is my blockchain ID. https://onename.com/jsnfwlr
Verifying issuance of colored coins asset with ID #Ua4r2C2hoQzufyVHv5fsAcbnnSJAaNPxK7NYoE

Keybase proof

I hereby claim:

  • I am jsnfwlr on github.
  • I am jsnfwlr (https://keybase.io/jsnfwlr) on keybase.
  • I have a public key whose fingerprint is 52F5 B15A 3F71 755A 573B 8D39 109C 8EB8 2C4B 7413

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1AGVNTwikFA8hFvwHGbutPaKt4cFNEfhiK https://explorer.blockstack.org/address/1AGVNTwikFA8hFvwHGbutPaKt4cFNEfhiK
#!/bin/bash
commit_regex='^\[(GM\w-[0-9]+|HotFix\-[0-9]{4}\/[0-9]{2}\/[0-9]{2})\]\s\w*\s-\s'
error_msg="Aborting commit. Your commit message is incomplete.\r\nPlease include the following:\r\n\t - a JIRA Issue number or a HotFix-date\r\n\t - a component label\r\n\t - a summary of what was changed"
if [[ $(cat "$1" | grep -icE "$commit_regex") -eq 0 ]]; then
echo $(cat "$1" | grep -icE "$commit_regex")
printf "$error_msg" >&2
exit 1
fi
@jsnfwlr
jsnfwlr / monit.rb
Created October 9, 2018 21:41 — forked from msaladna/monit.rb
Monit -> Pushover bridge
#!/usr/bin/ruby
require 'net/https'
re = Regexp.new('\bService\s*(?<svc>[^$]+)^$^\s*Date:\s*(?<date>.*?)$[\r\n]{1,2}
^\s*Action:\s*(?<action>.*?)$[\r\n]{1,2}
^\s*Host:\s*(?<host>(?<node>[^.]+).*?)$[\r\n]{1,2}
^\s*Description:\s*(?<desc>.*?)$', Regexp::MULTILINE|Regexp::EXTENDED)
# Take mail straight from STDIN
# show the size of folders in current (non-recursive)
ls -1 | sed 's/ /\\ /g' | xargs du -sh
# show the size all folders below the current (recursive)
ls -1 | sed 's/ /\\ /g' | xargs du -h
# Remove empty folders - must be run a few times to work up the tree
ls -1 | sed 's/ /\\ /g' | xargs du -h | grep '4.0K' | awk '{$1=""; print $0}' | sed 's/^ //g; s/ /\\ /g' | xargs rm -rf
@jsnfwlr
jsnfwlr / Vault-ssh-ca-README.md
Created February 20, 2020 01:52 — forked from kawsark/Vault-ssh-ca-README.md
A guide for configuring Vault's SSH-CA

SSH CA use-case with Vault

In this scenario we are going to set up Vault to sign SSH keys using an internal CA. We will configure the SSH secrets engine and create a CA within Vault. We will then configure an SSH server to trust the CA key we just created. Finally we will attempt to SSH using a private key, and a public key signed by Vault SSH CA.

Prerequisites

  • This guide assumes you have already provisioned a Vault server, SSH host using OpenSSH server, and a SSH client machine.
  • The client system must be able to reach the Vault server and the OpenSSH server.
  • We will refer to these systems respectively as:
  • VAULT_SERVER
body { background-color: #2c292d; }
#main { margin-top: 2.5vw !important; display: flex; width: 95vw !important; left: 0%; }
#main .column { max-width: calc(16.6% - 20px); margin: 10px; }
#main .column > ul > li + li { margin-top: 1em; }
#main .column > ul > li > .folder { display: inline-flex; background: #ffffff33; width: 100%;font-weight: bold; border-radius: 0.2em; }
#main .column > ul > li > .folder .icon { display: none; }
#main .column > ul > li > .folder.open { margin-bottom: 1em; }
#main .column:first-child { margin-right: auto !important; max-width: calc(14.285% - 20px) !important; }
#main .column:first-child > ul > li > div { padding: 0 !important; }
#main .column:first-child > ul > li > div > ul { display: flex; flex-wrap: wrap; }