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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: test | |
spec: | |
containers: | |
- args: | |
- -c | |
- while true; do sleep 10;done | |
command: |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: redash | |
name: redash | |
spec: | |
progressDeadlineSeconds: 600 | |
replicas: 1 | |
revisionHistoryLimit: 10 |
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
apiVersion: autoscaling/v2beta2 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: kafka-consumer | |
annotations: | |
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey> | |
metric-config.external.http.json/json-key: "$stats" | |
metric-config.external.http.json/endpoint: "http://www.mocky.io/v2/5eb958772f0000b32c3c3098" | |
spec: | |
scaleTargetRef: |
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
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ |
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
/* | |
This is how to speed up you linux machine. | |
https://askubuntu.com/questions/604720/setting-to-high-performance | |
*/ | |
#Available modes | |
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | |
#Check processor mode |
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
#MSQL | |
CREATE DATABASE `DB_NAME`; | |
CREATE USER `DB_USER`@'%' IDENTIFIED BY 'DB_PASS'; | |
GRANT CREATE,DELETE,INSERT,SELECT,UPDATE ON `DB_NAME`.* TO `DB_USER`@'%'; | |
SELECT User from mysql.user; | |
SELECT User from mysql.user WHERE USER='DB_USER'; | |
SHOW GRANTS for DB_USER; | |
FLUSH PRIVILEGES; | |
REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost'; |
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
#Simple commands to generate random strings. | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 | |
openssl rand -base64 15 | |
openssl rand -hex 15 |
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
#DUMP yamls | |
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl get deploy/$1 --export -o yaml > $1.yml' -- {} | |
#Rollout undo | |
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl rollout undo deploy/$1' -- {} | |
#Delete all everything in a namespace | |
kubectl delete --all services,deployments,pods,ingress,secrets,configmaps | |
#Delete specific services |
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
if [ -z "$1" ] | |
then | |
echo "Please pass the namespace as the argument!" | |
else | |
timestamp=`date "+%Y-%m-%d"` | |
dir="$1_dump_$timestamp" | |
mkdir -p $dir | |
for n in $(kubectl get -n $1 -o=name cm,ing,svc,secret,deployment,ds | grep -v 'secrets/default-token') | |
do | |
kubectl get -n $1 -o=yaml --export $n > $dir/$(dirname $n)_$(basename $n).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
apt-get update | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
NewerOlder