Docker – Commonly Used Commands

To build an image (use -t to specify name:tag):Run: docker build -t NAME /path/to/Dockerfile To run an image (use —name to define name for the container):Run: docker run -d —name ContainerNAME ImageNAME** -d means detached modeOr Run: docker run -dit …** -t means allocate a pseudo-TTY which can keep the container running if no other commands are provided.** -i,Continue reading “Docker – Commonly Used Commands”

[3W1H] Explaining The WordPress Loop in Detail

This is an article explaining the 3W1H of the well-known WordPress Loop(abbr. as the Loop). Tbh, not all of the 5W1H is suitable in explaining tech terms. So I removed the Who and Where from it. 5W1H is generally a good tool and starting point in understanding something more thoroughly and deeply. So, let’s getContinue reading “[3W1H] Explaining The WordPress Loop in Detail”

A simple script to git pull remotely

For my simple private web projects when there are no script building or bundling, I just don’t need the whole CI/CD pipeline to get stuff working. I only needed git and Github. So here’s how I automate part of my deployment. Before writing this bash script, I would have to first ssh into the remoteContinue reading “A simple script to git pull remotely”

DNS Records Terms Explained

MX – An MX record is the record on your domain that routes email traffic to the proper servers currently hosting your email. A – A record (Address Record) points a domain or subdomain to an IP address. CNAME – A CNAME (Canonical Name) points one domain or subdomain to another domain name, allowing you to update oneContinue reading “DNS Records Terms Explained”

Docker 101 – Bind mounts or Volumes

This article is written for docker beginners to understand bind mounts and volumes and how to choose between them. Bind mounts A file or directory on the host machine is mounted into a container, it is created on demand if it does not yet exist If you bind-mount to a non-empty directory in the container, that directory’sContinue reading “Docker 101 – Bind mounts or Volumes”

Switching git branch names

Recently I was working on a project where there’s only the master initially, which uses docker for the environment. Afterwards, as the project is ready to be launched, I made another branch named basic_setup which does not use docker anymore, but just uses the preset environment in the production server instead. Then I think itContinue reading “Switching git branch names”

Get an empty Ubuntu docker image up and running with a sudo-enabled user

I’m still a beginner in Docker and still don’t have a clue what most of the instructions in Dockerfile or docker-compose.yml do. I just understand the simple ones. So to consolidate my understandings and also shed light for others, I decided to just make a very simple Dockerfile for you, presumably also a beginner toContinue reading “Get an empty Ubuntu docker image up and running with a sudo-enabled user”

How to set up Git at a directory with an empty repository

Assuming you are already at the corresponding directory: Step 1: git init This command, quote from git documentation, creates an empty Git repository – basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. Step 2: git add -A The git add command adds changes in the working directory to the staging area, or more specifically, theContinue reading “How to set up Git at a directory with an empty repository”

Setting HTTP Cache Headers at server-side (PHP+Apache)

Recently I was trying to debug a WordPress site. I notice from the response headers on the pages, most of them have a “cache-control: max-age=600, public” header. Since I’m constantly changing code on certain pages and would like to see immediate effect, I decided to change the cache-control header to “no-store, must-revalidate”. In the functions.php,Continue reading “Setting HTTP Cache Headers at server-side (PHP+Apache)”