Skip to content

Instantly share code, notes, and snippets.

View etoews's full-sized avatar

Everett Toews etoews

View GitHub Profile
@etoews
etoews / awsweeper.yaml
Created September 2, 2022 23:44
Example of an AWSweeper configuration file for https://github.com/jckuester/awsweeper
# awsweeper --dry-run awsweeper.yml
aws_alb_target_group:
aws_ami:
aws_api_gateway_api_key:
aws_api_gateway_client_certificate:
aws_api_gateway_domain_name:
aws_api_gateway_rest_api:
aws_api_gateway_usage_plan:
aws_api_gateway_vpc_link:
aws_apigatewayv2_api:
-----BEGIN CERTIFICATE-----
MIIDhDCCAmygAwIBAgIQNu0nhr9HM4pbXdU27a2hFTANBgkqhkiG9w0BAQsFADBc
MQkwBwYDVQQGEwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQkwBwYDVQQREwAxETAP
BgNVBAoTCGJvb3RrdWJlMQkwBwYDVQQLEwAxEDAOBgNVBAMTB2t1YmUtY2EwHhcN
MTcxMTA2MTUxMzAxWhcNMjAxMTA1MTUxMzAxWjBcMQkwBwYDVQQGEwAxCTAHBgNV
BAgTADEJMAcGA1UEBxMAMQkwBwYDVQQREwAxETAPBgNVBAoTCGJvb3RrdWJlMQkw
BwYDVQQLEwAxEDAOBgNVBAMTB2t1YmUtY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCuZf9T+FHGHoQSWMtLeYfFworEKercP1iOK4jK+JB3Suehu+aE
7cwGkTWDJfyuIV4jQ0hbKMvbMtTnjnWLHp3+TcoPjaHT8jDD8xLLY/sEU5E30dzc
GhB6JZrp+8OsqifhtMwq/DBE6oGDNkNKsZCh6Fqws+NmWWeAF6lDHECH3qTFmvoC
apiVersion: v1
kind: ConfigMap
metadata:
name: app
data:
MYSQL_HOST: "db"
MYSQL_DATABASE: "auth"
MYSQL_USER: "app"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_PASSWORD: "rootpassword"
@etoews
etoews / .gitignore
Last active August 27, 2017 21:50
Code for Inject an Executable Script into a Container in Kubernetes http://blog.phymata.com/2017/08/27/managing-env-vars-and-secrets-in-kubernetes/
*
!.gitignore
!README.md
!template.sh
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ghost
labels:
role: blog
spec:
replicas: 1
template:
metadata:
@etoews
etoews / croc-hunter.sh
Created May 21, 2017 01:04
Rough notes on getting this "Zero to Kubernetes CI/CD in 5 minutes with Jenkins and Helm" demo https://www.youtube.com/watch?v=eMOzF_xAm7w running on MS Azure Container Service.
# https://github.com/Microsoft/azure-docs/blob/master/articles/container-service/container-service-kubernetes-walkthrough.md
alias az="docker run --rm --volume ${HOME}:/root azuresdk/azure-cli-python az"
az login
RESOURCE_GROUP=kubernetes
LOCATION=southcentralus
DNS_PREFIX=phymata
CLUSTER_NAME=kubernetes
FROM alpine:3.5
COPY cat-etc-hosts.sh .
RUN chmod u+x cat-etc-hosts.sh
CMD ["./cat-etc-hosts.sh"]
@etoews
etoews / remote-diff.sh
Last active April 12, 2017 22:04
remote-diff: a bash function to diff a local file with a remote file
# Usage: remote-diff foo.yaml https://raw.githubusercontent.com/some-org/some-repo/master/foo.yaml
# Note: It ignores lines that begin with a '#' (comments)
function remote-diff()
{
FILE=${1}
FILENAME=$(basename ${FILE})
TMP_FILE="/tmp/${FILENAME}"
REMOTE_FILE=${2}
@etoews
etoews / prat.sh
Created March 31, 2017 21:59
prat: a bash function to rapidly submit a pull request
# Usage: prat my-feature-branch "My commit (and pull request message)"
# Requirements: https://hub.github.com/
function prat()
{
BRANCH=${1:-}
MESSAGE=${2:-}
git diff
@etoews
etoews / .bash_profile
Created March 30, 2017 16:02
A PS1 with Docker context and Kubernetes context (including namespace)
PS1='(k:$(kubernetes-context) | d:$(docker-context "%s") | g:$(__git_ps1 "%s"))\n\W $ '
function docker-context()
{
if [ -z "$DOCKER_HOST" ]; then
printf "localhost"
else
local HOSTNAME_REGEX=".*//(.*):.*"
[[ $DOCKER_HOST =~ $HOSTNAME_REGEX ]]
printf ${BASH_REMATCH[1]}