Skip to content

Instantly share code, notes, and snippets.

View schneefisch's full-sized avatar

Florian schneefisch

View GitHub Profile

Docker: JVM Memory Debugging

Prerequisites

In the Dockerfile use the JVM debugging container as base-container e.g.

FROM gcr.io/distroless/java:11-debug

and add -XXNativeMemoryTracking=summary to the startup-parameters e.g.

@schneefisch
schneefisch / restart_pods.md
Last active April 19, 2024 08:32
How to restart all pods in a statefulset or deployment

Various ways to restart pods

Restart deployment

The most gracefull way is to trigger a restart for the deployment. In this case, a pod will only be terminated once the new pod is ready. It will slowly replace all pods one after the other.

kubectl rollout restart deployment <deployment-name>

Restart pods in a statefulset

@schneefisch
schneefisch / yubico_setup.sh
Last active September 14, 2020 08:59
How to setup Yubikey login protection on Ubuntu
#!/bin/bash
# how to configure Ubuntu, see:
# https://support.yubico.com/support/solutions/articles/15000011355-ubuntu-linux-login-guide-challenge-response
# configure a yubikey
ykman otp chalresp -g 2
# associate a yubikey with your account
ykpamcfg -2
@schneefisch
schneefisch / setup_selenium.sh
Last active September 14, 2020 09:00
How to install Selenium-HQ with Google-Chrome on Ubuntu
#!/usr/bin/env bash
#
# IMPORTANT: Update the STANDALONE_Version variable
#
# LINK:
# how to install selenium and chrome-driver on Ubuntu
# https://gist.github.com/ziadoz/3e8ab7e944d02fe872c3454d17af31a5
#
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
@schneefisch
schneefisch / gpg_basics.sh
Last active September 27, 2020 17:35
Basic GPG usage
#!/usr/bin/env bash
# encrypt file for specific key
gpg --output doc.gpg --encrypt --recipient blake@cyb.org doc
# encrypt with multiple recipients
gpg --output doc.gpg --encrypt --recipient blake@cyb.org --recipient bob@example.com doc
# decrypt file
gpg --output doc --decrypt doc.gpg
@schneefisch
schneefisch / db2.sh
Last active September 14, 2020 09:02
Basic DB2 commands
# list databases
db2 list db directory
# start db2
db2start
# Stop db2
# stop all dbs in this instance
db2stop
@schneefisch
schneefisch / metadata.sh
Last active September 27, 2020 17:35
View file metadata in Bash
# view document metadata with bash
# mdls -name KEY FILEPATH
mdls <FILEPATH>
# to store into a textfile
mdls <FILEPATH> > metadata.txt
@schneefisch
schneefisch / system_stats.sh
Last active September 27, 2020 17:35
Basic linux usage and stats commands
#!/usr/bin/env bash
#
# show file system usages
df -h
# disk usage (graphical)
ncdu
# prozess / system monitor
@schneefisch
schneefisch / secure_delete.sh
Last active September 14, 2020 09:03
Delete files securely
#!/usr/bin/env bash
# securely overwrite data (default: 3 iterations of random data)
shred -v <path_to_your_file>
# only overwrite once with zeros
shred -vzn 0 <path_to_your_file>
# alternative, for also securely deleting directories
@schneefisch
schneefisch / openssl_basics.md
Last active November 15, 2022 14:05
Basic usage for OpenSSL

OpenSSL Basics

Certificate information

Print certificate information. Works for .pem, .crt, .cer formats

openssl x509 -text -noout -in <domain.crt>

Print private-key information: