Skip to content

Instantly share code, notes, and snippets.

View fahimbabarpatel's full-sized avatar

Fahim Babar Patel fahimbabarpatel

View GitHub Profile
@DanishSiddiq
DanishSiddiq / app.js
Created September 23, 2018 10:44
app.js
import http from 'http';
import morgan from 'morgan';
import express from 'express';
import bodyParser from 'body-parser';
import cluster from 'cluster';
import { setRouter } from './route';
const app = express();
let workers = [];
@fahimbabarpatel
fahimbabarpatel / deployment_using_shipit.md
Created March 5, 2017 07:00
Deployment using Javascript shipit npm
Shipit-cli - Command line utility to execute shipit scripts. 
shipit-deploy - Npm to do actual code movement and publishing.
shipit-npm - Npm to install npms on servers during deployment.
shipit-shared - Npm to access symlinks file and directory on servers.


module.exports = function (shipit) {
  require('shipit-deploy')(shipit);
 require('shipit-shared')(shipit);
@fahimbabarpatel
fahimbabarpatel / socket_io_covered.md
Last active March 5, 2017 09:15
Socket.io covered
npm install --save socket.io

---------------------------------SERVER CODE START------------------------------------------
var express = require('express');
var app = express();
var server = http.createServer(app);
io = require("socket.io").listen(server);
server.listen(3000)
@fahimbabarpatel
fahimbabarpatel / ssh_special_commands.md
Last active August 13, 2016 17:58
ssh_special_commands
ssh remote_host

The remote_host in this example is the IP address or domain name that you are trying to connect to.

This command assumes that your username on the remote system is the same as your username on your local system.

If your username is different on the remote system, you can specify it by using this syntax:

@fahimbabarpatel
fahimbabarpatel / ruby_mongoid_setup.md
Created March 10, 2016 17:17
ruby_mongoid_setup
# mongoid.yml
development:
  clients:
    default:
      database: test
      hosts:
        - localhost:27017

@fahimbabarpatel
fahimbabarpatel / commands_to_find_out_live_ssh_session.md
Created March 1, 2016 12:48
commands_to_find_out_live_ssh_session
ps aux | grep ssh
last |grep "logged in"
ps aux | grep ssh | grep pts/
app.get('/login', function(req, res, next) {
  passport.authenticate('local', function(err, user, info) {
    if (err) { return next(err); }
    if (!user) { return res.redirect('/login'); }
    req.logIn(user, function(err) {
      if (err) { return next(err); }
      return res.redirect('/users/' + user.username);
    });
  })(req, res, next);
openssl genrsa 2048 > SSL.pem
openssl req -new -key SSL.pem -out CSR.pem
``````````````````````````````````````