Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import sys
if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) < 2:
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 /
Created Oct 27, 2018
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
#!/usr/bin/env python3
triviafile = 'trivia.csv'
apiurl = ''
sleep_between_requests = 0.1
questionsPerRequest = 50
import requests, os, hashlib, json, sys, csv, urllib, time
unquote = urllib.parse.unquote
lgommans / git-basics.txt
Created Feb 22, 2018
Git and Github basics
View git-basics.txt
==== 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:
lgommans /
Created Oct 24, 2017
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):
View gist:fdbd86fbbd3667479ee56b8bf29db241
I copy/pasted the following as required by Keybase.
### Keybase proof
I hereby claim:
* I am lgommans on github.
* I am luc ( on keybase.
* I have a public key whose fingerprint is 60CE 8AF6 E465 D1CB 5279 7CB1 B523 8646 7CE5 CCB7
You can’t perform that action at this time.