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 …

How to delete a WordPress.com website

If you are like me and you have a new hosting service for your blogs you may know that after moving from WordPress.com to WordPress.org you may want to delete that old website. Here is how to do it. 1- Open your web browser and navigate to the blog you want to delete, in my case https://kryptosit.wordpress.com 2- Click on …

Base64 URL Safe Encoding / Decoding (RFC-7515)

A few days back I was required to encode some string in base 64 URL safe. After some research I found that there are several variants of base 64. The one implemented in the code below corresponds to RFC-7515. Here is the code: function encodeBase64Url(str) { let s = new Buffer(str).toString(‘base64’); // Regular base64 encoder s = s.replace(‘=’, ”); // …

How to remove documents from a capped collection in MongoDB

You can’t remove one or all documents from a capped collection in MongoDB. BUT! you can drop the collection! Execute the following command: db.getCollection(‘myCollection’).drop() The result for me is: true There you go, quick and easy. Sources https://docs.mongodb.com/manual/core/capped-collections/ https://stackoverflow.com/questions/33048282/how-to-remove-a-document-from-the-capped-collection

How to count documents of a collection in MongoDB

Today, I had to do this at work. turns out it is very easy. I am using Robomongo 1.0-RC1. I just double click on the collection that I want, in this case knives and I just execute the following query: db.getCollection(‘knives’).count() The result in my case is: 1911 Hope it helps! Sources https://docs.mongodb.com/manual/reference/method/db.collection.count/

How to create a strong password?

There are a few things you can do to create a strong password that will protect your account from being compromised. Use lower case, upper case, numbers, and symbols (check list of valid symbols, this could vary depending on the website / system) Use at least 12 chars to allow a wide key space Don’t use common words or easy-to-guess …