Skip to content

Instantly share code, notes, and snippets.

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 23, 2025 14:10
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@blakev
blakev / background_tasks.py
Last active October 19, 2017 21:10
Background tasks manager for gevent Greenlets
#!/usr/bin/env python3
# ~*~ coding: utf-8 ~*~
#
# >>
# .. created: 5/20/16
# .. author: blake.vandemerwe
#
# LICENSE
# <<
@major
major / ca.py
Last active February 27, 2025 09:45
Making a certificate authority (CA) with python cryptography
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
import datetime
import uuid
one_day = datetime.timedelta(1, 0, 0)
private_key = rsa.generate_private_key(
public_exponent=65537,
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@jpanganiban
jpanganiban / reactor.py
Created December 6, 2012 01:45
A Very Simple Reactor Pattern Implementation in Python (with Gevent)
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all() # Patch everything
import gevent
import time
class Hub(object):
"""A simple reactor hub... In async!"""