Skip to content

Instantly share code, notes, and snippets.

View muyiwadosunmu's full-sized avatar
:octocat:
Focusing

ππuyiw@ muyiwadosunmu

:octocat:
Focusing
View GitHub Profile
@muyiwadosunmu
muyiwadosunmu / systemd_service_hardening.md
Created January 21, 2025 17:53 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@muyiwadosunmu
muyiwadosunmu / pdf.js
Created May 9, 2023 05:41 — forked from hagemann/pdf.js
Example to generate PDF with external image
const Printer = require('pdfmake')
const axios = require('axios')
const path = require('path')
module.exports.pdf = async (req, res, next) => {
var printer = new Printer({
Roboto: {
normal: path.resolve('src', 'fonts', 'Roboto.ttf'),
bold: path.resolve('src', 'fonts', 'Roboto-Bold.ttf'),
}

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

@muyiwadosunmu
muyiwadosunmu / Docker
Created March 20, 2023 09:48 — forked from orvi2014/Docker
Node Dockerization
# Use leightweight linux distrubution
# Choose alpine because it's size only 5MB
FROM alpine:3.7
ENV NVM_DIR /usr/local/nvm
ENV NODE_ENV=local
ENV PORT=4044
ENV JWT_ACCESS_TOKEN=iamdeveloper
ENV JWT_REFRESH_TOKEN=iamdevelopertoo
ENV JWT_EXPIRATION=60m
@muyiwadosunmu
muyiwadosunmu / webdev_online_resources.md
Created March 20, 2023 08:25 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@muyiwadosunmu
muyiwadosunmu / docker-help.md
Created March 20, 2023 08:24 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@muyiwadosunmu
muyiwadosunmu / mern-server-setup.md
Created March 20, 2023 08:20 — forked from bradtraversy/mern-server-setup.md
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@muyiwadosunmu
muyiwadosunmu / node_nginx_ssl.md
Created February 9, 2023 21:30 — forked from bradtraversy/node_nginx_ssl.md
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