Skip to content

Instantly share code, notes, and snippets.

@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@LucaFilipozzi
LucaFilipozzi / get_unix_socket_peer_info.py
Last active March 30, 2017 07:59
python implementation of getpeereid() and getpeerpid() for darwin
#!/usr/bin/python
# vim: set ts=4 sw=4 et ai si:
import socket
import struct
def getpeereid(sock):
LOCAL_PEERCRED = 0x001
fmt = struct.Struct('2Ih16I') # see /usr/include/sys/ucred.h struct xucred
res = tuple(fmt.unpack(sock.getsockopt(0, LOCAL_PEERCRED, fmt.size)))
@shatil
shatil / punnel.py
Created July 27, 2016 17:37
Python OpenSSL libraries' private key signing vs. OpenSSL's rsautl
#!/usr/bin/env python
from __future__ import print_function
import base64
import sys
PEM = ("""-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn