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_BUCKET_NAME="<insert_bucket>" | |
AWS_BUCKET_REGION="<insert_region>" | |
AWS_KEY="<insert_key>" | |
AWS_SECRET="<insert_secret>" | |
MAX_COUNT_TO_KEEP=30 | |
PROFILE="<insert_profile>" | |
log() { echo -e "["$(date "+%Y%m%dT%H%M%S")"] $1"; } | |
echo_blu(){ log "${BLUE}$1${NC}"; } |
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
aws cloudfront list-distributions --profile my-profile --output json | jq '.DistributionList.Items[] | select(.Comment | contains("my-project-key"))' |
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 | |
#/ Description: | |
#/ Creates a docker swarm ec2 cluster | |
#/ Examples: | |
#/ DEBUG=true ./create-ec2-swarm-cluster.sh (Enable debug messages) | |
#/ NO_COLORS=true ./create-ec2-swarm-cluster.sh (Disable colors) | |
#/ -------------------------------------------------------------------------------- | |
#/ Author: Rogério Castelo Branco Peixoto ([email protected]) | |
#/ -------------------------------------------------------------------------------- | |
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; } |
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 | |
docker images --no-trunc --format '{{.ID}} {{.CreatedSince}}' | grep months | awk '$2 > 3 { print $1 }' | xargs -r docker rmi |
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 | |
cmd='' | |
for i in "$@"; do | |
i="${i//\\/\\\\}" | |
cmd="$cmd \"${i//\"/\\\"}\"" | |
done |
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
curl -L https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.region=="sa-east-1") ' | jq --slurp -r '. | map([.ip_prefix, .region, .service] | join(", ")) | join("\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
FROM node:8-alpine | |
LABEL MAINTAINER="[email protected]" | |
ARG NODEJS_VERSION="8" | |
ARG IONIC_VERSION="3.20.0" | |
ARG GRADLE_VERSION="3.2" | |
ARG ANDROID_SDK_VERSION="4333796" | |
ARG ANDROID_HOME="/opt/android-sdk" | |
ARG GRADLE_HOME="/opt/gradle" |
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 | |
#/ Define properties and sort them in a file | |
#/ Usage: | |
#/ set_property key value filename | |
#/ Alternative: | |
#/ | |
#/ export PROPERTIES_FILE=myproperties | |
#/ set_property key value | |
#/ -------------------------------------------------------------------------------- | |
#/ Author: Rogério Peixoto ([email protected]) |
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 | |
STEP=0 | |
bump_step(){ | |
STEP=$(($STEP+1)) | |
log "${BLU}[INFO] ($STEP) $1${NC}" | |
} | |
log() { echo -e "${BWHT}["$(date "+%Y%m%d${NC}T${BWHT}%H%M%S")"]${NC} $*"; } | |
separator() { SEP=$(printf '%*s' 105 | tr ' ' '#') && log "${GRN}[INFO] $SEP${NC}"; } |
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
aws ec2 get-console-screenshot --instance-id ID --query "ImageData" --output text > f; cat f | base64 -D > console.jpg |