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 python | |
from StringIO import StringIO | |
import unittest | |
import sys | |
sys.setrecursionlimit(4000) | |
def resolve(ciphertext, allWords): |
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 debian:stretch | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -y apt-utils wget bzip2 | |
WORKDIR /src |
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 | |
from bson import MinKey | |
import pymongo | |
from pymongo import ASCENDING | |
client = pymongo.MongoClient() | |
db = client['test'] | |
collection = db['dataset'] |
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 | |
from argparse import ArgumentParser | |
from asyncio import run, get_running_loop, sleep, create_task | |
from logging import getLogger | |
from pathlib import Path | |
from dnslib import DNSRecord, DNSHeader, DNSQuestion, RR, A | |
logger = getLogger(Path(__file__).with_suffix('').name) |
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
[ ca ] | |
default_ca = CA_default | |
[ CA_default ] | |
dir = /XXX/root-ca | |
certs = $dir/certs | |
crl_dir = $dir/crl | |
new_certs_dir = $dir/newcerts | |
database = $dir/index.txt | |
serial = $dir/serial |
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 asyncio | |
import multiprocessing | |
import os | |
import ssl | |
from time import sleep | |
port = 9000 |
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
# BTW. I have created a library for this: https://github.com/messa/aiohttp-request-id-logging | |
from aiohttp import web | |
from aiohttp.web_log import AccessLogger | |
import asyncio | |
from asyncio import CancelledError | |
from contextvars import ContextVar | |
import logging | |
import os | |
import secrets |
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 | |
from argparse import ArgumentParser | |
from pathlib import Path | |
def replace_line(path, line_number, text): | |
if isinstance(text, str): | |
text = text.encode() | |
assert isinstance(text, bytes) |
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 asyncio | |
import logging | |
from pprint import pprint | |
from reprlib import repr as smart_repr | |
import requests | |
logger = logging.getLogger(__name__) |
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 | |
from aiohttp import ClientSession | |
import asyncio | |
import logging | |
from pprint import pprint | |
from reprlib import repr as smart_repr | |
logger = logging.getLogger(__name__) |
NewerOlder