Posts

How to check the Redis version?

< 1 min readTo check the version of Redis that is currently running, you can use the “redis-cli” command with the “info” command. This command returns a variety of information about the Redis server, including the version number. You can run the command in the command line by typing: This command shows the version of Redis server running,…

Read More

What is Redis?

2 min readRedis is an open-source, in-memory data structure store that is used as a database, cache, and message broker. It is often referred to as a “NoSQL” database, as it does not use the traditional table-based relational model used by SQL databases. Instead, it uses a key-value store model, which allows for extremely fast data retrieval…

Read More

How to start and stop a Redis server?

< 1 min readTo start a Redis server, you can use the “redis-server” command in the command line. This command starts the Redis server and listens for connections on the default port (6379). You can run the command in the command line by typing: You can also specify a configuration file using the redis-server command, the path of…

Read More

How to get all available keys in Redis?

< 1 min readTo get all available keys in Redis, you can use the “KEYS” command. This command takes a pattern as an argument and returns all keys that match the pattern. You can run the command in the redis-cli by typing: where “pattern” is the pattern you want to match. For example, to get all keys that…

Read More

How to delete everything in Redis?

< 1 min readTo delete everything in Redis, you can use the “FLUSHALL” command. This command will remove all keys from all databases in the Redis instance. You can run the command in the redis-cli by typing: or in python redis library Please be careful when using this command, as it will permanently delete all data stored in…

Read More

How to setup an auth.json file for Composer?

< 1 min readComposer uses an auth.json file to authenticate with private package repositories. The file is usually located in your home directory and is named “.composer/auth.json”. Here’s an example of what the contents of an auth.json file might look like: The http-basic key is used to authenticate with repositories that use basic authentication. The value is an…

Read More

How to create a function in PHP?

< 1 min readTo create a function in PHP, you can use the function keyword followed by the name of the function, a list of arguments in parentheses, and a block of code in curly braces. Here is an example of a simple function in PHP that takes two arguments and returns their sum: In this example, the…

Read More