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
# Make tmux use C-a instead of C-b (just like screen!) | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
# Reload config file | |
bind r source-file ~/.tmux.conf \; display "Config Reloaded" | |
# Reset the escape time | |
set -sg escape-time 1 |
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
http://oldblog.antirez.com/post/redis-manifesto |
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
Use Redis SETBIT / GETBIT for stats | |
SETBIT key offset value | |
etc. |
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
Redis containers are best for indexing. |
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
Don't bother putting a password on Redis. You should have secured it another way. |
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
In Redis 2.6, use Lua scripting in place of WATCH/MULTI/EXEC, which can be considered | |
more or less deprecated. |
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
ZSETs (sorted sets) are the most useful container in Redis. |
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
# Redis PUB/SUB example: | |
# client 1: | |
redis 127.0.0.1:6379> subscribe beartalk | |
Reading messages... (press Ctrl-C to quit) | |
1) "subscribe" | |
2) "beartalk" | |
3) (integer) 1 | |
# ...wait around for message... |
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
-- iterate over Redis hash in Lua. | |
local results = redis.call("HGETALL", KEYS[1]); | |
if results ~= 0 then | |
for key, value in ipairs(results) do | |
-- do something here | |
end | |
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
-- Set a key containing JSON in Redis | |
local key = KEYS[1]; | |
local name = ARGV[1]; | |
local value = ARGV[2]; | |
local data = redis.call('GET', key); | |
local json; | |
if not data then | |
json = {}; |
OlderNewer