Skip to content

Instantly share code, notes, and snippets.

Avatar

medina medina

  • New York City
View GitHub Profile
View ssl probes with openssl
```
$ 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 Jul 6, 2017
Simple HTTPS server in Python
View server.py
# 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 Jun 20, 2017
Playing with Encrypted Images
View encrypt-image.sh
#!/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 Sep 22, 2016
Boolean Logic w/ Python
View boolean.py
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),
])
View index.md

This is a sample, I hope.

@medina
medina / whiteboard
Created Sep 12, 2014
whiteboard snapshot cleaner-upper
View whiteboard
#!/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 Aug 29, 2015
virtualenv hooks
View postactivate
#!/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
View keybase.md

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: