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 sh | |
# Need to have the aws cli tool and jq | |
# aws cli: https://docs.aws.amazon.com/cli/latest/userguide/ | |
# jq: https://stedolan.github.io/jq/ | |
AWS_CLI='/usr/local/bin/aws' | |
JQ_LOC='/usr/local/bin/jq' | |
usage() { |
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 sh | |
# Quick little script that bumps the release version using `bump2version` | |
# and then creates a release using the github `hub` tool | |
# I added bump2version to the project's requirements.txt file | |
usage() { | |
echo "Usage: $0 [major|minor|patch]" 1>&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
# This workflow will install dependencies and create a build suitable | |
# to be used in an AWS Lambda Layer. The build will then be uploaded | |
# to S3 and then can be accessed from any lambda that uses the layer. | |
# | |
# This build is only for dev builds. Releases will be built from a | |
# seperate action. | |
# | |
# A new version of the layer will be created for every branch when a | |
# pull request is intitiated. This allows us to test the layer in a | |
# dev environment on AWS BEFORE the code is merged into 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
# This will enable sloppy focus (somewhat) on MacOSX | |
# | |
# Enter this command in any terminal and then relaunch: | |
defaults write com.apple.Terminal FocusFollowsMouse -string YES | |
# to disable: | |
defaults write com.apple.Terminal FocusFollowsMouse -string NO | |
# for more details: http://osxdaily.com/2011/04/18/terminal-focus-follow-mouse-mac/ |
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/sh | |
BUCKETNAME=$1 | |
echo Checking: $BUCKETNAME | |
echo Size of objects, number of objects | |
set result=`aws s3api list-objects --bucket $BUCKETNAME --output json --query "[sum(Contents[].Size), length(Contents[])]"` | |
echo Number of Objects: $3 | |
echo Size of Objects: $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
#!/bin/bash | |
# remove containers that have exited | |
docker rm -v $(docker ps -a -q -f status=exited) | |
# remove images that are not being used | |
docker rmi -f $(docker images -a "dangling=true" -q) | |
# remove volumes that are not being used | |
docker volume rm $(docker volume ls -qf dangling=true) |
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
# This is an interesting way to profile code | |
# Probably would not be too hard to add some foo activate/deactivate it | |
# and then maybe use it in integration test code. The decorator will | |
# produce a file called <function_being_profiled>.profile which can | |
# be processed with 'snakeviz' (pip install snakeviz) | |
import cProfile | |
import functools | |
def profile_this(func): |
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
repo_name/ | |
README.md - yeah, do us a favor and give us a quick overview of what this is and how to use it | |
PackageName/ | |
ModuleName/ | |
__init__.py | |
module_file_1.py | |
module_file_2.py | |
... | |
AnotherModule/ | |
__init__.py |
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 | |
INI_FILE=~/.aws/credentials | |
while IFS=' = ' read key value | |
do | |
if [[ $key == \[*] ]]; then | |
section=$key | |
elif [[ $value ]] && [[ $section == '[default]' ]]; then | |
if [[ $key == 'aws_access_key_id' ]]; then |
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 sh | |
aws ec2 describe-network-interfaces --filters "Name=vpc-id,Values=vpc-53acd32a" \ | |
| jq -r '.NetworkInterfaces[] | select(.Description | contains("Lambda")) | .RequesterId, .Attachment' | |
#.RequesterId, .Description, .Attachment.AttachTime' |
NewerOlder