Friday, September 13, 2024

Linux OS - SSH configuration

 SSH connection using Putty:


1. sudo apt-get update

2. sudo apt-get upgrade

3. sudo apt remove openssh-server

4. sudo apt install openssh-server


Edit SSH config file

vi /etc/ssh/sshd_config

set PasswordAuthentication yes

add "AllowUsers <username>" at the end of file


Check ssh service:

service ssh status


if you see: * sshd is not running:

service ssh start


restart service :

service ssh --full-restart


type the below command to edit the sudoers file.:

visudo



add the following line after "%sudo ALL=(ALL:ALL) ALL"

%sudo ALL=NOPASSWD: /usr/bin/sshd





Sunday, May 12, 2024

My Coding solutions

All the coding solutions are from different platforms like HackerRank, Techgig, GeeksforGeeks where I have solved the problems and passed the testcases. It is recommended to all the competitive/Learners to maintain a online reference for there day to day coding work as it will help in future.


Collection Framework Interview questions

 I have went through many interviews on java and the main topic in focus is Java collection framework.

All the below questions are asked in the interview to me and I will also add more after each interview. so it will not only benefit me for interview preparation but also helpful for others.


Q1. What is the difference in Collection and Collections?

Q2, What is immutable class?

Q3. What is the difference between HashMap and Concurrent HashMap?

Q4. What is the use of static keyword?

Q5. (class- inheritance)What error we will get for below code?

            interface Vehicle{

                    void brake();

            }

             public Class Car{

             public static void main(String[] args){

            Vehicle v = new Car();

                brake();

                }

               public void brake(){System.out.println("Car will stop");

                }

              }


Q6. What are the classes in the collection framework?

Q7. What is the difference between Set and List?

Linux OS - SSH configuration

 SSH connection using Putty: 1. sudo apt-get update 2. sudo apt-get upgrade 3. sudo apt remove openssh-server 4. sudo apt install openssh-se...