-
-
Save xuyuji9000/fdb7166ccd2c296ccddcc524e64775d1 to your computer and use it in GitHub Desktop.
Revisions
-
zhiguangwang revised this gist
Jun 13, 2019 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,7 +55,11 @@ ## Use TCP BBR This will enable TCP BBR congestion control algorithm to improve network bandwidth utilization (10x improvement is not uncommon). ### Install linux kernel 4.9 Note: do this only if the distribution comes with a older kernel version. ``` URL=http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.9/linux-image-4.9.9-040909-generic_4.9.9-040909.201702090333_amd64.deb @@ -64,7 +68,11 @@ wget $URL sudo dpkg -i $(basename $URL) sudo reboot ``` ### Enable TCP BBR ``` SYSCTL_CONF=/etc/sysctl.d/60-tcp-bbr.conf echo "net.core.default_qdisc=fq" | sudo tee $SYSCTL_CONF echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a $SYSCTL_CONF -
zhiguangwang revised this gist
Jun 8, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,8 @@ "server_port": "[port]", "password": "[password]", "timeout": 300, "method": "xchacha20-ietf-poly1305", "mode": "tcp_only", "fast_open": true, "nameserver": "8.8.8.8" } -
zhiguangwang revised this gist
Jan 5, 2018 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,9 +65,10 @@ sudo dpkg -i $(basename $URL) sudo reboot SYSCTL_CONF=/etc/sysctl.d/60-tcp-bbr.conf echo "net.core.default_qdisc=fq" | sudo tee $SYSCTL_CONF echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a $SYSCTL_CONF sudo sysctl -p $SYSCTL_CONF sysctl net.ipv4.tcp_available_congestion_control sysctl net.ipv4.tcp_congestion_control -
zhiguangwang revised this gist
Feb 26, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ 1. Restart the `shadowsocks-libev` service. sudo systemctl restart shadowsocks-libev sudo systemctl status shadowsocks-libev ## 16.04 xenial -
zhiguangwang revised this gist
Feb 26, 2017 . 1 changed file with 24 additions and 38 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,69 +2,55 @@ ## 16.10 yakkety and above 1. Install the the `shadowsocks-libev` package from apt repository. sudo apt update sudo apt install shadowsocks-libev 1. Save `ss.json` as `/etc/shadowsocks-libev/config.json`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Restart the `shadowsocks-libev` service. sudo systemctl restart shadowsocks-libev ## 16.04 xenial 1. Install shadowsocks with pip. sudo apt update sudo apt install python-pip sudo pip install shadowsocks 1. Save `ss.json` under `/etc/shadowsocks/`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Save `ssserver.service` under `/usr/lib/systemd/system/` 1. Enable the systemd service. sudo systemctl enable ssserver sudo systemctl start ssserver sudo systemctl status ssserver ## 14.04 trusty 1. Install shadowsocks with pip. sudo apt-get update sudo apt-get install python-pip sudo pip install shadowsocks 1. Save `ss.json`, `start.sh`, `stop.sh` under `/etc/shadowsocks/`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Put the following in `/etc/rc.local` to start **ssserver** upon server start. # Start shadowsocks server /etc/shadowsocks/start.sh ## Use TCP BBR -
zhiguangwang revised this gist
Feb 26, 2017 . 2 changed files with 37 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,35 @@ # Installing and running shadowsocks on Ubuntu Server ## 16.10 yakkety and above Use the `shadowsocks-libev` package. 1. Install the the `shadowsocks-libev` package from apt repository. ``` sudo apt update sudo apt install shadowsocks-libev ``` 1. Put `ss.json` as `/etc/shadowsocks-libev/config.json`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Restart the `shadowsocks-libev` service: ``` sudo systemctl restart shadowsocks-libev ``` ## 16.04 xenial (with Systemd) 1. Install shadowsocks with pip: ``` sudo apt update sudo apt install python-pip sudo pip install shadowsocks ``` 1. Put `ss.json` under `/etc/shadowsocks/`. @@ -18,9 +45,15 @@ sudo systemctl start ssserver sudo systemctl status ssserver ``` ## 14.04 trusty (without Systemd) 1. Install shadowsocks with pip: ``` sudo apt-get update sudo apt-get install python-pip sudo pip install shadowsocks ``` 1. Put `ss.json`, `start.sh`, `stop.sh` under `/etc/shadowsocks/`. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ -
zhiguangwang revised this gist
Feb 11, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,6 +48,7 @@ sudo reboot echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf sudo sysctl -p sysctl net.ipv4.tcp_available_congestion_control sysctl net.ipv4.tcp_congestion_control lsmod | grep bbr -
zhiguangwang revised this gist
Feb 11, 2017 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,4 +31,24 @@ sudo systemctl status ssserver ```shell # Start shadowsocks server /etc/shadowsocks/start.sh ``` ## Use TCP BBR This will install linux kernel 4.9 and enable TCP BBR congestion control algorithm to improve network bandwidth utilization (10x improvement is not uncommon). ``` URL=http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.9/linux-image-4.9.9-040909-generic_4.9.9-040909.201702090333_amd64.deb wget $URL sudo dpkg -i $(basename $URL) sudo reboot echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf sudo sysctl -p sysctl net.ipv4.tcp_available_congestion_control sysctl net.ipv4.tcp_congestion_control lsmod | grep bbr ``` -
zhiguangwang revised this gist
Feb 8, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ 1. Run the following commands: ``` sudo systemctl enable ssserver sudo systemctl start ssserver sudo systemctl status ssserver -
zhiguangwang revised this gist
Feb 7, 2017 . 2 changed files with 32 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,25 @@ # Installing and running shadowsocks on Ubuntu Server ## On Ubuntu Server 16.04 (with Systemd) 1. Run `install.sh` to install Shadowsocks. 1. Put `ss.json` under `/etc/shadowsocks/`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Put `ssserver.service` under `/usr/lib/systemd/system/` 1. Run the following commands: ```shell sudo systemctl enable ssserver sudo systemctl start ssserver sudo systemctl status ssserver ``` ## On Ubuntu Server 14.04 (without Systemd) 1. Run `install.sh` to install Shadowsocks. 1. Put `ss.json`, `start.sh`, `stop.sh` under `/etc/shadowsocks/`. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ [Unit] Description=Daemon to start shadowsocks server Wants=network-online.target After=network.target [Service] Type=simple ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss.json -qq User=nobody [Install] WantedBy=multi-user.target -
zhiguangwang revised this gist
Feb 7, 2017 . 3 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,13 @@ 1. Run `install.sh` to install Shadowsocks. 1. Put `ss.json`, `start.sh`, `stop.sh` under `/etc/shadowsocks/`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Put the following in `/etc/rc.local` to start **ssserver** upon server start. ```shell # Start shadowsocks server /etc/shadowsocks/start.sh ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ #!/bin/bash sudo /usr/local/bin/ssserver -c /etc/shadowsocks/ss.json --user nobody -qq -d start This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ #!/bin/bash sudo /usr/local/bin/ssserver -c /etc/shadowsocks/ss.json -d stop -
zhiguangwang renamed this gist
Feb 7, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
zhiguangwang renamed this gist
Feb 7, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
zhiguangwang revised this gist
Apr 22, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ { "server": "0.0.0.0", "server_port": "[port]", "password": "[password]", "timeout": 300, "method": "aes-256-cfb", -
zhiguangwang revised this gist
Apr 8, 2016 . 6 changed files with 33 additions and 45 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # Installing and running shadowsocks on Ubuntu Server 1. Run `install.sh` to install Shadowsocks. 1. Put `ss.json`, `start.sh`, `stop.sh` under `/var/shadowsocks/`. 1. Replace **server_port** and **password** in `ss.json` with your own choices. 1. Put the following in `/etc/rc.local` to start **ssserver** upon server start. ```shell # Start shadowsocks server /var/shadowsocks/start.sh ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ #!/bin/bash sudo apt-get update sudo apt-get install python-pip sudo pip install shadowsocks This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,45 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ { "server": "0.0.0.0", "server_port": [port], "password": "[password]", "timeout": 300, "method": "aes-256-cfb", "fast_open": true } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ #!/bin/bash sudo /usr/local/bin/ssserver -c /var/shadowsocks/ss.json --user nobody -qq -d start This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ #!/bin/bash sudo /usr/local/bin/ssserver -c /var/shadowsocks/ss.json -d stop -
zhiguangwang revised this gist
Mar 15, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,6 +33,7 @@ stop.sh ```shell #!/bin/bash sudo /usr/local/bin/ssserver -d stop ``` -
zhiguangwang revised this gist
Mar 15, 2016 . 1 changed file with 12 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,14 +21,24 @@ ss.json } ``` start.sh ```shell #!/bin/bash sudo /usr/local/bin/ssserver -c /var/shadowsocks/ss.json --user nobody -qq -d start ``` stop.sh ```shell #!/bin/bash sudo /usr/local/bin/ssserver -d stop ``` Invoke `start.sh` in `/etc/rc.local` ```shell # Start shadowsocks server /var/shadowsocks/start.sh ``` -
zhiguangwang revised this gist
Feb 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ ss.json Start ```shell sudo /usr/local/bin/ssserver -c /var/shadowsocks/ss.json --user nobody -qq -d start ``` Stop -
zhiguangwang revised this gist
Feb 16, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ Install (Ubuntu Server) ```shell sudo apt-get update sudo apt-get install python-pip sudo pip install shadowsocks ``` -
zhiguangwang revised this gist
Feb 2, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,11 +23,11 @@ ss.json Start ```shell sudo /usr/local/bin/ssserver -c /var/shadowsocks/ss.json --user nobody -d start ``` Stop ```shell sudo /usr/local/bin/ssserver -d stop ``` -
zhiguangwang created this gist
Feb 2, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ Install (Ubuntu Server) ```shell sudo apt-get install python-pip sudo pip install shadowsocks ``` Configuration ss.json ```json { "server": "0.0.0.0", "server_port": [port], "password": "[password]", "timeout": 300, "method": "aes-256-cfb", "fast_open": true } ``` Start ```shell sudo ssserver -c /var/shadowsocks/ss.json --user nobody -d start ``` Stop ```shell sudo ssserver -d stop ```