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
# HTTP crawler inside nginx. | |
# | |
# start crawling by curl http://127.0.0.1:18080/?host=<START URL> | |
# | |
worker_processes auto; | |
events { | |
worker_connections 16384; | |
} |
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
# Other settings have been omitted, the below changes are relevant | |
machine: | |
pre: | |
- sudo service postgresql stop | |
- sudo apt-get purge -y postgresql* | |
- sudo apt-get update | |
- sudo apt-get install postgresql | |
- sudo service postgresql start | |
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql" | |
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql" |
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
require "pg" | |
require "time" | |
PG_EPOCH = Time.gm(2000,1,1).to_i | |
conn = PG.connect | |
tm = PG::TypeMapByOid.new | |
tm.add_coder PG::BinaryDecoder::Integer.new(oid: 1184) | |
conn.type_map_for_results = tm | |
def parse_text(r) |
OlderNewer