A very small HTTP client with Rack/WSGI style interfaces.
$sid = 'ACxxxxxxxxxxxx';
$token = '12345678';
$http = new TinyHttp("https://$sid:[email protected]");
A very small HTTP client with Rack/WSGI style interfaces.
$sid = 'ACxxxxxxxxxxxx';
$token = '12345678';
$http = new TinyHttp("https://$sid:[email protected]");
| #!/bin/bash | |
| # | |
| # Whitelist Pingdom probe-servers in iptables. | |
| # | |
| # Create a chain called "PINGDOM" and jump to it somewhere before | |
| # the final REJECT/DROP, e.g. | |
| # | |
| # # New chain for Pingdom rules | |
| # :PINGDOM - [0:0] | |
| # |
| find . -name *.php ! -type d ! -name _tmp_ -exec sh -c 'expand -t 4 {} > _tmp_ && mv _tmp_ {}' \; |
Wensheng Wang, 10/1/11
Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html
When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:
$ cp /etc/redis.conf /etc/redis-xxx.conf...The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
| Credit to Paul Moore / @Paul_Reviews: | |
| 1. Navigate to http://www.roboform.com/have-i-been-hacked | |
| 2. Replace 'Enter account to test' with following: <script type="text/javascript">$('img').attr('src', 'https://lastpass.com/images/lastpass-logo.png');</script> | |
| 3. Click on 'Check Now' | |
| In action: | |
| http://g.recordit.co/oBk26XEv0P.gif |
| # Lighttpd | |
| $HTTP["referer"] !~ "^($|http://([^/]*\.)?imagesocket\.(com|net|org)/)" { | |
| magnet.attract-physical-path-to = ("/www/sites/conf/imagesocket/bandwidth.lua") | |
| } | |
| # Lua check for images that exceeded limit(S) | |
| # Path - Flag - Expiration | |
| local url_check = | |
| { | |
| ["/images/2012/08/20/1.png"] = true, -- 1352167206 |
| #!/bin/bash | |
| # | |
| # Whitelist Pingdom probe-servers in iptables. | |
| # | |
| # Create a chain called "PINGDOM" and jump to it somewhere before | |
| # the final REJECT/DROP, e.g. | |
| # | |
| # # New chain for Pingdom rules | |
| # :PINGDOM - [0:0] | |
| # |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE policymap [ | |
| <!ELEMENT policymap (policy)+> | |
| <!ELEMENT policy (#PCDATA)> | |
| <!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED> | |
| <!ATTLIST policy name CDATA #IMPLIED> | |
| <!ATTLIST policy rights CDATA #IMPLIED> | |
| <!ATTLIST policy pattern CDATA #IMPLIED> | |
| <!ATTLIST policy value CDATA #IMPLIED> |