#!/usr/bin/env python
import os
import django
import logging_tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream myapp { | |
server 127.0.0.1:8081; | |
} | |
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s; | |
server { | |
listen 443 ssl spdy; | |
server_name _; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging.config | |
import os | |
from django.utils.log import DEFAULT_LOGGING | |
# Disable Django's logging setup | |
LOGGING_CONFIG = None | |
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
logging.config.dictConfig({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "TRANSFER_HOST_KEY" {} | |
locals { | |
transfer = { | |
az_count = 2 | |
} | |
} | |
resource "aws_eip" "transfer" { | |
count = local.transfer.az_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.12-alpine as builder | |
ARG VERSION=2.3.930.0 | |
RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash && \ | |
curl -sLO https://github.com/aws/amazon-ssm-agent/archive/${VERSION}.tar.gz && \ | |
mkdir -p /go/src/github.com && \ | |
tar xzf ${VERSION}.tar.gz && \ | |
mv amazon-ssm-agent-${VERSION} /go/src/github.com/amazon-ssm-agent && \ | |
cd /go/src/github.com/amazon-ssm-agent && \ | |
echo ${VERSION} > VERSION && \ | |
gofmt -w agent && make checkstyle || ./Tools/bin/goimports -w agent && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <log_group_prefix> <log_stream_name>" | |
exit 1 | |
fi | |
LOG_GROUP_PREFIX=$1 | |
LOG_STREAM_NAME=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
import http.client | |
# make call to cat facts API | |
# https://cat-fact.herokuapp.com/facts | |
conn = http.client.HTTPSConnection("cat-fact.herokuapp.com") | |
conn.request("GET", "/facts") | |
response = conn.getresponse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twitter.com##[aria-label$="Trending now" i] | |
twitter.com##article [aria-label^="Recommended Topic" i]:upward(article) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# USAGE: CLUSTER=mycluster SERVICE=myservice ./docker-exec-ecs.sh | |
set -euf -o pipefail | |
TASK_ARN=$(aws ecs list-tasks --cluster=$CLUSTER --service=$SERVICE \ | |
| jq -r .taskArns[0]) | |
if [ "$TASK_ARN" = "null" ]; then | |
echo "Could not find any running tasks for $SERVICE on cluster:$CLUSTER." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(version 1) | |
(allow default) | |
(debug deny) | |
(define (home-subpath home-relative-subpath) | |
;; should be able to use something like (param "HOME_DIR") here, but it's not working for me | |
(subpath (string-append "/Users/pete" home-relative-subpath))) | |
;; can't write anywhere or read /Users by default | |
(deny file-write*) |
NewerOlder