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
# the following docker command mounts the current directory from a new alpine container | |
# on macos/linux | |
docker run -it --net host -v ${HOME}/.kube/:/root/.kube -v ${PWD}:/work -w /work alpine sh | |
# on windows | |
docker run -it --net host -v ${USERPROFILE}/.kube/:/root/.kube -v ${CD}:/work -w /work alpine sh | |
# TODO - Dockerfile | |
# FROM ubuntu:latest |
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 | |
# -------------------------------- | |
# from standard Cloud9 environment | |
# -------------------------------- | |
which aws cdk | |
npm install --force -g aws-cdk # upgrade | |
python -m pip install aws-cdk-lib | |
cdk doctor # status check | |
mkdir ~/environment/cdk-app && cd $_ |
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
# when you pass the "--debug" flag to the AWS CLI you can see which endpoint is being invoked. | |
# you can do something similar with kubectl when you pass the "-v6" flag as follows. | |
# documentation here: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging | |
kubectl get nodes -v6 | |
# the opening lines of the response reveal the endpoint | |
# strip out the hostname and pass what remains to kubectl as follows to see the original response which was previously prettified for you | |
kubectl get --raw /api/v1/nodes | |
# more examples as follows ... |
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
####################### | |
# cert-manager/eks demo | |
####################### | |
# to start, complete everything up to and including: | |
# https://github.com/amcginlay/eks-demos/blob/main/doc/06-build-cluster/README.md | |
# create ROOT PCA | |
# set variables |
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
#################################### | |
# cert-manager/kind/letsencrypt demo | |
#################################### | |
# cloudshell | |
# - Navigate to: https://us-west-2.console.aws.amazon.com/cloudshell | |
# - create SSM-enabled EC2 instance with ports 80/443 open | |
aws cloudformation create-stack \ | |
--stack-name cert-manager-k8s \ | |
--template-url https://amcginla-public.s3.amazonaws.com/cfn/cfn-ssm-jumpbox.yaml \ |
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
<Cognito User Pool Demo with Chalice> | |
PART 1 | |
- Create a new user pool (e.g. apm-demo-user-pool), click Review Defaults and create pool | |
- Show User and groups -> (empty) | |
- Show Policies -> deselect all password checkboxes (keep things simple) and save changes | |
- Show General settings / App clients -> | |
--- Add | |
--- set App client name (e.g. apm-demo-app-client) | |
--- Disable Generate client secret (so later call to "aws cognito-idp initiate-auth" doesn't barf) |
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 | |
# -------------------------------- | |
# from standard Cloud9 environment | |
# -------------------------------- | |
which aws cdk | |
pip install botocore boto3 # required to run python script for emptying versioned buckets (see later) | |
npm install --force -g aws-cdk # upgrade | |
cdk doctor # status check | |
# install maven |
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 | |
unique_id=${RANDOM} | |
echo ${unique_id} | |
aws secretsmanager create-secret --name "/qa/dummy-key-${unique_id}" --secret-string "mY-5uP3R-53cr3t-v@lu3" | |
aws secretsmanager list-secrets | |
aws secretsmanager get-secret-value --secret-id "/qa/dummy-key-${unique_id}" | |
------------------------------------------------------------------------------ | |
aws secretsmanager delete-secret --secret-id "/qa/dummy-key-${unique_id}" --recovery-window-in-days 7 |
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 | |
pip install awsebcli --upgrade --user | |
mkdir ebdemo && cd $_ | |
git config --global init.defaultBranch main | |
git init | |
cat > ./index.php << EOF | |
<?php | |
echo gethostname() . "\n"; | |
?> | |
EOF |
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
# inspired by https://www.youtube.com/watch?v=ZYr8Uc3PJJQ | |
sudo yum install -y nc | |
# 172-31-36-245: | |
sudo nc -l -p 8080 | |
# 172-31-36-246: | |
echo "hello" > /dev/tcp/172.31.36.245/8080 |