Wednesday, October 20, 2021

How to set Python3 as default interpreter for VS Code | or set any version as default interpreter.

Want to run your python code with a particular python version? And, make it the default version?

Read on..

Make sure that the required version is installed. You check the available version and the path by running this command.

 % which python  


 % which python2


 % which python3 


Now you know the path and versions available.
In the VS code, go to the View menu and select Command Pallete

Now search for Python and you will get all the installer versions of python.

Then select Python: Select interpreter. You will get all the installed versions of python. Select the one you want to be associated with your script.

Saturday, October 16, 2021

SOLVED | AdSense Approval Issues and Fixes for Site down or Unavailable | How to Fix

I tried to get an AdSense approval for my site but I got a mail from AdSense saying the site is down or unavailable. But the site is definitely accessible and all the other requirements are taken care of. The site is also very old and the domain itself is 3 years old. There are no issues with page views as well. 

Here is my situation.

I have an approved AdSense for YouTube. I got my blogger site upgrade to a top-level domain. This is the requirement to link your YouTube AdSense to your blogger site.  

I have taken care of all the requirements to apply for the AdSense for my site. 

1. Clean design and unique content. No issue with the design as I have created it using a blogger theme. 

2. About page, Contact Us Page, Privacy Policy Page. These are mandatory 

3. Top-Leve Domain

After applying for the AdSense I got the denial mail and looking at the reason, I was convinced that there must be a small mistake in the Domain setup or blogger settings.   

I tried these things and found the culprit. 

Make sure to check all these steps so that you will not get another denial. 

1. Check if the site is accessible with different combinations of WWW, HTTP and HTTPS

Note that my site still runs without HTTPS, yet to add SSL certificate.  

All these combinations worked. 

So no issues at this point. 

2. Check the DNS settings from your Domain service provider. All CNAME settings were found to be good. Going wrong here has less chances,  if there are any issues with your domain settings, your site may not be accessible. 

So no issues found yet. 

3. Check if you have custom rebots.txt enabled 

This is one of the major reasons why approval is denied. Check the settings of your blog or you can just check the content of your robots.txt by appending robots.txt to the domain URL

Make sure that your robots.txt is not blocking any of the Google servers. 

This is the default robots.txt from my site. 

User-agent: Mediapartners-Google

User-agent: *
Disallow: /search
Allow: /


checked my blogger settings and custom robots was turned off. 

This is also clean and not the culprit for my approval denial. 

4. Upload your sitemap to Google. 

I had done this before but, I did upload the sitemap.xml again. I am not sure if this will cause any issues. As long as your pages are searched from Google and you are getting the views then this should not be a problem. 

I do not think this was a problem for my site. 

5. While configuring your custom domain you might have selected the option "Redirect Domain". 

You will get an option to redirect your non-www site to www site under the Publishing tab of your blogger settings.  

like to

When I checked this setting, it was turned on. I guessed this could be the issue. Since we are providing the non-www site while applying for AdSense. It is better to turn off this redirection. So Google can find and navigate the www site.

My guess was right. After changing this setting,  I again applied for review. After 2 days, I checked the status and it was approved. :) 

Thank you and let me know what worked for you. 

Notes: If you are applying for the AdSense for the first time for your blogger site, then you have to do it from within the blogger's earnings tab. 

If you already have an approved AdSense then you have to have a custom domain and from the AdSense account login, you have to apply for the site approval. 

Friday, October 15, 2021

How to create MS Word document automatically with Excel

MS Word and Excel can do wonders together.  You can do a lot of automation using these 2 applications for your small and medium businesses.  Here is one such solution.  

Generating the MS word report automatically using excel as a data source. Mail merge is used to link data from excel to word. Then a simple macro is used to get the desired record from Excel Spreadsheet.

Download the MS word document and Excel spreadsheet used in this video here

If you are not able to access this link, let me know. The link in my YouTube channel was not working, now I have uploaded the files here. 

Monday, September 27, 2021

[SOLVED] MacBook Pro keyboard backlight not working? Check this post

Keyboard backlight not working on your MacBook Pro? And your Mac has a touch bar? 

Continue reading...

MacBook Pro 2020 which comes with a touch bar has moved its Keyboard backlight controls to the touch bar. You will not see any control on the screen under the Keyboard settings. But the setting in the touch bar is also not easy to see and it bit tricky. You most probably, think that there is some issue with Keyboard. Even the support people suggest resetting some of the settings. That is what happened with my case. Luckily I found a way to change the settings. 

By default, the Keyboard backlight settings are not visible on the touch bar. You have to expand the tra-like stuff on the touch bar and then you will find icons, which look similar to screen brightness control icons. 

On the right side of your touch bar, you will these 4 controls

1. Screen Brightness control 

2. Volume control 

3. Mute control 

4. Siri button. 

Left these controls there is an arrow button which looks like '<', by clicking on this, you will see more controls. 

Once you click on the left arrow mark as shown in the above picture, it will open up more controls. 

At the center of the touch bar, you will see controls that look similar to Screen Brightness controls. You can use these to adjust the backlight of the Keyboard. 

Saturday, July 17, 2021

