Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
triviafile = 'trivia.csv'
apiurl = 'https://opentdb.com/'
sleep_between_requests = 0.1
questionsPerRequest = 50
import requests, os, hashlib, json, sys, csv, urllib, time
unquote = urllib.parse.unquote
@lgommans
lgommans / rainbowtable.py
Created October 24, 2017 18:45
A toy rainbow table script
#!/usr/bin/env python3
import sys
from hashlib import md5
from base64 import b64encode
from binascii import hexlify, unhexlify
from time import time
def reduction_function(hash, max_password_length):
#!/usr/bin/env python3
import sys
if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) < 2:
print('''
Usage: {} run
(the run keyword just indicates you read/know this)
This script calculates what, as far as I've been able to come up with and find,
#!/usr/bin/env python3
import string, math, sys
ibase = '0123456789'
ival = sys.argv[1]
obase = '0123456789abcdef'
obase = string.digits + string.ascii_lowercase
obase = string.printable[:94].replace(',', '')
@lgommans
lgommans / btrfs-bitrot-backups-test.sh
Created October 27, 2018 23:29
Test backup solution for bit-rot detection
#!/usr/bin/env bash
### Run this script in an otherwise empty directory. It currently tests rsync and restic on btrfs. ###
### Tested on Debian Buster with restic 0.9.2, rsync 3.1.2, and btrfs-progs 4.17. ###
if [ "x$(sudo whoami)" != "xroot" ]; then
echo "No root, cannot use (u)mount."
exit 1
fi
@lgommans
lgommans / git-basics.txt
Created February 22, 2018 10:51
Git and Github basics
==== Creating repositories ====
Git has repositories. Github is a platform which keeps a copy of the
repository for you, and additionally makes it accessible through a website.
One can create a new repository by using the command "git init". You
then have a local repository, which is located in the .git/ folder, to
which you can do whatever you like. When you're ready to upload your
repository to Github for the first time, you need to:
I copy/pasted the following as required by Keybase.
### Keybase proof
I hereby claim:
* I am lgommans on github.
* I am luc (https://keybase.io/luc) on keybase.
* I have a public key whose fingerprint is 60CE 8AF6 E465 D1CB 5279 7CB1 B523 8646 7CE5 CCB7