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
__author__ = 'ahmed' | |
import boto3, argparse, yaml | |
from time import sleep | |
import os.path | |
def tag_instances(awsTags): | |
reservations = ec2Client.describe_instances() |
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 boto3 | |
import json | |
import logging | |
import time | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def notify_on_error(message): |
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 boto3 | |
import json | |
import urllib, urllib2 | |
import os | |
from datetime import datetime | |
from dateutil import tz | |
import time | |
ecs = boto3.client('ecs') | |
sns = boto3.client('sns') |
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
#Original Author https://raw.githubusercontent.com/kgoedecke/python-ecs-example/master/python_ecs_example/deployment.py | |
import boto3 | |
import pprint | |
import os | |
# Credentials & Region | |
access_key = os.environ["AWS_ACCESS_KEY_ID"] | |
secret_key = os.environ["AWS_SECRET_ACCESS_KEY"] | |
region = "us-east-1" |
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 | |
from __future__ import print_function | |
import json | |
import logging | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
from base64 import b64decode |
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 boto.ec2 | |
def get_running_instances(region): | |
ec2 = boto.ec2.connect_to_region(region) | |
instances = [i for r in ec2.get_all_reservations() for i in r.instances] | |
return filter(lambda i: i.state == 'running', instances) | |
def get_reserved_instances(region): | |
ec2 = boto.ec2.connect_to_region(region) | |
reserved_instances = ec2.get_all_reserved_instances() |
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 | |
from __future__ import print_function | |
import json | |
import logging | |
import re | |
from base64 import b64decode, b64encode | |
from urllib2 import Request, urlopen, URLError, HTTPError |
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 python3.6 | |
# coding: utf-8 | |
"""Interaction between Slack and Blink1. | |
Use the Slack Real Time Messaging API to analyze message and turn on the | |
Blink1 device. | |
Based on this great blog article : | |
https://www.fullstackpython.com/blog/build-first-slack-bot-python.html |
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 | |
import os | |
import time | |
import traceback | |
# pip install slackclient | |
from slackclient import SlackClient | |
OlderNewer