最近折腾Mac,总结下填过的坑。
Zsh
Bash看久了就想换一个,正好看到了Zsh,果断更换之。
Mac已经自带了Zsh,所以直接上 Oh My Zsh
1
2
3
4
5
6
|
#检查版本
$ zsh --version
#Homebrew
$ brew install zsh
#curl
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
基本配置
打开配置文件
vim ~/.zshrc
更改主题
ZSH_THEME="ys"
安装插件
检查已安装插件
ls ~/.oh-my-zsh/plugins/
推荐插件:
z
自带插件,添加到配置文件中即可启用,可以帮助你快速跳转到访问过的文件夹。参考文档
zsh-syntax-highlighting
输入正确的常用命令会以绿色高亮显示,输入错误则会显示其他的颜色。
1
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
zsh-autosuggestions
输入命令时,会用浅色字体给出建议的命令,按 →
即可自动补全。
1
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
安装:定位到 plugins
一行,在括号中添加需要的插件名称,以空格分隔。
更新配置文件
Error
升级oh_my_zsh报错:
“oh my zsh Cannot pull with rebase: You have unstaged changes. Please commit or stash them. There was an error updating. Try again later?”
1
2
3
4
|
$ cd ~/.oh-my-zsh/
$ git add .
$ git commit -m "commit message"
$ upgrade_oh_my_zsh
|
SSH
备份命令
1
2
3
4
5
6
7
8
9
10
11
12
|
#SSH
$ ssh -p 22 root@*.*.*.*
#Centos安装wget
$ yum -y install wget
#Centos安装 Curl
$ yum update -y && yum install curl -y
#Debian/Ubuntu 安装 wget
$ apt-get install wget
#Ubuntu/Debian 安装 Curl
$ apt-get update -y && apt-get install curl -y
#BBR加速
$ chmod +x tcp.sh && ./tcp.sh
|
v2ray
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#开启80、443端口
$ firewall-cmd --zone=public --add-port=80/tcp --permanent
$ firewall-cmd --zone=public --add-port=443/tcp --permanent
#重启防火墙
$ firewall-cmd --reload
#Vmess + websocket + TLS + Nginx +网站
$ wget -N --no-check-certificate -q -O install.sh "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh" && chmod +x install.sh && bash install.sh
#启动 V2Ray
$ systemctl start v2ray
#启动 Nginx
$ systemctl start nginx
#开机自动启动 V2Ray
$ systemctl enable v2ray
#开机自动启动 Nginx
$ systemctl enable nginx
#升级V2Ray core
# bash <(curl -L -s https://install.direct/go.sh)
|
SSR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#一键安装版本,致谢teddysun
$ wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh
$ chmod +x shadowsocks-all.sh
$ ./shadowsocks-all.sh
# 编辑配置文件
$ vi /etc/shadowsocks/config.json
#SSX
$ 启动:/etc/init.d/shadowsocks-x start
$ 停止:/etc/init.d/shadowsocks-x stop
$ 重启:/etc/init.d/shadowsocks-x restart
$ 状态:/etc/init.d/shadowsocks-x status
#BBR加速
$ wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh
$ chmod +x bbr.sh
$ ./bbr.sh
#BBR检查
$ sysctl net.ipv4.tcp_available_congestion_control # ~ = bbr cubic reno
$ sysctl net.ipv4.tcp_congestion_control # ~ = bbr
$ sysctl net.core.default_qdisc # ~ = fq
$ lsmod | grep bbr # tcp_bbr ~
#查询系统内核
$ uname -r
#CentOS6 x64 系统安装锐速
$ wget --no-check-certificate -O appex.sh https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh && bash appex.sh install '2.6.32-642.el6.x86_64'
#查看运行状态
$ /appex/bin/serverSpeeder.sh status
#启动锐速
$ /appex/bin/serverSpeeder.sh start
#停止锐速
$ /appex/bin/serverSpeeder.sh stop
#重启锐速
$ /appex/bin/serverSpeeder.sh restart
#卸载锐速
$ /appex/bin/serverSpeeder.sh uninstall
|