I hereby claim:
- I am allanlei on github.
- I am allanlei (https://keybase.io/allanlei) on keybase.
- I have a public key whose fingerprint is 851F D7DF 24A1 0109 D014 7301 8240 ED3E 5606 E5BA
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
MISSING_KEY_VALUE = None | |
def diff(d2, d1={}, missing=MISSING_KEY_VALUE): | |
for key, val in d2.items(): | |
if key not in d1: | |
yield key, (missing, val) |
docker run $(etcdctl ls $ETCD_ENV | while read e; do etcdctl get $e > /dev/null 2>&1 && echo --env $(echo $e | rev | cut -d/ -f1 | rev)=$(etcdctl get $e); done) busybox env |
server { | |
listen 80 default_server deferred; | |
listen 443 default_server deferred ssl; | |
listen [::]:80 ipv6only=on default_server deferred; | |
listen [::]:443 ipv6only=on default_server deferred ssl; | |
server_name example.com www.example.com testing.example.com; | |
root /path/to/static/files | |
# Include SSL stuff |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import urlparse | |
import click | |
@click.command() | |
@click.argument('iam_role') | |
@click.option('--metadata-url', default='http://169.254.169.254/latest/meta-data/iam/security-credentials/') |
FROM dockerfile/python | |
RUN pip install boto |
import StringIO | |
import subprocess | |
import os | |
import time | |
from datetime import datetime | |
from PIL import Image | |
# Motion detection settings: | |
# Threshold (how much a pixel has to change by to be marked as "changed") | |
# Sensitivity (how many changed pixels before capturing an image) |
import cv2 | |
def diffImg(t0, t1, t2): | |
d1 = cv2.absdiff(t2, t1) | |
d2 = cv2.absdiff(t1, t0) | |
return cv2.bitwise_and(d1, d2) | |
cam = cv2.VideoCapture(0) | |
winName = "Movement Indicator" |
from twisted.internet import reactor | |
from twisted.protocols import portforward | |
def server_dataReceived(self, data): | |
print 'Server received data:', data | |
portforward.Proxy.dataReceived(self, data) | |
portforward.ProxyServer.dataReceived = server_dataReceived | |
def client_dataReceived(self, data): | |
print 'Client received data:', data |
def procfile(filepath): | |
with open(filepath, 'rb') as fp: | |
for process_line in fp.readlines(): | |
process_line = process_line.strip() | |
if not process_line or process_line.startswith('#'): | |
continue | |
process_name, command = process_line.split(':', 1) | |
yield process_name.strip(), command.strip() |
I hereby claim:
To claim this, I am signing this object: