Skip to content

Instantly share code, notes, and snippets.

Itamar Haber itamarhaber

Block or report user

Report or block itamarhaber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docs.Dockerfile
FROM alpine
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin
COPY requirements.txt /mkdocs/
WORKDIR /mkdocs
RUN apk --update upgrade \
&& apk --no-cache --no-progress add py-pip \
&& rm -rf /var/cache/apk/* \

ACL v6RC1 default app profile

The purpose of this exercise is to define a "default" application ACL profile that can access the all the data without being able to cause too much harm.

Additive ("future-proof") profile

Required extra permissions:

  • All functional categories
itamarhaber /
Created Oct 2, 2018
Naively call RedisTF from Python with redis-py
  1. Clone, sh, and make run
  2. pip install redis tensorflow
  3. cd models
  4. Run python to prepare a minimal graph
  5. The attached demonstrates how to run the test in the README from Python:
$ python
Setting the graph: OK
Setting tensor t1: OK
itamarhaber /
Created Jul 20, 2018
Edgexfoundry and Redis for Core Data PoC

Edgexfoundry and Redis for Core Data PoC


  • Implement the Redis client for edgex-go core data client tests/benchmarks
  • Compare between TCP, UDS and embedded Redis connections vs. Mongo's

Setting up

Server set up

itamarhaber /
Created Feb 23, 2018
Some thoughts about "Building a sliding window rate limiter with Redis"

Reading Building a sliding window rate limiter with Redis, and w/o addressing the actual logic (which may or may not work).

Optimize by:

  1. Lua seems a much better choice: idiompotent, portable, server-side, less bandwidth, atomic...
  2. The call to ZRANGEBYSCORE seems to be unused, should be commented out if so
  3. Looking at the use of ZRANGE, it appears that ZCARD it what's actually needed

The (untested) Lua snippet:

View xmas.lua
0,{} while
h>0 do local
l='' h=h-1 for
x=0, 38 do local
a=x-6 if a<0 then a
= -a end if a <= d then
l = l .. '*' elseif (0.3/
(h+1)) > math.random() then
itamarhaber / setbitrange.lua
Last active Dec 20, 2017
A somewhat optimized scripted approach to complementing Redis with a `SETBITRANGE` command
View setbitrange.lua
Sets a bitmap range
Bitmaps are stored as Strings in Redis. A range spans one or more bytes,
so we can call `SETRANGE` when entire bytes need to be set instead of flipping
individual bits. Also, to avoid multiple internal memory allocations in
Redis, we traverse in reverse.
Expected input:
KEYS[1] - bitfield key
itamarhaber /
Created Dec 5, 2017
Threaded Redis PubSub demonstration in Python w/ redis-py
# Demonstrates PubSub
import threading
import redis
class Listener(threading.Thread):
def __init__(self, r, p):
self.redis = r
self.pubsub = self.redis.pubsub()
itamarhaber /
Last active Jul 17, 2017
A friend forwarded me this and swears this is a real email. I read it it like 4 times and I still can't figure out if it is real or shit. True modern day Voynich :)



Subject: Organizational challenges

Hi, As CDO of this company, it is my job to also to organizate because that's what the big-O in my title is for. Right?

I don't know everything about anything or nothing, but I feel compelled to do my job and clearly organilizing - my expertise after all - is the solution. Since I have the class' attention now I guess I'll need to improvise so:

itamarhaber /
Created Mar 27, 2017 proof of identity

Keybase proof

I hereby claim:

  • I am itamarhaber on github.
  • I am itamarhaber ( on keybase.
  • I have a public key whose fingerprint is 94E5 0F40 576C 29EA A92A E109 42AF AD7E F4D9 878B

To claim this, I am signing this object:

You can’t perform that action at this time.