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 argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
'--repo', metavar='repo', type=str, | |
help='Optionally filter by repository') | |
args = parser.parse_args() |
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 | |
import subprocess | |
import zipfile | |
import os | |
dirs = next(os.walk('.'))[1] | |
for d in dirs: | |
print("Preparing {} ZIP archive".format(d)) |
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 | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
if [[ "$BRANCH" == "master" ]]; then | |
./deploy.sh | |
fi |
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
" Display a red column 80 chars in .py files (to assist with line length) | |
" set colorcolumn=80 | |
autocmd FileType python setlocal colorcolumn=80 | |
" Return to last edit position when opening files | |
autocmd BufReadPost * | |
\ if line("'\"") > 0 && line("'\"") <= line("$") | | |
\ exe "normal! g`\"" | | |
\ endif |
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
Description: API Gateway to JSON payloads and send to SQS | |
Outputs: | |
ApiEndpoint: | |
Description: Endpoint for this stage of the api | |
Value: !Join | |
- '' | |
- - https:// | |
- !Ref 'SQSProxy' | |
- .execute-api.ap-southeast-2.amazonaws.com/ | |
- prod |
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
def convert(minutes): | |
if isinstance(minutes, int): | |
return str(minutes/24/60) + " day, " + \ | |
str(minutes/60 % 24) + " hours, " + \ | |
str(minutes % 60) + " minutes" | |
else: | |
return "0 days, 0 hours, 0 minutes" | |
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
def merge(r): | |
if '{{LESSOR}}' in r.text: | |
r.text = r.text.replace('{{LESSOR}}', 'my name') | |
if '{{LESSORADDRESS}}' in r.text: | |
r.text = r.text.replace('{{LESSORADDRESS}}', 'my address') | |
from docx import Document |
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
switch() { | |
export AWS_DEFAULT_PROFILE=$1 | |
PS1="\h:\W \u\$ ($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
# This file is: ~/.ssh/config | |
# You may have other (non-CodeCommit) SSH credentials stored in this | |
# config file – in addition to the CodeCommit settings shown below. | |
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file! | |
# Credentials for Account1 | |
Host awscc-account1 # 'awscc-account1' is a name you pick | |
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region |
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 | |
oldconfigname="$1" | |
newconfigname="$2" | |
ami="$3" | |
KEYNAME="my_keypair_name" | |
ASGROUP="my_autoscaling_group_name" | |
SECURITYGROUP="sg-1234" | |
INSTANCETYPE="t2.micro" |