sans-analysis

Redis Info

Setting up Redis on System

Installing Redis:

sudo apt install redis

Starting Redis Server:

redis-server --port <PORT NUMBER> &

Shutting Down Redis:

redis-cli shutdown

Starting CLI:

redis-cli

Interating with Redis via CLI

Get the Value Associated With “key”

get key

Set the Value Associated With “key” to “value”

set key value

Pushing Onto List (Left and Right Push)

Popping From List (Left and Right Push)

Getting List Values From Left (Ending Num is Inclusive)

Using Redis With Python

Installing:

pip3 install redis

Quickstart:

>>> import redis
>>> r = redis.Redis(host='localhost', port=6379, db=0, decode_responses=True)
>>> r.set('foo', 'bar')
True
>>> r.get('foo')
'bar'