Skip to content

Instantly share code, notes, and snippets.

View leonGravel's full-sized avatar
🕹️
Ctrl + C & Ctrl + V

leonGravel

🕹️
Ctrl + C & Ctrl + V
View GitHub Profile
function proxy_off(){
unset http_proxy
unset https_proxy
echo -e "已关闭代理"
}
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export http_proxy="http://127.0.0.1:8118"
export https_proxy=$http_proxy
@leonGravel
leonGravel / login.sh
Last active March 8, 2020 13:46
Connect to the server remotely
#!/usr/bin/expect -f
set user root
set host xxx.36.xxx.142
set password xxxxxxxx
set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof