Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@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 / check_ssl.py
Last active August 8, 2021 23:22
hosts - A mix of working google, twitter, wikipedia ips and no-ads
from socket import socket, error, setdefaulttimeout
import ssl
import re
import time
import sys
import os
from hashlib import md5
import json
os.chdir(os.path.split(sys.argv[0])[0])
@fffonion
fffonion / luajit-ctyp-remember-self.patch
Created April 2, 2021 14:38
LuaJIT FFI avoid incoditionally function create patch
diff --git a/src/lib_ffi.c b/src/lib_ffi.c
index a29014e5..268c948c 100644
--- a/src/lib_ffi.c
+++ b/src/lib_ffi.c
@@ -494,6 +494,7 @@ LJLIB_CF(ffi_new) LJLIB_REC(.)
{
CTState *cts = ctype_cts(L);
CTypeID id = ffi_checkctype(L, cts, NULL);
+ printf("my type is %d\n", id);
CType *ct = ctype_raw(cts, id);
@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
import re
import time
def rfc822(s):
_ = re.findall("[A-z][a-z]+,\s*([^\+G]+)(?:$|\s([\+\-]*)(\d+|GMT))", s)
if not s:
print("%s is not RFC822 Date" % s)
return 0
dt, sgn, tz = _[0]
if tz == "GMT":
@fffonion
fffonion / youku-kux.py
Last active October 11, 2019 10:57
youku kux -> mkv
#coding:utf-8
from __future__ import print_function
import os
import sys
import struct
import math
TAG_TYPE = {
18:'SCRIPT',
9:'VIDEO',
@fffonion
fffonion / Apache Config
Last active August 7, 2019 06:02
Wiki Mirror 维基百科镜像,B64加密超链接防止撞墙 https://wc.yooooo.us ,附apache和nginx配置
#Redirect 301 ^/$ /search.htm
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<FilesMatch ".(gif|jpg|jpeg|png|ico|css|js)$">
Header unset Pragma
@fffonion
fffonion / changyan.py
Created June 13, 2019 02:52
畅言导出评论转换成导入评论格式
import json
import time
cmt = open('export.json').read()
cmt = json.loads(cmt)
print(len(cmt['comments']))
blk = set((
'=======',
'~~~~~~~~~~~~'
@fffonion
fffonion / weather.conf
Created March 6, 2019 06:16
Hijack Phicomm K3 weather service to darksky weather API
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate certs/default.crt;
ssl_certificate_key certs/default.key;
server_name phiclouds.phicomm.com;
access_log /var/log/nginx/weather-access.log;
@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)