Saturday, August 23, 2025

What Is Vibe Coding?

Definition:

Vibe coding is an AI-powered style of programming where you describe your requirements in natural language, and a Large Language Model (LLM) generates working code in response—no manual line-by-line coding required. You guide, refine, and test iteratively


The term was coined by Andrej Karpathy, former AI head at Tesla and co-founder of OpenAI, who put it poetically as:


Why It’s Gaining Attention

Rapid prototyping & MVPs: You can spin up working features or apps almost instantly by prompting an AI.   

Lowering entry barriers: Even non-coders or learners can create tools and apps by describing what they want.    

Enterprise excitement: Businesses now use it to quickly build interfaces and prototypes. Gartner forecasts that 40% of new business software will use AI-assisted techniques in the near future.  

Boosting productivity: Small engineering teams can achieve output typical of far larger teams. Y Combinator’s Garry Tan suggests this may reshape startup paths.  

AI as a coding partner: AWS leadership views vibe coding tools as collaborative—helping developers focus on problem-solving rather than boilerplate.




How It Works


Vibe coding is essentially a dialogue between the developer and the LLM. It goes like this:

1. You express your goal in plain English.

2. The AI generates initial code.

3. You test it, ask for tweaks or debugging, and repeat.    


It’s exploratory and often iterative, leaning into creative flow over formal structure.  



Limitations & Risks

Code quality & maintainability: Auto-generated code may be buggy, insecure, or hard to understand long-term.     

Scaling challenges: Best suited for small projects or throwaway prototypes—not complex, production-grade systems.    

Over-reliance on AI: Blindly accepting AI output can lead to critical flaws. Human oversight remains essential.     

Loss of understanding: Developers may lose deep insight into what the code really does.   

Enterprise governance concerns: Without proper guardrails, AI-generated code may pose security or compliance risks



Wednesday, August 20, 2025

What is LangExtract


That’s where LangExtract comes in. It’s a free, open-source Python tool from Google that does the grunt work for you. It lives on GitHub, runs locally or with cloud AI models, and honestly feels like a friend who’s really good at highlighting exactly what matters.


You hand LangExtract a chunk of text, tell it what to look for, and it hands back a neat list of details — all linked to where they came from in the original.


Shows you exactly where it found each detail

Lets you guide it with a quick example so it knows your style

Handles giant documents without choking

Even makes a clickable webpage so you can explore your results

Works on pretty much anything — fiction, medical notes, contracts, whatever

I’ve been writing about tech for a decade, and this is one of those tools you try once and instantly get hooked on.




Why bother?

Because text is everywhere — emails, reports, books — and it’s rarely tidy. Picking through it manually is slow, boring, and easy to mess up. LangExtract is the shortcut. It’s tweakable, lightweight, and built by people who actually get that not everyone wants to wrestle with overcomplicated software.


pip install langextract


echo 'LANGEXTRACT_API_KEY=your-key' > .env


import langextract as lx


prompt = "Find characters, emotions, and relationships. Use exact words from the text."

examples = [

    lx.data.ExampleData(

        text="ROMEO. But soft! What light through yonder window breaks? It is the east, and Juliet is the sun.",

        extractions=[

            lx.data.Extraction("character", "ROMEO", {"mood": "amazed"}),

            lx.data.Extraction("emotion", "But soft!", {"feeling": "soft wonder"}),

            lx.data.Extraction("relationship", "Juliet is the sun", {"type": "poetry"})

        ]

    )

]

text = "Lady Juliet looked up at the stars, her heart racing for Romeo"

result = lx.extract(

    text_or_documents=text,

    prompt_description=prompt,

    examples=examples,

    model_id="gemini-2.5-flash"

)

lx.io.save_annotated_documents([result], "juliet_stuff.jsonl")

html = lx.visualize("juliet_stuff.jsonl")

with open("juliet_viz.html", "w") as f:

    f.write(html)


Want to run it on the entire Romeo and Juliet text from Project Gutenberg?


result = lx.extract(

    text_or_documents="https://www.gutenberg.org/files/1513/1513-0.txt",

    prompt_description=prompt,

    examples=examples,

    model_id="gemini-2.5-flash",

    extraction_passes=3,

    max_workers=20,

    max_char_buffer=1000

)



It’s not an official Google product — it’s Apache 2.0 licensed


Monday, August 18, 2025

Kubernetes - script for setting up master and worker

 


We’ll create two scripts:

1. k8s-node-setup.sh → run on all nodes (control-plane + workers)

2. k8s-master-init.sh → run only on the control-plane to initialize the cluster



1. k8s-node-setup.sh (all nodes)


