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
# https://www.tensorflow.org/versions/r0.10/tutorials/mnist/beginners/index.html#softmax-regressions | |
# download and read in the data automatically: | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
import tensorflow as tf | |
# model for handwritten digit [0-9] | |
# y = softmax(Wx + b) |
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
#!/usr/bin/env python | |
import sys | |
import boto3 | |
def main(argv): | |
autoscaling = boto3.client('autoscaling') | |
auto_scaling_groups = autoscaling.describe_auto_scaling_groups()['AutoScalingGroups'] | |
for asg in auto_scaling_groups: | |
break |
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": "2012-10-17", | |
"Id": "Policy1469359009696", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1469359007124", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:*", | |
"Resource": "arn:aws:s3:::<BUCKET_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
#!/bin/bash | |
aws ec2 create-image --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --name image-$(date +'%s') |
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 | |
# The TAG_KEY and TAG_VALUE environment variables | |
# can be set before running the script otherwise the | |
# default are used. | |
IDS`aws ec2 describe-instances \ | |
--filter "Name=tag:${TAG_KEY:-ScheduledUptime},Values=${TAG_VALUE:-True}" \ | |
--query 'Reservations[*].Instances[*].[InstanceId]' \ | |
--output text` |
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 | |
# The TAG_KEY and TAG_VALUE environment variables | |
# can be set before running the script otherwise the | |
# default are used. | |
IDS`aws ec2 describe-instances \ | |
--filter "Name=tag:${TAG_KEY:-ScheduledUptime},Values=${TAG_VALUE:-True}" \ | |
--query 'Reservations[*].Instances[*].[InstanceId]' \ | |
--output text` |
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 [ $# -eq 0 ]; then | |
echo "Usage: $@ upload|download" | |
if [ "$BUCKET_NAME" == "" ]; then | |
echo "variable \$BUCKET_NAME name must be set." | |
fi | |
else | |
DIR=`basename ${PWD}` | |
aws configure --profile cloud-backup |
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 | |
# Stop all containers | |
docker kill $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
DATE = $(shell date) | |
NAME = dcrbsltd/image | |
VERSION = 1 | |
all: build | |
build: | |
docker build -t $(NAME):$(VERSION) --rm . | |
tag_latest: |
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 | |
DNS_DOMAIN=${DNS_DOMAIN:-example.com} | |
HOST=${HOST:-www} | |
HOSTNAME=$HOST.$DNS_DOMAIN | |
PROTOCOL=${PROTOCOL:-https} | |
URL=$PROTOCOL://$HOSTNAME | |
echo " --> Testing for $URL" | |
# Number of requests | |
TIMEOUT=30 | |
# Time to wait between requests |