Skip to content

Instantly share code, notes, and snippets.

View eriknyk's full-sized avatar
🏠
Working from home

Erik Amaru Ortiz eriknyk

🏠
Working from home
View GitHub Profile
<VirtualHost 127.0.0.1>
ServerName processmaker
DocumentRoot /Users/erik/Web/processmaker.github/workflow/public_html
<Directory /Users/erik/Web/processmaker/workflow/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

Here's all you have to do to add clustering to your node.js application.

  • save this code as cluster.js, and run cluster.js instead of server.js (or /bin/www, or whatever it's called for your project)
  • the only line you'll need to change is the last line - it needs to point to the location of your server.js file
var cluster = require('cluster');

if (cluster.isMaster) {
  // Count the machine's CPUs
 var cpuCount = require('os').cpus().length;
@eriknyk
eriknyk / gist:4182919
Last active October 13, 2015 10:38 — forked from o1y/gist:1574898
show git branch and git status in command prompt of your current working directory
#
# Git branch/status monitor on Linux/MacOs Shel
# ---------------------------------------------
#To be added on .bashrc
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"