Skip to main content

Posts

Password Protect Excel Sheet

We all use excel sheets for some or the other purpose and many times we also want to protet them to restrict unauthorized access. Here are the simple steps to protect excel sheets (latest excel version): Open the excel sheet. From top menu, click on "File". Then select "Passwords..." Enter "Password to open". Enter "Password to modify". Next, you will be asked to "Reenter password to proceed". Same as Step 4. Next, you will be asked to "Reenter password to modify". Same as Step 5. Save and close the file. That's it. Next time when you open the file, you will be prompted to enter the password.   P.S. Click here to access my other posts.
Recent posts

Automated API Monitoring & Status Page

Have you ever thought about setting automated API monitoring? If yes, then it is good idea to setup an open source status page as well for your APIs. This way, you can establish trust and provide a view to your clients to check how your APIs are behaving over past few days. There could be several other ways to implement this, but this is what I am going to propose. Basically, we can interconnect few systems together and automatated API monitoring and status page. The workflow will be something like this: Build API monitoring script using Postman tool Export Postman collection Install following softwares on AWS EC2 instance: Jenkins (Installation steps in serarate article) Cachet (Installation steps in serarate article) MariaDB (Installation steps in serarate article) Newman (Command Line Postman Utility) (Installation steps in serarate article) Setup Jenkins job and configure postman collection using Newman Configure Jenkins job to run periodically Next, when

Securing Websited Hosted with Apache Web Server

In my previous article about Creating or Updating Users in htpasswd File, we saw how to create, update and remove user from htpasswd file. In this article, we will see how we can configure this file in Apache web server so that users will be prompts to provide credentials for accessing the web sites hosted with Apache web server. Follow my previous article and setup the users. Next, go to httpd and open the file which has virtual host configurations for your web site. Update the virtual host entry, it should looks something like this: Note that AuthType , AuthName , AuthUserFile and Require are important. Make sure to remove " Require all granted " from the virtual host entry (if you have it already). Otherwise, your website will be accessible without any authentication. That's it. Restart you Apache Web Server and now you will be prompted to provide credentials when you try to access the web site. P.S. Click here to access my other posts.

Creating or Updating Users in htpasswd File

The Apache   HTTP Server is free and open-source cross-platform web server. It can be configured to protect either entire website or part of the website. Once the authentication is enabled, user will be prompted to enter credentials to access the web pages. It is two step process, first, we need to setup the user credentials, and second, we need to configure these credentials in Apache. In this article, we will be covering the first part i.e. setting the user credentials. We will be using htpasswd comand line tool to create and manage users. I would suggest to login a root user. Let's say, we will be storing user credentials in this file: /etc/.apache_users 1. Setup credentials for very first user 2. Add new user to existing file ( note: do not use -c option, if already exists, it is rewritten and truncated ) 3. Update password for existing user 4. Remove user from the file In next article , we will cover how to configure these credentials in Apache. P.S. Click

Sublime Text 3 - Multi Select and Multi Edit

I use Sublime Text 3 text editor for viewing and editing files. Sublime Text offers various features. There is one important and useful feature - You can search and select multiple instances at one and replace them with a different text. For example, if you have text "-test" in multiple places in the document and if you want to replace the text with "-prod" at once for all the selected instances, then here are simple steps: Open the document in Sublime Text Select any string in the document, for my example I am selecting "-test" Now press: MAC: Command + Control + G Windows: Alt + F3 Now you will notice that all the occurrences are selected and highlighted Now hit Delete or Backspace Type different text, for my example I am typing "-prod" You can see that the text is now replaced with new value   P.S. Click here to access my other posts.

Postman - Storing and Retrieving Numeric Values from Environment Variables

If you are using Postman for your API testing and if you want to store and retrieve numeric values from environment variables, then here is a simple trick - use "Number" function. Let me explain the problem and solution. Problem: I want to store numeric value in environment variable, for example - response time, then I want to retrieve the value from this environment variable and use for comparison. Solution: To store response time in environment variable, use setEnvironmentVariable function To retrieve the value from environment variable, use postman.<variable_name> To convert variable value to number for comparison, use Number() function   P.S. Click here to access my other posts.

How to Extract Values from Response Header in JMeter?

JMeter is a powerful tool for API testing. Let's say you are are writing test cases for one of your RESTful service; and you want to extract and validate the value returned as part of response header. It is little bit tricky to extract the value from Response Header in JMeter , but it is possible. For example, your RESTful service returns "ETag" in response header. When you look at the raw response data, the value is displayed something like this: ETag: 2666d92fa9ebf10250acdb235546f045 To exact value of this reaponse header in JMeter: Right click on your HTTP request, then add Post Processor element - Regular Expression Extractor Select Radio button - Main sample only Select Radio burron - Response Headers Type some name in Reference Name section - for example, eTagVariable Type this expression in Reference Expression section - ETag:\s+(.+) IMPORTANT: This expression will select pick the ETag response header parameter and select everything after colon bla

MAC OS - Change Screenshots Location

If you want to take screenshot on your MAC OS, then it is very simple, just press and hold command+shift+4, then selected desired area, and when you leave these buttons, the screenshot will be saved on Desktop. That's right, MAC OS saves screenshots on your desktop by default. As the number of screenshots increase, and if you don't delete or move the old ones, your desktop becomes really messy. What if we need to change the location, can we do that? Yes, of course. Here are the simple steps: Create the folder for screenshots, for example, ~/Documents/MyScreenshots. Open Terminal Execute command: defaults write com.apple.screencapture location ~/Documents/MyScreenshots Then execute command to apply the changes: killall SystemUIServer That's it. Now try taking the screenshots. You will notice that the screenshots are saved in the new folder. You need to make sure you create folder first and then execute these commands, otherwise screenshots would still appear on you

MariaDB / MySQL - Access denied for user 'root'@'localhost'

I am using MariaDB for one of the project and today I encountered some weird issue while connecting from command line. For those who are not familiar with MariaDB - it is basically open source version of MySQL . Click here to get more information about MariaDB. Also, click here to read various MariaDB articles, basic commands, etc. You can access various training tutorials here . Alright, so I was trying to login to MariaDB from my Ubuntu Command Prompt but I was constantly getting error: Access denied for user 'root'@'localhost' I was going in various directions, but the solution to this problem was very very simple. I just had to run the login command with sudo , can you believe it? If prompted, you will have to type sudo password. Just so you know, default password for MariaDB root user is <nopassword> , that's right, it does not have any password. P.S. Click here to access my other posts.

VirtualBox - Access Internet from Guest Machine

Oracle VirtualBox is a free, open source and powerful virtualization tool. Some minor configurations tweaks are required to access guest localhost from host computer. I am running VirtualBox with Ubuntu on my MAC OS. If you are attempting to access internet from your virtual machine, but if you are getting error, then here are few steps that you can try. In my scenario, I also wanted to access guest localhost from host system . I was able to access internet from the virtual machine after these steps: Shut down virtual machine In VirtualBox, right click on the virtual machine and go to " Settings " Select " Network " tab Select " Adapter1 " Select " Enable Network Adapter " checkbox Click on " Attached to " drop down box and select " NAT " Select " Adapter2 " Select " Enable Network Adapter " checkbox Click on " Attached to " drop down box and select " Host-only Adapter "