Skip to content

Instantly share code, notes, and snippets.

View williamokano's full-sized avatar
🎯
println("Kotlin is nice")

William Okano williamokano

🎯
println("Kotlin is nice")
View GitHub Profile
@williamokano
williamokano / git-find-me-the-fucking-deleted-file.sh
Created April 14, 2021 10:58 — forked from joakin/git-find-me-the-fucking-deleted-file.sh
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
g co shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@williamokano
williamokano / .zshrc
Created September 10, 2020 03:38 — forked from ThYpHo0n/.zshrc
WSL(2) bash profile helpers
# Windows XSrv config
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
@williamokano
williamokano / .zshrc
Created September 10, 2020 03:38 — forked from ThYpHo0n/.zshrc
WSL(2) bash profile helpers
# Windows XSrv config
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
@williamokano
williamokano / README.md
Created May 7, 2020 23:52 — forked from Brunomachadob/README.md
Educational purposed implementation of a Onion Router (specification of Tor)

This is a educational purposed implementation of the Onion Router specification for encrypted/annonymous conversation between two parties.

Do not use this in production (as it is simplifying a lot of stuff, despite I know you will ignore this)

If you use IntelliJ, you can just paste the implementation into a new scratch and run it.

Let me know in the comments if you have anything that could be improved (without adding too much complexity to it)

@williamokano
williamokano / README.md
Created May 7, 2020 23:50 — forked from Brunomachadob/README.md
Educational-purposed implementation of Diffie Hellman key exchange

This is a educational purposed implementation of the Diffie Hellman key exchange for encrypted conversation between two parties.

Do not use this in production (as it is simplifying a lot of stuff, despite I know you will ignore this)

If you use IntelliJ, you can just paste the implementation into a new scratch and run it.

@williamokano
williamokano / kinesis-get-records.sh
Created March 23, 2020 18:15 — forked from codemedic/kinesis-get-records.sh
Get records from a AWS Kinesis Data Stream. It allows you to start iterating from a time in the past.
#!/usr/bin/env bash
if ! aws_bin="$(which aws)" 2>/dev/null; then
echo "aws cli is missing; you can get it from https://aws.amazon.com/cli/"
exit 1
fi
if ! jq_bin="$(which jq)" 2>/dev/null; then
echo "jq is missing; you can get it from https://stedolan.github.io/jq/"
exit 1
@williamokano
williamokano / gpg-import-and-export-instructions.md
Created September 24, 2019 20:43 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...