Skip to content

Instantly share code, notes, and snippets.

@thread13
thread13 / fsql.py
Last active October 14, 2023 11:38 — forked from jcarbaugh/fsql.py
#!/usr/bin/env python
# [ https://gist.github.com/jcarbaugh/100651/download# ]
# Convert a mysql dump into a sqlite-compatible format.
# I wrote this for just one script... no guarantees that it will work with others...
# python fsql.py < mysqldump.sql > readyforsqlite.sql
import re
import sys
@thread13
thread13 / sshpub-to-rsa
Created April 13, 2021 04:40 — forked from thwarted/sshpub-to-rsa
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
import sys
import base64
import struct
@thread13
thread13 / public_enc_example.sh
Created April 13, 2021 04:40 — forked from thinkerbot/public_enc_example.sh
Public-key encryption example using OpenSSL
#!/bin/bash
#
# Public-Key Encryption and Decryption
# * http://www.openssl.org/
# * http://barelyenough.org/blog/2008/04/fun-with-public-keys/
#
# Mac OS X 10.6.4
# OpenSSL 0.9.8l 5 Nov 2009
# Generate keys