Skip to content

Instantly share code, notes, and snippets.

curl -s https://gist.github.com/wongcyrus/a4e726b961260395efa7811cab0b4516/raw/6a045f51acb2338bb2149024a28621db2abfcaab/resize.sh | bash /dev/stdin 60
ansible-vault decrypt secrets_file.enc
ansible-vault edit secrets_file.enc
ansible-vault encrypt secrets_file.enc
ansible-playbook -i inventory -e @secrets_file.enc --vault-password-file password_file main.yml
docker network create --driver bridge iso_net
docker run -itd --net=iso_net -v $PWD:/code -w /code --name ansible1 ansible/awx:latest
docker network inspect iso_net
@us3r5pac3
us3r5pac3 / create_x509_certs.md
Created November 10, 2021 20:37 — forked from dasniko/create_x509_certs.md
Creating self signed tls certificates with self-signed root CA
MasterUser:
Type: "AWS::SecretsManager::Secret"
Properties:
Name: !Sub "${ServerName}-MasterUser"
Description: !Sub "RDS master username and password"
GenerateSecretString:
SecretStringTemplate: |
{
"username": "postgres",
"database": "postgres"
@us3r5pac3
us3r5pac3 / pipeline.yaml
Created September 13, 2021 20:26 — forked from mikebroberts/pipeline.yaml
Selectively triggering a GitHub sourced CodePipeline (only for one file)
# CodePipeline by default runs an execution whenever any change is detected in the configured source repository
# We can use a CodePipeline Webhook resource to filter such executions.
#
# This is a snippet that would be part of a CloudFormation template containing
# a CodePipeline resource (AWS::CodePipeline::Pipeline), named CodePipeline in this case, and
# assumes the GutHub OAuth token is available in the parameter GitHubOAuthToken.
# Typically a CodePipeline Webhook only contains the $.ref filter to check for
# the desired branch.
# However we can add up to 4 more filters, each of which can query the incoming webhook payload from Github.
# Such payloads are of the form:
run tmux session for each file transferring
@us3r5pac3
us3r5pac3 / enable-multi-region-guardduty.sh
Created July 29, 2021 21:11
Enable Amazon Inspector in multiple regions
#!/bin/bash
for region in `aws ec2 describe-regions --region us-west-2 --output text | cut -f4`
do
echo "Enabling GuardDuty in region:'$region'..."
aws guardduty create-detector --enable --region $region
done