Useful Commands

SSH to an EC2 instnace

ssh -i ~/repos/aws/keypair/awsAccess.pem ec2-user@

Copy a file to remote server

scp -i awsAccess.pem awsAccess.pem ec2-user@

Get docker login

Get docker login bash command

aws ecr get-login --no-include-email

Create stack using aws-cli

aws cloudformation create-stack --stack-name simpleSite --template-body file://s3_simple_website.json --parameters ParameterKey=Stackname,ParameterValue=stage1,ParameterKey=AppName,ParameterValue=something

aws cloudformation delete-stack --stack-name simpleSite

Redirect all TCP traffic to another ip address.

sudo yum install socat
socat TCP-LISTEN:8080,fork TCP: