Skip to content

Instantly share code, notes, and snippets.

View dkmonaghan's full-sized avatar

Dan Monaghan dkmonaghan

View GitHub Profile
dkmonaghan /
Last active May 1, 2022 21:48
Ingest Zigbee2MQTT readings into InfluxDB
from typing import NamedTuple
import os
import json
from pprint import pprint
import paho.mqtt.client as mqtt
from influxdb import InfluxDBClient
INFLUXDB_ADDRESS = 'localhost'
dkmonaghan /
Last active January 15, 2021 17:59
Searches a given network range for the now revoked QuoVadis Global SSL ICA G3 intermediate certificate and reports a list of hosts still presenting the old Intermediate
import ipaddress
import subprocess
import socket
import sys
import multiprocessing
bad_quo = "8W8hdONuKKpe9zKedhBFAvuxhDgKmnySglYc"
# Replace with your IP ranges!
dkmonaghan /
Last active December 7, 2020 20:06
Analyses Tesco-Customer-Data.json and gives you useless statistics about your order history
import json
import math
with open('Tesco-Customer-Data.json') as json_file:
data = json.load(json_file)
orders = []
for purchase_block in data['Purchase']:
for purchase in purchase_block:
dkmonaghan / sentry_mattermost_webhook.php
Created October 28, 2020 17:49
This script can act as a middleman between Sentry's webhook system and Mattermost's Incoming Webhooks
View sentry_mattermost_webhook.php
$json = json_decode(file_get_contents('php://input'), true);
if ($json['action'] !== 'created'){ die('Only create actions are alerted'); }
$error = $json['data']['issue'];
if ($error['project']['id'] == 1){ die('Ignore internal errors.'); }
if (empty($error['shortId'])){ die('No shortId passed'); }
// Set channel and username
if [ -f "/sys/class/net/ens192/address" ]; then
# Temporarily bring up the network
sed -i 's/eth0/ens192/g' /etc/network/interfaces
service networking restart
# Apt-get update
apt-get update

Keybase proof

I hereby claim:

  • I am dkmonaghan on github.
  • I am dkmonaghan ( on keybase.
  • I have a public key whose fingerprint is B07C 5AA3 CACC 3C67 905C 6E7B B057 5E32 A56B 23C4

To claim this, I am signing this object:

dkmonaghan /
Last active June 29, 2023 12:08 — forked from SamStudio8/
Fork of @SamStudio8's Python cascade calculator now with 100% more super hacked in Industrial Year support and MEng support
# NOTE - This was accurate as of 2019. Industrial Years are now assessed differently in Computer Science.
# As such, this script will no longer produce accurate results. You may be able to tweak this script to work.
y4 = [62,62,62,62,62,62,62,62,62,62,62,62]
y3 = [70,71,53,81,74,74,90,90,90,90,70,70]
y2 = [73,90,81,67,67,64,64,60,81,72,80,80]
band_s = [83] # IY Band
# 9 modules per band