Conflict-free Replicated Data Type (CRDT)

CRDT is a class of data structures that allows modifications in distributed environments to be applied on top of each other without any conflicts and in a consistent manner.

May 22, 2021

OAuth 2.0

OAuth 2.0 is an authorization scheme that is widely used today. In this note, we discussed oauth’s common flows, its tradeoffs and when to use each flow.

May 22, 2021

Kubernetes Basics

A gentle introduction to kubernetes components, tools and jargons

May 14, 2021

Docker Basics

A gentle introduction to Docker concepts and commands

May 12, 2021

Mac must-haves

A list of must-haves when you setup a mac

May 8, 2021

Git Tricks

Git tricks Force pull git fetch origin master git reset --hard origin/master Add deleted files to index git add . tracks file deletion (but adds other files as well) For the index to track single file deletion, git add $(git ls-files --deleted) can do the job. If you want to also handle space in file name, you can do SAVEIFS=$IFS IFS=$(echo -en "\n\b") # change IFS to \n\b to handle space in filename :( git add `git ls-files --deleted` IFS=$SAVEIFS Edit last commit git commit --amend --no-edit...

February 3, 2021

Domain Setup

Domain setup Inspired by this Domain registration Find a domain registrar that supports 2FA. I use Namecheap. Buy a domain and you are good to go. DNS hosting for the domain Create a Cloudflare account. Enable 2FA. Add your domain name to Cloudflare. Click on “Add a site” button. Fill in details. Copy the 2 nameservers given to you from Cloudflare, and input it to Namecheap. It is under Domain management panel > Domain > Nameservers > Custom DNS....

December 3, 2020

Heroku Monorepo

Deploying monorepo + heroku Related repo: CS2102 Project Repo Based on: Heroku-Node-Pg Monorepo + Heroku What I’ve tried (but don’t work) Buildpacks Manually building by utilizing postinstall script which will run after Heroku finish installing dependencies. Heroku will complain cannot find dependency. Building the application on process run. Not feasible: Heroku will terminate your process if it doesn’t bind to a port within 60 secs. Checking in the build files to git (but still in its own packages)....

November 13, 2020

Sunfire as Git Server

Setting up sunfire as a remote git server Background CS2105 HW involves testing in a remote server (sunfire) and I want to use git. So, I need to use it as a git server, and then I can sync changes using my usual git workflow. Problem Encountered command: git-upload-pack not found, although git is installed Solution Digging, the above problem is caused because git-upload-pack is not in the non-interactive $PATH used by git when ssh....

October 2, 2020


Virtual Env Using virtualenv is beneficial to keep the main python free from cluttered by one-off libraries. Here’s how to set up. For *NIX, change python to python3 python --version # check your python version python -m pip install --upgrade pip # upgrade python package manager version # create virtual environment python -m venv /path/to/new/virtual/environment # activate virtual environment venv\Scripts\activate # for windows # source ./bin/activate for *NIX # Install package inside virtualenv pip3 install <package-name> # To run something using python inside virtual env python <python-file> # the python command will refer to python inside the virtualenv folder....

August 18, 2020