sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| # Define ULID_DECODE and ULID_ENCODE which convert a ulid string to a binary and vice versa. | |
| delimiter // | |
| DROP FUNCTION IF EXISTS ULID_DECODE// | |
| CREATE FUNCTION ULID_DECODE (s CHAR(26)) RETURNS BINARY(16) DETERMINISTIC | |
| BEGIN | |
| DECLARE s_base32 CHAR(26); | |
| SET s_base32 = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(s), 'J', 'I'), 'K', 'J'), 'M', 'K'), 'N', 'L'), 'P', 'M'), 'Q', 'N'), 'R', 'O'), 'S', 'P'), 'T', 'Q'), 'V', 'R'), 'W', 'S'), 'X', 'T'), 'Y', 'U'), 'Z', 'V'); | |
| RETURN UNHEX(CONCAT(LPAD(CONV(SUBSTRING(s_base32, 1, 2), 32, 16), 2, '0'), LPAD(CONV(SUBSTRING(s_base32, 3, 12), 32, 16), 15, '0'), LPAD(CONV(SUBSTRING(s_base32, 15, 12), 32, 16), 15, '0'))); | |
| END// |
| # Based on articles: | |
| # https://ruhighload.com/%D0%9A%D1%8D%D1%88%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+%D1%81+nginx | |
| # https://wiki.enchtex.info/practice/nginx/cache | |
| # https://gist.github.com/yanmhlv/5612256 | |
| # https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html | |
| # https://blog.runcloud.io/2017/10/28/nginx-caching-tutorial-wordpress.html | |
| # https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps | |
| # https://easyengine.io/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/ | |
Install 3scale self managed API gateway (openresty) in Mac OS-X
brew update
brew install pcre openssl
wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar xzvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2