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
| 1 |
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
| import os | |
| import re | |
| class Iptables(object): | |
| _iptables = 'iptables' | |
| @classmethod | |
| def get_chain(cls): |
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
| import urllib2 | |
| import re | |
| for i in range(100000): | |
| try: | |
| response = urllib2.urlopen('http://www.freexs.cn/info/%s.htm' % i) | |
| t = re.findall('<h1>([\S\s]+?)</h1>', response.read())[0] | |
| print i, t | |
| except: | |
| print i |
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
| location ~ /(\d+)(.*) { | |
| set $size $1; | |
| set $unit $2; | |
| access_by_lua_block { | |
| local sent = 0 | |
| local bufsize = 8192 | |
| local payload = string.rep("0", bufsize) | |
| local _u = ngx.var.unit | |
| if _u ~= nil and _u ~= "" then | |
| _u = string.lower(_u) |
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
| FFmpeg has been removed from Ubuntu 14.04 and was replaced by Libav. This decision has been reversed so that FFmpeg is available now in Ubuntu 15.04 again, but there is still no official package for 14.04. In this tutorial, I will show you how to install FFmpeg from mc3man ppa. Add the mc3man ppa: | |
| sudo add-apt-repository ppa:mc3man/trusty-media | |
| And confirm the following message by pressing <enter>: | |
| Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades | |
| More info: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media | |
| Press [ENTER] to continue or ctrl-c to cancel adding it | |
| Update the package list. |
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
| local redis_c = require "resty.redis" | |
| local ok, new_tab = pcall(require, "table.new") | |
| if not ok or type(new_tab) ~= "function" then | |
| new_tab = function (narr, nrec) return {} end | |
| end | |
| local _M = new_tab(0, 155) |
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
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.options | |
| import tornado.web | |
| import tornado.httpclient | |
| import re | |
| from tornado.options import define, options | |
| from tornado import gen |
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
| #import gevent | |
| #from ghost import Ghost, Session | |
| import requests | |
| import re | |
| import json | |
| import time | |
| import socket | |
| #from gevent import monkey; monkey.patch_all() | |
| timeout = 90 | |
| socket.setdefaulttimeout(timeout) |
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
| #import gevent | |
| #from ghost import Ghost, Session | |
| import requests | |
| import re | |
| import json | |
| import time | |
| import socket | |
| #from gevent import monkey; monkey.patch_all() | |
| timeout = 90 | |
| socket.setdefaulttimeout(timeout) |
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
| server { | |
| resolver 114.114.114.114; | |
| listen 8989; | |
| location ^~ / { | |
| proxy_ssl_verify off; | |
| proxy_pass https://api.weixin.qq.com; | |
| } | |
| } |
OlderNewer