Skip to content

Instantly share code, notes, and snippets.

View Gr3yR0n1n's full-sized avatar
🍵
tea time?

gr3yR0n1n Gr3yR0n1n

🍵
tea time?
View GitHub Profile
@Gr3yR0n1n
Gr3yR0n1n / rsa.py
Created July 2, 2022 05:15 — forked from alairock/rsa.py
Simplify RSA encode and decode messages with the python rsa library.
import base64
import os
import rsa
def load_priv_key(path):
path = os.path.join(os.path.dirname(__file__), path)
with open(path, mode='rb') as privatefile:
keydata = privatefile.read()
return rsa.PrivateKey.load_pkcs1(keydata)
@Gr3yR0n1n
Gr3yR0n1n / caesar-cipher.py
Last active July 2, 2022 05:16
caesar-cipher.py
L2I = dict(zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",range(26)))
I2L = dict(zip(range(26),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
plaintext = input('input: ')
print(f'Original: {plaintext}')
# encipher
for key in range(26):
ciphertext = ""
for c in plaintext.upper():
@Gr3yR0n1n
Gr3yR0n1n / global-gitignore.md
Created April 12, 2021 17:26 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@Gr3yR0n1n
Gr3yR0n1n / ale.bash
Created February 10, 2021 22:30 — forked from boogah/ale.bash
Never think about maintaining your homebrew install again with this shitty (but useful) shell script & cron job!
#!/bin/bash
echo ""
echo "`date`: RUNNING: brew update"
/usr/local/bin/brew update
echo "`date`: FINISHED: brew update"
echo ""

Keybase proof

I hereby claim:

  • I am gr3yr0n1n on github.
  • I am gr3yr0n1n (https://keybase.io/gr3yr0n1n) on keybase.
  • I have a public key ASC9YDVskAKb3xsd2sVfwuMIMsaSZEVBi1SrXoxo2yq5Cwo

To claim this, I am signing this object:

@Gr3yR0n1n
Gr3yR0n1n / Breach Compilation (1.4 billion credentials) in Postgres.md This gist is a simple guide of effective storing 1.4 billion email and password pairs in PostgreSQL for fast searching and reducing required storage space

What would you need:

Hardware requirements

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@Gr3yR0n1n
Gr3yR0n1n / README.md
Created May 2, 2018 19:14 — forked from gburd/README.md
Hardening C code at compile time

Hardening flags enabled by default

format Adds the -Wformat -Wformat-security -Werror=format-security compiler options. At present, this warns about calls to printf and scanf functions where the format string is not a string literal and there are no format arguments, as in printf(foo). This may be a security hole if the format string came from untrusted input and contains %n.

stackprotector Adds the -fstack-protector-strong --param ssp-buffer-size=4 compiler options. This adds safety checks against stack overwrites rendering many potential code injection attacks into aborting situations. In the best case this turns code injection vulnerabilities into denial of service or into non-issues (depending on the application).

fortify Adds the -O2 -D_FORTIFY_SOURCE=2 compiler options. During code generation the compiler knows a great deal of information about buffer sizes (where possible), and attempts to replace insecure unlimited length buffer function calls with length-limited ones. This is especially useful for

# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
#! /bin/bash
folder=$1
watchlist=$1/watchlist
sleep=$2
slack_post() {
message=$1
payload='payload={"channel": "#earl-earl-url", "username": "earlbot", "text": "'$message'", "icon_emoji": ":ghost:"}'