Skip to content

Instantly share code, notes, and snippets.

View dkmonaghan's full-sized avatar

Dan Monaghan dkmonaghan

View GitHub Profile
@dkmonaghan
dkmonaghan / Zigbee2Influx.py
Last active May 1, 2022 21:48
Ingest Zigbee2MQTT readings into InfluxDB
View Zigbee2Influx.py
#!/usr/bin/python3
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'
INFLUXDB_DATABASE = 'metrics'
@dkmonaghan
dkmonaghan / QuoSearch.py
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
View QuoSearch.py
#!/usr/bin/python3
import ipaddress
import subprocess
import socket
import sys
import multiprocessing
bad_quo = "8W8hdONuKKpe9zKedhBFAvuxhDgKmnySglYc"
# Replace with your IP ranges!
@dkmonaghan
dkmonaghan / tesco-analysis.py
Last active December 7, 2020 20:06
Analyses Tesco-Customer-Data.json and gives you useless statistics about your order history
View tesco-analysis.py
#!/usr/bin/python3
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
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
<?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
View vmmigrate.sh
#!/bin/bash
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
fi
# Apt-get update
apt-get update
View keybase.md

Keybase proof

I hereby claim:

  • I am dkmonaghan on github.
  • I am dkmonaghan (https://keybase.io/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
dkmonaghan / cascade.py
Last active June 29, 2023 12:08 — forked from SamStudio8/cascade.py
Fork of @SamStudio8's Python cascade calculator now with 100% more super hacked in Industrial Year support and MEng support
View cascade.py
# 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
BAND_SIZE = 9