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 slacker | |
if __name__ == '__main__': | |
token = '<your token>' | |
slack = slacker.Slacker(token) | |
username = 'Do Stuff Bot' | |
channel = '#notifications' | |
text = "This is a message." | |
attachments = [{ | |
"fallback": "Somebody did something somewhere.", |
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 | |
def print_status(ses_client, identity): | |
response = ses_client.list_identities() | |
identities = response['Identities'] | |
response = ses_client.list_verified_email_addresses() | |
verified_email_addresses = response['VerifiedEmailAddresses'] | |
if identity in identities: |
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 __future__ import print_function | |
import boto3 | |
import botocore | |
import json | |
import logging | |
import urllib2 | |
from base64 import b64decode | |
from datetime import datetime |
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 getopt | |
import math | |
import sys | |
db_iops_limits = { | |
"aurora": { | |
"MinimumStorage": 100, | |
"MaximumStorage": 6000, | |
"TheoreticalMaximumIOPS": 30000 |
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 __future__ import print_function | |
import boto3 | |
import botocore | |
import json | |
import logging | |
import urllib2 | |
from base64 import b64decode | |
from datetime import datetime |
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
"""Listens to an SNS Queue and pops messages.""" | |
from multiprocessing import Process | |
import boto3 | |
sqs = boto3.client("sqs") | |
queue_url = "" | |
visibility_timeout = 30 | |
wait_percent = 0.8 |
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
"""A stupid experiment to see which is faster.""" | |
import inspect | |
import os | |
import tempfile | |
import timeit | |
def get_contents_exists(path): | |
"""Test if the path exists and return its contents. |
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
"""An AWS SNS example.""" | |
import logging | |
import time | |
import boto3 | |
logging.basicConfig( | |
level=logging.INFO, | |
format='[%(asctime)s] %(levelname)s:%(name)s:%(message)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
"""Kinesis data streams example how-to.""" | |
import datetime | |
import logging | |
import time | |
import botocore | |
import boto3 | |
logging.basicConfig(level=logging.INFO) |
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
"""A subnet IP address range calculator.""" | |
import argparse | |
import copy | |
import math | |
class Subnet: | |
"""A subnet.""" | |
@staticmethod |