Skip to content

Instantly share code, notes, and snippets.

View mdjnewman's full-sized avatar

Matt Newman mdjnewman

View GitHub Profile
@mdjnewman
mdjnewman / uptimes.sh
Last active July 12, 2023 22:10
Dump some info from uptime.is to CSV
#!/usr/bin/env bash
# 11 hours = 9 AM ET to 5 PM PT
curl 'https://get.uptime.is/api?sla=99&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' > out.json
curl 'https://get.uptime.is/api?sla=99.5&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
curl 'https://get.uptime.is/api?sla=99.9&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
curl 'https://get.uptime.is/api?sla=99.95&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
curl 'https://get.uptime.is/api?sla=99.99&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
curl 'https://get.uptime.is/api?sla=99.995&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
curl 'https://get.uptime.is/api?sla=99.999&dur=11&dur=11&dur=11&dur=11&dur=11&dur=0&dur=0' >> out.json
#!/usr/bin/env bash
# Usage (assumes you're logged in):
# vault-list secret/
set -o nounset
set -o pipefail
set -o errexit
set -o pipefail
From mnewman@192-168-1-3.tpgi.com.au Sun Mar 26 16:35:06 2017
X-Original-To: mnewman
Delivered-To: mnewman@192-168-1-3.tpgi.com.au
From: mnewman@192-168-1-3.tpgi.com.au (Cron Daemon)
To: mnewman@192-168-1-3.tpgi.com.au
Subject: Cron <mnewman@192-168-1-3> /Users/mnewman/bin/gnucash-price-quotes.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=mnewman>
X-Cron-Env: <USER=mnewman>
#!/usr/bin/env bash
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts]
where:
region - the AWS region
stack-name - the stack name
aws-cli-opts - extra options passed directly to create-stack/update-stack
"
@mdjnewman
mdjnewman / ghci-docker.sh
Last active February 5, 2019 16:32
Start ghci in a docker container with workspace mounted
#!/bin/bash
set -e
# Ensure that docker is available and correctly configured if using boot2docker
docker ps > /dev/null
WORKSPACE_HOST_PATH=$(pwd)
WORKSPACE_CONTAINER_PATH=/workspace
@mdjnewman
mdjnewman / bahmni-using-docker-bootstrap.sh
Last active February 5, 2019 16:32
Script to initialise working environment for Bahmni Using Docker
# See also https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Using+Docker
export BAHMNI_PROFILE=all
export BAHMNI_HOME=~/bahmni-code
mkdir $BAHMNI_HOME
cd $BAHMNI_HOME
git clone https://github.com/Bhamni/default-config
@mdjnewman
mdjnewman / _fix-jekyll-exporter-encoding.sh
Created February 15, 2015 07:57
Simple script to fix encodings from files created with the 'WordPress to Jekyll Exporter' tool
#!/bin/bash
FILES=$(find . -name \*.md)
for i in $FILES; do gsed -i "s/&#8211;/–/g" $i; done
for i in $FILES; do gsed -i "s/\xC2\xA0/ /g" $i; done
for i in $FILES; do gsed -i 's/&gt;/>/g' $i; done
for i in $FILES; do gsed -i "s/&#8230;/…/g" $i; done
for i in $FILES; do gsed -i "s/&#8220;/“/g" $i; done

Keybase proof

I hereby claim:

  • I am mdjnewman on github.
  • I am mdjnewman (https://keybase.io/mdjnewman) on keybase.
  • I have a public key whose fingerprint is 49CA B99E F812 795A 8BB8 0D6F EAE6 4120 AD25 FA05

To claim this, I am signing this object: