brew install tmux
Run tmux -CC or tmux -CC attach in iTerm2 and then menu is shown on terminal:
- ESC to detach
- C to run commands
- X to force quit
- L for log
| #!/bin/bash | |
| CRD_SUFFIX=${1} | |
| if [ -z "${CRD_SUFFIX}" ]; then | |
| echo "Missing CRD suffix" | |
| exit 1 | |
| fi | |
| echo "Removing CRDs with suffix ${CRD_SUFFIX}" |
| #!/bin/bash | |
| region=$(kubectl get nodes -o jsonpath="{.items[0].metadata.labels['topology\.kubernetes\.io/region']}") | |
| nodes=$(kubectl get nodes -o jsonpath="{.items[*].metadata.name}") | |
| for node in ${nodes[@]}; do | |
| ec2_instance_id=$(kubectl get nodes -o jsonpath="{.items[0].spec.providerID}" | cut -d "/" -f 5) | |
| echo "[INFO] Starting node '${node}' with instance ID '${ec2_instance_id}' in the '${region}' region" | |
| echo "[INFO] Draining node '${node}'" |
| #!/usr/bin/env sh | |
| # Example: ./download_minio.sh example.url.com username password bucket-name minio/path/to/file.txt.zst /download/path/to/file.txt.zst | |
| if [ -z $1 ]; then | |
| echo "You have NOT specified a MINIO URL!" | |
| exit 1 | |
| fi | |
| if [ -z $2 ]; then |
| #!/bin/sh | |
| tcpdump -i any -s 1500 '(tcp[((tcp[12:1] & 0xf0) >> 2)+5:1] = 0x01) and (tcp[((tcp[12:1] & 0xf0) >> 2):1] = 0x16)' -An | |
| # sudo tcpdump dst port 9443 -A |
| #!/bin/bash | |
| # How to run: `./backup_cluster.sh | tee export-$(date +%s).log` | |
| set -e | |
| if [ -n "${DEBUG}" ]; then | |
| set -x | |
| fi |
brew install tmux
Run tmux -CC or tmux -CC attach in iTerm2 and then menu is shown on terminal:
brew install tmux
Run tmux -CC or tmux -CC attach in iTerm2 and then menu is shown on terminal:
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: echo | |
| name: echo | |
| spec: | |
| ports: | |
| - port: 8080 | |
| name: high |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) | |
| func main() { |
| #!/bin/bash | |
| local template='lookup: %{time_namelookup}\nconnect: %{time_connect}\nappconnect: %{time_appconnect}\npretransfer: %{time_pretransfer}\nredirect: %{time_redirect}\nstarttransfer: %{time_starttransfer}\ntotal: %{time_total}\nhttp_code: %{http_code}\nnum_connects: %{num_connects}\nnum_redirects: %{num_redirects}\ntime_connect: %{time_connect}\ntime_namelookup: %{time_namelookup}\ntime_pretransfer: %{time_pretransfer}\ntime_starttransfer: %{time_starttransfer}\ntime_redirect: %{time_redirect}\ntime_total: %{time_total}\nsize_download: %{size_download}\nsize_upload: %{size_upload}\nspeed_download: %{speed_download}\nspeed_upload: %{speed_upload}' | |
| curl -L --output /dev/null --silent --show-error --write-out "${template}" ${@} | |