Skip to content

Instantly share code, notes, and snippets.

View pictolearn's full-sized avatar

Pictolearn pictolearn

  • Coimbatore, IN
View GitHub Profile
# 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
@pictolearn
pictolearn / CORS_CONFIGURATION_S3
Created June 4, 2019 13:01
CORS_CONFIGURATION_S3
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://testmy.cloud</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
@pictolearn
pictolearn / index.html
Created June 7, 2019 13:24
index.html
<!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>
@pictolearn
pictolearn / error.html
Created June 7, 2019 13:26
error.html
<!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>
@pictolearn
pictolearn / loadpage.html
Created June 7, 2019 13:42
loadpage.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Loaded Dynamically</title>
</head>
<body>
<div>
<h1>Loaded page Dynamically</h1>
<p>Page Loaded Dynamically</p>
<!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>
@pictolearn
pictolearn / Update_an_item.py
Last active February 11, 2023 12:34
update an item in a DynamoDB table by running a python script
# 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.
@pictolearn
pictolearn / DeleteTable.py
Last active June 17, 2019 06:50
deleting a DynamoDB using a python script
# 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()
@pictolearn
pictolearn / Increment_an_atomic_counter.py
Last active March 20, 2024 22:44
increment of atomic counter in DynamoDB using python
# 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
@pictolearn
pictolearn / update_an_item_conditionally.py
Last active June 27, 2022 00:03
conditional update in a DynamoDB table using python
# 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