Skip to content

Instantly share code, notes, and snippets.

View lifei's full-sized avatar

李飛 lifei

View GitHub Profile
@fqrouter
fqrouter / worker nginx conf
Last active August 13, 2024 07:41
Youtube Reverse Proxy
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
add_header Content-Disposition "attachment; filename=video.mp4;";
}
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
@yenliangl
yenliangl / fontconfig.properties
Created July 23, 2012 04:24
Java's fontconfig.properties file for Windows 7
# %W% %E%
#
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Version
version=1
# Component Font Mappings
@jmkacz
jmkacz / thrift_service.py
Created May 22, 2012 19:38
my usage of TProcessPoolServer
import signal
def set_signal_handlers(server):
def clean_shutdown(signum, frame):
logging.info("Signal received: {0}".format(signum))
server.stop()
signal.signal(signal.SIGTERM, clean_shutdown)
signal.signal(signal.SIGINT, clean_shutdown)
server = TProcessPoolServer(processor, transport, tfactory, pfactory)