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
[CmdLetBinding()] | |
Param( | |
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)] | |
[String] $HostedZoneId, | |
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)] | |
[ValidateSet("CNAME","A","AAAA","MX","TXT","PTR","SRV","SPF","NS","SOA")] | |
[String] $Type, | |
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)] |
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
# reset my local to my origin | |
git fetch --all | |
git reset --hard origin/<branch> | |
# auto rebase conflicts | |
git rebase -X ours upstream/master |
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
# -i case insensitive | |
# -l just show file path | |
# -r recursive | |
# -n line number | |
searchTerm="" | |
# just list the files containing search term | |
egrep -irl --include \*.tf --exclude-dir=.* "$searchTerm" | |
# to see the search term |
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
# set a var name | |
mycertfile=<mycertfilename> | |
# to decrypt the private key | |
# this will ask you for a password | |
openssl pkey -outform PEM -in $mycertfile | |
# get all the nodes from pks file type | |
openssl pkcs12 -in $mycertfile -nodes |
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
username= | |
sudo adduser $username | |
sudo su $username | |
cd ~ | |
mkdir .ssh | |
chmod 700 .ssh | |
touch .ssh/authorized_keys |
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
# see all users | |
sudo cat /etc/shadow | |
# list all users with a password set to expire | |
sudo cat /etc/shadow | grep ':90:' | |
# cut out just the user name | |
sudo cat /etc/shadow | grep ':90:' | tr ':' ' ' | awk '{print $1}' | |
# put those users in a var | |
USER_LIST=$(sudo cat /etc/shadow | grep ':90:' | tr ':' ' ' | awk '{print $1}') | |
# loop through those users and set expiration really high | |
for i in $USER_LIST; do echo $i; sudo passwd -x 99999 $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
# -e regex | |
# -r extended regex | |
# -i in place replace (saves the file) | |
# adhoc string replace | |
sed -i 's/term/replace/' somefile.tf | |
# delete all lines containing | |
sed -i '/somestring/d' somefile.tf |
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
# Terraform Troubleshooting | |
# keywords: trace, debug, verbose | |
# https://www.terraform.io/docs/internals/debugging.html | |
# TRACE, DEBUG, INFO, WARN or ERROR | |
export TF_LOG=WARN | |
export TF_LOG_PATH=./terraform.log |
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
# Terraform State Move - Refactoring Terraform Against Existing Infrastructure | |
# https://ryaneschinger.com/blog/terraform-state-move/ | |
terraform state mv aws_security_group.old_name aws_security_group.new_name |
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
# .bashrc | |
export PROMPT_COMMAND='history -a' | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# Uncomment the following line if you don't like systemctl's auto-paging feature: | |
# export SYSTEMD_PAGER= |
OlderNewer