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
for rsc in $(kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -oname); do | |
echo $rsc | |
dir=$(echo $rsc | cut -d'/' -f1) | |
file=$(echo $rsc | cut -d'/' -f2) | |
mkdir genereted/$dir | |
kubectl get $rsc -oyaml > genereted/$dir/$file.yaml | |
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
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
</head> | |
<link rel="stylesheet" type="text/css" | |
href="https://demos.aarafacademy.com/fireworks-using-javascript/css/fireworks.css" media="screen" /> | |
<script type="text/javascript" | |
src="https://demos.aarafacademy.com/fireworks-using-javascript/js/soundmanager2-nodebug-jsmin.js"></script> | |
<script type="text/javascript" src="https://demos.aarafacademy.com/fireworks-using-javascript/js/fireworks.js"></script> | |
<div id="fireworks-template"> | |
<div id="fw" class="firework"></div> |
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
""" | |
Copies a parameter group in RDS, particularly useful for doing cross-region copies (which AWS documents, | |
but doesn't actually support at the time of this writing. | |
Usage: python cp-parameter-group.py us-west-1:lookerdb-56 us-west-2:lookerdb-56 | |
""" | |
import boto3 | |
import sys |
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
# memcached default config file | |
# 2003 - Jay Bonci <[email protected]> | |
# This configuration file is read by the start-memcached script provided as | |
# part of the Debian GNU/Linux distribution. | |
# Run memcached as a daemon. This command is implied, and is not needed for the | |
# daemon to run. See the README.Debian that comes with this package for more | |
# information. | |
-d |
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
declare -a subnets=("subnet-0a5eeeb0cd492af31" "subnet-081a9964b79df659d" "subnet-0a223bb7af793f998") | |
for subnet in ${subnets[@]}; do | |
echo "$(aws ec2 describe-network-interfaces --filters "Name=subnet-id,Values=$subnet" --query 'NetworkInterfaces[*].PrivateIpAddress' --output text | wc -w) interfaces are taken at $subnet" | |
# echo "$(aws ec2 describe-instances --filters "Name=subnet-id,Values=$subnet" --query 'Reservations[*].Instances[*].PrivateIpAddress' --output text | wc -w) ips are taken at $subnet" | |
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
export CLUSTER="$(kubectl config view -ojson | jq -r --arg CTX $(kubectl config current-context) '.contexts | .[] | select(.name == $CTX) | .context.cluster | split("/") | .[length-1]')" | |
export REGION=$(aws configure get region) | |
export OIDC=$(aws eks describe-cluster --name ${CLUSTER} --query cluster.identity.oidc | jq -r '.issuer | split("/") | .[length-1]') | |
export ACCOUNT=$(aws sts get-caller-identity --query Account --output text) | |
echo "cluster $CLUSTER in region $REGION and account number ${ACCOUNT} has OIDC token: ${OIDC}" |
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
SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 / 1024 AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema; |
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 | |
KEY=dr.newadmin | |
VALUE=a88dd1213cf1811e9803406c5e12f321-536496363.eu-west-1.elb.amazonaws.com | |
HOSTED_ZONE_ID=Z2JG04O2LDY5NZ | |
# Creates route 53 records based on KEY name | |
aws route53 change-resource-record-sets --hosted-zone-id $HOSTED_ZONE_ID --change-batch '{ "Comment": "Testing creating a record set", "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "'"$KEY"'.hosted.zone.com", "Type": "CNAME", "TTL": 120, "ResourceRecords": [ { "Value": "'"$VALUE"'" } ] } } ] }' |
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
git branch -r > branch.txt | |
# delete master branch and "/origin" from branch.txt, and then: | |
for i in $(cat branch.txt); do sleep 1 && git push origin --delete $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
curl -s http://checkip.dyndns.org/ | cut -d ' ' -f 6 | sed s/"body\|html\|<\|>\|\/"//g |
NewerOlder