Skip to content

Instantly share code, notes, and snippets.

View kotopes's full-sized avatar

Evgeny Kulev kotopes

  • Thailand
View GitHub Profile
#!/bin/sh
#
# PROVIDE: mysql
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable mysqlmulti:
#
# mysqlmulti_enable (bool): Set it to "YES" to enable uwsgi
# Default is "NO".
# based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx
# using code from http://stackoverflow.com/questions/3554315/lua-base-converter
# fixes: use adresses with args, and adresses to way out site. example: /shorten/www.bn.ru/?test=shorten
# "database scheme"
# database 5: id ~> url (use 0 is not good idea)
# database 1: id ~> hits
# database 2: id ~> [{referer|user_agent}]
# database 3: id ~> hits (when id is not found)
# database 4: id ~> [{referer|user_agent}] (when id is not found)