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.
Get all products that a certain user viewed in the last 24 hours.
Get all products viewed by all users in the last 24 hours.
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 https://martinfowler.com/articles/consumerDrivenContracts.html https://docs.pact.io/ https://github.com/pact-foundation/pact-js https://docs.pact.io/documentation/matching.html Also seems like a...read more
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
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
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 $(docker ps -a -q) && docker rm $(docker ps -a -q)read more
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 mysqluserread more
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
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
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
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