Skip to content

Instantly share code, notes, and snippets.

kubectl get pods -n kube-system | \
grep Evicted | \
awk '{print $1}' | \
xargs kubectl delete pod -n kube-system
@laggage
laggage / ssh-autocomplete.sh
Created January 11, 2022 02:52
ssh autocomplete
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
@laggage
laggage / .bash-proxy-config.sh
Last active September 27, 2021 16:43
配置终端开启代理
!#/bin/sh
export http_proxy=http://127.0.0.1:10809
export https_proxy=$http_proxy
export all_proxy=socks5://127.0.0.1:10808
export ALL_PROXY=$all_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export no_proxy="127.0.0.1, localhost"
@laggage
laggage / update-browser-url-and-not-reload.ts
Last active July 2, 2021 03:33
js更新浏览器地址栏但是不刷新页面
// 更新浏览器地址栏但是不刷新页面
window.history.pushState(
{},
document.title,
window.location.origin + '?v=2')
);