Skip to content

Instantly share code, notes, and snippets.

View ryanlewis's full-sized avatar

Ryan Lewis ryanlewis

  • Leeds, United Kingdom
  • 00:09 (UTC +01:00)
View GitHub Profile
@ryanlewis
ryanlewis / leaky_bucket.lua
Created March 16, 2021 00:06 — forked from florentchauveau/leaky_bucket.lua
Redis script (Lua) to implement a leaky bucket
-- Redis script to implement a leaky bucket
-- see https://medium.com/callr-techblog/rate-limiting-for-distributed-systems-with-redis-and-lua-eeea745cb260
-- (c) Florent CHAUVEAU <florent.chauveau@gmail.com>
local ts = tonumber(ARGV[1])
local cps = tonumber(ARGV[2])
local key = KEYS[1]
-- remove tokens < min (older than now() -1s)
local min = ts -1
@ryanlewis
ryanlewis / copy-k8s-resources-across-namespaces.sh
Created July 25, 2017 19:36 — forked from simonswine/copy-k8s-resources-across-namespaces.sh
Copying kubernetes resources accross namespaces
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create-f -
@ryanlewis
ryanlewis / google_twunter_lol
Created May 27, 2014 14:28 — forked from jamiew/google_twunter_lol
Naughty word list, compiled by Google and @jamiew
4r5e
5h1t
5hit
a55
anal
anus
ar5e
arrse
arse
ass