My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
View kubernetes-gencerts.sh
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 | |
HOSTNAME=${1:-localhost} | |
openssl req -newkey rsa:2048 -nodes -keyout $HOSTNAME.key -x509 -days 3650 -out $HOSTNAME.crt | |
echo "apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: $HOSTNAME.tls | |
namespace: default | |
type: kubernetes.io/tls | |
data: |
View config.tf
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
terraform { | |
required_version = ">=0.12, <0.13" | |
} |
View kubernetes_pods_docker_disk_usage.md
identify big pods/containers
investigage big files
DST=/mnt
find /var/lib -type f -size +1G -exec ls -lh {} \; | tee $DST/bigfiles_var_lib_$(date "+%H%M").log
find /var/lib -type f -size +1G -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' | sort -rh > $DST/bigfiles_var_lib_$(date "+%H%M").sorted.log
misbehave processes
View cleanup.sh
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/sh | |
# OUTDATED: please refer to the link below for the latest version: | |
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh | |
docker rm -f $(docker ps -qa) | |
docker volume rm $(docker volume ls -q) | |
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke" | |
for dir in $cleanupdirs; do | |
echo "Removing $dir" | |
rm -rf $dir | |
done |
View cheatsheet-elasticsearch.md
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
Shortlinks:
View curl.md
Common Options
-#, --progress-bar
Make curl display a simple progress bar instead of the more informational standard meter.
-b, --cookie <name=data>
Supply cookie with request. If no =
, then specifies the cookie file to use (see -c
).
-c, --cookie-jar <file name>
File to save response cookies to.
View README.md
MySQL
Getting started
- http://www.sqlteaching.com/
- https://www.codecademy.com/learn/learn-sql
- https://www.codecademy.com/catalog/language/sql
Related tutorials
View README.md
Git
Global Settings
- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
Reminder
Press minus + shift + s
and return
to chop/fold long lines!