service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval
(in minutes)service.beta.kubernetes.io/aws-load-balancer-access-log-enabled
(true|false)service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
service.beta.kubernetes.io/aws-load-balancer-backend-protocol
(http|https|ssl|tcp)service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled
(true|false)service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout
(in seconds)
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
import sys | |
from itertools import product | |
from random import sample | |
def load(filename): | |
with open(filename) as fd: | |
return filter(lambda x:x, map(lambda x:x.strip(), fd.readlines())) |
This file contains hidden or 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 | |
# Provides 'git-prev' and 'git-next' commands for git | |
# to facilitate browsing step-by-step | |
# Run "source git_move.sh" to activate commands | |
_git_next() { | |
git log --reverse --pretty=%H master | \ |
This file contains hidden or 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 [ $EUID != 0 ]; then | |
echo "You must be root" | |
exit 1; | |
fi | |
# Installs Docker on Ubuntu 14.04 | |
apt-get update && apt-get -y install \ | |
apt-transport-https \ | |
ca-certificates \ |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from typing import List | |
def ptable(data : List[List], sep : str = "\t", sort_by : int = None): | |
""" | |
Pretty-prints a table | |
Args: | |
data (list): A list of lists where data[0] = the first row | |
sep (str): Default "\t" - the separator to use | |
sort_by (int): Default None - the column index to sort by |
This file contains hidden or 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 | |
# 0 * * * * /usr/local/bin/docker-cleanup.cron.sh > /var/log/docker-cleanup.log 2> /var/log/docker-cleanup.err.log | |
cleanup_images() { | |
echo "Cleaning up images" | |
docker rmi -f $(docker images -af dangling=true -q) | |
} | |
cleanup_containers() { | |
echo "Cleaning up containers" |
This file contains hidden or 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 | |
# fission.io router config for CoreOS | |
# v0.1.0 | |
# | |
# Usage: | |
# source fission_router_config.sh | |
# Or: | |
# eval $(./fission_router_config.sh) | |
ports=$(kubectl -n fission get svc | grep -e 'controller\|router' | cut -d: -f 2 | cut -d/ -f 1 | xargs echo) |
This file contains hidden or 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
""" | |
Allows one to handle *args and **kwargs together in an intuitive way: | |
api.create_thing('my-thing', 'property-1', 'property-2') | |
or | |
api.create_thing('my-thing', prop2='property-2') | |
or | |
api.create_thing(**config) |
This file contains hidden or 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
[app] | |
config_value = true | |
[db] | |
host = localhost | |
port = 1234 | |
user = root | |
pass = toor |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
./route_tables.py | dot -Tpng > routes.png | |
""" | |
import boto3 | |
def get_tag(obj, key, default=''): | |
for tag in obj['Tags']: | |
if tag['Key'] == key: | |
return tag['Value'] |