How to create self signed ssl certificate, easy steps

 These are the ready commands to create self-signed SSL certificate. These certificates can be used for testing purposes. For a production-grade application, you need to contact a CA authority to get the actual SSL certificate. But for your internal testing, you can always use a self-signed SSL certificate. 

Here are the steps to create a Self Signed SSL certificate using OpenSSL

# generate self sigend ssl certificate

rm -rf *.pem

echo "Generating CA certificates"

# Step 1: generate CAs certificate

openssl req -x509 -newkey rsa:4096 -days 365 -keyout ca-key.pem -out ca-cert.pem -subj "/C=IN/ST=kartnataka/L=bangalore/O=test/OU=test/CN=*"

#inspect the CAs certificate

#openssl x509 -in ca-cert.pem -noout -text

# Step 2 generate server sign request certificate which will be used for self signing. Change the subject to as per web server

echo "Generating Server certificate sign request"

openssl req  -newkey rsa:4096 -keyout server-key.pem -out server-req.pem -subj "/C=IN/ST=kartnataka/L=bangalore/O=sever/OU=server/CN=*"

#openssl x509 -in server-req.pem -noout -text

# Step 3 Sign certificate

echo "Signing the server certificate with CA"

openssl x509 -req -in server-req.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -out server-signed-cert.pem

# Inspect the signed certificate

#openssl x509 -in server-signed-cert.pem -noout -text

Saturday, August 22, 2020

How to Fix ImportError: No module named 'flask' with virtualenv

Flask is one of the most used frameworks in Python. If you are new to the flask and if you are getting this error - ImportError: No module named 'flask' on virtualenv, read further.

You are sure that the Flask module is already installed. But still, you are getting No module error. This is because you need to install a flask framework inside the virtualenv.

Follow these instructions

Step 1

Create a directory where you will be installing the virtualenv.


krishna@osboxes:~$ mkdir testenv


Step 2

Get inside the folder and install virtualenv

krishna@osboxes:~$ cd testenv/

krishna@osboxes:~/testenv$ pip install virtualenv


$ sudo apt-get install virtualenv


Successfully installed appdirs contextlib2 distlib filelock importlib-metadata importlib-resources pathlib2 scandir singledispatch six typing unknown unknown virtualenv

Step 3

Activate the virtualenv

This virtual environment requires activation and dedicated installation inside the virtual environment. It has to be installed after creating a virtual environment. The libraries will reside inside the folder created for the virtual environment.


krishna@osboxes:/tmp/tempenv$ source tempenv/bin/activate

(tempenv) krishna@osboxes:/tmp/tempenv$


Please note that you are inside the virtual environment.

Step 4

Install Flask inside the virtual environment

(tempenv) krishna@osboxes:/tmp/tempenv$ pip install Flask

Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 itsdangerous-1.1.0

Make sure that there is Flask package available inside the virtual env folder


(tempenv) krishna@osboxes:/tmp/tempenv$ ls -ltr tempenv/lib/python3.5/site-packages/ | grep -i flask

drwxrwxr-x 4 krishna krishna 4096 Aug 22 11:05 flask

drwxrwxr-x 2 krishna krishna 4096 Aug 22 11:05 Flask-1.1.2.dist-info


Step 6

Create a generic basic python script to test the Flask


from flask import Flask

app = Flask(__name__)


def hello_world():

    return 'Hello World!'

if __name__ == '__main__':


Execute the python script

(tempenv) krishna@osboxes:/tmp/tempenv$ python

 * Serving Flask app "test" (lazy loading)

 * Environment: production

   WARNING: This is a development server. Do not use it in a production deployment.

   Use a production WSGI server instead.

 * Debug mode: off

 * Running on (Press CTRL+C to quit)

Wednesday, March 11, 2020

Looking to move from development to DevOps? Here is what you should know

DevOps is a buzz word in the last decade, everybody wants to try their luck in DevOps. DevOps is the most generic area of software engineering. Every team and every company wants to have a team called DevOps. Nowadays, everybody wants a DevOps tag name attached to them irrespective of what they do. This works for most people. Because of the generous nature of the DevOps skillsets. That means, the pool of DevOps skillsets so huge, even if you know a few of them, it will work for you.

If you are a developer or QA and want to change over to DevOps, here is the list of bare minimum technologies and skills you should learn. These are the mandatory skillsets you should possess before you try your luck in DevOps.

1. Expert Knowledge on Linux Environment

You take any software development, without a Linux flavor it will be incomplete. You should have a thorough knowledge of how to work in a Linux environment. If you have system administration knowledge, then it's a huge advantage. Most of the DevOps activities involve manipulating the environments manually or through automation. You may have to analyze the system for performance, failures, and/or improve the performance of the existing systems. Create or add new features to your existing systems. You should be well versed with basic to advanced Linux commands. You should know multiple flavors of Linux distributions. Distributions like RHEL, CentOS, and Ubuntu are must, these are the most used distributions.

CentOS, Ubuntu, RHEL

2. Scripting Languages 

