Skip to content

Instantly share code, notes, and snippets.

View nekopanic's full-sized avatar

Steven Farlie nekopanic

  • Victoria, Australia
View GitHub Profile
@nekopanic
nekopanic / .profile
Created August 26, 2016 05:18
DATABASE_URL with mysql2
export DATABASE_URL="`echo $DATABASE_URL | sed -e 's/^mysql:/mysql2:/'`"
@nekopanic
nekopanic / poor-man-encryption.md
Created December 11, 2015 03:38
Poor man's encryption

Say you have someones public key at pubkey.pub:

$ echo "potato" | openssl rsautl -encrypt -pubin -inkey <(ssh-keygen -f pubkey.pub -e -m PKCS8) -ssl | openssl base64

Now send the result to them, e.g. message.txt, and they have their private key at ~/.ssh/id_rsa

$ cat message.txt | openssl base64 -d | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa
derp! :)
@nekopanic
nekopanic / penguin.gif
Created October 26, 2012 16:26
rapping. political. science.

Political Rap

Yeah, oh.
Political rap.
Yo, yo.
Demon apathy.
Yo, zappity.
Get ready.
Government,

Where you went?

@nekopanic
nekopanic / puddlejumper.py
Created August 30, 2012 19:33
Is the python documentation in British English or American English
#!/usr/bin/env python
# Try to determine if a pile of text is American English or British English.
# Give it a list of files on standard input. e.g. find /usr/share/doc/python-doc | ./puddlejump.py
import fileinput
from os import path
from HTMLParser import HTMLParser
files = []