Skip to content

Instantly share code, notes, and snippets.

@itamarhaber
itamarhaber / 99-misc
Last active August 29, 2015 14:19
Redis commands evolution
# get Redis' repo tags and their dates
git log --tags --simplify-by-decoration --pretty="format:%ct %d" | awk 'BEGIN { print "timestamp, tag" } /.*\(.*\)/ { print $1 ", " substr($3, 0, length($3)-1) }' > tags.csv
git log --tags --simplify-by-decoration --pretty="format:%ct %d" | awk 'BEGIN { print "{ \"releases\": [" } /.*\(.*\)/ { print " { \"timestamp\": " $1 ", \"name\": \"" substr($3, 0, length($3)-1) "\" }," } END { print " { \"timestamp\": 0, \"name\": \"the-big-bang\" }"; print "]}" }' > tags.json
@itamarhaber
itamarhaber / butt-emoticons.md
Last active August 29, 2015 14:19
Butt Emoticons

Butt Emoticons

(!)     the basic one
(_!_)   the fuller one
(.)     the flat one
(:)     the one plus one, a.k.a colons
(8)     the too weird one
(,)     the caught in the act one
(;) the 60FPS one
@itamarhaber
itamarhaber / 00_benchmarking-theorem.png
Last active August 29, 2015 14:20
Haber's Benchmarking Theorem (as postulated for Ask a Redis Expert™ Webinar: How to Achieve 1.5M ops/sec with Redis, https://www.youtube.com/watch?v=yS-Z9JnkWsA)
00_benchmarking-theorem.png
@itamarhaber
itamarhaber / external-references.md
Created May 13, 2015 14:03
20150513 Ask a Redis Expert Webinar - How to achieve 1.5M ops sec with Redis
@itamarhaber
itamarhaber / 00_Redis_Watch_44.NFO
Last active August 29, 2015 14:21
Lost in translation - Redis Watch #44
ii ii ii ii
ii ii ii ii
ii ii ii
i ii ii ii ii i ii iii ii iiii ii ii ii
iiiiii iiiiii iiiiiiii ii iiiiii ii ii iiiiiiiiiiiiii iiiiii iiiiiii
iiiiiiiiiiiiii iiiiiiiii ii iiiiii ii i ii iiiiiiii iiii iiiiiii iiiiiiii
iii iii ii iii iii ii ii i iii ii iiiiii iii ii iii iii iii
iii iiiiiiiii ii ii ii iiiii ii iiii ii ii ii ii iii ii ii
ii iiiiiiiii ii ii ii iiiii iiiiiiiiii ii ii ii ii ii ii
ii iii ii iii ii iii iiiiiiiii iii iii ii iii ii ii
@itamarhaber
itamarhaber / urls.md
Last active August 29, 2015 14:22
Redis & MongoDB Stop Big Data Indigestion Before It Starts
  1. Redis Watch - a weekly newsletter about everything Redis: http://bit.ly/RedisWatch
  2. WiredTiger iiBench Results: https://github.com/wiredtiger/wiredtiger/wiki/iiBench-results
  3. Redis Website: https://redis.io/
  4. Redis repository: https://github.com/antirez/redis
  5. Antirez's blog: http://antirez.com/
  6. Recorded webinar - How to Achieve 1.5M ops/sec with Redis: https://www.youtube.com/watch?v=yS-Z9JnkWsA
  7. Try Redis: http://try.redis.io/
  8. Download Redis Labs Enterprise Cluster: https://redislabs.com/redis-enterprise-downloads
  9. Redis Clients page: http://redis.io/clients
@itamarhaber
itamarhaber / redis rdb ttl
Created July 23, 2015 11:57
What happens to volatile keys when loading from RDB in Redis?
foo@bar:~$ redis-cli
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> set p persistent
OK
127.0.0.1:6379> set v volatile
OK
127.0.0.1:6379> expire v 99999999
@itamarhaber
itamarhaber / 10-redis-commandments.md
Last active September 25, 2015 08:49
Ten Redis Commandments

creative

"Went up the mountain, spent some time there, a bush or something was burning and I must have inhaled the smoke because I came back down carrying these two slabs of stone...", HippieLogLog

Ten Redis Commandments

I. I am thy open source, BSD licensed, data structure store

II. Thou shalt have no other data but that which fits in RAM

@itamarhaber
itamarhaber / output.txt
Created September 27, 2015 06:54
memtier_benchmark results for Memcached and Redis using the defaults on a i5 laptop in a VM
foo@bar:~/memtier_benchmark$ ./memtier_benchmark -p 11211 -P memcache_text -x 1
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 100%, 46 secs] 0 threads: 2000000 ops, 44427 (avg: 43467) ops/sec, 1.27MB/sec (avg: 1.24MB/sec), 4.50 (avg: 4.58) msec latency
4 Threads
50 Connections per thread
10000 Requests per thread
Type Ops/sec Hits/sec Misses/sec Latency KB/sec
------------------------------------------------------------------------
@itamarhaber
itamarhaber / code.py
Created November 21, 2015 21:14
Trash Mention's alerts
import requests
import json
jt = json.dumps({'trashed': True})
url = 'https://api.mention.net/api/accounts/<account identifier>/alerts/<alert identifier>/mentions'
gh = {'Accept': 'application/json', 'Accept-Language': 'en', 'Authorization': 'Bearer <token>'}
ph = gh.copy()
ph['Content-Type'] = 'application/json'