This script prepares Ubuntu for Kubernetes, installs containerd, kubeadm, kubelet, kubectl.


#!/bin/bash

set -e


echo "[Step 0] Updating system..."

sudo apt-get update -y


echo "[Step 1] Disabling swap..."

sudo swapoff -a

sudo sed -ri '/\sswap\s/s/^/#/' /etc/fstab


echo "[Step 2] Loading kernel modules..."

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf

overlay

br_netfilter

EOF


sudo modprobe overlay

sudo modprobe br_netfilter


echo "[Step 3] Setting sysctl params..."

cat <<EOF | sudo tee /etc/sysctl.d/kubernetes.conf

net.bridge.bridge-nf-call-iptables  = 1

net.bridge.bridge-nf-call-ip6tables = 1

net.ipv4.ip_forward                 = 1

EOF

sudo sysctl --system


echo "[Step 4] Installing containerd..."

sudo apt-get install -y containerd

sudo mkdir -p /etc/containerd

containerd config default | sudo tee /etc/containerd/config.toml >/dev/null

sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml

sudo systemctl enable --now containerd

sudo systemctl restart containerd


echo "[Step 5] Installing kubeadm, kubelet, kubectl..."

sudo apt-get install -y apt-transport-https ca-certificates curl gpg

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key \

  | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg


echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] \

https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /" \

| sudo tee /etc/apt/sources.list.d/kubernetes.list


sudo apt-get update

sudo apt-get install -y kubelet kubeadm kubectl

sudo apt-mark hold kubelet kubeadm kubectl


echo "✅ Node prep complete. Ready for kubeadm init (control-plane) or join (workers)."




2. k8s-master-init.sh (control-plane only)

This initializes the control-plane with Calico networking.


#!/bin/bash

set -e


POD_CIDR="192.168.0.0/16"

API_ADVERTISE_IP=$(hostname -I | awk '{print $1}')


echo "[Step 1] Initializing Kubernetes control-plane..."

sudo kubeadm init \

  --pod-network-cidr=${POD_CIDR} \

  --apiserver-advertise-address=${API_ADVERTISE_IP}


echo "[Step 2] Setting up kubeconfig for current user..."

mkdir -p $HOME/.kube

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

sudo chown $(id -u):$(id -g) $HOME/.kube/config


echo "[Step 3] Installing Calico CNI..."

kubectl apply -f https://docs.projectcalico.org/manifests/tigera-operator.yaml

kubectl apply -f https://docs.projectcalico.org/manifests/custom-resources.yaml


echo "✅ Control-plane initialized. Workers can now join using the kubeadm join command printed above."


3. Worker join command

After running the master init script, copy the kubeadm join ... line that is printed and run it on each worker node.

If you need a new token later:


sudo kubeadm token create --print-join-command


What are steps involved in setting up a multi-node Kubernetes cluster on Ubuntu VMs using kubeadm.

0) Plan & prerequisites (all nodes)

Give each VM a unique hostname and ensure full network connectivity between them.

Recommended (comfortable) sizes: control-plane ≥2 vCPU / 4 GB RAM; workers ≥2 GB RAM.

Make sure your firewall or cloud security groups allow the required Kubernetes ports (you can adjust later).



Open these ports (typical defaults):

Control-plane inbound: 6443/tcp (API server), 2379-2380/tcp (etcd), 10250/tcp (kubelet), 10257/tcp (controller), 10259/tcp (scheduler).  

Workers inbound: 10250/tcp (kubelet), 10256/tcp (kube-proxy), 30000-32767/tcp,udp (NodePort services). 


1) System prep (run on all nodes)


# Update OS

sudo apt-get update -y


# 1.1 Disable swap (kubeadm default expects swap off)

sudo swapoff -a

sudo sed -ri '/\sswap\s/s/^/#/' /etc/fstab



Kernel modules & sysctls for container networking


# 1.2 Load required modules on boot

cat <<'EOF' | sudo tee /etc/modules-load.d/k8s.conf

overlay

br_netfilter

EOF

sudo modprobe overlay

sudo modprobe br_netfilter


# 1.3 Allow bridged traffic to be seen by iptables and enable forwarding

cat <<'EOF' | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf

net.bridge.bridge-nf-call-iptables  = 1

net.bridge.bridge-nf-call-ip6tables = 1

net.ipv4.ip_forward                 = 1

EOF

sudo sysctl --system


These sysctls and modules are the standard container runtime prerequisites.)  


2) Install and configure containerd (all nodes)


# Install containerd

sudo apt-get install -y containerd


# Generate a default config and switch to systemd cgroups (recommended)

sudo mkdir -p /etc/containerd

