Skip to content

Instantly share code, notes, and snippets.

@Zayat
Zayat / multiple-url-paths.lua
Created April 24, 2018 15:53 — forked from anonymous/multiple-url-paths.lua
Benchmark multiple url paths with wrk
-- Resource: https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua
-- Initialize the pseudo random number generator
-- Resource: http://lua-users.org/wiki/MathLibraryTutorial
math.randomseed(os.time())
math.random(); math.random(); math.random()
-- Shuffle array
-- Returns a randomly shuffled array
function shuffle(paths)
@Zayat
Zayat / daemon.py
Created July 15, 2017 21:24 — forked from josephernest/daemon.py
Daemon for Python
# From "A simple unix/linux daemon in Python" by Sander Marechal
# See http://stackoverflow.com/a/473702/1422096
#
# Modified to add quit() that allows to run some code before closing the daemon
# See http://stackoverflow.com/a/40423758/1422096
#
# Joseph Ernest, 2016/11/12
import sys, os, time, atexit
from signal import signal, SIGTERM