Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
probably writing tests

Gabriel Falcão gabrielfalcao

👨‍💻
probably writing tests
View GitHub Profile
@gabrielfalcao
gabrielfalcao / git-ssh-pk.sh
Created Jun 8, 2021
Configure private key for git repo
View git-ssh-pk.sh
git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"
View git-recommit-latest
#!/usr/bin/env bash
set -e
OLD_DATE="$(git show HEAD -q | grep Date | cut -d: -f2-)"
NEW_DATE="$(date)"
OLD_HASH=$(git show HEAD -q | head -1 | awk '{print $2}')
pretty() {
colorcode="${1}"
shift
string="${*}"
@gabrielfalcao
gabrielfalcao / osx-quarantine-delete.sh
Created Feb 4, 2021
remove Emacs.app from Mac OSX quarantine via command-line
View osx-quarantine-delete.sh
sudo xattr -d com.apple.quarantine /Applications/Emacs.app
View BLM.txt
Black Lives Matter!
Please check out ways you can help out the movement:
https://blacklivesmatters.carrd.co/
View README.md

Usage

go test ./...
@gabrielfalcao
gabrielfalcao / segfault.py
Created Dec 19, 2019 — forked from coolreader18/segfault.py
Make CPython segfault in 5 lines of code.
View segfault.py
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@gabrielfalcao
gabrielfalcao / rsa_encryption.py
Created Nov 30, 2019
Using python cryptography module to generate an RSA keypair, serialize, deserialize the keys and perform encryption and decryption
View rsa_encryption.py
import base64
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
def utf8(s: bytes):
return str(s, 'utf-8')
@gabrielfalcao
gabrielfalcao / cryptography_ecdsa.py
Created Nov 30, 2019
Ed25519 signing in python
View cryptography_ecdsa.py
from cryptography.hazmat.primitives.asymmetric.ed25519 import (
Ed25519PrivateKey,
Ed25519PublicKey,
)
from cryptography.hazmat.primitives import serialization
private_key = Ed25519PrivateKey.generate()
public_key = private_key.public_key()