Monday, April 12, 2021

Intellij IDEA Shortcuts – System.out.println shortcut

https://mkyong.com/intellij/intellij-idea-system-out-println-shortcut/


In IDEA, you can type sout and press Tab to generate System.out.println automatically.


https://intellij-support.jetbrains.com/hc/en-us/community/posts/206274579-How-to-quickly-view-method-signature-

https://mkyong.com/intellij/intellij-idea-how-to-show-method-signature/#:~:text=In%20IDEA%2C%20clicks%20on%20the,to%20show%20the%20available%20parameters.


Show Signature

Ctrl-Q (Quick Javadoc) or, within the parenthesis of the method, Ctrl-P (Show Parameters).

Git ignore all files of a certain type except in all subdirectories of a certain directory?


# Package Files #
*.jar
*.war
*.nar
*.ear
*.tar.gz
*.rar


#Exceptions to File Types based on Locations
!LB/**/*.jar

Multiple Instances, LoadBalancer, @LoadBalanced

@LoadBalanced

import org.springframework.cloud.client.loadbalancer.LoadBalanced;

Why We place @LoadBalanced on RestTemplate because RestTemplate is used to to fetch Server IP Address and port from Eureka Registry and its also used for Client side Load Balancing


@EnableEurekaClient
public class MovieCatalogServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(MovieCatalogServiceApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
See , In , Image Below, How Multiple Instances are registered of same application
We achieved by running application in an executable Jar in separate port

java -Dserver.port=8084 -jar movie-info-service-0.0.1-SNAPSHOT.jar


IntelliJ - Multiple Maven Projects Back into 1 Single Workspace/Window

How to merge Multiple Maven Projects Back into 1 Single Workspace/Window

https://stackoverflow.com/questions/8774024/intellij-working-on-multiple-projects/14637761#14637761


View > Tool Windows > Maven > An inline Window Opens > Click on Plus(+) Sign > Choose POM File of the Project You want to add in Workspace/Window > OK


Sunday, April 11, 2021

Install Ubuntu 17 on Virtualbox - With Full Desktop Screem

Newer Ubuntu versions gave me some issues - Got Stuck for 2-3 Hours

Solution : 

  • Don't Select "Download Updates" and "3rd Party Software" When U Click on Install Ubuntu


Download VirtualBox
https://www.virtualbox.org/wiki/Downloads


Download Ubuntu


How to Make Ubuntu Full Desktop
https://superuser.com/questions/751831/virtualbox-ubuntu-full-screen-mode-resolution/754029#754029
https://developerslogblog.wordpress.com/2019/02/12/how-to-run-virtualbox-in-full-screen-mode-in-linux/

Saturday, April 10, 2021

AWS VPC Peering

https://www.youtube.com/watch?v=w-5lSvqSkjs&t=0s

AWS : Internet <-> Internet GW <-> VPC <-> Route Table <-> NACL <-> Security Group <-> EC2 Instance

 Data Flow inside AWS

Internet  :  Internet GW <-> VPC <-> Route Table   <->  NACL  <-> Security Group <-> EC2 Instance


VPC

Route Table : Once Data Arrives at Subnet, RT attached to Subnet decides where to route data traffic , It cannot block/unblock, it can just route
Data Traffic may want to come to My Subnet
Data Traffic may want to go from Subnet to Other Subnet or May want to Go to Outside World
Route to Local or Route to IGW or Route to NAT Gateway.
0.0.0.0.0 : Traffic meant for "NOT VPC Subnet"  -> Route to IGW or NAT
p.q.r.s/16  : "Subnet Traffic " -> Route Locally to Subnet

NACL : Once Data Traffic arrives at Subnet
It has to cross N/W Firewall - Subnet Firewall - known as NACL which may allow it or block it.
It checks Protocol Type, Port, Source/Destination (depending on Incoming/Outgoing Direction) and then allows or blocks, The rules are Numbered, If a Match is found, It can be DENY or ALLOW Rule and no further rules are processed.
Its stateless, You have to configure separate rule for incoming and outgoing and they both are independent of each other

Security Group :
Determines the traffic that can reach/leave your instance.
It is stateful 
It has Incoming and Outgoing Rules
But Incoming is related to Outgoing 
It has no DENY/ALLOW rule flag
All Rules are ALLOW by default
Rule says 
->  Allow PROTOCOL on PORT from SOURCE  - Incoming
->  Allow PROTOCOL on PORT from DESTINATION - Outgoing
SSH is TCP Protocol on 22
HTTP is TCP protocol on 80
PING in NCMP Protocol
If Incoming Rule allowed SSH on Port 80 and I did not mention Allow SSH on Port 22 for Outgoing, Even Then SSH will be allowed in Outgoing because its stateful, it remembers.
If Outgoing Rule is allowed, on PORT 80 and We did  not Configure HTTP on Incoming Side
Even then SSH will be allowed on that Machine



Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass