Skip to content

Instantly share code, notes, and snippets.

View elitemind12's full-sized avatar
๐Ÿ˜…
life is about to be happy

Daniel Makyao elitemind12

๐Ÿ˜…
life is about to be happy
View GitHub Profile
@elitemind12
elitemind12 / ecosystem.config.js
Created May 5, 2023 12:06 — forked from cgtarmenta/ecosystem.config.js
NodeJS deployment helpers
// Example of PM2 ecosystem file, working with nvm environment
// on a AWS EC2 instance running ubuntu
const HOST = '';
const REPONAME = '';
module.exports = {
apps: [
{
name : 'DEVICES:API',
script : 'server.js',
@elitemind12
elitemind12 / ecosystem.config.js
Created May 5, 2023 12:06 — forked from cgtarmenta/ecosystem.config.js
NodeJS deployment helpers
// Example of PM2 ecosystem file, working with nvm environment
// on a AWS EC2 instance running ubuntu
const HOST = '';
const REPONAME = '';
module.exports = {
apps: [
{
name : 'DEVICES:API',
script : 'server.js',
@elitemind12
elitemind12 / django-gunicorn-bash.sh
Created April 7, 2023 15:15 — forked from idris-rampurawala/django-gunicorn-bash.sh
Gunicorn script to run django app on Ubuntu
#!/bin/bash
NAME="Myproj" # Name of the application
DJANGODIR=/home/ubuntu/webapps/projects/myproj # Django project directory
DJANGOENVDIR=/home/ubuntu/webapps/projects/myproj_env # Django project env
SOCKFILE=/home/ubuntu/webapps/projects/myproj_env/run/gunicorn.sock # we will communicte using this unix socket
USER=ubuntu # the user to run as
GROUP=ubuntu # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (2 * CPUs + 1)
DJANGO_SETTINGS_MODULE=Myproj.settings # which settings file should Django use
@elitemind12
elitemind12 / samplerest.js
Created October 26, 2022 11:24 — forked from joshbirk/samplerest.js
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')