This file contains 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
local val,err = redis.pcall('get', KEYS[1]) | |
if err then | |
return err | |
else | |
return {val} | |
end |
This file contains 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
local val = redis.call('get', KEYS[1]) | |
if val then | |
return {val, redis.call('pttl', KEYS[1])} | |
else | |
return false | |
end |
This file contains 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
(world)matt@ununoctium:~/repos/wf% python text.py | |
Words occuring more than 3 times: | |
Number is the count of times the word occured in the data. | |
3: gdp, limited, cobra, :(, global, cheap, soon, rest, produced, kill, looks, | |
earth, disease,, saved, worked, party,, happiness., certainly, work., pray, | |
$500k, months., either., 0, preparing, asking, stefantalpalaru, 300bps, easy, | |
inherited, folks, sorry, full,, disproportionate, opt, ago,, sick, ilovecookies, | |
little,, dependent, celebrities, advocate, begging, choice, young., joint, | |
suffering, wishes, example, one., fall, report, using, more., chongli, kids,, | |
massively, about,, loss, term, crops, problems,, problems., solution, anything,, |
This file contains 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
(world)matt@ununoctium:~/repos/wf% python text.py drama | fold -s | |
=============================================================================== | |
Count of sentence ending words: | |
72: it. | |
35: sexism. | |
31: them. | |
24: people. |
This file contains 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
# Bring in dependencies if needed: | |
sudo pkg install ruby | |
sudo gem install redis | |
# Start 9 servers on 127.0.0.1 and 9 servers on net0's IP address | |
cd redis/src | |
for dir in {1..9}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind 127.0.0.1 --cluster-enabled yes --port 700$dir & popd; done | |
IP=`/sbin/ifconfig net0 |grep inet |awk '{printf $2}'` | |
for dir in {21..29}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind $IP --cluster-enabled yes --port 70$dir & popd; done |
This file contains 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
# Launch 18 redis cluster instances on one machine using two IPs | |
cd redis/src | |
for dir in {1..9}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind 127.0.0.1 --cluster-enabled yes --port 700$dir & popd; done | |
IP=`/sbin/ifconfig eth0 |grep "inet addr" | tail -1 |awk '{printf $2}' |awk -F: '{printf $2}'` | |
for dir in {21..29}; do mkdir $dir; pushd $dir; rm -f *.conf *.rdb; ../redis-server --bind $IP --cluster-enabled yes --port 70$dir & popd; done | |
./redis-trib.rb create --replicas 1 127.0.0.1:{7001..7009} $IP:{7021..7029} |
This file contains 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
#!/bin/bash | |
ARGS="-c 10 -n 1" | |
PATH=~/repos/redis/src | |
redis-benchmark $ARGS eval ' | |
for i=0,50000 do | |
local key = string.format("data/%019d/xxxxxxxxxxxxxxxxxx", i) | |
redis.call("HMSET", key, "AAAAAAAAAAA:current", "AA", "AAAAAAAAAAA:current-time", "Thu May 01 11:08:34 BST 2014", "AAAAAAAAAAA:target", "AA", "AAAAAAAAAAA:target-time", "Thu May 01 11:08:34 BST 2014", "aaaaaaaaaaaaaaaaaaaa:current", "aa", "aaaaaaaaaaaaaaaaaaaa:current-time", "Thu May 01 11:08:34 BST 2014", "aaaaaaaaaaaaaaaaaaaa:target", "aa", "aaaaaaaaaaaaaaaaaaaa:target-time", "Thu May 01 11:08:34 BST 2014", "bbbbb:current", "bbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbb:current-time", "Thu May 01 11:08:34 BST 2014", "bbbbb:target", "bbbbbbbbbbbbbbbbbbbbbbbbb", "bbbbb:target-time", "Thu May 01 11:08:34 BST 2014", "cccccccccccccccccccccc:current", "cc", "cccccccccccccccccccccc:current-time", "Thu May 01 11:08:34 BST 2014", "cccccccccccccccccccccc:target", "cc", "cccccccccccccccccccccc:target-time", "Thu May 01 11:08:34 BST 2014", "ddddddddd |
This file contains 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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use IO::All; | |
use IO::Socket::UNIX qw( SOCK_STREAM ); | |
use Benchmark ':hireswallclock'; | |
use Redis; | |
use RedisDB; |
This file contains 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
/* Usage: ./size_parse INTEGER [1-5] */ | |
#include <stdio.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/time.h> | |
#include <sys/types.h> |
This file contains 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
.section __TEXT,__text,regular,pure_instructions | |
.section __DWARF,__debug_info,regular,debug | |
Lsection_info: | |
.section __DWARF,__debug_abbrev,regular,debug | |
Lsection_abbrev: | |
.section __DWARF,__debug_aranges,regular,debug | |
.section __DWARF,__debug_macinfo,regular,debug | |
.section __DWARF,__debug_line,regular,debug | |
Lsection_line: | |
.section __DWARF,__debug_loc,regular,debug |
OlderNewer