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
-- apt-get install nginx-extras # to get nginx with lua support | |
-- apt-get install luarocks | |
-- apt-get install lua-nginx-redis | |
-- luarocks install lua-requests | |
-- In your nginx config file add two lua dict outside server definition | |
-- | |
-- lua_shared_dict ip_whitelist 1m; | |
-- lua_shared_dict ip_asklist 1m; | |
-- server { | |
-- |
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 struct | |
import re | |
import telnetlib | |
def read_until(s, stop): | |
res = '' | |
while not res.endswith(stop): | |
res += s.recv(1) |