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
# Virtualenv is a tool used to create an isolated Python environment. This environment has its own installation directories that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed libraries either). | |
# Ensure PYTHON3 is installed | |
python3 --version | |
# Create a virtual environment as follows | |
python3 -m venv ~/Pictolearn/venv | |
# Activating a virtual environment which was created | |
source ~/Pictolearn/venv/bin/activate |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "A VPC environment in two availability zones with an NAT instance.", | |
"Parameters": { | |
"envPrefix": { | |
"Description": "Environment name prefix.", | |
"Type": "String", | |
"Default": "Test" | |
}, | |
"vpcCidr": { |
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
# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html#w1ab2c21c45c15c15 | |
# Amazon EC2 instance in a security group Creates an Amazon EC2 instance in an Amazon EC2 security group. | |
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample: | |
Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based | |
on the region in which the stack is run. This example creates an EC2 security group | |
for the instance to give you SSH access. **WARNING** This template creates an Amazon | |
EC2 instance. You will be billed for the AWS resources used if you create a stack | |
from this template.' |
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
#!/bin/bash | |
yum update -y | |
amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2 | |
yum install -y httpd mariadb-server | |
systemctl start httpd | |
systemctl enable httpd | |
usermod -a -G apache ec2-user | |
chown -R ec2-user:apache /var/www | |
chmod 2775 /var/www | |
find /var/www -type d -exec chmod 2775 {} \; |
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
# conditional update | |
# boto3, an AWS SDK package | |
# JSON, a text format package that is language independent | |
# decimal, a precision Handling package | |
import boto3 | |
# this looks after validation error (throws a statement if the entity already exists) | |
from botocore.exceptions import ClientError |
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
# increment of an atomic counter | |
# boto3, an AWS SDK package | |
# JSON, a text format package that is language independent | |
# decimal, a precision Handling package | |
import boto3 | |
import json | |
import decimal | |
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
# boto3, an AWS SDK package # Delete an existing Table | |
import boto3 | |
# resource request service and region are set | |
dynamodb = boto3.resource('dynamodb', region_name='us-east-1') | |
input1=input("enter table :\t") | |
table = dynamodb.Table(input1) | |
# a function to delete a table | |
table.delete() |
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
# update an item in the table | |
# boto3, an AWS SDK package | |
# JSON, a text format package that is language independent | |
# decimal, a precision Handling package | |
import boto3 | |
import json | |
import decimal | |
# Helper class to convert a DynamoDB item to JSON. |
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>Page Loaded Dynamically</title> | |
</head> | |
<body> | |
<div> | |
<h1>Loaded page Dynamically</h1> | |
<p>Page Loaded Dynamically</p> |
NewerOlder