Lua scripts to perform some rate-limiting operations