from flask import Flask, render_template
from myapp.views.qrcode import bp, make_qrcode_url
app = Flask(__name__)
app.config['SECRET_KEY'] = 'random-bytes'
app.register_blueprint(bp)
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
笔者工作中使用的主力机器是 MacBookPro, 系统是 Yosemite. 下面简介在 Yosemite中安装Metasploit Framework. | |
## Install Commandline for XCode | |
``` | |
xcode-select --install | |
``` | |
## Install Java7 SDK & JRE | |
``` | |
http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-macosx-x64.dmg |
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 | |
''' | |
中国联不通每月通话时间统计 | |
用法: | |
1. 去 http://iservice.10010.com/ 下载通话详单(Excel 格式),导出为 CSV | |
2. ./sumup.py *.csv | |
''' |
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 requests | |
import datetime | |
#get the session id and set the cookies | |
payload4sessionid={'USER':'guest','PASSWORD':'guest','IMAGE_HEIGHT':'170','IMAGE_WIDTH':'1255','TabHeight':'580'} | |
index = requests.get("http://10.226.72.29:8080/nmmis/servlet/LoginServlet",params=payload4sessionid) | |
sessionid= index.cookies['JSESSIONID'] | |
cookies = dict(JSESSIONID=sessionid) | |
#get index page |
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
var ids = document.querySelectorAll(".member_id"); | |
var names = document.querySelectorAll(".member_name"); | |
var output = "", length = ids.length; | |
for(var i=0; i<length; i++){ | |
output += ids[i].innerHTML.slice(1,-1) + ":" + names[i].innerHTML + "\n"; | |
} | |
console.log(output); |
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 | |
deliver_target=([email protected] [email protected]) | |
smtp_account="[email protected]" | |
smpt_password="******" | |
issue_archive_dir="/srv/ebook-deliver/archives" | |
issue_name="solidot-$(date +%Y%m%d)" |
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
` | |
// vim: nowrap | |
// Copyright (c) 2013, smilekzs. (MIT Licensed) | |
// ==UserScript== | |
// @name renren-markdown | |
// @namespace http://github.com/smilekzs | |
// @version 0.4.15 | |
// @description write well-formatted blogs on renren.com with markdown | |
// @include *blog.renren.com/blog/*Blog* | |
// @include *blog.renren.com/*Entry* |
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 sys | |
import os | |
import re | |
import gevent | |
import gevent.monkey | |
import gevent.timeout | |
gevent.monkey.patch_all() |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
NewerOlder