Skip to content

Instantly share code, notes, and snippets.

@lihini
lihini / nestjs-in-ubuntu-with-nginx-pm2.md
Created June 10, 2024 11:03
Host Nest.js app in Ubuntu server with NGINX reverse proxying

Guide to host an Nest.js API on Ubuntu

1. Create new super user for deployments

sudo apt-get update
adduser deployer
usermod -aG sudo deployer
su deployer
@lihini
lihini / docker-cleanup-resources.md
Created June 25, 2021 10:16 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@lihini
lihini / namecheap SSL.md
Created May 22, 2021 16:01 — forked from Shourai/namecheap SSL.md
Letsencrypt SSL certificate with namecheap hosting

source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/

The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”

Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.

First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.

@lihini
lihini / AngularJSManualBootstrapping.md
Created December 19, 2017 14:51
Initialize an AngularJS application manually

AngularJS automatic bootstrapping

AngularJS initializes an angular application by detecting the ng-app directive in the HTML upon it's DOMContentLoaded event.

Chances are you've to take this initialization to your hand depending on your environment.

Ex: Initializing application module with different configurations in dev and prod environments.

For such situations, manual bootstrapping is the way to go.