Skip to content

Instantly share code, notes, and snippets.

View opieters's full-sized avatar

Olivier Pieters opieters

View GitHub Profile
from Crypto.Hash import SHA256
import struct, random, yaml, time
# hash to match
h = SHA256.new(b"123456")
ref = int(h.hexdigest(),16)
print(ref)
# config
treshhold = 20 # require AT LEAST 20 matching initial bits!
from Crypto.Hash import SHA256
import struct, random, yaml, time
# hash to match
h = SHA256.new(b"123456")
ref = int(h.hexdigest(),16)
# config
treshhold, timeout = 20, 120 # require AT LEAST 20 matching initial bits!

Keybase proof

I hereby claim:

  • I am opieters on github.
  • I am opieters (https://keybase.io/opieters) on keybase.
  • I have a public key ASDt-0Dtl9g8fgICqCGcSCkp38xzSjg7lOCjTSh0H3Dr6wo

To claim this, I am signing this object:

import os, subprocess, shutil
file_dir = "./_includes/latex-figures"
tmppath = subprocess.Popen("echo $TMPDIR", shell=True, stdout=subprocess.PIPE).stdout.read().replace('\n','')
# find all files
files = []
for f in os.listdir(file_dir):
if f.endswith(".tex"):
files += [f]
@opieters
opieters / gallery_creator.py
Last active July 10, 2022 17:50
Python script to generate configuration for a lightGallery photo gallery in Jekyll.