Code Snippets
πŸ“œ

Code Snippets

Tags
Programming
Published
June 26, 2023
Author
Soumendra Kumar Sahoo

Always keeping the services up.

function finish { # re-start service sudo service mongdb start } trap finish EXIT # Stop the mongod instance sudo service mongdb stop # (If mongod is configured to fork, e.g. as part of a replica set, you # may instead need to do "sudo killall --wait /usr/bin/mongod".)
source: http://redsymbol.net/articles/bash-exit-traps/

Get the memory size of Redis

apt-get install redis -y && redis-cli -h $REDIS_HOST info memory | grep '.*human';
source: https://stackoverflow.com/a/66967712/5014656
Β