Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@fffonion
fffonion / goo-proxy.conf
Created November 28, 2014 09:21
Google service redirect @nginx ver
access_log /var/log/nginx/google_proxy-access.log combined;
####sn-nx57
server {
listen 80;
server_name ~^r.+yn7s.c.android.clients.google.com$;
server_name ~^r.+yn7s.c.pack.google.com$;
location / {
proxy_pass http://173.194.56.9:80/;
@fffonion
fffonion / wiki_movie_names.py
Last active August 29, 2015 14:12
get original name of movies
#encoding:utf-8
import httplib2
import lxml.html as lhtml
import re
import os
import urllib
import sys
import gzip
reload(sys)
sys.setdefaultencoding('utf-8')
@fffonion
fffonion / vmstat.php
Created April 14, 2015 10:59
VPS all-in-one graph page for SolusVM and KiwiVM
<html>
<head><title>vmstat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
<body>
<?php
$simple = isset($_GET['simple'])?true:false;
function reasonable_size($s){
if($s<1000)
return $s."B";
else if($s<1024000)
@fffonion
fffonion / hosts
Created July 2, 2015 02:06
non 443 https redirect
# NOTE: THESE IPs HAVE ALL BEEN BLOCKED!
#216.58.216.14 -> *.google.com 3C8CE9507B1446C4 !4f7b1fca5b53588ecfe8c9f80bf8ef90!
#74.125.224.55 -> *.google.com, search
#216.58.217.193 -> *.googleusercontent.com
#216.58.216.138 -> *.googleapis.com 671AD610CD1A06CC !3814002429ed18bc84fc3a563a33589b!
#twitter
199.16.158.106 twitter.com
199.16.158.106 m.twitter.com

Keybase proof

I hereby claim:

  • I am fffonion on github.
  • I am fffonion (https://keybase.io/fffonion) on keybase.
  • I have a public key ASA8PXP8Ep5phLmxxpUdfJIS4tlX1lGZlmmPZ2fSm0u77go

To claim this, I am signing this object:

@fffonion
fffonion / result.md
Created September 23, 2015 22:57
testing gcc optimization options
args run_time
-Dfoo 1.942
-ftree-sink SAME
-fauto-inc-dec SAME
-fcrossjumping 1.925
-fif-conversion SAME
-faggressive-loop-optimizations SAME
-fconserve-stack SAME
-ftree-vrp SAME
@fffonion
fffonion / Readme.MD
Last active October 5, 2015 18:45
ARM emulator
@fffonion
fffonion / result.md
Created October 5, 2015 23:39
Reserved for CA assignment 2

(empty)

@fffonion
fffonion / issue.net
Last active December 20, 2018 23:26
FBI Warning SSH banner
\[033[1;37;41m FBI WARNING \[033[0m
Federal law provides severe civil and criminal penalties for
the unauthorized reproduction,distribution,or exhibition of
copyrighted motion prictures(Title 17,United States Code,
Sections 501 and 508).The federal bureau of Investigation
investigate allegations of criminal copyright infringement.
(Title 17,United States Code,Section 506)
@fffonion
fffonion / nginx-unzip-module_good.patch
Last active November 27, 2016 06:32
nginx-unzip-module, NODIR, NOCASE mod
diff --git a/ngx_http_unzip_module.c b/ngx_http_unzip_module.c
index 771e1dc..00ea0f1 100644
--- a/nginx-unzip-module/ngx_http_unzip_module.c
+++ b/nginx-unzip-module/ngx_http_unzip_module.c
@@ -224,7 +224,7 @@ static ngx_int_t ngx_http_unzip_handler(ngx_http_request_t *r)
zip_stat_init(&zip_st);
/* let's check what's the size of a file. return 404 if we can't stat file inside archive */
- if (0 != zip_stat(zip_source, unzipextract_path, 0, &zip_st)) {
+ if (0 != zip_stat(zip_source, unzipextract_path, ZIP_FL_NODIR|ZIP_FL_NOCASE, &zip_st)) {