Skip to content

Instantly share code, notes, and snippets.

View JulienPalard's full-sized avatar
🐍
🐍

Julien Palard JulienPalard

🐍
🐍
View GitHub Profile
@JulienPalard
JulienPalard / pi.py
Created December 12, 2019 14:50
Examine Python's PI
from math import pi
from fractions import Fraction
import struct
def double(bits: str) -> Fraction:
def exponent(input_value: str):
return int(input_value, 2) - 1023
def fraction(b):
@JulienPalard
JulienPalard / covid19fr.py
Last active September 7, 2020 16:33
Wikipedia: To update Covid graphs
#!/usr/bin/env python3
# Uses https://www.data.gouv.fr/fr/datasets/donnees-hospitalieres-relatives-a-lepidemie-de-covid-19/
# - donnees-hospitalieres-covid19
# - donnees-hospitalieres-nouveaux-covid19
import csv
from statistics import mean
from itertools import groupby
from dateutil.parser import parse
"""Copy a flat hierarchy (all .crt .csr, key files in the same directory) to an easy-rsa v3 hierarchy.
You'll manually need to copy openssl-easyrsa.cnf / safessl-easyrsa.cnf though.
Disclamer: I am no security expert, use at your own risk, and only if you understand better than me what's youre doing and why you're doing it.
Usage:
python3 easyrsa2to3.py SRC_DIR DEST_DIR
Example: