Ir al contenido principal

Entradas

Mostrando las entradas etiquetadas como In a nutshell

GCloud: Changing the default project (in a nutshell)

gcloud command line tool allow us managing a list of Google Cloud projects, one of which is considered as the default project, so all the operations we perform via gcloud are performed on it. Available projects To check what projects are available via gcloud , run the command: $ gcloud projects list This command drops an output similar to this example: PROJECT_ID NAME PROJECT_NUMBER fooOrg-pr01 Project Bar 239785793387 fooOrg-pr02 Project Zaz 348328582382 ... You can check the available options in the GCloud SDK reference . Current default project As you can see, that output doesn't set what is the default project. To get it run this command: $ gcloud config get-value project The command output will show the ID of the default project. Following the above example, the output of the command could be fooOrg-pr01 to state that the default project is our Project Bar. Changing the current default project To change the default project, run this comman...

Useful redis commands (in a nutshell)

redis-cli , the Redis command line tool, is a quick shortcut for running the most common operations that require our everyday job. Let's review them in a nutshell: To open a server session, run the console command: shell> redis-cli -h <hostname> The password can be specified in the above command by setting the -a <password> argument, but for security reasons it's better to authenticate once in the redis-cli console: redis> AUTH [username] password Again from the console, to check if one ore more keys exist: redis> EXISTS <key> [<key> ...] To search keys matching a given pattern: redis> KEYS <pattern> To get an entry value given its key: redis> GET <key> To delete an entry given its key: redis> DEL <key> To quit the redis-cli session: redis> EXIT Lastly, to access to the redis-cli command reference click here .

Update NPM to the latest version (in a nutshell)

To update npm itself to its latest version, run the command: npm install -g npm@latest If working on Linux/Mac, chances are that you need superuser rights, so prefix the above command with sudo : sudo npm install -g npm@latest Finally, to check the version before and after updating, run the command npm -v

Go code organization (in a nutshell)