Skip to content

Instantly share code, notes, and snippets.

@bluetoothfx
Last active May 29, 2023 07:04
Show Gist options
  • Select an option

  • Save bluetoothfx/9a9bc13b6975e94505e163fec0bd86cb to your computer and use it in GitHub Desktop.

Select an option

Save bluetoothfx/9a9bc13b6975e94505e163fec0bd86cb to your computer and use it in GitHub Desktop.

Revisions

  1. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion redis.learn
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    # run redis cli
    > redis-cli
    # combining previous 2 command
    docker exec -it redis1 redis-cli
    > docker exec -it redis1 redis-cli


    # To set redis container visible outside
  2. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,9 @@
    > docker exec -it redis1 sh
    # run redis cli
    > redis-cli
    # combining previous 2 command
    docker exec -it redis1 redis-cli


    # To set redis container visible outside
    > set bind 0.0.0.0
  3. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -74,8 +74,8 @@ https://redis.io/commands
    https://auth0.com/blog/introduction-to-redis-install-cli-commands-and-data-types/

    # Redis troubleshooting & experience share
    https://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production/

    https://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production
    https://www.slideshare.net/RedisLabs/redisconf18-2000-instances-and-beyond



  4. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -70,6 +70,12 @@ https://redis.io/topics/persistence
    # Redis commands
    https://redis.io/commands

    # Redis basics at a glance
    https://auth0.com/blog/introduction-to-redis-install-cli-commands-and-data-types/

    # Redis troubleshooting & experience share
    https://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production/




  5. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -40,6 +40,19 @@
    # exit form cli & shell
    > exit

    ------------------------------------------------------------------------------
    LOGIN FROM REDIS-CLI TO REDIS SERVER
    ------------------------------------------------------------------------------
    # To use redis cli without server follow following guideline then use below command
    https://redislabs.com/blog/get-redis-cli-without-installing-redis-server/
    # actually node index.js opening a redis-cli
    https://github.com/lujiajing1126/redis-cli

    # redis cli login from user pc
    > node index.js -h <ip address/host address>
    # redis cli login from user pc with pass
    > node index.js -a <your password> -h <ip address/host address>


    -------------------------------------------------------------------------------
    SOME REDIS Help Line
  6. bluetoothfx revised this gist Mar 1, 2020. No changes.
  7. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion redis.learn
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@


    -------------------------------------------------------------------------------
    SOME REDIS COMMAND
    SOME REDIS-CLI COMMAND
    -------------------------------------------------------------------------------
    > ping //check redis cli
    # setting a value
    @@ -30,6 +30,12 @@
    # get all keys
    > KEYS '*'
    > --scan --pattern '*'
    # get all redis configuration
    > CONFIG GET *
    # get redis configuration
    > CONFIG GET <config_name>
    # set redis configuration
    > CONFIG SET <config_name>

    # exit form cli & shell
    > exit
  8. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,9 @@
    > set bind 0.0.0.0
    > save

    # redis inspection
    > docker inspect redis1


    -------------------------------------------------------------------------------
    SOME REDIS COMMAND
  9. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion redis.learn
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # To get & run redis on docker (6379 is default port)
    > docker run -d -p 6379:6379 --name redis1 redis
    # Run redis on docker & guaranteed backup
    # Run redis on docker & guaranteed backup (-create /home/redisDB directory 1st in your host machine)
    > docker run -v /home/redisDB:/data -d -p 6379:6379 --name redis1 redis redis-server --appendonly yes
    # to check if redis is functioning in docker (status checking)
    > docker ps
  10. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # To get & run redis on docker (6379 is default port)
    > docker run -d -p 6379:6379 --name redis1 redis
    # Run redis on docker & guaranteed backup
    > docker run -v /home/redisDB:/data -d -p 6379:6379 --name redis1 redis redis-server --appendonly yes
    # to check if redis is functioning in docker (status checking)
    > docker ps
    # to view redis logs
    @@ -40,6 +42,12 @@ https://redislabs.com/blog/get-redis-cli-without-installing-redis-server/
    # Make Radis container available outside of host machine
    https://stackoverflow.com/questions/41371402/connecting-to-redis-running-in-docker-container-from-host-machine

    # Redis Persistance
    https://redis.io/topics/persistence

    # Redis commands
    https://redis.io/commands




  11. bluetoothfx revised this gist Mar 1, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,9 @@
    > set name mango // set <key> <value>
    # getting a value
    > get name // get <key>
    # get all keys
    > KEYS '*'
    > --scan --pattern '*'

    # exit form cli & shell
    > exit
  12. bluetoothfx revised this gist Feb 29, 2020. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion redis.learn
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,12 @@
    > docker exec -it redis1 sh
    # run redis cli
    > redis-cli

    # To set redis container visible outside
    > set bind 0.0.0.0
    > save


    -------------------------------------------------------------------------------
    SOME REDIS COMMAND
    -------------------------------------------------------------------------------
    @@ -21,9 +27,15 @@
    > exit


    -------------------------------------------------------------------------------
    SOME REDIS Help Line
    -------------------------------------------------------------------------------

    # Install redis CLI without server (Help for testing)
    https://redislabs.com/blog/get-redis-cli-without-installing-redis-server/


    # Make Radis container available outside of host machine
    https://stackoverflow.com/questions/41371402/connecting-to-redis-running-in-docker-container-from-host-machine



  13. bluetoothfx created this gist Feb 27, 2020.
    31 changes: 31 additions & 0 deletions redis.learn
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # To get & run redis on docker (6379 is default port)
    > docker run -d -p 6379:6379 --name redis1 redis
    # to check if redis is functioning in docker (status checking)
    > docker ps
    # to view redis logs
    > docker logs redis1
    # start a new interactive session (-it) inside the running container
    > docker exec -it redis1 sh
    # run redis cli
    > redis-cli
    -------------------------------------------------------------------------------
    SOME REDIS COMMAND
    -------------------------------------------------------------------------------
    > ping //check redis cli
    # setting a value
    > set name mango // set <key> <value>
    # getting a value
    > get name // get <key>

    # exit form cli & shell
    > exit