Skip to content

Instantly share code, notes, and snippets.

View tkssharma's full-sized avatar
🎯
only JS

codewithtkssharma tkssharma

🎯
only JS
View GitHub Profile
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CF Template to create VPC, Subnet, Security Group, Route Table and Internet Gateway",
"Parameters":{
"AvailabilityZone": {
"Description": "select the Availability Zone for your Deployment",
"Type": "AWS::EC2::AvailabilityZone::Name"
}
},
"Mappings": {
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS Cloud Formation template to launch an EC2 Instance and
a LoadBalancer",
"Parameters": {
"AvailabilityZone": {
"Description": "select the Availability Zone to launch the Instance",
"Type": "AWS::EC2::AvailabilityZone::Name"
},
"EC2InstanceType": {
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "A simple description of what this template does",
"Parameters": {
//variables that can be passed to the template during deployment.
},
"Mappings": {
//keys which match to a corresponding set of named values
}
//AWS::ProductIdentifier::ResourceType
//----------------------------------------------//
{
"Resources" : {
"HelloBucket" : {
"Type" : "AWS::S3::Bucket"
}
}
}
@tkssharma
tkssharma / gist:bd112f556157cc7e9f6c5aed2a14ab4e
Created January 14, 2017 10:40
cloudWatch custom watch
#!/bin/bash
yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https -y
curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O
unzip CloudWatchMonitoringScripts-1.2.1.zip
rm CloudWatchMonitoringScripts-1.2.1.zip
@tkssharma
tkssharma / gist:e8339f3aa09b1cb67ffe0b353d126629
Created January 14, 2017 10:50
EC2 user data script to boostrap Windows instance with Python and AWS CLI
<powershell>
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install python -y
(new-object net.webclient).DownloadFile('https://s3.amazonaws.com/aws-cli/AWSCLI64.msi','c:\AWSCLI64.msi')
msiexec.exe /i 'C:\AWSCLI64.msi' /qn
</powershell>
@tkssharma
tkssharma / launch Configuration user Data script
Created January 17, 2017 10:21
launch Configuration for AWS EC2
#!/bin/bash
yum install httpd -y
/sbin/chkconfig --levels 235 httpd on
service httpd start
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
echo "<h1>$instanceId</h1>" > /var/www/html/index.html
aws ec2 create-tags --resources "$instanceId" --tags Key=Name,Value="PROD-$instanceId" --region "$region"
@tkssharma
tkssharma / Docker.md
Created February 6, 2017 07:39
Docker Tutorial - Cheatsheet
What is a “component”?
When would you use a component over a directive?
What is component architecture?
What is the difference between a stateful and stateless component?
What are lifecycle hooks and why are they important?
When would you consider one-way dataflow over two-way?
Why is isolate scope an important concept?
How would you describe “MVC/MVVM”?
What is the difference between MVC/MVVM and component architecture?
What types of bindings can a component receive?
function bind(fn,obj){
rerurn function(){
return fn.call(obj)
}
}
function foo(){
console.log(this.bar);
}