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 / Compact-Cluster.yaml
Last active April 24, 2024 10:03
Redhat Openshift Agent-based Installer files for SNO & compact-cluster
---
# >>>>>> A 3-node, _compact_ cluster: <<<<<<<<<<<<
## API-VIP and APPS-VIP will be taken care of via keepalived,
## and you just need to provide API IPs and DNS records!
# 192.168.50.2 api.demo.cloud.example.com
# 192.168.50.2 api-int.demo.cloud.example.com
# 192.168.50.3 *.apps.demo.cloud.example.com
##
# install-config.yaml
##
@thikade
thikade / bashrc
Created December 1, 2023 15:02
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 / wasdecode.md
Last active November 9, 2023 15:48
WebSphere wsadmin-embedded password en/decoder

Decode WAS password using wsadmin.sh:

./wsadmin.sh -lang jython -conntype none -c 'import com.ibm.ws.security.util.PasswordDecoder as pd; pd.main(["{xor}KzosK25tbH4n"]);'

Encode WAS password using wsadmin.sh:

./wsadmin.sh -lang jython -conntype none -c 'import com.ibm.ws.security.util.PasswordEncoder as pd; pd.main(["test123!x"]);'
@thikade
thikade / TLSSLed_v1.3.sh
Last active March 26, 2023 18:46
SSL/TLS Debugging tools & cheatsheet
#!/usr/bin/env bash
#
#### Source: http://www.taddong.com/tools/TLSSLed_v1.3.sh
#
#
# Tool:
# TLSSLed.sh
#
# Description:
# Script to extract the most relevant security details from a
@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
# 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 / Java_GC_Tuning.md
Last active March 8, 2023 12:02
Java GC tuning

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 / vim_syntaxchecker.md
Last active February 27, 2023 04:47
vim syntax checker / syntastic yamllint

Getting vim yaml linter to work:

  1. Install syntastic vim plugin (as of vim 7.4.x no plugin manager is required anymore!)
    mkdir -p ~/.vim/pack/$USER/start/
    cd ~/.vim/pack/$USER/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    
  2. Install yamllint: pip3 install yamllint
  3. Configure yamllint:
@thikade
thikade / groovy_cheatsheet.md
Last active February 6, 2023 13:38
Jenkins / Groovy language patterns

links

Jenkins Shared Pipelines

killing hanging jenkins jobs

go to script console https://<jenkins>/script, find out JobName and JobNumber, then run:

def jobName = "JobName" // pls change!
def jobNumber = 42      // pls change!
Jenkins.instance.getItemByFullName(jobName)
 .getBuildByNumber(jobNumber)
@thikade
thikade / mcp.desktop
Last active December 10, 2022 16:19
control minecraft-pi using xbox controller on raspberry pi
[Desktop Entry]
Name=Minecraft Pi MCP
Comment=Fun with Blocks
# TryExec=minecraft-pi
Exec=/home/pi/mcp.sh
Icon=/usr/share/pixmaps/minecraft-pi.png
Terminal=false
Type=Application
Categories=Application;Game;
StartupNotify=true
@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
---
# 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