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
@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
#!/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
Verifying my Blockstack ID is secured with the address 1AGVNTwikFA8hFvwHGbutPaKt4cFNEfhiK https://explorer.blockstack.org/address/1AGVNTwikFA8hFvwHGbutPaKt4cFNEfhiK

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 issuance of colored coins asset with ID #Ua4r2C2hoQzufyVHv5fsAcbnnSJAaNPxK7NYoE
Verifying that +jsnfwlr is my blockchain ID. https://onename.com/jsnfwlr
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}