Skip to content

Instantly share code, notes, and snippets.

View borgle's full-sized avatar

波哥 borgle

View GitHub Profile
@borgle
borgle / MovePicture.py
Last active December 24, 2015 16:25
【更新根据exif读取时间】图片太多,写个脚本整理图片到子文件夹,按照图片的创建时间整理。
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os,time,shutil,sys
import exifread
folder = os.path.join(os.path.dirname(__file__), "a")
for fname in os.listdir(folder):
fpath = os.path.join(folder,fname)
sys.stdout.write(u"\r正在处理 %s" % fpath)
@borgle
borgle / taoyer.code.crack.py
Created November 25, 2015 07:55
利用cloudsightapi破解电信积分手机版本图形验证码测试代码
#!/usr/bin/env python
#coding: utf-8
import requests
import json,time,os
REQURL = 'https://api.cloudsightapi.com/image_requests'
RESPURL = 'https://api.cloudsightapi.com/image_responses'
headers = {"Authorization":"CloudSight 39OOYyT553WHpEPlo2Ehcw00",
@borgle
borgle / upgrade_filetime.py
Created January 15, 2016 01:54
有时候需要更改当前目录下所有文件的访问时间和修改时间,当文件过多的时候,可以试试这个小脚本。当然,如果你是工作在linux上,这个可以帮助到你【 find ./ | xargs touch -c -t 201601010000 】
#!/usr/bin/env python
# -*- coding:utf8 -*-
import time,os,sys
newtime = time.time()
for root,dirs,files in os.walk(os.path.dirname(__file__)):
for name in files:
filepath = os.path.join(root, name)
os.utime(filepath, (newtime,newtime))
sys.stdout.write(u"\r正在处理 %s...%s" % (filepath.decode('gbk')[:35-len(name)],filepath.decode('gbk')[-len(name)-35:]))
@borgle
borgle / GridViewSort.cs
Created February 18, 2016 17:08 — forked from sayurin/GridViewSort.cs
Automatically sort library for WPF ListView (GridView).
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
namespace Sayuri.Windows {
public static class GridViewSort {
class SortIcon : Adorner {
@borgle
borgle / hzti.com.9004.py
Created March 13, 2016 09:13
杭州市机动车驾驶人考试互联网预约平台预约考试人员统计脚本
#coding: utf-8
import requests,re
headers = {'User-Agent': 'Mozilla/4.0',
'Accept-Language':'en-US,en;q=0.8',
'Accept-Encoding':'gzip, deflate, sdch',
'Cache-Control': 'max-age=0',
'Accept': 'text/html;q=0.9,*/*;q=0.8'
}
@borgle
borgle / imgservice.py
Last active November 25, 2017 02:28
提供一个web服务,返回处理过的远程图片。
#!/usr/bin/env python
# coding:utf-8
__version__ = '1.0.0'
try:
import gevent
import gevent.queue
import gevent.monkey
gevent.monkey.patch_all()
@borgle
borgle / X-Apple-I-FD-Client-Info.js
Last active October 4, 2023 02:27
在访问 https://appleid.apple.com/account?&localang=CN-ZH 这个页面的时候,页面会ajax一个特殊的header请求,其中的X-Apple-I-FD-Client-Info信息是一个json对象,本gist是整理后的F值获取方式源码。
(function(m) {
function g(e) {
try {
if (navigator.plugins && navigator.plugins.length)
for (var t = 0; t < navigator.plugins.length; t++) {
var n = navigator.plugins[t];
if (n.name.indexOf(e) >= 0)
return n.name + (n.description ? "|" + n.description : "")
}
} catch (r) {}
@borgle
borgle / Hello.py
Last active July 4, 2016 10:53
simplify Web Server base on wsgi on gunicorn, gevent. visit eg. http://localhost/DEMO/Hello?method=Say&other=otherparameter
#!/usr/bin/env python
# coding:utf-8
import requsts
import imghdr, json
''' this file is in package DEMO folder '''
def Say(parameters, start_response):
s = {
@borgle
borgle / google.reverse.conf
Last active July 21, 2016 02:36
集合多人智慧,nginx反向代理google网站的配置。 如果是restart nginx的话,记得先rm -rf /var/run/nginx-gunzip.sock;当然reload的话,就不需要。
upstream google {
server 210.158.146.160:443 max_fails=3;
server 210.158.146.161:443 max_fails=3;
server 210.158.146.162:443 max_fails=3;
server 210.158.146.163:443 max_fails=3;
server 210.158.146.164:443 max_fails=3;
server 210.158.146.165:443 max_fails=3;
# add more google ip
}
server {
@borgle
borgle / install.sh
Last active August 15, 2017 10:29
some service install & init script
#!/usr/bin/env bash
# === open bbr mode for linux ===
yum -y install kernel-ml grub2
yum install -y kernel-ml
cat >>/etc/sysctl.conf << EOF
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF