Blog#
Running Multiple Apps Under a Single Domain with Vercel
I own the copdips.com domain, and need to point it at several Vercel apps so that:
- https://apps.copdips.com/app1 routes to https://app1.vercel.app
- https://apps.copdips.com/app2 routes to https://app2.vercel.app
- direct https://app1.vercel.app, still works as before
- direct https://app2.vercel.app, still works as before
This is a standard Multi-Tenant Routing with Context Awareness scenario. To serve both the root domain (app1.vercel.app) and the subpath version (apps.copdips.com/app1) from the same deployment, each app must become host-aware-effectively detecting whether the request comes through the main router or directly and adjusting asset URLs and links accordingly.
OIDC (OpenID Connect)
OIDC (OpenID Connect) is an authentication layer (verify identity + obtain profile) built on top of the OAuth2 protocol (authorization layer). It allows Web-based, mobile, and JavaScript clients to verify the identity of end-users based on the authentication performed by an authorization server (aka AS or IdP), as well as to obtain basic profile information about the end-user in an interoperable and REST-like manner. It eliminates storing and managing people's passwords.
Google Chrome DevTools MCP
Chrome DevTools MCP (Model Context Protocol) allows you to interact with Google Chrome programmatically through AI coding agents like Claude Code, Copilot, Codex, etc. This enables automated testing, debugging, and inspection of web applications directly from the command line.
AI Coding Playbook
Some useful patterns for AI coding. This blog will be regularly updated with new tips.
Python uv cheat sheet
Python uv common usage cheat sheet, but doesn't cover all the features.
Using Pageant with VSCode Remote SSH
While Putty and Pageant are widely used tools for SSH connections, you can also integrate Pageant with VSCode to establish remote SSH connections without administrative privileges. While the default ssh-agent service offers similar functionality, it's disabled by default and requires administrative access to start if disabled, making Pageant a more flexible alternative. Here's how you can set it up:
Installing Ollama without root
Inspired by the official guide, here is my method for installing (or updating) Ollama without root access.
mkdir -p ~/src
cd ~/src
curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
mkdir -p ~/opt/ollama
tar -C ~/opt/ollama -xzf ollama-linux-amd64.tgz
Add Ollama to $PATH:
Then you can run ollama in your terminal:
nohup ollama serve &
ollama -v
ollama list
# Pull the embeddings model for AnythingLLM RAG
ollama pull nomic-embed-text
# Run the smallest deepseek model
ollama run deepseek-r1:5b
To stop the Ollama server:
Process, port, and file usages in Linux
Use lsof, fuser, ss, pgrep, pstree, ps, htop, etc. to find process, port and file usages in Linux.
PySpark database connectors
General
Use spark.jars to add local ODBC/JDBC drivers to PySpark, and use spark.jars.packages to add remote ODBC/JDBC drivers, PySpark will download the packages from Maven repository.
For spark-shell: https://docs.snowflake.com/en/user-guide/spark-connector-install#installing-additional-packages-if-needed