Skip to content

Instantly share code, notes, and snippets.

View thikade's full-sized avatar

Thomas Hikade thikade

  • Alpium IT Solutions
  • Vienna
View GitHub Profile
@thikade
thikade / bashrc
Created December 1, 2023 15:02
bashrc
View bashrc
# User specific aliases and functions
HISTTIMEFORMAT="%d/%m/%y %T "
HISTSIZE=1000000
HISTFILESIZE=1000000
# source ~/bin/switch.sh
alias ll="ls -al"
alias sw=switch
@thikade
thikade / helm-get-objects.sh
Last active March 22, 2023 19:22 — forked from bioshazard/helm-get-objects.sh
List and VERIFY all objects in helm deployment
View helm-get-objects.sh
# helm get manifest $RELEASE_NAME | yq -N eval '[.kind, .metadata.name] | join("/")' - | sort
helm get manifest $RELEASE_NAME | yq -N '[.kind,.metadata.name] | join("/") '| sort | \
while read X; do \
Y=$(kubectl get $X -o name 2>/dev/null); \
test $? -eq 0 && Y="OK " || Y="MISSING"; \
echo "$Y $X"; \
done
# sample output:
MISSING ConfigMap/elastic-7
@thikade
thikade / service-loadbalancing.yml
Last active October 12, 2022 10:38
test K8s service loadbalancing. Deploys a client pod, a webserver deployment with 2 replicas, as well as a *stateful* and a *stateless* service to the webserver pods
View service-loadbalancing.yml
---
# Use curl to test service loadbalancing on stateful and stateless services:
### simple:
# oc exec client -- curl -sS http://stateless:8080
#
### automated:
# for i in $(seq 1 100); do oc exec client -- curl -sS http://stateless:8080 | head -n1; sleep 1; done
# for i in $(seq 1 100); do oc exec client -- curl -sS http://stateful:8080 | head -n1; sleep 1; done
apiVersion: v1
@thikade
thikade / argocd_healthcheck.yaml
Created September 26, 2022 13:18
Overriden ArgoCD healthcheck for operator subscriptions to nicely work with manual approvals.
View argocd_healthcheck.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
name: argocd-cm
data:
resource.customizations: |
argoproj.io/Application:
@thikade
thikade / jenkins-decrypt.groovy
Created October 21, 2021 15:11 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password
View jenkins-decrypt.groovy
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@thikade
thikade / convert-deploymentconfig-to-deployment.md
Last active June 12, 2022 05:13 — forked from tillkahlbrock/convert-deploymentconfig-to-deployment.md
Convert OpenShift DeploymentConfig to Kubernetes Deployment
View convert-deploymentconfig-to-deployment.md
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@thikade
thikade / k8s-patch-virtualservice.go
Created May 11, 2021 14:14 — forked from dwmkerr/k8s-patch-virtualservice.go
Example showing how to patch an Istio VirtualService CRDs Golang
View k8s-patch-virtualservice.go
// Example showing how to patch Kubernetes resources.
package main
import (
"encoding/json"
"fmt"
"k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/dynamic"
@thikade
thikade / etcd-backup-cron.yaml
Created April 2, 2021 22:43 — forked from dmc5179/etcd-backup-cron.yaml
OpenShift Cron job to backup etcd database
View etcd-backup-cron.yaml
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: etcd-backup
spec:
schedule: "0 0 * * *"
jobTemplate:
spec:
template:
@thikade
thikade / Java_GC_Tuning.md
Last active March 8, 2023 12:02
Java GC tuning
View Java_GC_Tuning.md

determine JVM defaults

java -XshowSettings:vm -XX:+PrintFlagsFinal -version

Default Java 1.8.0_275: (-XX:+UseParallelGC)

$ java -XshowSettings:vm -XX:+PrintFlagsFinal  -version 2>&1 | \
  grep -E 'GCTimeRatio|HeapFreeRatio|MaxRAM|MaxHeapSize|UnlockExperimentalVMOptions|UseCGroupMemoryLimitForHeap'
    uintx DefaultMaxRAMFraction                     = 4                                   {product}
@thikade
thikade / git_crlf_conversion.md
Created November 1, 2020 16:04
Git replacing LF with CRLF
View git_crlf_conversion.md