Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
for ns in $(kubectl get ns -o name | cut -d'/' -f2); do | |
for pod in $(kubectl get pods -n $ns --field-selector=status.phase!=Running -o name | cut -d'/' -f2); do | |
kubectl delete pod -n $ns $pod | |
done | |
for rs in $(kubectl get rs -n "$ns" -o name | cut -d'/' -f2); do | |
kubectl delete rs -n $ns $rs | |
done | |
done | |
kubectl get pods -A && kubectl top pods -A && kubectl top node |
iperf3
serverwg-quick down wg0
/etc/wireguard/wg0.conf
file#!/usr/bin/env bash | |
NODESAPI=/api/v1/nodes | |
function getNodes() { | |
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name' | |
} | |
function getPVCs() { | |
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\ |
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V TaskbarGlomLevel /T REG_DWORD /D 2 /F | |
taskkill /f /im explorer.exe | |
start explorer.exe |
#!/usr/bin/env bash | |
cd ~/ | |
mkdir -p ~/.local/bin | |
wget "https://discordapp.com/api/download/canary?platform=linux&format=tar.gz" -O discord.tar.gz | |
tar -xvf discord.tar.gz -C ~/.local/bin | |
sudo ln -s ~/.local/bin/DiscordCanary/discord.png /usr/share/icons/discord.png | |
sudo ln -s ~/.local/bin/DiscordCanary/DiscordCanary /usr/bin | |
wget https://gist.githubusercontent.com/AdrianKoshka/a12ca0bfe2f334a9f208aff72f8738c3/raw/9d606ad7ce7cc1dd23f6a99993e2396540538a02/discord.desktop -O discord.desktop | |
mkdir -p ~/.local/share/applications/ | |
mv ~/discord.desktop ~/.local/share/applications/ |
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
MY_BASH_BLUE="\033[0;34m" #Blue | |
MY_BASH_NOCOLOR="\033[0m" | |
HISTTIMEFORMAT=`echo -e ${MY_BASH_BLUE}[%F %T] $MY_BASH_NOCOLOR ` | |
HISTSIZE=20000 | |
HISTFILESIZE=20000 |
# Check CAP support in Kernel | |
cat /proc/config.gz | gunzip | grep CAPABILITY | |
/sbin/capsh --print | |
# Set CAP on core binary | |
sudo setcap cap_net_raw,cap_net_admin+eip /usr/bin/dumpcap | |
# Add current user to Wireshark group | |
sudo usermod -aG wireshark $USER |