Skip to content

Instantly share code, notes, and snippets.

View Tim-Schwalbe's full-sized avatar
🤠

Tim Schwalbe Tim-Schwalbe

🤠
View GitHub Profile
https://editor.cilium.io/?id=AJ8LtZ3h9SCP1MKC
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "name" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "name" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
@Tim-Schwalbe
Tim-Schwalbe / gist:23ca6e3ee4968c954e3b2367c1c9edc8
Created May 19, 2021 10:23
Optimize multiple MySQL Tables
set @tables_like = "%table_name%";
set @optimize = null;
set @show_tables = concat("show tables where", ifnull(concat(" `Tables_in_", database(), "` like '", @tables_like, "' and"), ''), " (@optimize:=concat_ws(',',@optimize,`Tables_in_", database() ,"`))");
Prepare `bd` from @show_tables;
EXECUTE `bd`;
DEALLOCATE PREPARE `bd`;
set @optimize := concat('optimize table ', @optimize);
PREPARE `sql` FROM @optimize;
@Tim-Schwalbe
Tim-Schwalbe / sh
Last active July 8, 2021 12:24
Copy K8S Secret from one Namespace to another
kubectl get secret wildcard-tls --namespace=prod -o yaml | sed 's/namespace: prod/namespace: monitoring/g' | kubectl create -f -
@Tim-Schwalbe
Tim-Schwalbe / gist:63bc01043bc534e2af276ed703185534
Created July 20, 2020 08:50
Kubectl: Delete released persistent volumes (PV)
kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done
@Tim-Schwalbe
Tim-Schwalbe / send_file.py
Created April 16, 2019 16:01
python - mattermost api v4 send file into channel
import os
import json
import requests
SERVER_URL = "YOUR_SERVER_URL"
CHANNEL_ID = "YOUR_CHANNEL_ID"
FILE_PATH = './test.jpg'
s = requests.Session()
s.headers.update({"Authorization": "Bearer YOUR_PERSONAL_ACCESS_TOKEN"})
rm ~/.docker/config.json
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io
@Tim-Schwalbe
Tim-Schwalbe / gist:71b85f45967198dfc98d013dcdc9b1c5
Created March 18, 2019 15:33
Best way for trouble with image pull secret
https://container-solutions.com/using-google-container-registry-with-kubernetes/
@Tim-Schwalbe
Tim-Schwalbe / maintenance.properties
Created December 28, 2018 16:50
BASH: one liner to read properties files in bash script
app.config.name=test app
app.config.url= www.test