Created
October 1, 2015 19:35
-
-
Save markuman/1c3357ede006c2646b73 to your computer and use it in GitHub Desktop.
Nine Nine Nine 4/4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:6379> eval 'local seed = redis.call("INFO") math.randomseed(tonumber(string.match(seed, "uptime_in_seconds:(%d+)")) + tonumber(string.match(seed, "total_commands_processed:(%d+)"))) return string.format("%f", math.random())' 0 | |
"0.219070" | |
127.0.0.1:6379> eval 'local seed = redis.call("INFO") math.randomseed(tonumber(string.match(seed, "uptime_in_seconds:(%d+)")) + tonumber(string.match(seed, "total_commands_processed:(%d+)"))) return string.format("%f", math.random())' 0 | |
"0.074487" | |
127.0.0.1:6379> eval 'local seed = redis.call("INFO") math.randomseed(tonumber(string.match(seed, "uptime_in_seconds:(%d+)")) + tonumber(string.match(seed, "total_commands_processed:(%d+)"))) return redis.call("SET", "mykey", string.format("%f", math.random()))' 0 | |
OK | |
-- local seed = redis.call("INFO") | |
-- math.randomseed(tonumber( | |
-- string.match(seed, "uptime_in_seconds:(%d+)")) + | |
-- tonumber(string.match(seed, "total_commands_processed:(%d+)"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment