Skip to content

Instantly share code, notes, and snippets.

View mohankumar-i2i's full-sized avatar

Mohan Kumar mohankumar-i2i

  • ideas2it technologies
  • chennai,tamil nadu,India
View GitHub Profile
const cluster = require("cluster");
const express = require("express");
const numCPUs = require("os").cpus().length;
const app = require
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running`);
// Fork workers.
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
@mohankumar-i2i
mohankumar-i2i / ec2-user-data.sh
Last active August 6, 2020 02:05
Sample user data for ec2
#!/bin/bash
# install httpd (Linux 2 version)
# create role with s3 write access privilege and set to ec2 instance
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www/html
chmod 2775 /var/www/html