Skip to content

Instantly share code, notes, and snippets.

View imranfakhrul's full-sized avatar
🎯
Focusing

Imran Fakhrul imranfakhrul

🎯
Focusing
View GitHub Profile
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active November 10, 2024 07:51
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@Tamal
Tamal / git-ssh-error-fix.sh
Last active November 14, 2024 11:16
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@initcron
initcron / wordpress_install_ubuntu-1604.sh
Last active September 22, 2023 22:37
Install wordpress on Ubuntu 16.04 LTS
#!/bin/bash
sudo apt-get update
sudo apt-get install apache2 apache2-utils -yq
sudo systemctl enable apache2
sudo systemctl start apache2
sudo apt-get install php libapache2-mod-php php-mysql -yq
sudo apt-get install php-curl php-gd php-mbstring php-xml php-xmlrpc -yq
sudo a2enmod rewrite
sudo systemctl restart apache2
cd /var/www
@joynal
joynal / user.js
Last active January 6, 2019 13:05
const mongoose = require('mongoose');
const jwt = require('jsonwebtoken');
const config = require('config');
const User = require('../model/user');
const signUp = async (req, res) => {
try {
// You may remove this if statement by adding data validation layer at routing
if (req.body.username && req.body.email && req.body.password) {
const jwt = require('jsonwebtoken');
const redis = require('redis');
const config = require('config');
const { promisify } = require('util');
const client = redis.createClient({
url: config.get('redisdbURL'),
password: config.get('redispassword'),
});
@bradtraversy
bradtraversy / docker-help.md
Last active November 15, 2024 17:06
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@chranderson
chranderson / nvmCommands.js
Last active November 13, 2024 16:18
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node