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 | |
import os | |
import zipfile | |
import glob | |
import logging | |
import shutil | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
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
from pynamodb.models import Model | |
from pynamodb.attributes import UnicodeAttribute, ListAttribute, MapAttribute | |
import os | |
import json | |
class BaseModel(Model): | |
def to_dict(self): | |
rval = {} | |
for key in self.attribute_values: |
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 hudson.model.* | |
def queue = Hudson.instance.queue | |
println "Queue contains ${queue.items.length} items" | |
queue.clear() | |
println "Queue cleared" |
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 = { |
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 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
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 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
#!/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
#!/bin/bash | |
ffmpeg -i $1 -vcodec h264 -acodec aac -r 24 -crf 15 $2 |