Skip to content

Instantly share code, notes, and snippets.

View PageotD's full-sized avatar

Damien Pageot PageotD

View GitHub Profile
@PageotD
PageotD / bash-colors.md
Created August 3, 2024 08:40 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@PageotD
PageotD / vault.py
Last active August 14, 2024 05:57
simple file encryption/decrytion in python
import argparse
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.backends import default_backend
import os
# Constants
SALT_SIZE = 16
IV_SIZE = 16
@PageotD
PageotD / diff.py
Created August 17, 2024 13:33 — forked from adamnew123456/diff.py
An implementation of the Myers diff algorithm
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@PageotD
PageotD / key_detect.py
Created August 18, 2024 07:27 — forked from jasonrdsouza/key_detect.py
Python function to get keypresses from the terminal
def getchar():
#Returns a single character from standard input
import tty, termios, sys
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)