Skip to content

Instantly share code, notes, and snippets.

import dataclasses
import enum
import getpass
import secrets
import struct
class AuthenticationFailure(ValueError):
"""Wrong password."""
@0xpizza
0xpizza / es.py
Last active October 15, 2021 23:30
Run this program, and the Elastic Stack will pop out!
#!/usr/bin/python3 -B
#coding:ascii
# SG Version: 1.0.1.0
#########################################################
# #
# Update this and run with "-U" flag to upgrade #
\
ELASTIC_VERSION = '7.15.0' #
# #
@0xpizza
0xpizza / calculator.py
Last active January 22, 2021 20:16
bc on steroids
import ast
import math
import cmath
import itertools
import functools
import statistics
import tkinter as tk
import os
import getpass
import datetime
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
#!python3.8
# NOTE: This version is incomplete and will refuse to run properly. See previous version for stable, working code.
import csv
import mmap
import time
import shutil
import mmap
from pathlib import Path
from functools import partial
from hashlib import blake2b as _blake2b # BLAKE is faster than SHA!
#from hashlib import sha256
HASH_SIZE = 16
HASH_FUNCTION = partial(_blake2b, digest_size=HASH_SIZE)
import itertools
import tkinter as tk
class Tile(tk.Label):
default = ' '
def __init__(self, master=None, **kwargs):
super().__init__(master, **kwargs)
self.config(
#!/usr/bin/env python3.8
import sqlite3
import itertools
import threading
import webbrowser
from pathlib import Path
from functools import partial
@0xpizza
0xpizza / GIL_test.py
Last active November 16, 2020 06:25
Examine how python threads operate when the GIL is released.
import secrets
import hashlib
import tkinter as tk
from tkinter.ttk import Progressbar
import concurrent.futures
def scrypt(pw, salt=None):
assert isinstance(pw, bytes)
if salt is None:
#!python3.8
import math
import random
import secrets
import itertools
import threading
import functools
from types import SimpleNamespace