My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
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: |
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" | |
} |
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
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 |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
- 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/
Press minus + shift + s
and return
to chop/fold long lines!