containerd config default | sudo tee /etc/containerd/config.toml >/dev/null

sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml


# Enable and restart

sudo systemctl enable --now containerd

sudo systemctl restart containerd




3) Install kubeadm, kubelet, kubectl (all nodes)


# Add Kubernetes APT keyring & repo (Kubernetes v1.33 line shown here)

sudo apt-get install -y apt-transport-https ca-certificates curl gpg

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key \

  | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg


echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] \

https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' \

| sudo tee /etc/apt/sources.list.d/kubernetes.list


sudo apt-get update

sudo apt-get install -y kubelet kubeadm kubectl

sudo apt-mark hold kubelet kubeadm kubectl


4) Initialize the control-plane (control-plane node only)


Pick a Pod CIDR that matches your CNI choice. Two popular options:

Calico defaults to 192.168.0.0/16

Flannel defaults to 10.244.0.0/16


Below shows Calico (you can swap to Flannel later—see Step 6):


# Replace the advertise-address with this node's primary IP

POD_CIDR=192.168.0.0/16

API_ADVERTISE_IP=$(hostname -I | awk '{print $1}')


sudo kubeadm init \

  --pod-network-cidr=${POD_CIDR} \

  --apiserver-advertise-address=${API_ADVERTISE_IP}



When it completes, it prints two important things:

A kubeadm join ... command for workers

A note to set up your kubeconfig for kubectl on this node


Set kubeconfig for your current user:


mkdir -p $HOME/.kube

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

sudo chown "$(id -u)":"$(id -g)" $HOME/.kube/config


# Verify

kubectl get nodes


(Init/join workflow per kubeadm docs.) 



5) Install a CNI network plugin (control-plane)

You need a CNI so Pods can talk to each other. Choose one:


Option A — Calico (NetworkPolicy-capable)


# Install the Tigera operator

kubectl apply -f https://docs.projectcalico.org/manifests/tigera-operator.yaml

# Create a default Calico installation (uses 192.168.0.0/16 by default)

kubectl apply -f https://docs.projectcalico.org/manifests/custom-resources.yaml


# Wait for calico pods to be Ready

kubectl get pods -n tigera-operator

kubectl get pods -n calico-system


Option B — Flannel (simple & lightweight)


If you prefer Flannel, ensure you used --pod-network-cidr=10.244.0.0/16 in step 4, then:


kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml


(Official Flannel manifest.)  


Give the CNI a minute to roll out. kubectl get nodes should show the control-plane Ready once CNI is settled.


6) Join worker nodes (run on each worker)


On each worker VM, paste the kubeadm join ... command that kubeadm init printed.

It looks like:


sudo kubeadm join <API_SERVER_IP>:6443 \

  --token <token> \

  --discovery-token-ca-cert-hash sha256:<hash>


If you lost it, re-create a fresh join command on the control-plane:


sudo kubeadm token create --print-join-command


(Join procedure is part of standard kubeadm workflow.)  


Verify from the control-plane:


kubectl get nodes -o wide


7) (Optional) Basic sanity tests


# Test DNS & scheduling with a simple deployment and NodePort service

kubectl create deploy hello --image=nginx

kubectl expose deploy hello --port=80 --type=NodePort

kubectl get svc hello -o wide  # Note the NodePort to test via workerIP:nodePort



8) Firewalls and security groups (recap)


If you run a host firewall (ufw, firewalld) or cloud SGs, ensure the required ports from step 0 are open; otherwise, components may be NotReady. Official list here.


Common gotchas

Swap not fully disabled: kubelet won’t start cleanly. Re-run the swap commands.  

Cgroups mismatch: If kubelet logs complain about cgroups, ensure SystemdCgroup = true in /etc/containerd/config.toml, then systemctl restart containerd and systemctl restart kubelet.  

CNI not installed: Nodes stay NotReady. Install Calico/Flannel as in step 5 and wait for pods to be Ready.   

Ports blocked: API at :6443 unreachable or workers can’t join—open the ports listed earlier.




Sunday, August 17, 2025

What is Flowwise?

Flowise is an open-source, low-code platform that enables users to build AI applications, particularly those involving large language models (LLMs), using a drag-and-drop interface. It simplifies the process of creating and customizing LLM flows, AI agents, and other related applications by providing a visual, modular, and highly flexible environment. 

Here's a more detailed look:

Key Features and Capabilities:

Visual, Drag-and-Drop Interface:

Flowise uses a visual interface where users can connect pre-built blocks (like LLM blocks, function blocks, memory blocks, etc.) to create complex AI workflows. 

Low-Code/No-Code Approach:

