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
class RedisConcept(): | |
def __init__(self): | |
self.host = "localhost" | |
self.port = "6379" | |
self.db = "1" | |
self.r = redis.Redis(host=self.host, port=self.port, db=self.db) | |
def get_key(self, key): | |
return self.r.get(key) |
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
location / { | |
content_by_lua "ngx.say(ngx.var.remote_addr)"; | |
} | |
# to build nginx you have to install lua and grab the modules | |
# libluajit-5.1-dev | |
# ./configure --prefix=/opt/nginx --add-module=/builds/ngx_devel_kit-0.2.19 --add-module=/builds/lua-nginx-module-0.9.6 | |
# just follow the installation instructionshttp://wiki.nginx.org/HttpLuaModule#Installation |
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
""" | |
Example of use of inotify. Extracted from django.utils.autoreload | |
""" | |
import pyinotify | |
def inotify_logs_changed(): | |
class EventHandler(pyinotify.ProcessEvent): | |
def process_default(self, event): |
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
Traceback (most recent call last): | |
File "/home/gotche/.pyenv/versions/autocomp3.8.0rc1/bin/pytest", line 10, in <module> | |
sys.exit(main()) | |
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/_pytest/config/__init__.py", line 60, in main | |
config = _prepareconfig(args, plugins) | |
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/_pytest/config/__init__.py", line 203, in _prepareconfig | |
return pluginmanager.hook.pytest_cmdline_parse( | |
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__ | |
return self._hookexec(self, self.get_hookimpls(), kwargs) | |
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec |