Skip to content

Instantly share code, notes, and snippets.

View astraw's full-sized avatar

Andrew Straw astraw

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astraw
astraw / hook-dns-01-lets-encrypt-route53.py
Created February 18, 2018 14:24
Python 3 script to use as a hook for the letsencrypt.sh client
#!/usr/bin/env python3
# How to use:
#
# LE_HOSTED_ZONE=XXXXXX LE_AWS_PROFILE=dns-access ./letsencrypt.sh --cron --domain example.org --challenge dns-01 --hook /tmp/hook-dns-01-lets-encrypt-route53.py
#
# More info about letsencrypt.sh: https://github.com/lukas2511/letsencrypt.sh/wiki/Examples-for-DNS-01-hooks
# Using AWS Profiles: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles
# Obtaining your Hosted Zone ID from Route 53: http://docs.aws.amazon.com/cli/latest/reference/route53/list-hosted-zones-by-name.html
{
"metadata": {
"name": "Zar birds two-way ANOVA"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
# Build this docker image with:
#
# sudo docker build .
#
# Take note of the <image_id>, which will be the output above in the
# form "Successfully built <image_id>". Now, run the IPython web
# notebook with:
#
# sudo docker run -p 8889:8889 <image_id>
#
@astraw
astraw / Dockerfile
Created November 18, 2013 21:41
stdeb quickstart: This uses docker ( http://docker.io ) to create an IPython notebook pre-configured to build a Debian source package. See the comments at the top of the Dockerfile for further instructions.
# Build this docker image with:
#
# sudo docker build .
#
# Take note of the <image_id>, which will be the output above in the
# form "Successfully built <image_id>". Now, run the IPython web
# notebook with:
#
# sudo docker run -p 8889:8889 <image_id>
#
@astraw
astraw / beep.py
Created March 11, 2013 22:02
Simple pushover.net notifier
#!/usr/bin/env python
import httplib, urllib
import argparse
def main():
parser = argparse.ArgumentParser(
description='send pushover.net notification')
parser.add_argument('note', metavar='note', default=['(no note)'], nargs='*')
args = parser.parse_args()
#!/usr/bin/env python
import requests
import time, datetime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import models
import sys, os
@astraw
astraw / wget-no-cache.sh
Created October 19, 2012 13:40
get the current webpage (and not a version in a proxy's cache)
wget --cache=no --header='Cache-Control: max-age=0, no-cache' $*
@astraw
astraw / calib_test_numpy.py
Created November 5, 2011 12:51
computing the OpenGL projection matrix from intrinsic camera parameters
#!/usr/bin/env python
# stdlib imports
import os
#other imports
import numpy as np
import scipy.misc
import matplotlib.pyplot as plt
@astraw
astraw / download_data.py
Created October 23, 2011 07:25
query and download data from strawlab tethered data server
import json, os
import requests
SCRIPT_NAME = 'hausen4.py'
DIRNAME = '~/hausen4_datasets_tmp'
def get_auth():
user = os.environ.get('STRAWLAB_USER')
password = os.environ.get('STRAWLAB_PASSWORD')