Posts

Showing posts from March, 2026

North - South and East - West principle in Coding

  The “North–South” and “East–West” principle in coding is simply about understanding how data moves in and out of your system (North–South) versus how it flows internally between services (East–West). Think of it like traffic: cars entering/exiting a city vs. cars moving between neighborhoods inside the city. 🌐 Simple Explanation North–South Traffic Definition: Data crossing the boundary of your system. Examples: A user’s browser sending a request to your API. Your service calling an external payment gateway. Security Needs: Protect entry and exit points with HTTPS/TLS, firewalls, API gateways, and monitoring. East–West Traffic Definition: Data moving inside your system between microservices. Examples: Orders service talking to Payments service. Pods communicating inside Kubernetes. Security Needs: Encrypt internal calls (mTLS), use service meshes (Istio, Linkerd), and enforce “zero trust” (always verify, even internally). 🧭 Easy Compass Metaphor No...

How to create GIT Hub OAuth Apps

Image
Register GitHub OAuth App Go to https://github.com/settings/developers Click "New OAuth App" (or "OAuth Apps" → "New OAuth App") Fill in Application name: Bridge Integration (or any name) Homepage URL: http://localhost:3000 Authorization callback URL: http://localhost:3000/api/oauth/github/callback Click "Register application" Copy the Client ID (a long string, not "8") Click "Generate a new client secret" and copy it  we can use this in our application.

Alternative to Short Polling

  The best alternative to short polling depends on who needs to talk (just the server, or both) and how often the data changes. Here are the three industry-standard alternatives: 1. Long Polling (The "Bridge" Solution) Long polling is the closest relative to short polling but much more efficient. Instead of the server saying "No" immediately, it holds the request open until data is ready or a timeout occurs. How it works: Client asks $\rightarrow$ Server waits until the PDF is processed $\rightarrow$ Server responds $\rightarrow$ Client immediately asks again. Best for: Tasks that take a variable amount of time (like AI processing) where you want to reduce empty network traffic. Pros: Easy to implement; works everywhere (no special protocols). 2. Server-Sent Events (SSE) (The "Streamer") SSE allows the server to push updates to the client over a single, long-lived HTTP connection. It is unidirectional (Server $\rightarrow$ Client). How it works...

What is Short Polling

  Short polling is the simplest (and most "old-school") way for a client (like your web browser) to get updates from a server. In this model, the client repeatedly asks the server, "Do you have new data for me yet?" at fixed intervals (e.g., every 5 seconds). The server responds immediately, even if there is nothing new to report. How it Works Think of short polling like a kid in the backseat of a car on a road trip. Every two minutes, they ask, "Are we there yet?" * If the answer is No , the parent says "No" immediately. If the answer is Yes , the parent says "Yes." Either way, the kid waits another two minutes and asks the exact same question again. The Workflow Request: The client sends an HTTP request to the serve Immediate Response: The server checks its database or state. If there is new data , it sends it back (200 OK). If there is no data , it sends back an empty response (204 No Content or 200 OK with an empty list). Wait:...

Finding Your Redis Credentials: Host, Port, and Password

 Finding Your Redis Credentials: Host, Port, and Password Here is how to hunt down your Redis credentials in seconds. 1. The Host: Where is Redis living? In 90% of local development scenarios (including WSL), Redis lives right on your machine. Standard Local Host: 127.0.0.1 or localhost Remote Server: If you're connecting to a staging or production server, you will need that server's specific IP address or domain name (e.g., redis.example.com ). 2. The Port: Which door is open? The default port for Redis is 6379 . However, if you're running multiple instances, it might be different. To confirm exactly which port your instance is listening on, run: redis-cli CONFIG GET port Alternatively, you can ask your system which process is "squatting" on the network: sudo ss -tlnp | grep redis If you see 0.0.0.0:6379 , you're using the default. 3. The Password: Is the gate locked? By default, a fresh Redis installation has no password . In a local environment, this is ...

How to know Redis is installed or not in WSL

How to Check if Redis is Installed on WSL (and How to Fix It) If you're developing on Windows, using Redis inside Windows Subsystem for Linux (WSL) is the gold standard for performance. But sometimes, it’s hard to tell if you already have it set up or if the service is just sleeping. Here is a quick guide to verifying your Redis installation and getting it running in seconds. Phase 1: The "Quick Check" Before digging into system logs, try these two commands to see if Redis is already in your path. 1. Check the Version redis-server --version Success: You’ll see Redis server v=7.x.x . Failure: You’ll see command not found . 2. Locate the Binary which redis-server This tells you exactly where the executable lives (usually /usr/bin/redis-server ). If it returns nothing, Redis likely isn't installed. Phase 2: Verifying via Package Manager If the commands above failed, it’s possible the package is there but not in your environment path. Check the dpkg database: dpkg -...

How to install Tesseract in WSL

Image
 Hi, In this post, we will see how to use tesseract ocr in wsl and use. Install Tesseract OCR: sudo apt install tesseract-ocr -y Install Language packes: Since my project needs both English and Tamil support: # English (usually included by default, but explicit is safer) sudo apt install tesseract-ocr-eng -y # Tamil language pack sudo apt install tesseract-ocr-tam -y Verify Installation # Check Tesseract version tesseract --version # List installed languages tesseract --list-langs

How to fix Cannot start Docker Compose application

 Hi Everyone, Today, lets see how to solve the below issue while starting the docker containers. Cannot start Docker Compose application. Reason: compose [start] exit status 1. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Steps to  Fix : 1 . Open  Docker  Desktop  Settings Click the  Docker Desktop icon  in system tray  → Settings  (gear icon) 2. Enable W SL  2 Backend Go to  General  tab Check   "Use the W SL 2  based engine " Click   Apply  & Restart 3 . Enable WSL  Integration Go  to  Resources  →  WSL Integration Turn on  "Enable integration  with  my  default W SL  distro " Or manually enable  your specific  distro from  the  list Click   Apply & Restart