- Replace the
user-data
file on your coreos-vagrant directory. - Run command:
vagrant provision
- Run command:
vagrant reload
- Open the docker-web site, have fun :)
This file contains hidden or 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
#coding: utf-8 | |
import os | |
import hashlib | |
my_path = os.path.dirname(os.path.abspath(__file__))+'/qrcodes' | |
def get_all_files_from_directory(): | |
files = os.listdir(my_path) | |
return files | |
def caculate_file_md5(file): |
亲爱的用户, 你好!欢迎使用PingMedium!
This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
# 分别统计中文和英文的字数,不包括标点符号。 | |
# Author: Pan Junyong from zopen.cn, panjy at zopen dot cn | |
import re | |
import sys | |
from types import StringType | |
import operator | |
import urllib2 | |
This file contains hidden or 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
App.ApplicationRoute = Ember.Route.extend | |
setupController: (controller,model)-> | |
this._super(controller,model) | |
controller.set('menu',App.Menu.find()) | |
return |
This file contains hidden or 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
#coding: utf-8 | |
import requests | |
import re | |
from requests import * | |
import pyquery | |
from pyquery import PyQuery as pq | |
from lxml import etree | |
import urllib | |
import sys | |
reload(sys) |
This file contains hidden or 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
// 展示一个趋势图 | |
// width : 宽度 | |
// height: 高度 | |
// countweek: url接口地址 , | |
// #trends : dom selector | |
// 数据格式(返回的是当前登录用户的数据): | |
/* | |
[ | |
{ | |
"date": "2011 02", |
This file contains hidden or 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/python -tt | |
""" Example of how to use Google IMAP Extensions using Python | |
http://code.google.com/apis/gmail/imap/ | |
""" | |
import imaplib | |
import re | |
class GmailIMAP4_SSL( imaplib.IMAP4_SSL ): |
##前言 什么是自由?自由不是想做什么都能做什么,而是当你不想做什么的时候可以选择不做。 ##正题 其实你知道,所有的成绩都是以数据的形式存放在学校的数据库中,而学校通过IP显示、网络端口的限制等一系列手段来保证数据的安全,当然,这些做法是无可厚非的,但是你不然学生查到自己的成绩就有点……
首先看下学校的查成绩方式:
-
登陆学校的教务系统。在这一次的登陆中,你会输入用户名、密码,学校的后台程序在接收到你的登陆请求以后就会验证,通过验证则会在本地保存一个cookie,在服务器端维护一个session。这些是你已经登陆的证明。
-
点击查成绩。学校的教务系统使用的iframe的嵌入方式,也就是说他其实就是外边一个框,当你点击里面链接的时候只变换里面的内容。但是你会发现这样页面的url地址并没有变化,然后就有异步刷新的假象……额,这种方式多年以前很流行,我只能这样说
This file contains hidden or 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
NSMutableURLRequest *request; | |
NSError *error; | |
NSURLResponse* response; | |
NSData *receivedData; | |
NSString*result; | |
static NSString* url_pic =@"http://douban.fm/misc/captcha?size=m&id="; | |
request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:url_fav_song]]; | |
[request setValue:@"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" forHTTPHeaderField:@"Accept"]; | |
[request setValue:@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0" forHTTPHeaderField:@"User-Agent"]; | |
receivedData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; |
NewerOlder