惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
博客园 - Franky
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 叶小钗
罗磊的独立博客
The GitHub Blog
The GitHub Blog
H
Help Net Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
N
Netflix TechBlog - Medium
T
The Exploit Database - CXSecurity.com
云风的 BLOG
云风的 BLOG
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
T
Threatpost
T
Threat Research - Cisco Blogs
Recent Announcements
Recent Announcements
T
Tor Project blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
量子位
V
V2EX
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Proofpoint News Feed
I
Intezer
Schneier on Security
Schneier on Security
雷峰网
雷峰网
B
Blog RSS Feed
Jina AI
Jina AI
爱范儿
爱范儿
Attack and Defense Labs
Attack and Defense Labs
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
美团技术团队
博客园 - 【当耐特】

herrkaefer

"Vibe planning \u003e vibe coding" "Anything to Markdown" "Built anocus: anonymous commenting for static sites" "日记与小说 -- AI 续写小说欣赏" "Any-podcast: from newsletters to a podcast" "Made MicPipe: a simple voice input tool using ChatGPT dictation" "关于 Tools 和 Skills 的一点感想" "Realtime monitoring of ComEd hourly price" "Introducing SwiftEdgeTTS" "Thoughts on the philosophy of building AI-native apps" "jelly鼻屎" "等饭的人" "Use home assistant to motivate my kid to brush teeth" "Migrated Blog to Hugo and Cloudflare Pages" "Easy Aspen monitoring for Chicago parents" "Introducing HabitBuilder: A simple Telegram bot for habit tracking" "鼓捣" "Open folder or file with Sublime Text from Finder toolbar" "Python dev workflow on macOS" "Create new text file from Finder toolbar" "Uno reinvented for 3-year-old kids" "Uno变身儿童数字游戏" "自动转发Twitter到微博" "Handle annoying operations of objects in Realm DB" "Move Jekyll blog to Ubuntu VPS" "Introducing Mole" "Note taking without note taking app" "Deploy Python web application on Ubuntu server" "Linode Notes - Basic Setup" "CLASS Style Adapted for Embedded Systems" "psycopgr Tutorial" "pgRouting Notes" "PostgreSQL Notes" "阿城三王" "这一年,这一把日子" "另一面的发现——读《坟》" "定理" "封面与腰封" "Google book下载" "lulu最新写真出炉" "The Big Bang Theory第三季" "自拍婚纱照1" "日全食" "期待动画片" "《麦兜响当当》动画电影主题曲" "转:饶毅--“杂志拜物教”:何时发Cell Nature Science 论文害你" "转:饶毅--提醒年轻人:何时SCI害你?" "西安" "3d打印机" "Dropbox" "刷牙" "贴几张照片" "6156167" "永久和凤凰" "老板的想法" "春" "原来奥巴马也是个朗读者" "应邀发Freeware List 2.0" "史上最能睡的淘宝老板" "至少出名的效果是达到了" "错怪了msn" "独立游戏节2009" "114" "馒头" "Crayon Physics Deluxe" "2008,2009" "盖章记" "小虎队附身许巍" "怎么给word文档加索引:排序问题" "怎么给word文档加索引Q\u0026amp;A" "怎么给Word文档加索引" "教我如何不疯掉" "二则" "P" "哦!报告" "蓝天" "萧翰" "lm" "故宫印象" "转:美国历任总统像" "time can kill itself" "嗯" "建议,只是建议哦" "奥地利行记3" "奥地利行记2" "奥地利行记1" "叶子" "GayBoy" "天使教你扔frisbie" "门徒因何面容愁?" "手机教堂" "丝竹管弦之盛" "残奥" "争座位" "秋意浅" "总理府" "流觞曲水" "映带左右引以为" "咚咚咚 续" "茂林修竹又有"
"Setup Shadowsocks / VPN on Ubuntu Server"
"herrkaefer" · 2016-10-06 · via herrkaefer

image

(Environment: Ubuntu 16.04 LTS installed on VPS such as Linode)

Install and run Shadowsocks on server

I put the following process into a shell script. Check this “one-click” method: giraffe

Install Shadowsocks

Update packages:




sudo apt-get update && apt-get upgrade

Install pip and m2crypto:




sudo apt-get install python-pip



