Skip to content

Instantly share code, notes, and snippets.

View wofeiwo's full-sized avatar
💭
蚂蚁集团长期招人,安全各方面

GaRY wofeiwo

💭
蚂蚁集团长期招人,安全各方面
View GitHub Profile
@wofeiwo
wofeiwo / gist:3582748
Created September 1, 2012 18:37
Signal handle in golang
package main
import (
"fmt"
"os"
"os/signal"
)
func main() {
// 处理一下Ctrl+c
@wofeiwo
wofeiwo / gist:3634357
Created September 5, 2012 10:00
Golang daemonize
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {
@wofeiwo
wofeiwo / setup.py
Created September 13, 2012 13:16
Python System Execute Module
from distutils.core import setup, Extension
ext = Extension('system', sources=['system.c'])
setup(name='system', version='1.0', description='Test description', ext_modules=[ext])
@wofeiwo
wofeiwo / flup_fcgi_client.py
Created September 14, 2012 06:33
Python FCGI Client
#!/usr/bin/env python
# pylint: disable=W0622
# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
# Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@wofeiwo
wofeiwo / fcgiclient.go
Created September 15, 2012 09:08
Golang FastCGI Client
// Copyright 2012 Junqing Tan <ivan@mysqlab.net> and The Go Authors
// Use of this source code is governed by a BSD-style
// Part of source code is from Go fcgi package
// Fix bug: Can't recive more than 1 record untill FCGI_END_REQUEST 2012-09-15
// By: wofeiwo
package fcgiclient
import (
@wofeiwo
wofeiwo / hex_str_transfer.py
Created December 13, 2012 05:38
hex,string,int_bits transfer
def hexstr(s):
"""
turns ABCD
into
41424344
"""
tmp=[]
for c in s:
tmp+=["%2.2x"%ord(c)]
return "".join(tmp)
@wofeiwo
wofeiwo / readLines-writeLines.go
Created April 2, 2013 04:41
read lines write lines like python api in golang
package main
import (
"io"
"os"
"bufio"
"bytes"
"fmt"
"strings"
)
@wofeiwo
wofeiwo / grace.go
Last active December 17, 2015 00:49 — forked from rcrowley/grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
local http = require "http"
local shortport = require "shortport"
local stdnse = require "stdnse"
local string = require "string"
local vulns = require "vulns"
description = [[
Detects Ruby on Rails installations that are vulnerable to CVE-2013-0156, This critical vulnerability allows unauthenticated attackers to execute code remotely.
This is the nmap/lua port of the metasploit scanner module from hd moore
@wofeiwo
wofeiwo / phpweblog2markdown.py
Created May 11, 2013 19:09
trans all blog entities from phpweblog.net to markdown format. each entity a file. include all files and images.
#!/usr/bin/env python
#coding=utf-8
from xml.dom import minidom as md
from datetime import datetime
import re
from urllib2 import urlopen
from os.path import basename
from socket import setdefaulttimeout