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
{ | |
"ap-northeast-1": "Asia Pacific (Tokyo)", | |
"ap-northeast-2": "Asia Pacific (Seoul)", | |
"ap-southeast-1": "Asia Pacific (Singapore)", | |
"ap-southeast-2": "Asia Pacific (Sydney)", | |
"ap-south-1": "Asia Pacific (Mumbai)", | |
"eu-central-1": "EU (Frankfurt)", | |
"eu-north-1": "Europe (Stockholm)", | |
"eu-west-1": "EU (Ireland)", | |
"eu-west-2": "Europe (London)", |
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
pushed = 0 | |
namespace = 'my cw space' | |
while pushed < len(metric_data): | |
left = pushed | |
if len(metric_data) - pushed >= 20: | |
right = left + 20 | |
else: | |
right = len(metric_data) | |
pushed += (right - left) | |
to_push = metric_data[left:right] |
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 bash | |
for f in *.yaml; do | |
printf "Check ${f}..." | |
aws cloudformation validate-template --template-body "file://${f}" > /dev/null 2>&1 | |
if [ "$?" != "0" ]; then | |
echo "\n${f} failed, run following for details" | |
echo " aws cloudformation validate-template --template-body file://${f}\n\n" | |
exit 1 | |
fi | |
printf " [OK]\n" |
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 | |
ffmpeg -i $1 -vcodec h264 -acodec aac -r 24 -crf 15 $2 |
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 -u | |
import boto3 | |
import os | |
import time | |
import sys | |
codedeploy = boto3.client('codedeploy',region_name=os.environ['AWS_REGION']) | |
application = os.environ['APPLICATION'] | |
codedeploy_bucket = os.environ['CODEDEPLOY_BUCKET'] | |
codedeploy_path = os.environ['CODEDEPLOY_PATH'] |
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 logging | |
from urllib.request import urlopen, Request, HTTPError, URLError | |
import json | |
logger = logging.getLogger() | |
class CustomResourceResponse: | |
def __init__(self, event): | |
self.event = event | |
self.response = { |
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 boto3 | |
def pull_s3_prefix(dst_dir, bucket, prefix): | |
client = boto3.client('s3') | |
resource = boto3.resource('s3') | |
download_dir(client, resource, prefix, prefix, dst_dir, bucket) | |
def download_dir(client, resource, prefix, start_prefix, local, bucket ): | |
paginator = client.get_paginator('list_objects') | |
for result in paginator.paginate(Bucket=bucket, Delimiter='/', Prefix=prefix): |
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 boto3; | |
client = boto3.client('ssm') | |
src_path = '/source/ssm/path' | |
dst_path = '/destination/ssm/path' | |
ssm_key_id = '<<keyidhere>>' | |
def printparams(params): | |
for p in params['Parameters']: | |
new_path = p['Name'].replace(src_path, dst_path) |
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
git config --global alias.plom '!git pull origin master' | |
git config --global alias.psom '!git push origin master' | |
git config --global alias.plod '!git pull origin develop' | |
git config --global alias.psod '!git push origin develop' | |
git config --global alias.plum '!git pull upstream master' | |
git config --global alias.plud '!git pull upstream develop' | |
git config --global alias.plrum '!git pull --rebase upstream master' | |
git config --global alias.plrom '!git pull --rebase origin 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
import json | |
import base64 | |
import sys | |
import os | |
def lambda_handler(event, context): | |
url = os.environ['slack_incoming_hook'] | |
headers = { |