This file contains 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 characters
#!/bin/bash | |
read_dir() { | |
for item in $(ls $1) | |
do | |
if [ -d $1"/"$item ];then | |
read_dir $1"/"$item | |
else | |
file=$1"/"$item | |
suffix=${file##*.} |
This file contains 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 characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains 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 characters
[Unit] | |
Description=Shadowsocks Server | |
After=network.target | |
[Service] | |
User=nobody | |
Group=nobody | |
ExecStart=/usr/bin/ssserver --pid-file /var/run/shadowsocks/redir.pid -c /etc/shadowsocks.json | |
Restart=on-failure | |
ExecReload=/bin/kill -HUP $MAINPID |
This file contains 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 characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# 有关 Fiber 的解释: (按照数据流的方向分为两部分) | |
# 在 `主线程' 中使用 resume 方法来启动(或继续执行)一个 `纤程'. | |
# 1. 第一次调用 fiber.resume, 会启动一个纤程, | |
# 如果 resume 调用时提供了实参, 会作为代码块形参传入代码块. | |
# 2. 如果非第一次调用 fiber.resume, 即, `恢复' 一个纤程, 会做两件事: | |
# - 从上次离开纤程的那个位置(调用 Fiber.yield 离开纤程的那个位置), 恢复纤程的执行. |