Skip to content

Instantly share code, notes, and snippets.

@mtigas
mtigas / gpg.conf
Last active April 7, 2016 03:41
hide your PGP version & other info
#~/.gnupg/gpg.conf
# Hide your PGP version & other PGP version metadata with these two config lines.
# This line hides the "Version: GnuPG vX.XX.XX" line
no-emit-version
# This line hides the "Comment: XXXXX" lines
no-comments
# NOTE if you are using Thunderbird+Enigmail you probably need to set this again in
# the Enigmail->Preference settings:
@mtigas
mtigas / 1-tls
Last active March 5, 2016 18:06
Some PGP-signed verification for various ProPublica TLS & Tor hidden service identities.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
The following are the SSL certificate fingerprints for the
following propublica.org servers as of 2016-03-05.
CN or SAN: www.propublica.org
Note: this domain is now served via the Fastly CDN, relying on shared SSL
certificates. The www.propublica.org domain should be listed as a Subject
Alternative Name on the certificate served by the CDN endpoint.

Updating rbenv Ruby to use newer OpenSSL versions

rbenv/ruby-build don’t use Homebrew-installed versions of OpenSSL — instead, they on OS X's built-in ancient version.

This can throw OpenSSL::SSL::SSLErrors when talking to websites that enforce newer SSL/TLS protocols and ciphersuites.


1: Dependencies

$ alias openssl="`brew --prefix openssl`/bin/openssl"
$ openssl version
OpenSSL 1.0.1h 5 Jun 2014
$ openssl ciphers -v 'kEECDH+ECDSA+AESGCM kEECDH+AESGCM kEECDH+ECDSA+AES256 kEECDH+ECDSA+AES128 kEECDH+AES256 kEECDH+AES128 kEDH+AESGCM kEDH+AES256 kEDH+AES128 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !MD5 !EXP !DSS !PSK !SRP !kECDH !CAMELLIA !RC4 !SEED'
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD
@mtigas
mtigas / 0.txt
Last active December 21, 2015 21:39 — forked from veltman/gist:6369472
-Step 1: basic HTML skeleton for a full-screen map
-Step 2: initialize a map
-Step 3: add a tile layer
-Step 4: Add a marker
-Step 5: Add a line
-Step 6: Add a polygon
-Step 7: Styling: add a polygon with different styling
-Step 8: Click/hover
-On click, re-center map
-On hover, change styling of polygon
#!/usr/bin/env python
#coding=utf-8
"""
btsync_key.py
generates keys of abitrary size, for bittorrent sync[1].
btsync uses a 32-char key as the secret identifier for a shared folder,
but this key actually be a Base64 string of any length > 40.[2] so
this script allows you to generate stronger keys than otherwise
possible.
@mtigas
mtigas / cannonball_core_auth_crypto.py
Last active December 19, 2015 22:08
Simple subclass of Django PBKDF2PasswordHasher (which uses pbkdf2+sha256) that ups `iterations` to 3x the Django default and adjusts digest to use SHA384 (to fit within the 128 char limit in DB).
from django import VERSION
if (VERSION[0] == 1) and (VERSION[1] >= 4):
from django.contrib.auth.hashers import PBKDF2PasswordHasher
import hashlib
class PBKDF2SHA384PasswordHasher(PBKDF2PasswordHasher):
# don't use SHA512: growing the `iterations` too much will likely
# cause name:itr:hash to grow beyond the 128 character limit for
# the `password` field in DB
#
@mtigas
mtigas / gist:5959014
Last active December 19, 2015 12:59
List of some cybersecurity-related sessions from recent journalism conferences
@mtigas
mtigas / README.md
Created March 28, 2013 15:56
README.md

PROJECT_NAME