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
#!/bin/bash -eu | |
get-password() { | |
kubectl -n $ns get secret $esName-es-elastic-user -o go-template='{{.data.elastic | base64decode}}' | |
} | |
port-forward-es() { | |
if [[ "${V:-}" == "1" ]]; then | |
echo kubectl -n $ns port-forward "service/$esName-es-http" 9200 | |
fi |
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
#!/bin/bash -eu | |
# Increase Virtual Memory for Elasticsearch on GKE | |
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html | |
# Dependencies: kubectl, gcloud, jq | |
nodes() { | |
kubectl get nodes -o custom-columns=n:.metadata.name --no-headers | |
} |
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
#!/bin/bash -eu | |
# install kubectl: https://kubernetes.io/docs/tasks/tools | |
# install gcloud: https://cloud.google.com/sdk/docs/install | |
# authenticate: gcloud auth login | |
# gcloud container clusters create c0 --region europe-west1 | |
kubectl create -f https://download.elastic.co/downloads/eck/2.10.0/crds.yaml | |
kubectl apply -f https://download.elastic.co/downloads/eck/2.10.0/operator.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
# Generate a passphrase | |
openssl rand -base64 48 > passphrase.txt | |
# Generate a Private Key | |
openssl genrsa -aes128 -passout file:passphrase.txt -out server.key 2048 | |
# Generate a CSR (Certificate Signing Request) | |
openssl req -new -passin file:passphrase.txt -key server.key -out server.csr \ | |
-subj "/C=FR/O=krkr/OU=Domain Control Validated/CN=*.krkr.io" |
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
com.sun.management:type=DiagnosticCommand | |
com.sun.management:type=HotSpotDiagnostic | |
java.lang:name=CodeCacheManager,type=MemoryManager | |
java.lang:name=Code Cache,type=MemoryPool | |
java.lang:name=Compressed Class Space,type=MemoryPool | |
java.lang:name=G1 Eden Space,type=MemoryPool | |
java.lang:name=G1 Old Generation,type=GarbageCollector | |
java.lang:name=G1 Old Gen,type=MemoryPool | |
java.lang:name=G1 Survivor Space,type=MemoryPool | |
java.lang:name=G1 Young Generation,type=GarbageCollector |
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
#!/bin/bash -eu | |
to_auth() { | |
jq -r '.Username,.Secret' | paste -sd ":" - | tr -d '\n' | base64 | |
} | |
main() { | |
registry="$1" | |
jq -cnM --arg auth $(docker-credential-desktop <<< "$registry" | to_auth) '{ | |
"auths": { "'"$registry"'": { "auth": $auth } } |
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
#!/usr/bin/env bash | |
# | |
# Script to release Helm charts. | |
# | |
# Requires: helm, gsutil, yq. | |
# | |
# Usage: release.sh CHART_DIR | |
# |
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
> k get es,scp | |
NAME HEALTH NODES VERSION PHASE AGE | |
elasticsearch/xyz green 1 8.7.0 Ready 6m | |
NAME READY PHASE AGE | |
stackconfigpolicy/snapshot-repo 1/1 Ready 5m | |
> eckurl default xyz /_snapshot | |
{"repo-snapshots":{"type":"s3","settings":{"readonly":"true","base_path":"snapshots/default-xyz"}}} |
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
def ret = 0 | |
def MAX_FAILURES = 3 | |
def projects = jenkins.model.Jenkins.instance.projects.findAll { it.name.contains("ping") || it.name.contains("post") } | |
for (p in projects) { | |
def projectName = p.name | |
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
Show hidden characters
[ | |
{ "keys": ["f12"], "command": "htmlprettify"}, | |
{ "keys": ["f1"], "command": "fold" }, | |
{ "keys": ["f2"], "command": "unfold" }, | |
{ "keys": ["ctrl+à"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, | |
{ "keys": ["ctrl+!"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
{ "keys": ["ctrl+space"], "command": "auto_complete" }, | |
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context": | |
[ | |
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" }, |
NewerOlder