apiVersion: v1
kind: Pod
metadata:
name: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
# Just spin & wait forever
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
Discover k8s resources | |
``` | |
kubectl api-resources | |
``` | |
Fetch resource schemas | |
``` | |
kubectl explain replicaset --recursive | |
``` |
Dump http parsed messages
tcpdump -A -vv 'port 8086'
FOO=${VARIABLE:-default} # If variable not set or null, use default.
FOO=${VARIABLE:=default} # If variable not set or null, set it to default.
sed 's/,/,\n/g' bigdata2.txt > bigdata2_formatted.txt
cat bigdata2_formatted.txt | grep label | awk -F ":" '{print $2}' | sort | uniq -c
Useful Default Configurations
# git push by default pushes all matching branches upstream, options simple will just push the current branch
git config --global push.default simple
# git pull by default do a fetch and merge, introduces a merge commit, instead use a 'git pull --rebase' as default
git config --global pull.rebase true
# Configure ReReRe (Reuse Recorded Resolution)
git config --global rerere.enabled true
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
# Single Quote ('') vs Double Quote("") | |
Enclosing characters in single quotes (‘'’) preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. | |
[https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html#Double-Quotes] | |
# Sort directories by size and print | |
du -h --max-depth=1 | sort -hr | |
# Setup ssh key based access | |
ssh-copy-id user@host |
Print JVM defaults
java -XX:+PrintFlagsFinal
Print System Properties
jcmd process_id VM.system_properties
Print JVM tuning flags
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
/** | |
Instructions: | |
1) Open flink console | |
2) Open javascript console in the browser | |
3) Paste this script | |
4) When required call flinkSummary() | |
**/ | |
// Import axios javascript | |
if (!document.getElementById("axios_script_id")) { |
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
# Set the base index for windows to 1 instead of 0 | |
set -g base-index 1 | |
# Set the base index for panesl to 1 instead of 0 | |
setw -g pane-base-index 1 | |
# Reload tmx configuration | |
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf!" | |
# Ensure we can send Ctrl+b to other apps |
NewerOlder