Skip to content

Instantly share code, notes, and snippets.

Avatar

Ticiano Herrera Ticiano-mw

View GitHub Profile
@Ticiano-mw
Ticiano-mw / cheatsheet-elasticsearch.md
Created Aug 5, 2021 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
View cheatsheet-elasticsearch.md
@fauberso
fauberso / kubernetes-gencerts.sh
Created May 11, 2020
Generates self-signed tls secrets for kubernetes. Run this with e.g. 'kubernetes-gencerts microk8s.local', then install the secrets with 'kubectl apply -f microk8s.local.yaml'
View kubernetes-gencerts.sh
#!/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
terraform {
required_version = ">=0.12, <0.13"
}
@epcim
epcim / kubernetes_pods_docker_disk_usage.md
Last active Aug 18, 2022
docker disk space introspection kubernetes docker overlay
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

@superseb
superseb / cleanup.sh
Last active Sep 30, 2022
Cleanup host added as custom to Rancher 2.0
View cleanup.sh
#!/bin/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
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active Sep 27, 2022
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
View cheatsheet-elasticsearch.md
@subfuzion
subfuzion / curl.md
Last active Oct 2, 2022
curl POST examples
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