This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
| import asyncio | |
| import aiohttp | |
| import time | |
| async def make_request(session, qty_req, req_n): | |
| url = "http://10.86.36.223:8080" | |
| for idx in range(qty_req): | |
| async with session.get(url) as resp: | |
| if resp.status == 200: | |
| await resp.text() |
| # coding:utf-8 | |
| """ | |
| [email protected] | |
| package A : pack num, pack length | |
| package B : pack lenght, pack payload | |
| Client Send pA, get ack, then send pB, Server give ack | |
| python ttcp.py server |
| #!/bin/bash | |
| export LANG='zh_CN.UTF-8' | |
| # bearychat svn | |
| # Requires Curl and Subversion Server installed. | |
| # Put this file as "post-commit" with 755 permissions on the hooks directory of your repo | |
| REPO_PATH=$1 | |
| REV=$2 | |
| LOOK=/usr/bin/svnlook |
| import json | |
| import time | |
| from twisted.internet import defer | |
| from twisted.internet.protocol import ServerFactory | |
| from twisted.protocols.basic import LineReceiver | |
| from twisted.python import log | |
| class BasicProtocol(LineReceiver): |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
| import socket | |
| import sys | |
| import time | |
| import struct | |
| host = 'localhost' | |
| port = 8888 | |
| buffersize = 1024 | |
| N = 1000000 | |
| server_address = (host, port) |
| #coding=utf-8 | |
| #filename crypto_test.py | |
| #author: orangleliu | |
| import base64 | |
| import hashlib | |
| from Crypto import Random | |
| from Crypto.Cipher import AES | |
| class AESCipher(object): |
| #!/usr/bin/env python | |
| # | |
| # Proof of Concept: UDP Hole Punching | |
| # Two client connect to a server and get redirected to each other. | |
| # | |
| # This is the client. | |
| # | |
| # Koen Bollen <meneer koenbollen nl> | |
| # 2010 GPL | |
| # |
| #!/usr/bin/python2.7 | |
| # -*- coding: utf-8 -*- | |
| #python2.7x | |
| #authror: zhizhi.liu | |
| #备份radius中的上网记录表,每个月备份一次,原始表中保留一份数据 | |
| #使用同一个数据库中的一个不同表名的表备份 | |
| import time | |
| import datetime | |
| import logging |