Skip to content

Instantly share code, notes, and snippets.

View markwallsgrove's full-sized avatar

Mark Wallsgrove markwallsgrove

  • infosum
  • Midlands, UK
View GitHub Profile
@markwallsgrove
markwallsgrove / setup_ngrok.sh
Last active March 15, 2019 10:24
Publically Accessible SSH Port With Ngrok (Ubuntu)
#!/bin/bash
# Create a account at https://ngrok.com/ to use ngrok
if [ -z "$NGROK_AUTHTOKEN" ] && [ ! -f ~/.ngrok2/ngrok.yml ]; then
1>&2 echo "ngrok authentication token missing"
exit 1
fi
apt-get install -y unzip openssh-server
service ssh start
@markwallsgrove
markwallsgrove / gist:94169332da50592e3f4a8e2195b07d01
Created February 24, 2017 12:19
Summarise SSL signature hash type used by providers within SAML federation
#!/usr/bin/python2.7
import lxml.etree as etree
from cryptography import x509
from cryptography.hazmat.backends import default_backend
def chunkstring(string, length):
return (string[0+i:length+i] for i in range(0, len(string), length))
def main():
with open('fed.xml', 'r') as myfile:
### Keybase proof
I hereby claim:
* I am markwallsgrove on github.
* I am smoky (https://keybase.io/smoky) on keybase.
* I have a public key whose fingerprint is C34B 376D F5DB 5394 7E65 4C19 4971 0850 3D50 AC92
To claim this, I am signing this object:
@markwallsgrove
markwallsgrove / go-update.go
Created February 18, 2016 20:21
go-update tutorial, fast start
package main
// https://godoc.org/github.com/inconshreveable/go-update
// This gist documents go-install using a SHA-256 checksum,
// elliptic curve (prime 256) encrypted signature & bsdiff
// formatted patch.
// These steps took me over a hour to figure. go-install currently
// doesn't include a tutorial or quick start guide, so I created this
@markwallsgrove
markwallsgrove / jshintrc.js
Created September 24, 2015 13:41
JSHint Strict Configuration
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@markwallsgrove
markwallsgrove / timeouts-resque.rb
Created July 30, 2015 09:57
Sensu check for Resque jobs that are taking too long
#! /usr/bin/env ruby
#
# resque-timeouts
#
# DESCRIPTION:
# Monitor Resque queues for jobs that are taking too long
#
# OUTPUT:
# List of jobs that are taking too long
#