Skip to content

Instantly share code, notes, and snippets.

View KishCom's full-sized avatar

Andy Kish KishCom

View GitHub Profile
@prideout
prideout / servewasm.py
Created November 8, 2018 00:44
Python WASM server
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map.update({
'.wasm': 'application/wasm',
@apisandipas
apisandipas / postalCodeToTimezone
Created July 2, 2015 01:38
Guess timezone given a Canadian postal code.
/**
* Maps a Canada postal code to a (marginal) guess at your Timezone.
* @type {Object}
*/
var data = {
'America/Chicago': [
'S', 'R', 'X0C'
],
'America/New_York': [
'J', 'G', 'H', 'L', 'K', 'M', 'N', 'X0A'
@woodrow
woodrow / hpkp_hashes.sh
Created February 21, 2014 07:44
Public key pinning digest generation
# get the SHA-1 digest of the subjectPublicKeyInfo of a certificate as used by Chromium's preloaded public key pinning
# http://src.chromium.org/viewvc/chrome/trunk/src/net/http/transport_security_state_static.h?r1=191212&r2=191211&pathrev=191212
curl -s https://pki.google.com/GIAG2.crt | openssl x509 -inform der -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha1
# (stdin)= 43dad630ee53f8a980ca6efd85f46aa37990e0ea
# get the base64-encoded SHA-256 digest of the subjectPublicKeyInfo of a certificate as used by HTTP Public Key Pinning
# (http://tools.ietf.org/html/draft-ietf-websec-key-pinning-11)
curl -s https://pki.google.com/GIAG2.crt | openssl x509 -inform der -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64
# 7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=