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
# Run a container with the AWS CLI on a specific node: | |
kubectl run -it debug --image amazon/aws-cli --command bash --overrides='{ "apiVersion": "apps/v1beta1", "spec": { "template": { "spec": { "nodeSelector": { "kubernetes.io/hostname": "<node-name>" } } } } }' | |
# Configure KIAM role: | |
kubectl run -it debug --image amazon/aws-cli --overrides='{"spec": {"template": {"metadata": {"annotations": {"iam.amazonaws.com/role": "my-cool-role"}}}}}' -- bash |
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
import uuid | |
import boto3 | |
from decimal import Decimal | |
from functools import partial | |
from django.db import models | |
from django.conf import settings | |
class UUIDModel(models.Model): | |
""" |
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/sh | |
docker events --filter 'event=start' --filter 'event=stop' | while read event | |
do | |
container_id=`echo $event | sed 's/.*Z\ \(.*\):\ .*/\1/'` | |
echo $container_id |
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
"""Simple but robust implementation of generator/coroutine-based | |
pipelines in Python. The pipelines may be run either sequentially | |
(single-threaded) or in parallel (one thread per pipeline stage). | |
This implementation supports pipeline bubbles (indications that the | |
processing for a certain item should abort). To use them, yield the | |
BUBBLE constant from any stage coroutine except the last. | |
In the parallel case, the implementation transparently handles thread | |
shutdown when the processing is complete and when a stage raises an |