Skip to content

Instantly share code, notes, and snippets.

WenMing moonbingbing

Block or report user

Report or block moonbingbing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View redis.lua
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
local _M = new_tab(0, 155)
View gist:c0e540226279962dc3cb
import os
import re
import sys
import wmi
def get_memory_info():
computer_system = wmi.WMI().Win32_ComputerSystem()
op_system = wmi.WMI().Win32_OperatingSystem()
total_mem = int(computer_system[0].TotalPhysicalMemory)/1024/1024
moonbingbing / csrf_post
Created Apr 12, 2013
一个简单的csrf post攻击模拟
View csrf_post
<body onload="load()">
<form action="" target="form_iframe" id="csrf" method="post">
<input type="hidden" name="newPwd" value="DEAD" />
moonbingbing / nginx.conf
Created Nov 2, 2012
query postgres in openresty
View nginx.conf
worker_processes 1;
events {
worker_connections 64;
http {
send_timeout 1s;
server_tokens off;
moonbingbing / parse_form_protocol.lua
Created Nov 2, 2012
parse content-Type multipart/form-data according to RFC2388
View parse_form_protocol.lua
--parse content-Type multipart/form-data according to RFC2388.
function parse_form_protocol(query_data)
local result = {}
local boundary = get_boundary()
if boundary == nil then
return result
boundary = "--" .. boundary
local regex = [[name="(\w+)"\s+([\S\s]+?)\s+?]] .. boundary
for m in, regex) do
# -*- coding: utf-8 -*-
import random
def random_string(length):
str = ''
for i in range(length):
str += chr(random.randint(ord('#'),ord('~')))
return str
moonbingbing /
Created Aug 23, 2012
python string xor sample
# -*- coding: utf-8 -*-
import itertools
def xor(s, key):
key = key * (len(s) / len(key) + 1)
return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in itertools.izip(s, key))
if __name__ == "__main__":
You can’t perform that action at this time.