pip install locustio
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
<source> | |
type forward | |
</source> | |
<match **> | |
type record_reformer | |
renew_record false | |
enable_ruby true | |
tag ip_formatted.${tag} |
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
""" | |
Usage | |
===== | |
:: | |
$ python easyscript.py 1 2 | |
3 | |
""" |
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
2015-06-16 09:42:09,565 ERROR [waitress][Dummy-4] Exception when serving /manage/terms/ãã£/@@properties | |
Traceback (most recent call last): | |
File "/home/hirokiky/dev/deepthought/env/lib/python3.4/site-packages/waitress/channel.py", line 337, in service | |
task.service() | |
File "/home/hirokiky/dev/deepthought/env/lib/python3.4/site-packages/waitress/task.py", line 173, in service | |
self.execute() | |
File "/home/hirokiky/dev/deepthought/env/lib/python3.4/site-packages/waitress/task.py", line 392, in execute | |
app_iter = self.channel.server.application(env, start_response) | |
File "/home/hirokiky/dev/deepthought/env/lib/python3.4/site-packages/pyramid-1.6a1-py3.4.egg/pyramid/router.py", line 223, in __call__ | |
response = self.invoke_subrequest(request, use_tweens=True) |
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 msgpack | |
data = {} # Input large Python dict | |
import time | |
import json | |
print("Dumping") | |
print("########### msgpack ##############") | |
print("started") |
pip install falcon
pip install requests
pip install gunicorn
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 moment = require('moment') | |
undefined | |
> null < moment('1970-01-01') | |
false | |
> null < moment('1970-01-02') | |
true | |
> |
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 cachetools | |
import requests | |
class ForceCacheSession(requests.Session): | |
""" Force caching requests.Session | |
* Apply `cachetools.Cache` by `mount_cache()` methoud | |
* It will cache if the method was GET and status code was 200 | |
* It will apply `res.from_cache` bool value |
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 docker | |
class WSFixedClient(docker.Client): | |
def _create_websocket_connection(self, url): | |
sslopt = {} | |
if self.cert: | |
sslopt["certfile"] = self.cert[0] | |
sslopt["keyfile"] = self.cert[1] | |
return websocket.create_connection( |
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
container.exec({Cmd: ['/bin/sh', '-c', 'cat > /path/to/test.txt], AttachStdin: true}, (err, exec) => { | |
exec.start({hijack: true, stdin: true}, function(err, stream) { | |
stream.write("Hi there.\n") | |
}); | |
}); |