View gist:761649fa91df0ed594f75effbaa6d77c
./redis-check-rdb dump.rdb :rdb-check*: ??
[offset 0] Checking RDB file dump.rdb
[offset 32] AUX FIELD redis-ver = '999.999.999'
[offset 46] AUX FIELD redis-bits = '64'
[offset 58] AUX FIELD ctime = '1467380086'
[offset 73] AUX FIELD used-mem = '1049664'
[offset 75] Selecting DB ID 0
[offset 4113] Internal error in RDB reading function at rdb.c:468 -> Unknown RDB string encoding type 14
[additional info] While doing: read-object-value

Random weighted element with Redis sorted sets

Imagine you have elements A, B and C with weights 1, 2 and 3. You compute the sum of the weights, which is 1+2+3 = 6

At this point you add all the elements into a sorted set using this algorithm:

SUM = ELEMENTS.TOTAL_WEIGHT // 6 in this case.
View convert.c
#include <stdio.h>
#include <limits.h>
int main(void) {
int a;
unsigned int b;
a = -10;
printf("Before: %d\n", a);
View cset.c
#include <stdio.h>
int main(void) {
int c;
printf("char *cset = \"");
for (c = 'A'; c <= 'Z'; c++) printf("%c",c);
for (c = 'a'; c <= 'z'; c++) printf("%c",c);
for (c = '0'; c <= '9'; c++) printf("%c",c);
return 0;
View align.c
/tmp ➤ gcc foo.c -m32
/tmp ➤ ./a.out
one offset: 0
two offset: 4
three offset: 12
/tmp ➤ cat foo.c
#include <stdio.h>
#include <stdint.h>
struct foo {
View debug.txt> debug
(error) ERR You must specify a subcommand for DEBUG. Try DEBUG HELP for info.> debug help
1) DEBUG <subcommand> arg arg ... arg. Subcommands:
2) segfault -- Crash the server with sigsegv.
3) restart -- Graceful restart: save config, db, restart.
4) crash-and-recovery <milliseconds> -- Hard crash and restart after <milliseconds> delay.
5) assert -- Crash by assertion failed.
6) reload -- Save the RDB on disk and reload it back in memory.
7) loadaof -- Flush the AOF buffers on disk and reload the AOF in memory.
View Git

Hello and thanks for reading,

I've a Redis pull request that no longer applies because, for example, one line where there was a < b is now a > b, otherwise the patch would apply cleanly.

if I try to cherry pick the commit and resolve the conflicts, it works, it's just a lot of useless work editing the conflicting code to merge properly and there is even the risk of making mistakes.

An alternative is to:

  1. Modify back the source code to a < b with a commit called FOO.
View fuzzer.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
#define C_OK 1
#define C_ERR 0
typedef struct clusterNode {
View ae.patch
diff --git a/src/ae.c b/src/ae.c
index 63a1ab4..79fcde6 100644
--- a/src/ae.c
+++ b/src/ae.c
@@ -221,21 +221,12 @@ long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds,
int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id)
- aeTimeEvent *te, *prev = NULL;