This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import random | |
from datetime import datetime | |
from enum import Enum | |
from dataclasses import dataclass | |
class CMD_STATE(Enum): | |
Undefined = 0 | |
Ask = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def van_eck(): | |
"""https://oeis.org/A181391 | |
""" | |
seen = {} | |
yield 0 | |
previous, current = 0, None | |
i = 1 | |
while True: | |
if previous in seen: | |
current = i - seen[previous] - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am julienpalard on github. | |
* I am julienpalard (https://keybase.io/julienpalard) on keybase. | |
* I have a public key ASC7dVPPYwLtCqT2bOTWWE-JgQ40WPTZCTkgFS4JEZqm1wo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
from glob import glob | |
import os | |
from textwrap import fill | |
import regex | |
import polib | |
from tabulate import tabulate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/tmp/python-build.20180623214511.15791 ~/.pyenv | |
/tmp/python-build.20180623214511.15791/Python-3.7.0rc1 /tmp/python-build.20180623214511.15791 ~/.pyenv | |
checking build system type... x86_64-pc-linux-gnu | |
checking host system type... x86_64-pc-linux-gnu | |
checking for python3.7... python3.7 | |
checking for --enable-universalsdk... no | |
checking for --with-universal-archs... no | |
checking MACHDEP... checking for --without-gcc... no | |
checking for --with-icc... no | |
checking for gcc... gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Usage: ./backup.py login@host | |
""" | |
import sys | |
import pexpect | |
import getpass | |
child = pexpect.spawn('ssh ' + sys.argv[1]) | |
while True: | |
match = child.expect(['password:', '\(.*\) >']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import itertools | |
from uritemplate import URITemplate | |
def dict_product(a_dict): | |
"""Iterate over the product of all values of the given dict. | |
>>> for d in dict_product({'foo': [1, 2], 'bar': [1, 2]}): |
NewerOlder