Skip to content

Instantly share code, notes, and snippets.

View jameskyle's full-sized avatar

James Kyle jameskyle

View GitHub Profile
%matplotlib inline
from datetime import date, timedelta
RACE_DISTANCE = 200
CLIMBING_DISTANCE = 4219
RACE_DATE = date(2014, 7, 26)
RATE = 0.10
PERCENT_OF_TARGET = .80
TODAY = date.today()
[Unit]
Description=Ubuntu Latest
After=etcd.service
After=docker.service
[Service]
ExecStart=/usr/bin/docker run --name ubuntu-latest ubuntu /bin/bash -c "while true; do sleep 60; done"
ExecStop=/usr/bin/docker stop ubuntu-latest
[Install]
@jameskyle
jameskyle / text
Last active August 29, 2015 14:00
cat<<-EOF > /etc/systemd/system/
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
ExecStartPre=/bin/mount --make-rprivate /
# Run docker but don't have docker automatically restart
# containers. This is a job for systemd and unit files.
ExecStart=/usr/bin/docker -d -s=btrfs -r=false --tlsverify --tlscacert=/var/ssl/ca.pem --tlscert=/var/ssl/server-cert.pem --tlskey=/var/ssl/server-key.pem -H fd://
# correct
def func1(num):
x, y = (1, 0)
h = 0.1
for n in xrange(num):
x_n = x
y_n = y
x = x_n + h
y = y_n + h * (x_n - y_n**2)
yield (x,y)
FROM ubuntu:latest
MAINTAINER James Kyle "[email protected]"
RUN apt-get update -qq && apt-get -y install nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
ADD default /etc/nginx/sites-available/default
EXPOSE 80
$ tree
.
├── distribution
│   ├── distribution.go
│   └── gammavariate.go
├── flowdist.json
├── flows
│   └── flow.go
├── rage
│   └── agent.go
server {
location /roadrage {
rewrite /roadrage/(.*) /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
# I've tried with and without the trailing /
proxy_pass http://cl1.dlstx.met:8888/;
proxy_redirect default;
}
[Match]
Name=vlan1500
[Network]
Description=Management Network
Address=10.1.20.15/16
[Unit]
Description=Packet Filtering Framework
DefaultDependencies=no
After=systemd-sysctl.service
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/iptables-restore /etc/iptables.rules
ExecReload=/usr/sbin/iptables-restore /etc/iptables.rules
@jameskyle
jameskyle / certs.sh
Last active June 7, 2017 18:46
Generating CA, Server, & Client Certificates
#!/bin/bash
###############################################################################
# NOTICE: This script is intended to be used in conjunction with a openssl.cnf
# template such as this one:
# https://gist.github.com/jameskyle/8106d4d5c6dfa5395cef
# (C) Copyright 2014 James A. Kyle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.