Skip to content

Instantly share code, notes, and snippets.

View eMahtab's full-sized avatar
💭
مهتاب

Mahtab Alam eMahtab

💭
مهتاب
View GitHub Profile
@eMahtab
eMahtab / gist:f4b52e509816cf3a04e25a3fb269e5d9
Created January 2, 2020 13:50 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@eMahtab
eMahtab / _resources.md
Created December 10, 2018 14:12 — forked from g0t4/_resources.md
Resources for TeamCity Getting Started Course
@eMahtab
eMahtab / gist:da829f3260cac88ff63e293fa4e7c475
Created October 6, 2018 05:09 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@eMahtab
eMahtab / gist:27ca8f29e51235a8b7de7aeb588c8477
Created August 27, 2018 14:06 — forked from mikepfeiffer/gist:a4ce6d25ae092f1a4ea97afad5879530
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>
@eMahtab
eMahtab / gist:192c3cec47e8aa5deb161bf3d69e6878
Created August 26, 2018 17:28 — forked from mikepfeiffer/gist:3851e3bd95591e0675aa4c76cd57635f
AWS Lambda Function to Start an EC2 Instance
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
var ec2 = new AWS.EC2({region: 'us-east-1'});
ec2.startInstances({InstanceIds : ['i-0114833f8ffc9151c'] },function (err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
context.done(err,data);
});
};
@eMahtab
eMahtab / gist:d4da9b40c2ffb2581fda313a51e23882
Created August 26, 2018 17:27 — forked from mikepfeiffer/gist:6f9e6cac7607fc365874cd7d31dbb141
Example to Create AWS ELB, Launch Config, and Auto Scaling Group
aws elb create-load-balancer \
--load-balancer-name MyELB \
--listeners Protocol=TCP,LoadBalancerPort=80,InstanceProtocol=TCP,InstancePort=80 \
--subnets subnet-46e6506c subnet-57b8010f \
--scheme internet-facing \
--security-groups sg-aec570d4
aws autoscaling create-launch-configuration \
--launch-configuration-name MyLC \
--key-name virginia \
@eMahtab
eMahtab / gist:f97194641f6b49f2ca7053066fec9051
Created August 26, 2018 17:27 — forked from mikepfeiffer/gist:7c949e2d04c9e51ef204fb9a7f3d2978
Userdata script to setup a basic web page with instance id and tag instance
#!/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"
@eMahtab
eMahtab / gist:84dbd724c7a92619bfd3d6556e224380
Created August 26, 2018 17:26 — forked from mikepfeiffer/gist:4aea8cba143ff31fa90a33ff4818b809
How to create and complete a lifecycle hook
aws autoscaling put-lifecycle-hook \
--lifecycle-hook-name scale-out-hook \
--auto-scaling-group-name MyASG \
--lifecycle-transition autoscaling:EC2_INSTANCE_LAUNCHING
aws autoscaling complete-lifecycle-action \
--lifecycle-action-result CONTINUE \
--instance-id i-0680775fb68bc97a5 \
--lifecycle-hook-name scale-out-hook \
--auto-scaling-group-name MyASG
@eMahtab
eMahtab / gist:a4ea2ef704788ac487d17a718ccfb944
Created August 14, 2018 11:18 — forked from mikepfeiffer/gist:4d9386afdcceaf29493a
EC2 UserData script to install CodeDeploy agent
#!/bin/bash
yum install -y aws-cli
cd /home/ec2-user/
aws s3 cp 's3://aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm' . --region us-east-1
yum -y install codedeploy-agent.noarch.rpm
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Builds a VPC w/ INET Gateway and 3 public subnets. **WARNING** This template creates Amazon EC2 instance(s). You will be billed for the AWS resources used if you create a stack from this template.",
"Resources" : {
"VPC" : {
"Type" : "AWS::EC2::VPC",
"Properties" : {