Skip to content

Instantly share code, notes, and snippets.

# Device to be limited
DEVICE=eth0
# Average rate you want
RATE=500mbit
# Amount of burst data. I suggest RATE / 10
BURST=50mbit
tc qdisc del dev $DEVICE root
tc qdisc add dev %i root handle 1: tbf rate $RATE burst $BURST latency 1s
@ryd994
ryd994 / rclone_refresh.py
Last active June 8, 2017 16:06
Script to refresh ACD token with token from drivesink
#!/bin/env python
import json
import logging
import sys
import os
from six.moves import configparser
from datetime import datetime, timedelta
'''
Usage:
@ryd994
ryd994 / default.conf
Created June 20, 2016 19:57
nginx-default-reject.conf
server {
listen [::]:80 default_server ipv6only=off;
listen [::]:443 default_server ipv6only=off ssl;
ssl_certificate conf.d/default.crt;
ssl_certificate_key conf.d/default.key;
return 404;
}

原文

警告:请务必读完本文!全篇读完!

无论新老用户,都有可能掉进陷阱。 下面我们列出了常见的问题,并解释如何解决他们。 在 Freenode IRC 的 #nginx 频道,我们经常看到这些问题。

[TOC]

server {
listen unix:/var/run/nginx-gunzip.sock;
location / {
proxy_set_header Accept-Encoding gzip;
proxy_pass http://$host$request_uri;
gunzip on;
access_log off;
}
}