Saturday, April 30, 2022

Set up gmail in outlook using app password

You might receive an error saying, "unable to connect to your outgoing server" while setting up a gmail account in outlook even when your gmail account password you have entered is correct.

This is due to new settings in gmail account, which required you to enable 2FA in your account and allow you to set up a password to access your gmail account via smtp or any application client like outlook.

Follow below steps to do set up your gmail account in outlook 2016:

1. Login to your gmail account and set up 2fa, you may visit below link Google Less secure apps (login using your gmail account you would like to configure in outlook), click back(<--) and you will see the settings:

2. Make sure that you have enabled 2FA as per below screenshot.

3. Click on App passwords, select App as Mail and device as Windows Computer.
4. Click on generate, it will generate a string password, copy it (it can be used as a password while setting up other apps to access your gmail account).

5. Open your outlook, click on File>Add account, fill up the account information and paste the password copied from previous step(step 4), click on next.



It will set up your outlook with your gmail account.

Wednesday, April 6, 2022

Basics of git, create, update and collaborate code using git

Git is version control tool for track, monitor and collaborate code. and it does not require codeing and is useful for developers, designer, project managers, students, teachers and  for anyone who would like to learn.

Core competencies:

1. Prerequisite - Bash terminal and a text editor

2. Important terminal commands

3. Git commands and using git locally

4. git remotes and github

Installation:

MaC OS:

Open terminal and run below command

$xcode-select --install

It will pop up a message to install xcode command line tool, click on install and agree.

To test it run the command "git" on the terminal and you will see below which shows that the git has been installed.

Linux/Ubuntu:

To install git on Linux run below command:

$ sudo apt-get update 

$ sudo apt-get install git

$ git --version

Download and install sublime text or any of your favorite text editor.

Windows:

To install for windows OS follow the link Git - Downloading Package (git-scm.com).

Basic terminal commands will be used:

pwd- check the current directory

ls - list directories 

cd - Change Direcotry

touch- create file

mkdir- create directory

Create first git repository:

$mkdir GitProject1 //create folder GitProject

$cd GitProject1 //to change local directory to GitProject1

$touch myFile.txt //create an empty file

Open the file myFile.txt in your favourite editor and write some text and save it, we will be using vi editor to dot it:


$vi myFile.txt

//Press i in the keyboard after above command to make it insert mode and type "Hello World". Press Esc+:x and press enter the file will be saved.

Below is the file content:


Now run the command git init from inside the GitProject1 directory

1. git init: to initialize a git repository.



Run below command to see the git folders initialized under GitProject1 directory

$ls -a 



As we were successfully able to initialize git repository, now we will use below commands for further actions:

1. git status : to check the status of the git repository, what branch you are on and tracked/un-tracked files.

We can see we have one un-tracked file myFile.txt which we will be tracking.



2. git add : to add the file to the staging for tracking purpose

As you can see, the file is added to the staging, now we can run the status command to see the tracking status.


From the above screenshot, you can see that we have changes to be committed under the file myFile.txt.

3. git commit -m "initial-commit" : to commit the changes




4. git log: to check the latest commits and the changes made to the repository


5. Making an update to existing file
Open the file in your preferred editor and update the file, we have used vi editor.

Once the changes are updated in the file, run the command get status to verify the changes to be staged.
 



As we have made changes to the file, we need to run git add command to add these changes to the staging.
After adding the file for the changes, we can run the status command again to see that the changes are ready to commit.
Next run the commit command and check the status of the file.








At the end we can run the git log command to see the changes/commits made to the project as per above screenshot.

Sunday, April 3, 2022

How to enable telnet in windows

 Telnet command is not by default enabled sometimes in Windows. In order to enable telnet command, please follow below steps:

1. Click on Start button and search for "Turn windows features On or ff" , right click it and select run as administrator


2. Make sure you mark "Telnet client" from the list and click on OK.



3. Restart the computer

4. To confirm, open command prompt and type telnet and hit enter to make sure it is enabled after the changes




How to check if the port is up or a service is running command line Windows and UNIX

In order to check for service status we have below 2 options to check. You need to have the host name and port number to check if the port is running.

Windows: From the source system/server follow below steps:

a. Open command prompt by clicking start button and click on command prompt

b. Type below command and hit enter

telnet host_ip/hostname port_number

Ex: telnet 10.10.10.12 80

Host ip is the ip address of the server/computer where the service is running and port number is the actual port number assigned to the service.

After running the command if you see a blank screen, the port is up and the service is running.


If you do see unable to connect message means either service is not up or the source server is not able to reach to the destination. Try to use tracert command to figure out.


If you receive telnet command not found, click on below link to install telnet command on Windows.

TroubleShooting: How to enable telnet in windows (aksanswer.blogspot.com)

Unix: For unix, run the same command

telnet destination_ip/host_name port_number

Ex: telnet 100.200.1.1 8080

If telnet command not found, please check corresponding unix/linux installation procedure and try the same once the telnet command is installed.

 

How to kill java process in windows and unix

Sometimes, there are multiple java threads executed and might get hang, in order to kill them all together, below are the provided steps:

Windows:

a. Open command prompt as admin: click on Windows button and type "cmd", right click and select run as administrator


b. Once the command prompt is open type below command and hit enter

taskkill /im java.exe


It will terminate all the java.exe programs running in the Winows.

Unix:

Below are 2 ways to kill the java process:

a. To kill all java processes

pkill -f 'java -jar'

b. To find all the java processes

ps -ef | grep java

Once found the list of java process it can be killed by kill command by providing process id

kill -9 process_id 

Process_id is from the previous command



Set up gmail in outlook using app password

You might receive an error saying, "unable to connect to your outgoing server" while setting up a gmail account in outlook even wh...