It reduces the need for extensive coding, making it accessible to users with varying levels of programming expertise. 

LLM Integration:

Flowise seamlessly integrates with various components of LLM applications, including language models, memory, data loaders, and tools. 

AI Agent Building:

It facilitates the creation of both single and multi-agent systems, enabling the development of conversational agents and other complex AI applications. 

Flexibility and Customization:

Flowise allows for customization and fine-tuning of workflows, making it suitable for a wide range of use cases. 

LangChain and LlamaIndex Integration:

It leverages the capabilities of LangChain and LlamaIndex, popular libraries for building LLM-powered applications, to provide a more robust and versatile platform. 

Open Source:

Being open-source, Flowise is freely available for both personal and commercial use, encouraging community contributions and continuous development. 

Use Cases:

Chatbots and Virtual Assistants: Flowise can be used to build conversational interfaces for various applications. 

Automation Solutions: It can be employed to automate tasks and workflows using AI agents. 

Data Analysis Tools: Users can create agents that can analyze datasets and provide insights. 

NLP Applications: Flowise can be utilized to build applications that involve natural language processing tasks. 

RAG (Retrieval-Augmented Generation) Systems: Flowise can be used to build systems that combine retrieval and generation capabilities. 

In essence, Flowise provides a powerful and user-friendly platform for building and deploying a wide variety of AI applications, especially those leveraging the capabilities of large language models. 


Saturday, August 16, 2025

What is difference between CopyRight and CopyLeft

 ðŸ“œ Copyright

What it is:

A legal right automatically given to the creator of an original work (book, music, software, etc.).

It gives the creator exclusive rights to use, distribute, modify, and license the work.

How it works in software:

When you write code, you own the copyright by default.

You can then decide:

Keep it private,

Sell licenses,

Or open-source it under a license (MIT, GPL, etc.).


👉 Copyright = ownership + control.



🔄 Copyleft

What it is:

A licensing strategy that uses copyright law in reverse: instead of restricting sharing, it enforces sharing.

Introduced by Richard Stallman (FSF, GNU project).

How it works:

Copyleft licenses (like GPL, AGPL) say:

“You can use, modify, and distribute this software freely — but if you distribute or offer it as a service, you must also share your modifications under the same license.”

Effect:

Ensures the software and all its derivatives remain open-source.

Prevents companies from taking open-source software, improving it, and releasing it as closed-source.


👉 Copyleft = open-source with mandatory sharing.



⚖️ Example Contrast


Case Copyright Copyleft

You write software You automatically own the copyright You can choose to apply a copyleft license

If others use it They need your permission (license) They can use it, but must share improvements

Closed-source use Allowed (if you sell/proprietary license) Not allowed — derivatives must stay open-source

Example licenses Proprietary EULAs, MIT, Apache GPL, AGPL, LGPL




🔑 Simple Analogy

Copyright is like “No one may copy or use my book without my permission.”

Copyleft is like “You may copy and modify my book, but if you publish it, you must also let others copy and modify your version.”



✅ So:

Copyright = protection & exclusivity.

Copyleft = freedom, but with the condition that freedom must continue downstream.



👉 Would you like me to also make a diagram/visual flow showing how software changes hands differently under Copyright-only, Permissive licenses (MIT/Apache), and Copyleft (GPL/AGPL)?

Friday, August 15, 2025

What is Docling Parser

Docling parses PDF, DOCX, PPTX, HTML, and other formats into a rich unified representation including document layout, tables etc., making them ready for generative AI workflows like RAG. This integration provides Docling's capabilities via the DoclingLoader document loader.

Docling is an open-source document parsing library developed by IBM, designed to extract information from various document formats like PDFs, Word documents, and HTML. It excels at converting these documents into formats like Markdown and JSON, which are suitable for use in AI workflows like Retrieval Augmented Generation (RAG). Docling utilizes fine-tuned table and structure extractors, and also provides OCR (Optical Character Recognition) support, making it effective for handling scanned documents. 

Here's a more detailed breakdown:

Document Parsing:

Docling is built to parse a wide range of document types, including PDF, DOCX, PPTX, XLSX, HTML, and even images. 

Output Formats:

It can convert these documents into Markdown or JSON, making them easily usable in AI pipelines. 

AI Integration:

Docling integrates with popular AI tools like LangChain, Hugging Face, and LlamaIndex, enabling users to build AI applications for document understanding. 

RAG Applications:

Docling is particularly useful for Retrieval Augmented Generation (RAG) workflows, where the ability to accurately extract information from complex documents is crucial. 

Key Features:

Docling's key features include layout analysis, OCR, and object recognition, which help maintain the original document's structure during the parsing process.