sudo apt-get install python-m2crypto

Install shadowsocks:




pip install setuptools



pip install shadowsocks

If locale error happens:

Configue Shadowsocks

Create a config file /etc/shadowsocks.json as:

For single user:




{



"server": "my_server_ip",



"server_port": 8388,



"local_address": "127.0.0.1",



"local_port": 1080,



"password": "mypassword",



"timeout": 300,



"method": "aes-256-cfb",



"fast_open": false



}

For multiple users:




{



"server": "0.0.0.0",



"port_password": {



"8381": "ps1",



"8382": "ps2",



"8383": "ps3",



"8384": "ps4"



},



"timeout": 300,



"method": "aes-256-cfb"



}

Start Shadowsocks server

Run shadowsocks server as daemon:




ssserver -c /etc/shadowsocks.json -d start

Stop SS server:




ssserver -c /etc/shadowsocks.json -d stop

Restart:




ssserver -c /etc/shadowsocks.json -d restart

Auto start after system reboot

You can start SS server manually with the above command every time the system powers on, or find a way to let it auto started.

There is a method: add the above start command in /etc/rc.local before exit 0 line. However it does not work for me and I don’t know why.

Supervisor can do this job.

Install supervisor:




sudo apt-get install supervisor

Create a supervisor config file /etc/supervisor/conf.d/shadowsocks.conf with contents:




[program:shadowsocks]



command=ssserver -c /etc/shadowsocks.json -d start



autostart=true



autorestart=true



user=root



log_stderr=true



logfile=/var/log/shadowsocks.log

Then start (or restart) supervisor:




sudo service supervisor start

And the server part is done.

Update kernel and install BBR acceleration (for kernel version < 4.9)

ref: 一键安装最新内核并开启 BBR 脚本

Check kernal version




wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh



chmod +x bbr.sh



./bbr.sh

Mac client

Download: ShadowsocksX

Automatically update pac file

(Problem: ShadowsocksX client update pac file from GFWList failed.)

Download a shell script from here and name it update_gfwlist.sh.




chmod +x update_gfwlist.sh



mv update_gfwlist.sh /usr/local/bin

Then you can manually run update_gfwlist.sh, or schedule a daily job:




export EDITOR=nano



crontab -e

and add a line:




# Update GFWList PAC file for ShadowsocksX at 10:30 everyday



30 10 * * * sh /usr/local/bin/update_gfwlist.sh

This will automatically update the file ~/.ShadowsocksX/gfwlist.js everyday at 10:30 am.

iTerm

Using Shadowsocks with Command Line Tools

iOS client

Wingy

Thanks to NEKit, there’s perfect way for iOS user.

> Wingy - Http(s),Socks5 Proxy Utility 作者是 SMART LIMITED

>

> App Store: Wingy

(This approach is not recommended now)

For iOS, the following method is OK for home use if you have an idle or long-time working Mac.

Step 1: make Mac a http proxy with privoxy

Edit config file: /usr/local/etc/privoxy/config:

  • line “forward-socks5t / …” -> “forward-socks5t / 127.0.0.1:1080”

  • line “listen-address 127.0.0.1:8118” -> “listen-address 0.0.0.0:6666” (6666 is a custom unused port)

Start privoxy:




/usr/local/sbin/privoxy --no-daemon /usr/local/etc/privoxy/config &amp;

Step 2: make Mac a pac server

Make a folder to be served by nginx and copy the pac file into it:




mkdir /usr/local/share/pac



cp ~/.ShadowsocksX/gfwlist.js /usr/local/share/pac/proxy.pac

Edit proxy.pac, change the line “var proxy = …” to:




var proxy = "PROXY [IP_of_Mac]:6666; DIRECT;";

Note that 6666 is the port you configured for privoxy.

Then add a nginx configuration file in /usr/local/etc/nginx/servers:




server {



listen       8000;



location / {



root   /usr/local/share/pac;



index  index.html index.htm;



}



}

Start nginx:




brew services start nginx

On iPhone, in WiFi’s http proxy auto mode, add:




http://[IP_of_Mac]:8000/proxy.pac

We can also fix the IP of Mac by configuring the router.

Install and running IPsec VPN server

IPsec VPN 服务器一键安装脚本