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 | |
| set -e | |
| AWS_FUNCTIONS=$(aws lambda list-functions --query "Functions[].FunctionArn") | |
| for func in $AWS_FUNCTIONS | |
| do | |
| CMD="aws lambda delete-function --function-name $func" | |
| echo $CMD | |
| $CMD |
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 | |
| # This command installs binaries at specified versions | |
| # into $GOBIN, $GOPATH/bin or $HOME/bin. | |
| # It assumes Go 1.11. | |
| if [ $# = 0 ]; then | |
| usage: vgoget cmdpackage[@version]... >&2 | |
| exit 2 | |
| fi | |
| d=`mktemp -d` | |
| cd "$d" |
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 | |
| # This command installs binaries at specified versions | |
| # into $GOBIN, $GOPATH/bin or $HOME/bin. | |
| # It assumes Go 1.11. | |
| if [ $# = 0 ]; then | |
| usage: vgoget cmdpackage[@version]... >&2 | |
| exit 2 | |
| fi | |
| d=`mktemp -d` | |
| cd "$d" |
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 ruby | |
| # this script will delete ECR images that are older than N days | |
| require 'date' | |
| require 'json' | |
| # customize this script | |
| repo = 'snapdocs' | |
| delete_if_older_than = 60 # days |
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 | |
| aws ecr describe-repositories | jq '.repositories[].repositoryName' | xargs -I {} aws ecr put-lifecycle-policy --repository-name {} --lifecycle-policy-text "file://policy.json" |
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 | |
| for i in $(find $PWD -maxdepth 1 -type d); do | |
| cd $i | |
| if [ -d .git ]; then | |
| remotes=$(git remote -v) | |
| if [[ "$remotes" =~ origin.git@github.com:myorg ]]; then | |
| git remote set-url origin git@github.com:myneworg/$(basename `git rev-parse --show-toplevel`) | |
| fi | |
| fi | |
| cd .. |
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 q = Jenkins.instance.queue | |
| q.items.each { | |
| if (it =~ /deploy-to/) { | |
| q.cancel(it.task) | |
| } | |
| } |
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 | |
| # (optional) You might need to set your PATH variable at the top here | |
| # depending on how you run this script | |
| #PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
| # Hosted Zone ID e.g. BJBK35SKMM9OE | |
| ZONEID="enter zone id here" | |
| # The CNAME you want to update e.g. hello.example.com |
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 -x | |
| WEBAPPS=$(docker ps | grep "philchristensen/insite:latest" | awk '{print $1}') | |
| WORKERS=$(docker ps | grep "philchristensen/insite:worker" | awk '{print $1}') | |
| BEATER=$(docker ps | grep "philchristensen/insite:beat" | awk '{print $1}') | |
| find /opt/insite-web -name '*.pyc' -delete | |
| echo "$WEBAPPS" | xargs -I ID docker exec ID pip install -r requirements.txt | |
| date > /opt/insite-web/reload |
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
| ############################################################################### | |
| # Helpful Docker commands and code snippets | |
| ############################################################################### | |
| ### CONTAINERS ### | |
| docker stop $(docker ps -a -q) #stop ALL containers | |
| docker rm -f $(docker ps -a -q) # remove ALL containers | |
| docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
| # exec into container |