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
python3 -c 'for n in range(256): print(f"{n:02x}")' | xargs -n1 -P5 ./your-app |
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
#!/usr/bin/env python3 | |
from codecs import decode, encode | |
from hashlib import md5 | |
from json import dumps, loads | |
from Crypto.Cipher import AES | |
N = 16 |
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 json import dumps | |
from traceback import print_exc | |
class TcpLog: | |
def __init__(self, addr): | |
host, port = addr.split(":") | |
self._address = host, int(port) | |
self._socket = None | |
self._message = b'' |
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
#!/usr/bin/env python3 | |
import csv | |
import sys | |
for i in csv.reader(sys.stdin): | |
print(*i, sep="\t") |
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
#!/usr/bin/env python3 | |
import collections | |
from asyncio import Future | |
from typing import Dict, List, Tuple | |
from fastapi import FastAPI, HTTPException, Request | |
todos: Dict[str, List[Tuple[Future, Request]]] = collections.defaultdict(list) | |
app = FastAPI() |
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
#!/usr/bin/env python3 | |
import requests | |
def update_dnspod(sub_domain, ip): | |
token = '49794,a259c8cdfc221e32078e867fdfea0415' | |
session = requests.Session() | |
session.headers["User-Agent"] = "Py/3.x ([email protected])" | |
data = { |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
func init() { |
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
dd if=/dev/zero bs=1M count=1000 | curl -T - localhost:1111 | |
curl -T /dev/urandom localhost:1111 |
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
#!/usr/bin/env python3 | |
import multiprocessing.connection | |
import os | |
import time | |
import signal | |
def wait(*_): | |
while True: |
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
#!/usr/bin/env python3 | |
import asyncio | |
import collections | |
import tornado.web | |
class Base(tornado.web.RequestHandler): | |
_futures = collections.defaultdict(set) |