As a DevOps engineer, you should give more importance to Scripting languages rather than programming languages. You should know more than one scripting language. In the current trend, Python and Shell scripting are must have skillsets. These two scripts are most used in DevOps automation. Shell scripting is a building block while you are working in a Linux environment. You can build simple to complex tools and utilities using Shell scripts. While you can use Python in just about any area. In fact, python is replacing most of the mainstream programming languages, because of its conciseness and narrow learning curve. In addition to these two, you can have PHP, JavaScript, Ruby, etc, which will boost your chances.

Python, Shell Scripting, PHP

3. Programming Languages

Apart from scripting, you should also know multiple programming languages. It is ok even if you know a basic understanding of the constructs of the language. There are fewer chances that you end up writing programs in these high-level programming languages like C, C++, C#, or Java. But you may be involved in products or solutions which are written in these languages. You will have to support the production and release of these software packages. So, you must know how the code is built, how the binary packages created, how they are distributed. After all the DevOps is derived from Build and Release Management.

C, C++, Java, C#

4. Version control tools

Being in the software industry you must know one of the version control tools. It does not matter whether you are a developer, QA, or Program Manager. But for a DevOps person, you must have expert level knowledge on more than one version control tool. Being a DevOps guy, you own the entire codebase that the developer has put in. So, you take the pride saying that. You should be thoroughly knowledgeable about codebase management. You should be capable of introducing the best practices to the developer so that their time is better utilized. You take all the burden of the operations in the version control and give the developer his time to develop the application. You take the responsibility of giving him feedback about the quality of his code. This is where the automation comes into the picture. This is where you can excel, you have a better scope for showing your talent.

GIT, Bitbucket, SVN, TFS

5. CI/CD and CM tools

This is a major area where the scope differs from one company to another. Different companies use different sets of tools. Being a DevOps engineer you have the authority to choose and suggest in the interest of productivity. Every now and then there are new tools coming up. You should thrive learning new tools, analyze and choose the best-suited tool for your environment. Jenkins is a must-have tool for CI and CD. It is the most used CI/CD tool, thanks to its extendibility feature. You will get plenty of plugins to suit your needs. There are other options like Bamboo, TeamCity, Gitlab CI, CruiseControl, UrbanCode, etc.

Jenkins, Jenkins pipeline

CM tools are configuration management tools used in provisioning the systems. When you have to install and configure the environments more frequently, you can go for one of these automation tools. These tools are also called orchestration tools. This works on the concept of write once deploy many times. You keep your configuration items as code when you need to create or update an environment, just deploy/run your codebase which contains your configured items

Chef, Puppet, Ansible, Saltstack are major tools available. If you know anyone of these should fine.

 6. Virtualization and Container Technologies

Without Docker and Kubernetes, you will not be considered fit for the DevOps. How much it is being used in many companies is a different argument. As an entry point, you should know virtualization and containerization. Virtualization is key in the areas of Cloud, Containers, Orchestration, and Configuration Management. People are moving towards software-defined hardware. What that means is, instead of going with physical hardware, a software abstraction is used to achieve the functionality of that hardware. A major breakthrough is a software-defined network. It is gaining momentum in Software-defined storage, software-defined data center, software-defined infrastructure, etc.

It gives you a jump start to your career if you are familiar with enterprise-level virtualization tools and concepts from VMWare, Citrix, NetApps, and EMC2, etc.

You should be familiar with Container and container management tools. Docker, Kubernetes, Docker Enterprise, Docker Swarm, Redhat OpenShift, AWS ECS, Google Container Engine are the major stakeholders in the containers management field. If you know at least 3 of them, then you are better placed than others.

7. Cloud concepts

AWS is an undisputed king in the cloud technologies until a few years. And in recent years, Microsoft Azure is not far behind, they are catching up. Google cloud is the next promising player in the cloud business. It is very important to have either AWS or MS Azure experience in your resume. If you do not have one, it's better to start today, as you will get plenty of free tiers cloud accounts. You can try as much as you want and get familiar with cloud technologies.

Amazon AWS, MS Azure

8. Build tools 

This is an old technological area, it takes the least position but it is important to know if you are aspiring a DevOps role. The build tool is used for building a software component out of the source code. There are different tools for different programming languages. For Java, you have Ant, Maven, and Gradle. For C/C++ you have GNU make and CMake. For C# you have MSBuild.

Make, Ant, Maven, MSBuild

9. Build and Release Management 

After all, DevOps is derived from BnR a.k.a, Build and Release Management. There are companies still stuck with this BnR or B&R and many other companies renamed their teams as DevOps, but under the hood, they are still doing somewhat similar tasks. The only difference is that they have upgraded with the tools they use. Having prior knowledge of Build and Release management gives you an unmatched advantage to start your DevOps job.


These are the minimum requirements to start with DevOps. As you start working in DevOps, you should be capable of continuously adapting to changes as and when required. That is one major quality a DevOps engineer should possess. Since the tools and technologies vary hugely from company to company, you should be a quick learner to make yourself capable of the tools used in your newer job. 

How to set Python3 as default interpreter for VS Code | or set any version as default interpreter.

Want to run your python code with a particular python version? And, make it the default version? Read on.. Make sure that the required versi...