代理切换
1 | export PROXY_URI=127.0.0.1:7890 |
简单的命令行选项
1 | while [[ "${@}" != 0 ]]; do |
Confirm
1 | confirm() { |
文件前后写
1 | cat file | { |
换 apt 源
1 | src="http://mirrors.tuna.tsinghua.edu.cn/ubuntu/" |
- 原始源 http://archive.ubuntu.com/ubuntu/
- 阿里源 http://mirrors.aliyun.com/ubuntu/
- 中科大源 https://mirrors.ustc.edu.cn/ubuntu/
- 163 源 http://mirrors.163.com/ubuntu/
Aliases
1 | exists() { |
终端颜色
1 | declare -rA fg=( [black]="\e[30m" [red]="\e[31m" [green]="\e[32m" [yellow]="\e[33m" [blue]="\e[34m" [magenta]="\e[35m" [cyan]="\e[36m" [white]="\e[37m" [gray]="\e[90m" ) |
Prompt
1 | # bash 与 zsh 可通用 |
Are You In China?
1 | curl -fsS "https://www.ip.cn/ip/$(curl -fsS ipv4.ip.sb).html" | grep "中国" &>> /dev/null |