This file contains 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
# Source: https://missionimpossiblecode.io/building-a-best-practice-cloudformation-custom-resource-pattern | |
Parameters: | |
SpecifyVPCToUse: | |
Description: > | |
DefaultVPC - finds the VPC and configures all of its subnets for you. Otherwise type | |
in the VPC id of a VPC in the same region where you run the template. | |
All subnets and azs of the chosen vpc will be used. | |
The VPC and chosen subnets must be setup in a way that allows the runner instances | |
to resolve the DNS name and connect to port 443 on the GitLab instance URL you provide. | |
Default: DefaultVPC |
This file contains 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 | |
for r in `aws ec2 describe-regions --query 'Regions[].RegionName' --out text`; do | |
echo $r; | |
aws securityhub disable-security-hub --region $r; | |
done |
This file contains 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 | |
# shellcheck disable=1091,2068,2086,2162,2016 | |
STRING=pipeline | |
if command -v colours &> /dev/null; then source colours; fi | |
unset COUNT | |
[[ $* == *"--force"* ]] && FORCE=yes | |
[[ $* == *"--check"* ]] && CHECK=yes |
This file contains 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 | |
# shellcheck disable=1091,2068,2162 | |
SSMSTRING=backend | |
BUCKSTRING=state | |
DDBSTRING=locks | |
if command -v colours &> /dev/null; then source colours; fi | |
unset COUNT | |
[[ $* == *"--force"* ]] && FORCE=yes |
This file contains 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 | |
# Insert lines at the top of a file | |
ext=sh | |
for f in *.${ext}; do | |
# e.g. add shebang and shellcheck disable | |
printf '%s\n%s\n' "#shellcheck disable=1072,1073,1035,1020" "$(cat ${f})" >${f} | |
printf '%s\n%s\n' "#\!/usr/bin/env bash" "$(cat ${f})" >${f} | |
done |
This file contains 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 | |
# Bulk rename given file extension to another | |
ext_before=txt | |
ext_after=extend | |
for file in *.${ext_before}; do mv "$file" "${file%."${ext_before}"}.${ext_after}"; done |
This file contains 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 | |
# Check if AWS Config is enabled in all regions | |
for r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --out text); do | |
aws configservice describe-configuration-recorder-status --region $r --out yaml --query \ | |
'ConfigurationRecordersStatus[].{name:name,recording:recording,lastStatus:lastStatus}'; | |
done |
This file contains 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 | |
[[ "$1" == "yes" ]] || { echo "Specify \"yes\" to nuke Helix Native"; exit 0; } | |
echo | |
echo "NUKING HELIX NATIVE!" | |
echo | |
FOLDERS=( | |
"${HOME}/Library/Application Support/Line 6" |
This file contains 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 | |
# REGISTER OR DEREGISTER INSTANCES WITH/FROM ELB CLASSIC | |
## SANDBOX/PLAY ACCOUNT | |
ELBNAME=23feb22 | |
INSTANCES=( | |
i-0673baad826269229 # Name: dummy1 | |
i-0a72c8136b4ee5042 # Name: dummy2 | |
) |