This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CORSConfiguration> | |
<CORSRule> | |
<AllowedOrigin>http://testmy.cloud</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new SSH Key | |
# -t stands for ‘type’ and rsa is type of encryption | |
# -C is for comment | |
ssh-keygen -t rsa -C “your-email-address” | |
# The above command shows rs key pair | |
# Enter file in which to save the key (/c/Users/your_username/.ssh/id_rsa) ~/.ssh/id_rsa_<your-file-name> | |
# make sure you have the file | |
ls -al ~/.ssh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1559630929660", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1559630927924", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": [ | |
"s3:GetObject" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 # a development kit package in AWS | |
import os # package which runs shell commands | |
import time # package which handles date and time | |
def get_ec2_con_for_give_region(my_region): # function definition to get region | |
ec2_con_re=boto3.resource('ec2',region_name=my_region) | |
return ec2_con_re | |
def list_instances_on_my_region(ec2_con_re): # function definition to get instance in that respective region | |
for each in ec2_con_re.instances.all(): | |
print(each.id) | |
def get_instant_state(ec2_con_re,in_id): # function definition to get the state of instances in that respective region |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launches an instance | |
# aws ec2 run-instances \ | |
# --image-id <ami-xxxxx> \ | |
# --count 1 \ | |
# --instance-type t2.micro \ | |
# --key-name <your KeyPair> \ | |
# --security-group-ids <group_id> \ | |
# --subnet-id <your subnet id> | |
aws ec2 run-instances --image-id ami-0cc96feef8c6bbff3 --count 1 --instance-type t2.micro --key-name pictolearn-ec2 --security-group-ids sg-0bc5999645783c843 --subnet-id subnet-76f2c879 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content-Type: multipart/mixed; boundary="//" | |
MIME-Version: 1.0 | |
--// | |
Content-Type: text/cloud-config; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cloud-config.txt" | |
#cloud-config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content-Type: multipart/mixed; boundary="//" | |
MIME-Version: 1.0 | |
--// | |
Content-Type: text/cloud-config; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cloud-config.txt" | |
#cloud-config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# STOP NGINX | |
sudo systemctl stop nginx | |
#START NGINX | |
sudo systemctl start nginx | |
#To stop and then start the service again, type: | |
sudo systemctl restart nginx | |
# If you are simply making configuration changes, Nginx can often reload without dropping connections. |