How to SCP a file into EC2 Instance (SCP)

scp -i  /path/to/file.pem  /file.rpm  ec2-user@ec2-54-xxx-xxx-168.us-west-2.compute.amazonaws.com:~/.

where

/path/to/file.pem is path to your key-pair file

file.rpm is the file you want to transfer


How to transfer a file from local machine to Remote Server (Linux - SCP)

The scp command copies files to or from a remote Linux system. You will be prompted for your TCC password for authentication.

To copy files from the local system to a remote system:
scp file... user@host.domain:path
where:
file
File to be copied.
user
Your username on the remote system.
host.domain
The Internet address of the remote system, such as linux.nmt.edu.
path
The absolute path name to the destination on the remote system.

To copy files from a remote system to your local system:
scp user@host.domain:path ... dest
where dest is the path name on your local system where you want the files copied.

Examples:
scp ann beth clyde forsythe@linux.nmt.edu:/u/forsythe/tmp
scp 'forsythe@linux.nmt.edu:/u/forsythe/images/*.jpg' pictures/LaborDay


Source : http://infohost.nmt.edu/tcc/help/xfer/scp.html

How to SSH into EC2 Instance

ssh -i /path/to/publickey/file.pem  ec2-50-xxx-x-xxx.us-west-2.compute.amazonaws.com

Interview Questions

1. Name any five methods of object class.
2. Difference between SOAP and REST?
3. Life Cycle of a Servlet and can we override destroy method?
4. How can you increase the JVM memory size?
5. Why would you prefer Javascript over Jquery?
6. Explain Bean life cycle in Spring?
7.Why String is immutable in Java?
8. When abstraction can have all methods unimplemented , why do we have Interface in Java?
9. Difference between Jboss and Tomcat Server?
10. Difference between Aggregation and Composition?
11. Difference between Array and ArrayList,  LinkedList and ArrayList?
12 Is List a class or Interface?
13. Difference between HashMap and HashSet?
14. Difference between sendRedirect and forward (jsp)?

How to install Certicate of another server on your linux server

Let say you want to install certificate of server A on server B. So that Server B can access Server A .
Here are the steps you need to do install it.

1. Export the certificate of server A























by exporting it you can save it to your local system say as servera.blah.com

2. Login to your server B as root and run this command

keytool -import -trustcacerts -file ~/servera.blah.com -keystore $JAVA_HOME/jre/lib/security/cacerts -alias proxy01


 There you go !!