Linux: Compress an Entire Directory or a Single File

Use the following command to compress an entire directory or a single file on Linux. It’ll also compress every other directory inside a directory you specify–in other words, it works recursively.

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

Here’s what those switches actually mean:

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
  • -f: Allows you to specify the filename of the archive.

To extract use below

tar -xzvf archive.tar.gz

Basic Auth

lets say id:password are aseem:password, when encoded it looks like YXNlZW06UGFzc3dvcmQ=

Here is the sample request with basic auth

curl –request POST ‘’ \–header ‘Content-Type: application/json’ \–header ‘User-Agent: latest’ \–header ‘Authorization: Basic YXNlZW06UGFzc3dvcmQ=’ \–

In IntellIJ IDEA how can I exclude a few files from find in path?

!*.json, !*.txt,!*.js,!*Test*.java,*.java 

In IntelliJ 2021, you can include specific file type by .ext1 separated with commas and to exclude them with !.ext2

Refer image, I need only .java file and not !.js
you can also exclude ! as well.

What is a test fixture

Tests need to run against the background of a known set of objects. This set of objects is called a test fixture. When you are writing tests you will often find that you spend more time writing the code to set up the fixture than you do in actually testing values.

The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Some people call this the test context.

Examples of fixtures:

Loading a database with a specific, known set of data
Erasing a hard disk and installing a known clean operating system installation
Copying a specific known set of files
Preparation of input data and set-up/creation of fake or mock objects

One of the most time-consuming parts of writing tests is writing the code to set the world up in a known state and then return it to its original state when the test is complete. This known state is called the fixture of the test.

AWS Certified Cloud Practitioner

Hi Friends,

I am happy to share that have passed another AWS cloud certification exam. The training and sponsorship was provided by Rackspace Cloud (AWS partner). This exam “AWS Cloud Practitioner” is relatively very simple in comparison to “AWS Solutions Architect“. I finished it in almost half the time 😉 given in exam.

The certificate is issued by AWS Training and Certification.

Feel free to reach out to me if for any help, assistance, guidance or motivation related to AWS certification.

AWS Certified Solutions Architect Associate SAA-C02

After working in cloud industry for more then 8 years, finally I am now a certified AWS Cloud Solutions architect 🙂

The certificate is issued by AWS Training and Certification.