This document is not a PEP but an aggregation of my notes, feedbacks, findings and experiments on this topic. However, it tries to be as close as possible from recent PEPs format for :
- me to ensure that I give as much as possible information that would be required for a PEP
- readers, to make it as easy as possible to read this document
This file contains hidden or 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 contextlib import asynccontextmanager | |
from fastapi import FastAPI, APIRouter | |
def fake_answer_to_everything_ml_model(x: float): | |
return x * 42 | |
ml_models = {} |
This is a local copy of the commands from:
- http://www.jmknoble.net/keys/#master-key
- http://www.macfreek.nl/mindmaster/Convert_GPG_keys_to_subkeys
- http://wiki.fsfe.org/Card_howtos/Card_with_subkeys_using_backups/
This guide serves as a reference of collected information necessary for strict management of PGP keys. This includes keeping a master key that always remains
# Boot off a live usb or similar as if you're installing
# If you're more comfortable with a different keyboard layout
$ loadkeys dvorak
# populate the second argument of the cryptsetup command based on this
$ parted <<<'print'
# the third argument may be anything, it needn't be used later
$ cryptsetup open /dev/sda3 foobar
# check your volume groups to see what to mount
$ ls /dev/vg
This file contains hidden or 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 json | |
from pytezos import pytezos, crypto | |
CURVES = b'ed', b'sp', b'p2' | |
for curve in CURVES: | |
key = crypto.Key.generate(curve=curve) | |
filename = f'{key.public_key_hash()}.json' | |
with open(filename) as inf: |
This file contains hidden or 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
DOMAIN=data.localhost |
This file contains hidden or 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
''' | |
A LibreOffice Calc Python macro exporting each sheet to an individual CSV file. | |
The CSV will be named <sheet name>.csv and will be sibling the source file. | |
To use this macro, store this file in your LibreOffice Python Scripts dir, | |
ie. `~/.config/libreoffice/4/user/Scripts/python/` on Linux | |
''' | |
import os |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals, print_function | |
import logging | |
import sys | |
from udata.app import create_app, standalone | |
from udata.commands import init_logging | |
from udata.search import es, commands as cmd |
This file contains hidden or 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
db.user.aggregate([ | |
{ $sort: { created_at: 1 } }, | |
{ | |
"$group": { | |
_id: "$email", | |
dups: { $addToSet: "$_id" } , | |
count: { $sum : 1 } | |
} | |
}, | |
{ |
NewerOlder