Skip to content

Instantly share code, notes, and snippets.

View kitelife's full-sized avatar
💪
I may be slow to respond.

xiayf kitelife

💪
I may be slow to respond.
View GitHub Profile
@kitelife
kitelife / checklink.py
Created June 26, 2012 12:29 — forked from tonyseek/checklink.py
Visit all links of a website.
@kitelife
kitelife / extract_captcha.py
Created July 27, 2012 17:04 — forked from tonyseek/extract_captcha.py
Distinguish captcha with PIL and Tesseract
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import StringIO
import requests
import PIL.Image
import tesserwrap
def profile_func(filename=None):
def proffunc(f):
def profiled_func(*args, **kwargs):
import cProfile
import logging
logging.info('Profiling function %s' % (f.__name__))
try:
profiler = cProfile.Profile()
retval = profiler.runcall(f, *args, **kwargs)
profiler.dump_stats(filename or '%s_func.profile' % (f.__name__))
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@kitelife
kitelife / go_scp.go
Created September 6, 2013 09:00 — forked from jedy/go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"code.google.com/p/go.crypto/ssh"
"crypto"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Modify by linuz.ly
package main
import (
"bytes"
"fmt"
"code.google.com/p/go.crypto/ssh"
#! /usr/bin/env python
import argparse
import sys
import re
import time
line_nginx_full = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""",
re.IGNORECASE)
line_nginx_onlyStatus = re.compile(r'.+HTTP\/1\.1" (?P<statuscode>\d{3})')