Skip to content

Instantly share code, notes, and snippets.

@zorchp
Created August 28, 2023 02:17
Show Gist options
  • Save zorchp/25294d515a717ebfcc59c9922946e16e to your computer and use it in GitHub Desktop.
Save zorchp/25294d515a717ebfcc59c9922946e16e to your computer and use it in GitHub Desktop.
centos bashrc with useful alias etc.
############### for proxy accelerate network ############################
# start_clash.sh: (may stdout in screen, you should use `nohup`)
: '
#!/bin/bash
./clash -d . &
'
alias vpn='cd ~/opt/clash && ./start_clash.sh && cd -'
alias uvpn='pkill -9 clash'
alias vv="export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890"
alias uv="unset https_proxy http_proxy all_proxy"
alias goo='curl -vvv google.com'
##########################################################################
## colorful prompt for bash prompt
export PS1='\[\033[01;36m\]\u@\h\[\033[01;32m\] \w \r\n\$\[\033[00m\] '
################## for firewall (optional) ############################
alias addtcp='func_tcp() { sudo firewall-cmd --zone=public --add-port=$1/tcp --permanent && sudo iptables -I INPUT -ptcp --dport $1 -j ACCEPT; };func_tcp'
alias addudp='func_udp() { sudo firewall-cmd --zone=public --add-port=$1/udp --permanent && sudo iptables -I INPUT -pudp --dport $1 -j ACCEPT; };func_udp'
alias reufw="sudo firewall-cmd --reload"
alias port_status='func_port_status() { sudo netstat -tunlp | grep $1 && sudo iptables -L -n --line-numbers | grep $1; }; func_port_status'
##########################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment