Skip to content

Instantly share code, notes, and snippets.

@darshitvvora
darshitvvora / ServerDeploySteps.txt
Created May 5, 2020 08:16
Basic Node Server Deployment
Welcome to the Sample API wiki!
1. Starting NodeJS Project with Angular FullStack
2. Configuring Git
3. Setup DB
4. Setup Solr
5. Setup Hooks
6. Setup Staging Server
7. Setup Production Server
@darshitvvora
darshitvvora / oodo.txt
Created May 5, 2020 07:13
Odoo Installation on Ubuntu Server and customization tips
To install Odoo on Ubuntu Server 14.04 refer this Link -:
http://openies.com/install-openerp-odoo-9-on-ubuntu-server-14-04-lts/
refer link -: http://www.odoo.yenthevg.com/configure-outgoing-mailservers/
## Creating custom filter
Activate the Developer Mode
Go to the view you want to add the filter to
From the debug dropdown menu, select edit search view 4)then add filter in filter_domain="['|','|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self),('phone', 'ilike', self)]" code
@darshitvvora
darshitvvora / launchApps.sh
Created May 5, 2020 07:12
Launch all project apps on your local machine using shell script. This is useful when some apps are dependent on other in separate projects
projDir='/home/USERNAME/projects/'
declare -A MYMAPS=(
["ui-1"]="grunt serve"
["ui-2"]="grunt serve"
["ui-3"]="gulp serve"
["ui-4"]="gulp serve"
["ui-5"]="gulp serve"
["accounts"]="gulp serve"
["xtension"]="npm run dev"
@darshitvvora
darshitvvora / mysql-phpmyadmin-docker.sh
Last active April 28, 2020 09:39
Install MySQL and PhpMyAdmin
# Install Docker and pull mysql docker image
```shell
docker pull mysql:8.0.1
```
# Create the network called "asgard"
docker network create asgard
# Create dir for database data
mkdir -p /Users/darshitvora/repo/career/mysql
@darshitvvora
darshitvvora / nginx.txt
Created April 20, 2020 09:57
Deploy sample node app on nginx
# Node.js Deployment
> Steps to deploy a Node.js app to DigitalOcean/Linode using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
## 1. Sign up for Digital Ocean/Linode
## 2. Create a droplet and log in via ssh
I will be using the root user, but would suggest creating a new user
@darshitvvora
darshitvvora / server.sh
Last active March 23, 2020 10:12
Useful Server Operations and Maintainence Command
# Tarzip and compress a folder in linux
tar -zcvf filename.tar.gz /mnt/volume-nyc1-03/foldername
# Check disk space
df -h
# Check current folder path
pwd
# Detach volume (Linode/DigitalOcean) remove text from fstab file
@darshitvvora
darshitvvora / installPackageJSON.sh
Created March 23, 2020 07:08
Loop over all project in directory and run npm i
for f in ~/repo/quezx/*;
do
[ -d $f ] && cd "$f" && echo Entering into $f and installing packages && npm i
done;
@darshitvvora
darshitvvora / api.service
Last active April 18, 2019 07:07
Sample Linux service file - /etc/systemd/system
[Unit]
Description=API Server
After=syslog.target
[Service]
WorkingDirectory=/home/user/repo/api
ExecStart=/usr/local/bin/node server/boot
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always
@darshitvvora
darshitvvora / boot.js
Created April 17, 2019 10:26
Boot Node app.js with number of workers
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
const cluster = require('cluster');
const log = require('debug')('boot:master');
const workerCount = process.env.WORKER_COUNT || 2;
@darshitvvora
darshitvvora / gist:fc28193de4caaa873c363a4f52b10139
Created December 27, 2018 07:40
Top 10 OWASP learning guide with recommended steps for handling it in NodeJS Express project
https://www.evernote.com/shard/s603/sh/896e0a7f-7200-415c-ba08-943bc0e810dd/89993b2de699995abddb32f0b22c44b8