Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Michalec epcim

View GitHub Profile
View imapsync.md
View eksctl-config-us-west-2-managed.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eksctl-us-west-2-managed
region: us-west-2
vpc:
id: vpc-0b953326cd7a2f917
subnets:
@epcim
epcim / disable-ipv6.sh
Created Jul 1, 2020 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
View disable-ipv6.sh
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@epcim
epcim / systemd_loging.sh
Last active Jun 11, 2020
bash snippet for systemd logging functions
View systemd_loging.sh
#!/bin/bash
printf_stdin() { local stdin; read -d '' -u 0 stdin; printf "$@" "$stdin"; }
exec {log_fd}> >(systemd-cat -t $(basename $0))
log_emerg() { echo "EMERG: $1"|tee /dev/stderr| printf_stdin '<0>%s\n' "$1" >&"$log_fd"; }
log_alert() { echo "ALERT: $1"|tee /dev/stderr| printf_stdin '<1>%s\n' "$1" >&"$log_fd"; }
log_crit() { echo "CRIT: $1" |tee /dev/stderr| printf_stdin '<2>%s\n' "$1" >&"$log_fd"; }
log_err() { echo "ERROR: $1"|tee /dev/stderr| printf_stdin '<3>%s\n' "$1" >&"$log_fd"; }
log_warn() { echo "WARN: $1" |tee /dev/stderr| printf_stdin '<4>%s\n' "$1" >&"$log_fd"; }
@epcim
epcim / instructions.md
Created Mar 24, 2020 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)
View instructions.md

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret > keybase-private.key
@epcim
epcim / keybase.md
Created Mar 24, 2020 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key
View keybase.md

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@epcim
epcim / az.md
Last active Feb 19, 2020
Azure az queries
View az.md

Interesting Ops queris for Azure / AKS

Account, Subscription

az account list --query '[*].{Name:name}' --output table

Resource groups

List:

@epcim
epcim / indexer
Last active Feb 13, 2020
udev rules ordered interface
View indexer
#!/bin/sh
#if [ $# -lt 1 ]; then
# echo "Usage: $0 prefix [initial] [database/file] " >&2
# exit 1
#fi
key="${1:-"eth"}"
initial="${2:-0}"
datfile="${3:-/run/indexerdb_$key}"
@epcim
epcim / k8s_job_replay.sh
Last active Jan 7, 2020
kubernetes job
View k8s_job_replay.sh
kubectl get job -n sre kibana-config -o json | jq 'del(.spec.selector)' | jq 'del(.spec.template.metadata.labels)' | kubectl replace --force -f -
@epcim
epcim / kubernetes_pods_docker_disk_usage.md
Last active Oct 5, 2020
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

You can’t perform that action at this time.