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
./redis-cli latency graph aof-write | |
aof-write - high 16 ms, low 1 ms (all time high 16 ms) | |
-------------------------------------------------------------------------------- | |
_ | |
_####### _#### #_ #o_# | | |
o__________o_ _oo|||||||| _o____o_ ___ooo__ _______o__|||||#||#|||| | ___ _ ___ | |
|||||||||||||#|||||||||||_#||||||||#||||||||#|||||||||||||||||||||||_|o|||#|#||| | |
44444444444444444444444442222222222222222221111111111111111111111111111111111111 | |
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm |
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
$LOAD_PATH.unshift("./lib") | |
require './lib/redis.rb' | |
Sentinels = [{:host => "127.0.0.1", :port => 26380}, | |
{:host => "127.0.0.1", :port => 26381}] | |
r = Redis.new(:url => "sentinel://mymaster", :sentinels => Sentinels, :role => :master) | |
r.ping | |
(0..1000000).each{|i| | |
begin |
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
WARNING: You can brick your phone, follow this steps at your risk. | |
With older basebands 4.4.2 has issues with the network, so a baseband update is required. | |
If you don't want to touch Windows / Odin for this, this has worked for me, since the vanilly "run" failed to upgrade the baseband file. Basically the trick is, for some obscure reason, to upgrade the baseband two times in a row. | |
1) Use Heimdall v1.4.0 | |
2) Flast first time with: heimdall flash --MDM modem.bin (Obtained from baseband file modem_XXUFNB8.tar) | |
3) When the device reboots, press volume down AGAIN to enter Download/Odin mode again. | |
4) Flash again with: heimdall flash --MDM modem.bin --no-reboot |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/file.h> | |
#include <errno.h> | |
void lockFile(char *filename) { | |
int fd; | |
/* To lock it, we need to open the file in a way it is created if |
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
<? | |
require("redis.php"); | |
require("json.php"); | |
$term = $_GET['term']; | |
$r = new Redis("127.0.0.1","6379"); | |
$r->connect(); | |
$items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10")); |
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> pfadd hll 1 2 3 4 5 6 | |
(integer) 1 | |
127.0.0.1:6379> pfdebug decode hll | |
"Z:495 v:2,1 Z:2084 v:1,1 Z:4946 v:1,1 Z:3445 v:1,1 Z:4397 v:4,1 Z:208 v:2,1 Z:803" |
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
cardinality 1 uses 5 bytes (0.00244140625 bits per register}) | |
cardinality 10 uses 31 bytes (0.01513671875 bits per register}) | |
cardinality 100 uses 271 bytes (0.13232421875 bits per register}) | |
cardinality 1000 uses 1906 bytes (0.9306640625 bits per register}) | |
cardinality 2000 uses 3517 bytes (1.71728515625 bits per register}) | |
cardinality 3000 uses 4918 bytes (2.4013671875 bits per register}) | |
cardinality 4000 uses 6129 bytes (2.99267578125 bits per register}) | |
cardinality 5000 uses 7206 bytes (3.5185546875 bits per register}) | |
cardinality 6000 uses 8099 bytes (3.95458984375 bits per register}) | |
cardinality 7000 uses 8868 bytes (4.330078125 bits per register}) |
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> zrangebylex words [anter + LIMIT 0 10 | |
1) "anterior" | |
2) "anteriorly" | |
3) "anteroom" | |
4) "anterooms" | |
5) "antes" | |
6) "anthem" | |
7) "anthemed" | |
8) "anthems" | |
9) "anther" |
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
require 'rubygems' | |
require 'redis' | |
r = Redis.new | |
r.config("SET","maxmemory","2000000") | |
r.config("SET","maxmemory-policy","allkeys-lru") | |
r.config("SET","maxmemory-samples",1000) | |
r.config("RESETSTAT") | |
r.flushall |
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
redis-cli -c -p 7000 :3.0: | |
redis 192.168.1.10:7000> set foo bar | |
-> Redirected to slot [12182] located at 192.168.1.11:7001 | |
OK | |
redis 192.168.1.11:7001> |