Skip to content

Instantly share code, notes, and snippets.

View benjaminbarbe's full-sized avatar

Benjamin Barbe benjaminbarbe

View GitHub Profile
@benjaminbarbe
benjaminbarbe / README.md
Last active September 18, 2023 17:29 — forked from raucao/nginx-lua-s3.nginxconf
Nginx proxy to S3 with caching
@benjaminbarbe
benjaminbarbe / fd_setsize.md
Last active December 23, 2015 04:09
Riak on Mac OS X tcp_inet driver #Port<0.9363> failed: fd=1024 is larger than the largest allowed fd=1023 gen_server memsup terminated with reason: maximum number of file descriptors exhausted

Erlang

curl -O http://erlang.org/download/otp_src_R15B01.tar.gz
tar zxvf otp_src_R15B01.tar.gz
cd otp_src_R15B01
CFLAGS="-O0 -DREDEFINE_FD_SETSIZE -DFD_SETSIZE=15000 -D_DARWIN_UNLIMITED_SELECT" ./configure --disable-hipe --enable-smp-support --enable-threads \
--enable-kernel-poll --enable-darwin-64bit
local resty_sha1 = require "resty.sha1"
local upload = require "resty.upload"
local chunk_size = 4096
local form = upload:new(chunk_size)
local sha1 = resty_sha1:new()
local file
while true do
local typ, res, err = form:read()