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 | |
set -e | |
if [[ -z "${GLOW_VERSION}" ]]; then | |
GLOW_VERSION=1.5.0 | |
fi | |
DOWNLOAD_URL="https://github.com/charmbracelet/glow/releases/download/v${GLOW_VERSION}/glow_${GLOW_VERSION}_Linux_x86_64.tar.gz" | |
INSTALL_DIR=$HOME/.local/bin | |
if [[ ! -d $INSTALL_DIR ]]; 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 bash | |
set -e | |
if [[ -z "$TF_VERSION" ]]; then | |
TF_VERSION=1.4.6 | |
fi | |
DOWNLOAD_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip" | |
WORK_DIR=$HOME | |
INSTALL_DIR=$HOME/.local/bin |
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 | |
set -e | |
set -u | |
set -o pipefail | |
set -C | |
WORK_DIR=$HOME/.cache | |
DOWNLOAD_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip | |
ZIP_FILE=awscliv2.zip |
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 | |
set -e | |
# default variables | |
BACKUP_DIR=$HOME/backup | |
AWSCLI=/usr/local/bin/aws | |
WPCLI=/usr/local/bin/wp | |
DATE=$(date +%Y%m%d%H%M%S) | |
ROTATE=3 |
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 | |
MODE=$1 | |
#get_instances() { | |
#aws ec2 describe-instances --filter "Name=instance-state-name,Values=${STATE}" "Name=tag:Environment,Values=development" | jq -r '.Reservations[].Instances[] | [ .InstanceId, (.Tags[] | select(.Key == "Name").Value) ] | @csv' | |
#aws ec2 describe-instances --filter "Name=instance-state-name,Values=${state}" "Name=tag:Environment,Values=development" | jq -r '.Reservations[].Instances[] | .InstanceId' | |
#} | |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"ce:DescribeCostCategoryDefinition", | |
"ce:ListTagsForResource", | |
"ce:GetAnomalySubscriptions", |
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 | |
# vim:fileencoding=utf-8 | |
import os | |
import json | |
import requests | |
import datetime | |
import time | |
import boto3 | |
import calendar |
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 | |
# vim:fileencoding=utf-8 | |
import os | |
import requests | |
import datetime | |
import boto3 | |
from dateutil.relativedelta import relativedelta | |
dt = datetime.datetime.now() |
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 | |
if [ -z "${AWS_DEFAULT_PROFILE}" ]; then | |
export AWS_DEFAULT_PROFILE=default | |
fi | |
set -e | |
set -u | |
START_TIME=$(date -u +%Y-%m-%dT00:00:00Z -d "1 day ago") |
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 -sfL https://api.github.com/repos/nestjs/nest/git/refs/tags/ | jq -r ".[].ref" | perl -nle "s/^refs\/tags\/// && print if /^refs\/tags\/(v\d{1,2}\.\d{1,2}\.\d{1,2})$/" |