Skip to content

Instantly share code, notes, and snippets.

@nickyleach
nickyleach / Lock.php
Created September 10, 2012 22:54
Simple redis-backed Mutex
<?
class Lock {
const TIMEOUT = 20;
const SLEEP = 100000;
/**
* Stores the expire time of the currently held lock
* @var int
@nickyleach
nickyleach / concat.sh
Created October 2, 2012 05:06
De-sharding Redis
scp redis-server-1:/var/lib/redis/appendonly.aof /var/lib/redis/appendonly.aof.1
scp redis-server-2:/var/lib/redis/appendonly.aof /var/lib/redis/appendonly.aof.2
cat /var/lib/redis/appendonly.aof.* > /var/lib/redis/appendonly.aof

Keybase proof

I hereby claim:

  • I am nickyleach on github.
  • I am nleach (https://keybase.io/nleach) on keybase.
  • I have a public key whose fingerprint is 2CDE C5B4 5CCE 7DE7 360E 502C 1931 C762 BE52 E7C5

To claim this, I am signing this object: