aws --profile dev ec2 describe-instances | jq '.Reservations[].Instances[] | select(.InstanceId == "i-0abcdefe412345678")'
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 | |
filename="git_repo_list.txt" | |
while read repo | |
do | |
echo "Starting to Archive repository '$repo'" | |
echo "Git checking out repository '$repo'" | |
git clone $repo | |
repoShortName=$(echo $repo | grep -E -o '([^\/\.]+).git$') |
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 | |
CURRENT_CERT_MD5SUM=af375610c480018271caa1b624c838b3 | |
for acmCertificate in $(aws acm list-certificates | jq -r .CertificateSummaryList[].CertificateArn) | |
do | |
echo "Cert ARN is $acmCertificate" | |
ACM_CERT_MD5SUM=$(aws acm list-tags-for-certificate --certificate-arn $acmCertificate | jq -r '.Tags[] | select(.Key | contains("Md5SumCert")) | .Value') | |
if [[ "$CURRENT_CERT_MD5SUM" == "$ACM_CERT_MD5SUM" ]] | |
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/bash | |
# pre-requisites: | |
# apt install python3-pip awscli | |
# pip3 install certbot certbot-dns-route53 awscli | |
# mkdir .certbot/{config,work,logs} | |
# IAM policy attached to EC2 instance with: | |
# - route53:ListHostedZones | |
# - route53:GetChange | |
# - route53:ChangeResourceRecordSets |
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/python3 | |
import boto3 | |
session = boto3.Session(profile_name='foobar') | |
client = session.client('ssm') | |
fromPath = "/production/" | |
toPath = "/uat/" |
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 | |
# PREREQUISITES: On Ubuntu 18.04 need to make sure that the "libcgroup1" and "cgroup-tools" packages are installed | |
MAXNUMPROCS=11 | |
MAXNUMCHILDPROCS=8 | |
PARENTGROUP=sandwich | |
# Create the parent cgroup | |
##OPTIONAL: This part should be already there on more recent Linux distributions |
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
John Wayne | [email protected] | GKE service account for John | |
---|---|---|---|
Barbara Streisand | [email protected] | GKE service account for Barbara |
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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
const NAME = process.env.NAME || "World" | |
app.get('/', (req, res) => { | |
res.send('Hello ' + NAME + '!') | |
}) | |
app.listen(port, () => { |
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 --profile dev \ | |
ec2 describe-instances \ | |
--query 'Reservations[].Instances[].[InstanceId,Tags[?Key==`Name`].Value[],NetworkInterfaces[].Association.{IP:PublicIp}]' |
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/python3 | |
# NOTE: Requires the python3-apt package | |
import apt | |
import apt_pkg | |
import json | |
need_upgrade = [] |