Skip to content

Instantly share code, notes, and snippets.

View medina's full-sized avatar

medina medina

  • New York City
View GitHub Profile
@medina
medina / ssl probes with openssl
Last active June 19, 2017 19:47
Some TLS probing
```
$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016
```
```
$ echo | openssl s_client -connect www.nyu.edu:443 -servername www.nyu.edu
CONNECTED(00000003)
---
Certificate chain
@medina
medina / server.py
Last active July 6, 2017 03:21
Simple HTTPS server in Python
# Slightly more complicated than
# $ python -m SimpleHTTPServer 8000
# Generate simple cert:
# $ openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# Run the server:
# $ python server.py
# In a browser:
@medina
medina / encrypt-image.sh
Last active June 20, 2017 21:14
Playing with Encrypted Images
#!/bin/bash -x
### Uses curl, openssl, ImageMagick (convert, identify)
### Grab an image
URL=https://avatars0.githubusercontent.com/u/54688
IMAGE=medina
curl -L $URL -o$IMAGE.png
### Extract the "raw" image
@medina
medina / boolean.py
Created September 22, 2016 18:16
Boolean Logic w/ Python
import operator
print "\t".join([ "A", "B", "A and B", "A or B", "A xor B"])
for a in [True, False]:
for b in [True, False]:
print "\t".join(
str(x) for x in [
a, b, operator.iand(a,b), operator.ior(a,b), operator.ixor(a,b),
])
@medina
medina / index.md
Created July 3, 2016 21:54
Sample MD

This is a sample, I hope.

@medina
medina / whiteboard
Created September 12, 2014 21:18
whiteboard snapshot cleaner-upper
#!/bin/bash
if [ -z "$1" -o -z "$2" ]
then
echo "Usage: $0 infile outfile"
exit 1
fi
convert "$1" \
-morphology Convolve DoG:15,100,0 \
@medina
medina / postactivate
Last active August 29, 2015 14:05
virtualenv hooks
#!/bin/bash
# This hook is sourced after every virtualenv is activated.
if [[ ! -z ${TMUX} ]];
then
venv=$(basename $VIRTUAL_ENV)
_TMUX_OLD_WINDOW=$(tmux display-message -p "#W")
tmux rename-window "$venv"
fi

Keybase proof

I hereby claim:

  • I am medina on github.
  • I am medina (https://keybase.io/medina) on keybase.
  • I have a public key whose fingerprint is 95E1 4D7D 47BA AB88 65DC BD91 25A4 06FB 1196 F495

To claim this, I am signing this object: