Redis Info

some examples

from SO:
Here’s one approach. Whenever a user views a product, create a key of the form,

and set this key’s expiry to 24 hours. After 24 hours this key will be deleted automatically. The value can be anything, but if you are interested in knowing exactly when the user viewed the product, then store the timestamp as the value of this key.

Searching for keys by pattern will allow you to make the above queries.

Get all users that a certain product in the last 24 hours.

KEYS user:*:products_viewed:5400

Get all products that a certain user viewed in the last 24 hours.

KEYS user:53:products_viewed:*

Get all products viewed by all users in the last 24 hours.

KEYS user:*:products_viewed:*

Consumer-Driven Contracts: links

Posted by on Feb 8th, 2017 in Misc Tech | 0 comments

I like the idea of CDC, certainly easier to aspire to than to implement, would be interested to hear actual success stories. Also the examples showing 1-to-1 matching criteria seem to against the intention of “not caring exactly what the data is, as long as it satifies my needs”. Consumer-Driven Contracts: A Service Evolution Pattern Also seems like a...

read more

Docker Compose LAMP demo project

Posted by on Jul 21st, 2016 in Apache, Docker, LAMP/Node, Misc Tech, MySql, PHP | 0 comments

Project showing a basic LAMP set-up using a networked multi-container configuration. docker-compose.yml version: '2' services: php: image: phpmyadmin/phpmyadmin links: - mysql:db depends_on: - mysql mysql: image: k0st/alpine-mariadb volumes: - ./data/mysql:/var/lib/mysql environment: - MYSQL_DATABASE=mydb - MYSQL_USER=myuser - MYSQL_PASSWORD=mypass nginx: image: nginx:stable-alpine ports: - "81:80" volumes: - ./nginx/log:/var/log/nginx ...

read more

Docker remove only exited containers

Posted by on Jul 19th, 2016 in Docker, Misc Tech | 0 comments

To remove just the containers that have exited as opposed to all (ps -aq) you can do: docker rm $(docker ps -a | grep Exit | cut -d ' ' -f 1)

read more

Connect to Docker for Mac Alpine Host

Posted by on Jul 11th, 2016 in Docker, LAMP/Node, Mac Tech, Misc Tech | 0 comments

The new Docker for Mac (mid-2016) doesn’t work the same way as previous versions or the native linux version. To interact with the Docker Host VM, instead of SSH, you can use: screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty and login with root user. No password should be required. You can also get networking, etc info about the host by querying a container host-networked like so: docker run --rm --privileged --net=host alpine...

read more

Docker stop and remove all active containers

Posted by on May 30th, 2016 in Docker, Misc Tech | 0 comments

docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)

read more

Docker pass term env to container with exec

Posted by on May 29th, 2016 in Docker, Misc Tech | 0 comments

Sometimes you need quick interactive access to a container that doesn’t have the TERM environment set, so you can pass it via something like this: docker exec -ti mysql env TERM=xterm mysql -u mysqluser

read more

Alpine Linux with Docker – node build tool updates

Posted by on May 10th, 2016 in Docker, LAMP/Node, Linux, Misc Tech | 0 comments

Smaller distros like Alpine for containers just seems to make sense. Some build tools for node.js include: apk --update add bash nano wget python make gcc g++ You can install on a “build” container and create an artifact to transfer to a sparse box without the build tools. See base images like: mhart/alpine-node.

read more

Solved: Adobe Lightroom CC 2015 update problem

Posted by on Apr 4th, 2016 in Mac Tech, Misc Tech | 0 comments

After realizing my Adobe Lightroom CC 2015 at home hadn’t been auto-updating (and needed the latest update to be compatible with recent Sony raw format), nothing seemed to fix it — neither trying manual download nor updating permissions or other common online advice. (It was updating fine on another machine.) The solution turned out to be: delete the file: /Library/Application Support/Adobe/AAMUpdaterInventory/1.0/AdobeUpdaterAdminPrefs.dat Symptoms were: the “update” option under the help menu was disabled and the...

read more

Docker network info, linked containers

Posted by on Jan 3rd, 2016 in Docker, Misc Tech | 0 comments

To see network info for Docker host, use the network (v1.9+) command: docker network [OPTIONS] COMMAND [OPTIONS] To link containers by name, you now need to use the –link command: The docker network inspect command above shows all the connected containers and their network resources on a given network. Containers in this default network are able to communicate with each other using IP addresses. Docker does not support automatic service discovery on the default bridge network. If you want to communicate with container...

read more

Basic Docker usage stats

Posted by on Jan 3rd, 2016 in Docker, Misc Tech | 0 comments

Display a live stream of container(s) resource usage statistics: docker stats [OPTIONS] CONTAINER [CONTAINER...] To see all running containers: docker stats $(docker ps -q)

read more

No Responses to “ “Redis Info”


  1. Redis page created | LDG Tech Blog - [...] link > Redis Page [...]

Leave a Reply