Skip to content

Instantly share code, notes, and snippets.

View npodonnell's full-sized avatar
🎯
Focusing

npodonnell npodonnell

🎯
Focusing
View GitHub Profile

OpenSSL Encryption Cheatsheet

N. P. O'Donnell, 2020

Encrypting a file with AES 256 CBC

openssl enc -aes-256-cbc -in <plaintext input file> -out <ciphertext output file>
@npodonnell
npodonnell / ssh_cheatsheet.md
Last active December 14, 2022 23:34
SSH Cheatsheet

SSH Cheatsheet

N. P. O'Donnell, 2020

Specify a Key

To have SSH use a specific key:

ssh -i <path/to/key> <remote host>
@npodonnell
npodonnell / jenkins_cheatsheet.md
Last active January 2, 2021 21:38
Jenkins Cheatsheet

Jenkins Cheatsheet

N. P. O'Donnell, 2020-21

Run in Docker

Get the Jenkins docker image:

docker pull jenkins/jenkins
@npodonnell
npodonnell / number_theory.hs
Last active December 29, 2020 01:50
Number Theory in Haskell
-- Number Theory stuff
-- N. P. O'Donnell, 2020
module NumberTheory (congruent, factors, prime, extendedEuclideanAlgorithm, greatestCommonDivisor, lowestCommonMultiple, coPrime) where
-- Euclidean division of two integers
euclideanDivision :: Integer -> Integer -> Integer
euclideanDivision a b = toInteger (floor ((fromIntegral a) / (fromIntegral b)))
@npodonnell
npodonnell / crypto_number_theory.py
Last active July 25, 2023 12:42
Crypto Number Theory
#!/usr/bin/env python3
#
# Crypto & Number Theory
# N. P. O'Donnell, 2020
def odd(a):
"""
Is a odd?
"""
@npodonnell
npodonnell / git_cheatsheet.md
Last active June 22, 2022 09:01
Git Cheatsheet

Git Cheatsheet

N. P. O'Donnell, 2020

Remotes

List all commits on all remotes:

for c in $(git rev-list --remotes); do git show $c | head -n8; done | less
@npodonnell
npodonnell / elliptic_curves.py
Last active January 6, 2025 12:05
Elliptic Curves
#!/usr/bin/env python3
# Elliptic Curve functions
# For educational purposes only.
#
# N. P. O'Donnell, 2020-2021
from math import inf
import random
@npodonnell
npodonnell / worker.py
Last active December 29, 2020 22:25
Python Worker
#!/usr/bin/env python3
# Simple worker which can run a function in a different thread, and
# catch exceptions so they can be handled in the calling thread.
#
# N. P. O'Donnell, 2020
from threading import Thread
from typing import Callable
import random
import time
@npodonnell
npodonnell / groovy_crash_course.md
Last active January 3, 2021 22:34
Groovy Crash Course

Groovy Crash Course

N. P. O'Donnell, 2021

Groovy and Java

Groovy runs in the JVM. All valid Java is valid Groovy.

Hello World

@npodonnell
npodonnell / gpg_cheatsheet.md
Last active January 3, 2021 01:13
GPG Cheatsheet

GPG Cheatsheet

N. P. O'Donnell, 2021

Key Management

List Secret Keys:

gpg --list-secret-keys