Skip to content

Instantly share code, notes, and snippets.

View LewisMcMahon's full-sized avatar

Lewis McMahon LewisMcMahon

View GitHub Profile
@LewisMcMahon
LewisMcMahon / gist:88c0cc9ca1d04fb9d531
Created July 10, 2015 13:10
AWS Cloudwatch metric for Ubuntu security updates available
aws cloudwatch put-metric-data --metric-name "Security Updates Available" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(/usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 2)
@LewisMcMahon
LewisMcMahon / gist:3d4612201159a4a42d43
Last active July 25, 2018 05:22
AWS Cloudwatch metric for postfix queue length
aws cloudwatch put-metric-data --metric-name "Mail Queue" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(echo $(($(mailq | grep -Po "(?<=in )([0-9]+)"| paste -sd+ | bc)+0)))
@LewisMcMahon
LewisMcMahon / gist:9ece67274e1f941ffc6f
Last active August 29, 2015 14:24
AWS Cloudwatch metric for sendmail queue length
aws cloudwatch put-metric-data --metric-name "sendmail queue" --dimensions InstanceId=$(ec2metadata --instance-id) --namespace "EC2" --value $(mailq | grep -Po "(?<=Total requests\: )([0-9]+)"| paste -sd+ | bc)
@LewisMcMahon
LewisMcMahon / gist:54c942095791635488ff
Last active August 29, 2015 14:06 — forked from DarokinB/gist:5826648
Roll20 Auto Initiative for Shadowrun E4
var Combat_Begins = Combat_Begins || {};
Combat_Begins.statName = new Array ("Dex"); //Stats to be added to roll, commas between values
Combat_Begins.rollValue = 20; //rolling 1d20, change if you roll 1dXX
Combat_Begins.sendChat = true; //True if you want the chat log to show their results
Combat_Begins.includeChars = true; //set false if you want to roll for players
//If you want players to roll, make this a global macro (add other stats as needed):
// @{selected|token_name} rolls a [[ 1d20 + @{selected|Dex} &{tracker} ]] for initiative!