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 / Dockerfile
Created November 19, 2018 14:57
Docker 2048
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y nginx zip curl
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN curl -o /usr/share/nginx/www/master.zip -L https://github.com/eMahtab/2048/archive/master.zip
RUN cd /usr/share/nginx/www/ && unzip master.zip && mv 2048-master/* . && rm -rf 2048-master master.zip
EXPOSE 80
@eMahtab
eMahtab / Dockerrun.aws.json
Created November 19, 2018 14:56
Elastic Beanstalk Single Container
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "mahtab/heyyo:v1",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "80"
}
@eMahtab
eMahtab / cloudfront-signed-url.js
Created October 25, 2018 19:07
Generating CloudFront Signed URL
var cfsign = require('aws-cloudfront-sign');
var currentTime = new Date()
var currentTimeinMillis = currentTime.getTime();
console.log("---------------------------------------------------------------------------")
console.log('Current Time is '+currentTime)
var expiryTime = currentTimeinMillis + 1*60*1000;
console.log("---------------------------------------------------------------------------")
console.log('Signed URL wiil expire on '+new Date(expiryTime));
@eMahtab
eMahtab / bash-while-loop
Created October 24, 2018 18:29
While loop
while [ 1 ]; do echo $(date), $RANDOM ; sleep 1; done;
@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 \