Skip to content

Instantly share code, notes, and snippets.

View jcjones's full-sized avatar

J.C. Jones jcjones

View GitHub Profile
@jcjones
jcjones / Searing Smite
Last active August 16, 2021 01:15
Foundry VTT Macros - Forge Cleric
let targets = Array.from(game.user.targets)
if (targets.length == 1) {
target_data = `<div><img src="${targets[0].actor.img}" height="30" style="border:0px"/>${targets[0].actor.name}</div>`
} else {
target_data = "Flames leap"
}
ChatMessage.create({
user: game.user._id,
speaker: ChatMessage.getSpeaker({token: actor}),
@jcjones
jcjones / main.py
Created October 15, 2020 00:50
diff prod and stage onecrl work-in-progress buckets
from rich.console import Console
from collections import defaultdict, Counter
import requests
console = Console()
def diff_entry(ident, prod, stage):
differences = 0
for field in ["enabled", "issuerName", "serialNumber", "pubKeyHash", "subject"]:
-----BEGIN CERTIFICATE-----
MIIDajCCAlKgAwIBAgIEXzBKHzANBgkqhkiG9w0BAQsFADBAMQ4wDAYDVQQKDAVDaXNjbzEuMCwGA1UEAwwlQ2lzY28gVW1icmVsbGEgU2Vjb25kYXJ5IFN1YkNBIGxheC1TRzAeFw0yMDA4MDcxOTEwNTVaFw0yMDA4MTIxOTEwNTVaMH0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRYwFAYDVQQKDA1PcGVuRE5TLCBJbmMuMSkwJwYDVQQDDCB3d3cuZ29vZ2xlcGx1c2RhdGFsaXRpZ2F0aW9uLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMBv/KPqWNNuMe1vxD5g5Bu6NckhfdsWER17GjbzYs225J3HpnuTsufa/AVM8su6N9dQxVRW8f/GAlu5JhnUAfkn9OOx0/cPT1TpRDWHQy7N0Eex5o4GeMxv9f1LJ+uG3rQDgU8HNjCSOHE/6cF07oa4oEMuvGNyWH8HWOdNMFCuHSy8DDQxg1H6MLoa4ACDLK4C0bnaDO1MF+/3JuGw7hqblRlQmVp8wl0bj2wwsQ6+6a0pab6rrl9ywgmWVhLry7Lf7zgFQK5dFOWb60jx5qGVvj4Yg9xBtFqagoPYM0Z3mlzu+xNqdVTrjL5AhZFri/DN3SxDscIdJw9ZqKl/RE8CAwEAAaMvMC0wKwYDVR0RBCQwIoIgd3d3Lmdvb2dsZXBsdXNkYXRhbGl0aWdhdGlvbi5jb20wDQYJKoZIhvcNAQELBQADggEBAEGKoIDoJzCxBBzhFuit666gO2LGEVD/EIUukOPCXrbfqoyEUCT+BtpXr3+IleDNOhLS6+WIOPPG1rd9LLNhClVLN1KufDI2TV6qXoveaW9DaKLwlpZMbqYBYYUvQiUYIYn3bQrJL5hW9UwxH6weyQfclwB4ZIx98hQp+9a0
#!/usr/bin/env python3
import argparse
import sys
parser = argparse.ArgumentParser(description="Process some integers.")
parser.add_argument("data")
args = parser.parse_args()
print(f"Processing {args.data}")
@jcjones
jcjones / README.md
Created January 3, 2020 22:52
CRLite filter generation times, blogpost set

Stackdriver log query:

resource.type="k8s_container"
resource.labels.project_id="crlite-beta"
resource.labels.location="us-west1-a"
resource.labels.cluster_name="standard-cluster-1"
resource.labels.namespace_name="default"
resource.labels.container_name="crlite-generate"
"INFO:generate_mlbf:Running" OR "INFO:cert_to_crlite:crlite" OR "aggregate-crls is starting" OR "aggregate-known is starting" OR "INFO:root:Downloaded" OR "are marked as enrolled"
@jcjones
jcjones / generate-hex.py
Created November 1, 2019 17:54
Broken RSA PKCS8 structure - missing the prime1 field of PKCS1
pkcs1 = {
"version": 0,
"modulus": 25919547779068344813557225018916459243888511060580538521317535335916939669305711198124884121889905971452025616014278206275340890512969518554057142602273923483999163870181876938187799162284290847100195363021806949618646246749945850028053399500856599964212551512723624622979641733723716683062556541446382026036719662605892702171703485093064473383644496568073302712792779146792258459955311804887040246129590180745167177685560045626455120174460475726780417816070155430314837988907034054380822924150908056421408653448071530817548866905564640574264813470442105775538969501246892411050963085070599532463413097543580760453193,
"publicExponent": 65537,
"privateExponent": 6861045132845227059914105614052561682148677691669609262978418343950548077927208719731914639769078364782485319538820793177359564347147339790893438971332957330979713670444408519213298440076718153340772222678827333597575035302471285018946097235773079270933355869855645512602817107841967697907582447793030431476561
#!/bin/bash
# Date : (2019-07-07 14-39)
# Last revision : (2019-07-10 16-00)
# Wine version used : 4.11
# Distribution used to test : MacOS 10.14.5
# Author : Pug
# PlayOnLinux : 4.3.4
# Script licence : Public Domain
# Program licence : GPL2
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
7e:3e:18:16:bd:36:93:b9:2d:b6:a9:c4:a1:fa:28:c7
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
Validity
Not Before: Nov 18 00:00:00 2015 GMT
Not After : Feb 17 23:59:59 2019 GMT
#!/bin/bash
if [ ! -x $(which ocspchecker) ] ; then
go install github.com/jcjones/ocspchecker
fi
for id in $@; do
echo "Downloading crt.sh ID ${id}"
curl --silent https://crt.sh/?d=${id} > /tmp/${id}.pem || exit 1
ocspchecker -pem /tmp/${id}.pem
echo ""
@jcjones
jcjones / crtshToDNStruct.py
Last active October 19, 2017 03:15
Take a list of https://crt.sh/ IDs and produce binary forms of the Subject DNs
import sys, re, requests
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.x509.oid import NameOID
def hex_string_for_struct(bytes):
return [ "0x{:02X}".format(x) for x in bytes ]
def hex_string_human_readable(bytes):