Skip to content

Instantly share code, notes, and snippets.

View aaronjanse's full-sized avatar

Aaron Janse aaronjanse

  • Berkeley, CA
View GitHub Profile
@aaronjanse
aaronjanse / shamir.go
Last active May 31, 2018 03:30
An easy way to do shamir secret sharing from the command line
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
sssa "github.com/SSSAAS/sssa-golang"
@aaronjanse
aaronjanse / README.md
Last active October 14, 2017 19:02
A simple command to check how many commits have not been pushed/pulled

Shows how many commits ahead and behind git remotes are.

How to run:

bash remote_status.sh [remote]

The remote defaults to origin

(optional) Installation:

@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active March 16, 2024 13:18
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

@aaronjanse
aaronjanse / fix.sh
Created August 21, 2017 14:37
Magical command to make gpg work with YubiKey smartcard
killall gpg-agent && gpg-agent --daemon --use-standard-socket --pinentry-program /usr/local/bin/pinentry

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@aaronjanse
aaronjanse / burschcleaner.user.js
Last active September 27, 2016 22:20
Bursch Blog Cleaner
// ==UserScript==
// @name Bursch Blog Cleaner
// @version 1.0
// @description This makes Mr.Bursch's blog legible!
// @author Aaron Janse
// @match http://mrbursch.blogspot.com/*
// @grant none
// ==/UserScript==
(function() {
@karlhorky
karlhorky / .gitconfig
Last active July 18, 2023 01:28 — forked from gnarf/..git-pr.md
Fetch and delete refs to GitHub pull request branches
[alias]
fetch-pr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; } ; f"
delete-prs = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
@aaronjanse
aaronjanse / anglediff.js
Created June 20, 2016 21:42
find the smallest distance between two angles
// from http://stackoverflow.com/a/7869457
// converted to js code
// x and y are the angles in radians
function getDifference(x, y) {
var a = x-y;
a = (function(i, j) {return i-Math.floor(i/j)*j})(a+Math.PI, Math.PI*2); // (a+180) % 360; this ensures the correct sign
a -= Math.PI;
return a;
}
@robert2d
robert2d / bash-cli-openssl-stdin-encryption
Last active March 2, 2022 12:18
Bash $STDIN Encryption with openssl and aes256
# Encrypt STDIN and provide a password(prompt)
echo "message" | openssl enc -aes-256-cbc -a
# Decrypt STDIN and provide a password(prompt)
echo "encrypted" | openssl enc -aes-256-cbc -a -d
@karpathy
karpathy / min-char-rnn.py
Last active May 4, 2024 17:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)