Skip to content

Instantly share code, notes, and snippets.

View danielwetan's full-sized avatar

Daniel Saputra danielwetan

View GitHub Profile
@danielwetan
danielwetan / transaction.py
Created March 11, 2023 02:43 — forked from rrafal/transaction.py
Lock PostgreSQL table in Django app
from django.db.transaction import * # NOQA
from django.utils.decorators import ContextDecorator
LOCK_MODES = (
'ACCESS SHARE',
'ROW SHARE',
'ROW EXCLUSIVE',
'SHARE UPDATE EXCLUSIVE',
'SHARE',
@danielwetan
danielwetan / build-server.sh
Created February 19, 2023 10:38 — forked from cerico/build-server.sh
pm2 rails nginx setup
#!/bin/bash
###--- Basics ---###
sudo apt-get update
sudo apt-get install -y tree software-properties-common git-core openssl libssl-dev git vim curl zsh
###--- Node ---###
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active October 31, 2024 04:33
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder