Skip to content

Instantly share code, notes, and snippets.

View ivanov17's full-sized avatar
🏴
freedom for peoples, death to empires

anarchist Ivanov ivanov17

🏴
freedom for peoples, death to empires
View GitHub Profile
@ivanov17
ivanov17 / post-merge
Created April 17, 2021 23:54 — forked from pshchelo/post-merge
Git hook to auto-update pytnon venv after `git pull` if some certain files were changed
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# Forked by Pavlo Shchelokovskyy (pshchelo) - pshchelo.bitbucket.org
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
@ivanov17
ivanov17 / jwk2asn1.py
Last active June 12, 2023 07:51 — forked from jonlundy/conv.py
Convert the Letsencrypt/Certbot private_key.json file to Abstract Syntax Notation One (ASN.1)
#!/usr/bin/env python3
# Convert certbot private_key.json to Abstract Syntax Notation One (ASN.1)
# Usage: python3 jwk2asn1.py private_key.json > private_key.asn1
# openssl asn1parse -genconf private_key.asn1 -noout -out private_key.der
# openssl rsa -in private_key.der -inform der > private_key.pem
#
# Originally developed and published by Jon Lundy under the MIT License, 2015
# Updated to Python 3.6 by Anton Ivanov, Agorist International Conspiracy, 2020
#
from sys import argv
@ivanov17
ivanov17 / rsapem2jwk.py
Last active August 8, 2021 12:35 — forked from meeuw/rsapem2json.py
Will convert the RSA PEM private key to the Letsencrypt/Certbot private_key.json file. From: https://www.osso.nl/blog/convert-dehydrated-certbot-letsencrypt-config/
#!/usr/bin/env python3
# Usage: openssl rsa -in account_key.pem -text -noout | python3 rsapem2json.py
# Will convert the RSA PEM private key to the Letsencrypt/Certbot
# private_key.json file.
#
# From:
# -----BEGIN RSA PRIVATE KEY-----
# MIIJJwsdAyjCseEAtNsljpkjhk9143w//jVdsfWsdf9sffLgdsf+sefdfsgE54km
# ...
#