How to hash files in Linux?

How many times have you needed to get the hash of any file in Linux? For whatever purpose you have needed to do that, rest assured that there is a set of commands that will make your life easier. These commands are part of Linux core utils. MD5 md5sum <file_name> SHA-1 sha1sum <file_name> SHA-256 sha256sum <file_name> SHA-384 sha384sum <file_name> SHA-512 …

How to create a Node.JS application with Express Generator

I am assuming that you already have Node.JS installed. If you don’t, worry not! you can get your own copy today from the Node.JS download section! Using ExpressJS is very quick and easy. It generates all the file structure needed for a web application. You can select  any of the different views they have available, in this case I am …

How to Encrypt / Decrypt with AES (CCM & GCM) in Node.JS

First of all we have to understand what is CCM mode and GCM mode. Roughly: CCM CCM mode (Counter with CBC-MAC) is a mode of operation for cryptographic block ciphers. It is an authenticated encryption algorithm designed to provide both authentication and confidentiality. CCM mode is only defined for block ciphers with a block length of 128 bits. GCM Galois/Counter …

How to add sudo users in Linux

First of all you have to be logged in as root. Just type command below followed by your password: terminator@skynet:~$ sudo su – [sudo] password for terminator: Now that you are root you can use the following command to create the user: adduser <username> You will be prompted for password, information and confirmation. Once done you can use the following …

How to see running processes in Linux

One essential command to know when you are experimenting in Linux is the command to see which processes are running in your machine, just in case you need to kill one of them for any reason. This command is top and you use it like this: Type top in a Linux Terminal and press Enter: pi@raspberrypi:~ $ top You should …

Check property of JSON response in Postman

In the Tests section of any request you can check if the JSON response contains or doesn’t contain a specific property like this: // Verify that header object is NOT returned pm.test(“Verify that header:{…} object is NOT returned”, function () {  pm.expect(pm.response.json()).to.not.have.property(‘header’); }); // Verify that data object is returned pm.test(“Verify that data:{…} object is returned”, function () {  pm.expect(pm.response.json()).to.have.property(‘data’); …

How to see available disk space in Linux

Playing around with a Raspberry PI I came to need this info. Here is the command: df -h You should see something similar to this: pi@raspberrypi:~ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/root 26G 6.5G 18G 27% / devtmpfs 334M 0 334M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.4M 456M 2% /run …

How to know which Linux version you are running

Easy peasy! Run the following command in a Terminal: lsb_release -a You should see something similar to this: pi@raspberrypi:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster

How to reset Raspbian 10 (Buster) password on Raspberry PI 4

Hey! if you are reading this chances are you forgot the password to your Raspberry PI. Worry not though here is how to reset it on Raspbian 10 Buster using a Raspberry PI 4, I don’t really think the model of Raspberry PI matters but it’s just to give you a better idea of my environment. First start your Raspberry …

How to delete a collection of IDs in POSTMAN

Today I had to delete several objects that I created when testing an API. It was very easy to click the Send button and create a bunch of stuff but now I have to clean the DB. I am using Postman as testing tool and I chose to execute the following code in the Pre-request Script of my test. The …