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
John Wayne | [email protected] | GKE service account for John | |
---|---|---|---|
Barbara Streisand | [email protected] | GKE service account for Barbara |
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
#!/bin/bash | |
# PREREQUISITES: On Ubuntu 18.04 need to make sure that the "libcgroup1" and "cgroup-tools" packages are installed | |
MAXNUMPROCS=11 | |
MAXNUMCHILDPROCS=8 | |
PARENTGROUP=sandwich | |
# Create the parent cgroup | |
##OPTIONAL: This part should be already there on more recent Linux distributions |
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
#!/usr/bin/python3 | |
import boto3 | |
session = boto3.Session(profile_name='foobar') | |
client = session.client('ssm') | |
fromPath = "/production/" | |
toPath = "/uat/" |
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
#!/usr/bin/bash | |
# pre-requisites: | |
# apt install python3-pip awscli | |
# pip3 install certbot certbot-dns-route53 awscli | |
# mkdir .certbot/{config,work,logs} | |
# IAM policy attached to EC2 instance with: | |
# - route53:ListHostedZones | |
# - route53:GetChange | |
# - route53:ChangeResourceRecordSets |
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
#!/bin/bash | |
CURRENT_CERT_MD5SUM=af375610c480018271caa1b624c838b3 | |
for acmCertificate in $(aws acm list-certificates | jq -r .CertificateSummaryList[].CertificateArn) | |
do | |
echo "Cert ARN is $acmCertificate" | |
ACM_CERT_MD5SUM=$(aws acm list-tags-for-certificate --certificate-arn $acmCertificate | jq -r '.Tags[] | select(.Key | contains("Md5SumCert")) | .Value') | |
if [[ "$CURRENT_CERT_MD5SUM" == "$ACM_CERT_MD5SUM" ]] | |
then |
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
#!/bin/bash | |
filename="git_repo_list.txt" | |
while read repo | |
do | |
echo "Starting to Archive repository '$repo'" | |
echo "Git checking out repository '$repo'" | |
git clone $repo | |
repoShortName=$(echo $repo | grep -E -o '([^\/\.]+).git$') |
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
import base64 | |
import json | |
import time | |
import requests | |
import os | |
def push_to_github(filename, repo, branch, token): | |
url="https://api.github.com/repos/" + repo + "/contents/" + filename | |
fileContents = """Last timestamp: """ |
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
#!/bin/bash | |
KUBECOMMAND="kubectl --kubeconfig ~/.kube/mycluster --namespace dev" | |
for each in $($KUBECOMMAND get deployments -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep -v tiller-deploy); | |
do | |
#kubectl delete ns $each | |
echo "Deleting deployment $each" | |
$KUBECOMMAND delete deployment $each | |
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
FROM ubuntu:19.10 | |
RUN apt update && apt install -y python3 python3-dev python3-pip vim wget | |
RUN pip3 install numpy plotly pandas | |
RUN pip3 install fbprophet | |
RUN pip3 install jupyter | |
RUN mkdir /fbprophet | |
WORKDIR /fbprophet | |
RUN wget https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv | |
ENTRYPOINT jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root |
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
#!/usr/bin/python3 | |
def catch(function): | |
def wrapper(*args, **kwargs): | |
try: | |
return function(*args, **kwargs) | |
except Exception as error: | |
return {'error': error} | |
return wrapper |