[{"content":"I build quietly.\nI learn relentlessly.\nYou\u0026rsquo;ll find no noise here — just presence, and purpose.\n","date":"21 October 2025","externalUrl":null,"permalink":"/","section":"Anohba Jehad","summary":"","title":"Anohba Jehad","type":"page"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/dev-tools/","section":"Tags","summary":"","title":"Dev Tools","type":"tags"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/gist/","section":"Tags","summary":"","title":"Gist","type":"tags"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/github/","section":"Tags","summary":"","title":"Github","type":"tags"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/hugo/","section":"Tags","summary":"","title":"Hugo","type":"tags"},{"content":" The Gist of It # There are moments when you write a small piece of code that solves something neat, maybe a Python function you’re proud of, a command you don’t want to forget, or a quick experiment that doesn’t need a full repo.\nThat’s where GitHub Gist comes in. A mini-repository for your ideas.\nIt’s the perfect middle ground between a full GitHub repo and a random code file lost in your local folder. Think of it as your personal snippet vault: lightweight, version-controlled, and shareable with a single link\nWhat Exactly Is a Gist? # A Gist is a lightweight GitHub repository, designed for sharing snippets of code, text, or even full files.\nIt supports versioning, forks, and comments, just like a regular GitHub repo, but it’s built for quick sharing and collaboration.\nYou can create public gists to share with others or private ones for your personal library of notes.\nPublic Gists: These gists are visible to the viewers on gist profle and anyone whom you shared url with. Private Gists: These gists are called Secret gists. Though they are not visible on profile yet can be viewed through shared url. Developers\u0026rsquo; Tool? Absolutely Gistified # Version Control for Snippets: Every update is saved and tracked. Easy Sharing: Each gist gets a unique URL, perfect for posting on blogs or forums. Language Highlighting: Automatic syntax highlighting for most programming languages. Embeddable Anywhere: Works beautifully inside blogs, markdown files, and Hugo posts. Personal Knowledge Base: Great for saving reusable shell scripts, code patterns, or configs. Embedding Gists in Hugo # If you use Hugo (like I do for my portfolio), embedding a Gist is surprisingly simple.\nA Simple Way: Quick Embed # Just drop this line inside your Markdown content:\nhttps://gist.github.com/anohbajhd/48bb69c9b06d0bca84fa7dd5c71bf3f6 That’s it! Hugo will render your snippet exactly like it appears on GitHub.\n","date":"21 October 2025","externalUrl":null,"permalink":"/posts/gist/","section":"Posts","summary":"","title":"Just a Gist","type":"posts"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/posts/","section":"Posts","summary":"","title":"Posts","type":"posts"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/productivity/","section":"Tags","summary":"","title":"Productivity","type":"tags"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/","section":"Tags","summary":"","title":"Tags","type":"tags"},{"content":"","date":"21 October 2025","externalUrl":null,"permalink":"/tags/workflow/","section":"Tags","summary":"","title":"Workflow","type":"tags"},{"content":"Cloud Computing 101: A Beginner’s Guide to the Future of Technology\nIn today’s digital world, where data rules and remote access is the norm, cloud computing is the backbone of modern innovation. But what exactly is cloud computing, and why is it such a game-changer?\nWhat is Cloud Computing? # Cloud computing refers to the delivery of computing services—like servers, storage, databases, networking, software, and analytics—over the internet (“the cloud”) instead of your local computer or private data center.\nInstead of owning the hardware or infrastructure, you rent or subscribe to it from cloud providers like Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), and others.\nWhy is it Called \u0026ldquo;Cloud\u0026rdquo;? # The term \u0026ldquo;cloud\u0026rdquo; comes from the cloud symbol used to represent the internet in diagrams. It’s a metaphor for computing resources existing somewhere remotely—accessible but not seen.\nKey Characteristics # Here are the defining traits of cloud computing: Characteristic\tDescription On-demand self-service\tUsers can provision resources like storage or servers without human interaction. Broad network access\tAccessible from anywhere via the internet. Resource pooling\tShared resources serve multiple customers using multi-tenant models. Rapid elasticity\tInstantly scale up or down based on need. Measured service\tYou pay only for what you use (like utilities).\nCloud Service Models # There are three major service models in cloud computing:\n1. IaaS (Infrastructure as a Service) # You rent IT infrastructure—servers, virtual machines, storage, and networking—on a pay-as-you-go basis.\nExample: AWS EC2, Google Compute Engine Ideal for: Developers who want control over servers 2. PaaS (Platform as a Service) # You get a platform with tools to develop, test, and deploy apps—without managing the underlying infrastructure.\nExample: Heroku, Google App Engine Ideal for: Developers focused on app development, not server setup 3. SaaS (Software as a Service) # You use fully developed software via the internet—no installations or maintenance required.\nExample: Gmail, Microsoft 365, Dropbox Ideal for: End-users who just need functionality Types of Cloud Environments # Clouds can be deployed in different ways depending on control, security, and scale needs:\nPublic Cloud # Owned by third-party providers; resources shared among users.\nExample: AWS, Azure, GCP Pros: Scalable, affordable Cons: Less control, potential compliance concerns Private Cloud # Used exclusively by a single organization. Can be on-premises or hosted externally.\nExample: VMware Private Cloud Pros: High security, control Cons: More costly, maintenance-heavy Hybrid Cloud # Combines public and private clouds, allowing data and applications to move between them.\nExample: AWS Outposts, Azure Stack Pros: Flexibility, cost-efficiency\nCons: More complex setup\nBenefits of Cloud Computing # Cost Efficiency – No upfront hardware costs Scalability – Instantly scale resources as your demand grows Accessibility – Work from anywhere in the world Disaster Recovery – Built-in backup and recovery tools Automatic Updates – Systems update automatically with the latest features Is Cloud Computing Safe? # Security is a shared responsibility. While cloud providers offer strong protections (encryption, firewalls, compliance), users must also configure and use services securely.\nLook for:\nMulti-factor authentication (MFA)\nIdentity and access management (IAM)\nData encryption (at rest and in transit)\nThe Future of Cloud # Cloud computing is evolving rapidly:\nEdge Computing: Bringing computing closer to the source (IoT, autonomous vehicles)\nServerless Architecture: No need to manage servers at all\nAI \u0026amp; ML Integration: Cloud is now the go-to platform for running large-scale AI models\nFinal Thoughts # Cloud computing is no longer just a tech buzzword—it’s the foundation of modern digital infrastructure. Whether you’re an aspiring developer, business owner, or tech explorer, understanding the cloud is essential.\nThe cloud isn’t the future—it’s already here. And it’s changing everything.\n","date":"30 July 2025","externalUrl":null,"permalink":"/posts/cloudcomputing/","section":"Posts","summary":"","title":"Basics of Cloud Computing","type":"posts"},{"content":"","date":"30 July 2025","externalUrl":null,"permalink":"/tags/cloud-computing/","section":"Tags","summary":"","title":"Cloud Computing","type":"tags"},{"content":"","date":"30 July 2025","externalUrl":null,"permalink":"/tags/iaas/","section":"Tags","summary":"","title":"IaaS","type":"tags"},{"content":"","date":"30 July 2025","externalUrl":null,"permalink":"/tags/paas/","section":"Tags","summary":"","title":"PaaS","type":"tags"},{"content":"","date":"30 July 2025","externalUrl":null,"permalink":"/tags/saas/","section":"Tags","summary":"","title":"SaaS","type":"tags"},{"content":"","date":"30 July 2025","externalUrl":null,"permalink":"/tags/technology/","section":"Tags","summary":"","title":"Technology","type":"tags"},{"content":"","date":"25 July 2025","externalUrl":null,"permalink":"/tags/cluster/","section":"Tags","summary":"","title":"Cluster","type":"tags"},{"content":"","date":"25 July 2025","externalUrl":null,"permalink":"/tags/container-orchestration/","section":"Tags","summary":"","title":"Container Orchestration","type":"tags"},{"content":"","date":"25 July 2025","externalUrl":null,"permalink":"/tags/kubectl/","section":"Tags","summary":"","title":"Kubectl","type":"tags"},{"content":"","date":"25 July 2025","externalUrl":null,"permalink":"/tags/kubernetes/","section":"Tags","summary":"","title":"Kubernetes","type":"tags"},{"content":"","date":"25 July 2025","externalUrl":null,"permalink":"/tags/minikube/","section":"Tags","summary":"","title":"Minikube","type":"tags"},{"content":" Introduction # In the evolving world of cloud-native applications, containerization has revolutionized how we build, ship, and run software. But as the number of containers in a project grows, managing them becomes a challenge. That’s where Container Orchestration steps in - and Kubernetes is the undisputed leader in this space.\nWhat is Container Orchestration? # Container orchestration is a way to automate the deployment, scaling, and management of many containers.\nInstead of starting and stopping each container manually, orchestration tools (like Kubernetes) handle it for you - making sure your apps run smoothly, restart if they crash, and scale when needed.\nIt\u0026rsquo;s like having a smart system that keeps all your containerized apps organized and running the way you want, across multiple machines.\nWhat Is Kubernetes? # Kubernetes (K8s) is an open-source platform that automates deploying, scaling, and managing containerized applications.\nOriginally built by Google and now maintained by the Cloud Native Computing Foundation (CNCF), it enables:\nAutomatic container scheduling\nLoad balancing\nSelf-healing and auto-scaling\nService discovery\nWhy Minikube and kubectl? # To run Kubernetes on your local machine, you need two key tools:\n1. kubectl - The Kubernetes Command-Line Tool # kubectl is the primary way to interact with a Kubernetes cluster. You use it to:\nDeploy applications\nInspect and manage cluster resources\nView logs\nScale deployments\nExpose services\nWithout kubectl, you cannot communicate with your cluster’s API server or manage any workloads.\nThink of `kubectl` as your terminal interface to Kubernetes - just like git is to version control. 2. Minikube - Local Kubernetes Cluster # Minikube is a lightweight tool that sets up a single-node Kubernetes cluster on your machine. It’s ideal for:\nLearning Kubernetes basics\nLocal development\nTesting configuration files before production\nPrerequisites # Make sure you have:\nA system with virtualization enabled (Docker, VirtualBox, etc.)\nTerminal access with sudo privileges\nInternet connection\nStep-by-Step Installation Guide (Ubuntu/Linux) # Step 1: Install kubectl # Downlaod the latest stable version: Then make the file executable with: Move it to your system\u0026rsquo;s binary path by: Check the version if it is installed successfully: Step 2: Install minikube # Downloa the minikube binary: Install it to your system path: Check version: Step 3: Start the Kubernetes Cluster # Recommended: Choose a driver (Docker is common): Optional: this command automatically selects the best available driver on your system (e.g., Docker, VirtualBox, KVM): This downloads the required components and spins up a single-node cluster.\nStep 4: Verify the Cluster is Running # Step 5: Interact with Your Cluster # You should see one node in a Ready state.\nStep 6: Deploy a Sample App # Do you have a deployment? # If there’s no output, create one: # Option 1: # Through kubernetes CLI (kubectl):\nkubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4 Option 2: # Using the Kubernetes Dashboard (Optional UI):\nLanch the minikube dashboard: If the output says somethin like:\nNo resources found in kubernetes-dashboard namespace. It means the dashboard pods haven’t been created yet - so naturally, proxy health will hang since there\u0026rsquo;s nothing to proxy to.\nHow to Fix it: Manually Enable the Dashboard Addon # Minikube is supposed to auto-enable it with minikube dashboard, but sometimes it silently fails. You can force it like this: Then manually install the metrics scraper (recommended for full functionality): Wait and Watch: # Then watch pods getting created: Once Running: # Launch the dashboard again:\nminikube dashboard Boom! You\u0026rsquo;re in the Kubernetes Dashboard - mission accomplished! This means your entire Minikube cluster is working exactly as it should.\nWhat You Can Do From Here # Now that you\u0026rsquo;re inside the dashboard UI, here are a few things worth exploring:\n1. Workloads # Check out: Deployments, Pods, ReplicaSets\nTry creating a sample deployment from the UI\n2. Create a Deployment # Use the \u0026ldquo;+\u0026rdquo; button (top-right) or go to:\n+ CREATE → Deploy a containerized app I did this simple yaml:\napiVersion: apps/v1 kind: Deployment metadata: name: hello-node spec: replicas: 1 selector: matchLabels: app: hello template: metadata: labels: app: hello spec: containers: - name: hello image: k8s.gcr.io/echoserver:1.10 ports: - containerPort: 8080 3. Expose a Service # You can expose your deployment right from the dashboard as a NodePort -then open it in a browser using: This will:\nCreate a Service named hello-node\nExpose port 8080 of your pod\nAssign a random NodePort between 30000–32767\nTo access the app: # It should open in your browser! Stopping or Cleaning Up # When you\u0026rsquo;re done, you can stop the cluster: minikube stop To delete the cluster entirely: minikube delete Conclusion # Kubernetes might seem complex at first, but starting with a local setup helps demystify it. By running a cluster on your own machine using Minikube, you gain the confidence to move to production environments later.\nKubernetes isn’t just a tool - it’s a platform that empowers you to build resilient, scalable, and manageable applications at scale.\n\u0026quot;Learning Kubernetes is like learning how to drive a spaceship. But once you do, you're ready to explore galaxies.\u0026quot;\nCommands List # curl -LO \u0026#34;https://dl.k8s.io/release/$(curl -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl\u0026#34; chmod +x kubectl sudo mv kubectl /usr/local/bin/ ____________________________________________________________________________________________________________ kubectl version --client curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube minikube version minikube start --driver=docker minikube status ____________________________________________________________________________________________________________ kubectl get nodes minikube dashboard ##or minikube dashboard --url kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4 minikube addons enable dashboard minikube addons enable metrics-server ____________________________________________________________________________________________________________ kubectl get pods -n kubernetes-dashboard -w kubectl expose deployment hello-node --type=LoadBalancer --port=8080 kubectl get service hello-node minikube service hello-node ","date":"25 July 2025","externalUrl":null,"permalink":"/posts/kubernetes/","section":"Posts","summary":"","title":"Modern Infrastructure – Part 2: Kubernetes","type":"posts"},{"content":"","date":"13 July 2025","externalUrl":null,"permalink":"/tags/ci/cd/","section":"Tags","summary":"","title":"CI/CD","type":"tags"},{"content":"","date":"13 July 2025","externalUrl":null,"permalink":"/tags/containers/","section":"Tags","summary":"","title":"Containers","type":"tags"},{"content":"","date":"13 July 2025","externalUrl":null,"permalink":"/tags/devops/","section":"Tags","summary":"","title":"DevOps","type":"tags"},{"content":"","date":"13 July 2025","externalUrl":null,"permalink":"/tags/dockers/","section":"Tags","summary":"","title":"Dockers","type":"tags"},{"content":"“Build once, run anywhere.”\nThat’s not a dream - that’s Docker.\nWhat is Docker? # Docker is an open-source platform that allows you to develop, ship, and run applications inside containers. Containers package your app along with its environment, dependencies, and tools - making them portable, lightweight, and consistent across all platforms.\nWhy Docker? # Traditional VMs vs Docker\nFeature Traditional VM Docker OS Architecture Heavy OS per VM Shared kernel, lightweight Boot Time Slower boot time Fast boot/startup Resource Usage More resources used Less CPU/RAM needed Portability Hard to move Easy to share or deploy Use Docker when you want to:\nAvoid \u0026ldquo;It works on my machine\u0026rdquo; Speed up development and CI/CD Build microservices Scale easily Docker Architecture # Core Components: # Docker Host: Docker Host or Docker Engine is the brain of docker. It conatians docker daemon that runs in the background, manages Docker objects (containers, images, networks).\nDocker Client: The command-line interface to talk to the daemon.\nDocker Objects: It includes:\nImages: Blueprint for containers/app Containers: running instances of app Volumns: Storing persistent data into host system Network: Docker Registries: Central hubs for sharing /storing images (like Docker Hub, GitHub etc).\nDeveloper → Docker CLI → Docker Daemon → Container → Application Installing Docker # Ubuntu: # sudo apt update sudo apt install docker.io sudo systemctl start docker sudo systemctl enable docker Check version:\ndocker --version Enable running without sudo:\nsudo usermod -aG docker $USER Manjaro KDE: # Update your system and install docker: Enable docker and check version: Basic Docker Commands # Working with Images # Create a Dockerfile (Script to create an image): Build an image from dockerfile: Delete an image: Working with Containers # Run a container from an image: Note: You cannot create two containers with same name. Open browser http://localhost:8080 , you\u0026rsquo;ll see: List active containers: List all containers (including stopped ones): Stop a running container or remove a container: Delete all containers at once: Introduction to Docker Compose # What is Docker Compose? # Docker Compose is a tool to define and manage multi-container applications.\nInstead of running containers manually one by one, you define them in a docker-compose.yml file and start them all with a single command.\nA sample docker compose.yml file: Installation of Docker Compose # Install docker compose: Verify if installation is successful: Rebuild images and start containers in background: Lists the containers (services) that are running (or have been created) using your docker-compose.yml file:\ndocker compose ps Stops all running containers defined in your Compose file, but does not remove them: docker compose stop Starts containers that were previously stopped using: docker compose start Stops and removes all the containers, networks, and by default also volumes that were created by: Docker vs Kubernetes # Feature Docker Kubernetes Purpose Containerization Orchestration Scale Manual Auto-scaling, rolling updates Networking Simple Complex but powerful Use case Dev \u0026amp; CI/CD Production, large systems Real-World Use Cases # CI/CD Pipelines: Jenkins + Docker\nLocal Dev Environments: VSCode devcontainers\nMicroservices Architecture: API Gateway + Services + DB\nEdge Computing: IoT and Raspberry Pi deployments\nApp Distribution: One image, many platforms\nConclusion # Docker is no longer optional - it\u0026rsquo;s essential for modern software development. Whether you’re building a Node.js app, a Python API, or a full-stack microservice, Docker gives you consistency, speed, and portability.\nBonus: Quick Reference Sheet # sudo systemctl start docker sudo usermod -aG docker $USER newgrp docker docker build -t docker-hello . docker run -d -p 8080:80 docker-hello docker ps # See running containers docker ps -a # See all containers (even stopped ones) docker stop hello-container # Stop a running container docker start hello-container # Start it again docker rm hello-container # Remove a container docker images # List all images docker rmi docker-hello # Remove an image sudo pacman -S docker-compose v2 → docker compose up -d v1 → docker-compose up -d docker compose ps # Show running services Open browser http://localhost:8080 docker compose stop # Stop all services docker compose start # Start them again docker compose down # Stop \u0026amp; remove everything ","date":"13 July 2025","externalUrl":null,"permalink":"/posts/dockers/","section":"Posts","summary":"","title":"Modern Infrastructure – Part 1: Docker","type":"posts"},{"content":"","date":"8 July 2025","externalUrl":null,"permalink":"/tags/jenkins/","section":"Tags","summary":"","title":"Jenkins","type":"tags"},{"content":" What is Jenkins? # Jenkins is an open-source automation tool written in Java. It helps developers build, test, and deploy their software automatically, making Continuous Integration (CI) and Continuous Delivery (CD) possible.\nCI: Continuous Integration Automatically building and testing code whenever changes are pushed. CD: Continuous Delivery Automatically deploying/releasing the code to production or staging. Together, CI/CD makes your workflow faster, safer, and hands-free. In simple terms:\nJenkins watches your code and runs jobs (like building or testing) whenever you push changes — saving you tons of manual work.\nJenkins is a server. It’s a program you install on a machine (your own computer, a VPS, or cloud) that:\n• Runs 24/7. • Waits for code changes (like GitHub push). • Does tasks you define (build, test, deploy). • Reports the results. Why Use Jenkins? # Automate repetitive tasks like testing and deploying. Supports a wide range of plugins and tools. Saves time in large teams and projects. Detects bugs early by testing code regularly. Web-based interface for managing jobs easily. Key Concepts to Know # Term Meaning Job / Project A task that Jenkins runs (e.g., build, test). Build The process of compiling code, running scripts, etc. Pipeline A set of steps that automate the process from build to deployment. Node / Agent A machine that runs Jenkins jobs (can be remote). Plugin Extension that adds new features to Jenkins. How to Install Jenkins on Ubuntu (Beginner-Friendly) # Step 1: Install Java # Then run: Check the Java version: Step 2: Add Jenkins Repository # Step 3: Install Jenkins # Step 4: Start and Enable Jenkins # Then check the status if its active: Step 5: Open Jenkins in Browser # Visit: http://localhost:8080\nTo unlock Jenkins, run:\nPaste the password in your browser when prompted.\nProceed with the steps required and it will get you to the main Jenkins page: Setting Up Your First Job (Freestyle Project) # Go to Dashboard \u0026gt; New Item\nChoose Freestyle project and give it a name\nIn Build Steps, choose:\nExecute shell for Linux commands\nOr Execute Windows batch command for Windows\nAdd your script like: echo \u0026#34;Hello from Jenkins!\u0026#34; Click Save, then Build Now Jenkins will run your job and show you output in the Console Output.\nJenkins Pipeline (Scripted Automation) # Create a new Pipeline job and use the following example script:\npipeline { agent any stages { stage(\u0026#39;Build\u0026#39;) { steps { echo \u0026#39;Building the project...\u0026#39; } } stage(\u0026#39;Test\u0026#39;) { steps { echo \u0026#39;Running tests...\u0026#39; } } stage(\u0026#39;Deploy\u0026#39;) { steps { echo \u0026#39;Deploying the project...\u0026#39; } } } } Integrating Jenkins with Git (or GitLab) # Jenkins works best when connected to a version control system like GitHub or GitLab. This allows Jenkins to:\nWatch for new code pushes Automatically trigger builds and tests Pull code into your pipeline jobs Example (GitLab): # Install the Git Plugin (if not already). Create a Personal Access Token in GitLab. In Jenkins, go to Credentials \u0026gt; Add Credentials and enter your GitLab token. Create a new Pipeline or Freestyle job. Under Source Code Management, choose Git and paste your GitLab repo URL. Now every time you push to GitLab, Jenkins can respond automatically.\nUseful Plugins to Explore # Plugin Purpose Git Plugin Integrate with Git repositories GitHub Integration Trigger builds from GitHub pushes Pipeline Plugin Use Jenkinsfile for automation workflows Email Extension Send notifications based on build status Docker Plugin Build and run Docker containers via Jenkins Final Thoughts # Jenkins is like your project manager robot — it does the boring and repetitive tasks so you can focus on writing code.\nWith its powerful CI/CD pipelines, plugin ecosystem, and integration options, Jenkins is trusted by teams all over the world to ship better software — faster.\nOnce you\u0026rsquo;re comfortable with the basics, explore more advanced topics like:\nShared Libraries (DRY pipelines) Blue Ocean (visual pipeline editor) Dockerized builds Jenkins + Kubernetes or AWS for cloud deployments Jenkins + GitLab CI integration Jenkins is not just a tool, it’s the engine behind modern DevOps.\nJenkins Installation Commands # sudo apt update sudo apt install openjdk-17-jdk java -version wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc \u0026gt; /dev/null echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list \u0026gt; /dev/null sudo apt update sudo apt install jenkins sudo systemctl enable jenkins sudo systemctl start jenkins sudo systemctl status jenkins sudo cat /var/lib/jenkins/secrets/initialAdminPassword ","date":"8 July 2025","externalUrl":null,"permalink":"/posts/jenkins/","section":"Posts","summary":"","title":"Meet Jenkins: A Guide to Automation","type":"posts"},{"content":"","date":"8 July 2025","externalUrl":null,"permalink":"/tags/pipeline/","section":"Tags","summary":"","title":"Pipeline","type":"tags"},{"content":"","date":"8 July 2025","externalUrl":null,"permalink":"/tags/plugins/","section":"Tags","summary":"","title":"Plugins","type":"tags"},{"content":"","date":"8 July 2025","externalUrl":null,"permalink":"/tags/shell/","section":"Tags","summary":"","title":"Shell","type":"tags"},{"content":"","date":"5 July 2025","externalUrl":null,"permalink":"/tags/backend/","section":"Tags","summary":"","title":"Backend","type":"tags"},{"content":"","date":"5 July 2025","externalUrl":null,"permalink":"/tags/frontend/","section":"Tags","summary":"","title":"Frontend","type":"tags"},{"content":"Web development is all about building digital experiences; from simple websites to complex applications. But behind every site you visit lies a combination of two powerful sides: the frontend and the backend.\nIn this blog, we’ll walk through the core building blocks of each side. This isn’t a tutorial, it’s a clarity-first breakdown of each element so you can understand what it does, and why it\u0026rsquo;s important.\nFrontend: What Users See and Interact With # The frontend is the part of a website or web application that users directly experience. It includes everything from layout and buttons to animations and form interactions.\nHTML – The Structure # HTML (HyperText Markup Language) forms the basic structure of every web page. It organizes content using tags; like paragraphs, headings, links, and images, so the browser knows what to display and where.\nCSS – The Style # CSS (Cascading Style Sheets) adds styling to HTML. It controls how things look—colors, spacing, fonts, responsiveness, and more. Without CSS, all websites would look like plain black-and-white documents.\nBootstrap – Pre-Styled Components # Bootstrap is a CSS framework that gives you ready-made design elements like buttons, navbars, and grids. It helps speed up development while ensuring consistency and responsiveness across devices.\nJavaScript – The Interactivity # JavaScript brings life to websites. It allows you to respond to user actions—like clicking buttons, filling out forms, or navigating through tabs. It’s what makes websites interactive instead of just static pages.\nDOM Manipulation – Controlling Page Content Dynamically # DOM (Document Object Model) manipulation lets you change or update HTML elements using JavaScript in real-time. It\u0026rsquo;s how websites update content on the fly without needing a page reload—like showing a new message or hiding a popup.\nES6 – Modern JavaScript # ES6 (ECMAScript 6) introduced newer, cleaner ways to write JavaScript—like arrow functions, let/const, destructuring, and template literals. It improves code readability and helps developers write more efficient scripts.\njQuery – Simplified JavaScript (Legacy Tool) # jQuery is a JavaScript library that makes common tasks (like animations, event handling, and AJAX calls) easier with less code. While it’s less used in modern frameworks, it’s still relevant for understanding older projects.\nBackend: What Happens Behind the Scenes # The backend powers everything the user doesn’t see—from user authentication and data storage to server-side logic and APIs. It ensures the frontend can access and process information correctly.\nNode.js – JavaScript on the Server # Node.js allows JavaScript to run on the server, not just in the browser. It enables backend development using the same language as the frontend and is great for building scalable web applications.\nMongoDB – Flexible Data Storage # MongoDB is a NoSQL database that stores data as JSON-like documents. It’s schema-less and highly flexible, making it ideal for handling unstructured or evolving data.\nExpress.js – Web Framework for Node # Express.js is a minimal and powerful web application framework for Node.js. It simplifies routing, request handling, and building RESTful APIs, making backend development faster and more organized.\nSQL – Structured Data Management # SQL (Structured Query Language) is used to store and manage data in relational databases. It organizes data in rows and columns and allows precise querying, updating, and filtering of that data.\nPHP – Traditional Server-Side Scripting # PHP is a scripting language designed for web development. It’s widely used in websites and content management systems (like WordPress) to handle forms, sessions, and server-side processing.\nPHP REST APIs – Bridging Frontend and Backend # REST APIs (in PHP or other languages) act as a bridge between the frontend and backend. They allow applications to send and receive data, enabling communication between the browser and server.\nConclusion: The Full Picture # Frontend builds the visual layer—the face users see.\nBackend builds the logic layer—the engine that runs everything under the hood.\nBoth work together to make modern web experiences possible.\nWhether you want to design interfaces or build powerful backend systems (or both!), this roadmap gives you a clear understanding of what each piece does—and why it\u0026rsquo;s important.\nKnowing what each tool does is the first step. Learning how to use it comes next. ","date":"5 July 2025","externalUrl":null,"permalink":"/posts/webdev/","section":"Posts","summary":"","title":"The Architecture of the Modern Web","type":"posts"},{"content":"","date":"5 July 2025","externalUrl":null,"permalink":"/tags/ubuntu/","section":"Tags","summary":"","title":"Ubuntu","type":"tags"},{"content":"","date":"5 July 2025","externalUrl":null,"permalink":"/tags/webdevelopment/","section":"Tags","summary":"","title":"Webdevelopment","type":"tags"},{"content":"If you\u0026rsquo;ve ever used a Linux terminal or written a script to automate tasks on a Unix-like system, you\u0026rsquo;ve already brushed up against the world of shell scripting. But there\u0026rsquo;s one term that often floats around with little explanation, the POSIX shell. What is it, and why does it matter?\nWhat Is a Shell? # A shell is a program that provides a command-line interface (CLI) for users to interact with the operating system. There are many types of shells, including:\nbash (Bourne Again Shell) zsh (Z Shell) fish (Friendly Interactive SHell) sh (Bourne Shell) What Is POSIX? # POSIX stands for Portable Operating System Interface. It\u0026rsquo;s a set of standards created by the IEEE to make Unix-like operating systems more compatible with each other.\nPOSIX defines a standard shell behavior. This means if you write a script using only POSIX-compliant features, it should work on any POSIX-compliant system, such as:\nLinux macOS BSD systems Many embedded systems What Is the POSIX Shell? # The POSIX shell is a standardized shell specification (based on the original Bourne shell) that ensures scripts can run consistently across different Unix-like systems.\nThis doesn\u0026rsquo;t refer to a specific shell executable, but rather a set of rules and features that compliant shells must follow.\nPopular shells like bash, dash, ksh, and zsh all can act as POSIX-compliant when invoked as sh.\nWhy Learn the POSIX Shell? # Reason Explanation Portability Your scripts will run on any POSIX-compliant system. Simplicity POSIX scripts are typically cleaner and less complex. Speed Some POSIX shells (like dash) are very fast, making them ideal for boot scripts. Interoperability Ideal for system scripts, Dockerfiles, and CI/CD pipelines. POSIX Shell vs Bash # Feature POSIX Shell Bash Compatibility Universal (POSIX systems) Mostly Linux, not POSIX-only Features Minimal Rich, advanced Portability High Moderate Common usage System scripts, init User scripts, interactive use Tip: Stick to POSIX when writing system-level scripts or scripts meant to run anywhere.\nWriting a POSIX Shell Script # Let’s start with a simple POSIX-compatible script.\nExample: Hello World # #!/bin/sh echo \u0026#34;Hello, POSIX world!\u0026#34; Key POSIX Shell Features # 1. Variables # name=\u0026#34;Anohba\u0026#34; echo \u0026#34;Hello, $name\u0026#34; No spaces around =, or it will error!\n2. Conditionals # if [ \u0026#34;$name\u0026#34; = \u0026#34;Anohba\u0026#34; ]; then echo \u0026#34;Welcome!\u0026#34; fi Use [ ] for conditions, with spaces around the brackets.\n3. Loops # i=1 while [ \u0026#34;$i\u0026#34; -le 5 ]; do echo \u0026#34;Number: $i\u0026#34; i=$((i + 1)) done 4. Functions # greet() { echo \u0026#34;Hi, $1!\u0026#34; } greet \u0026#34;Anohba\u0026#34; 5. Command Substitution # today=$(date) echo \u0026#34;Today is $today\u0026#34; POSIX allows $(\u0026hellip;) and backticks ..., but $(\u0026hellip;) is recommended.\nAvoid Non-POSIX Bashisms # Examples of features not POSIX-compliant:\n[[ \u0026hellip; ]] for conditions\n(( \u0026hellip; )) for arithmetic (use $(( \u0026hellip; )) instead)\nfunction name {} syntax\nArrays Always test your scripts with sh, not bash, if you want to ensure compliance.\nHow to Check for POSIX Compliance # Use dash (a minimal POSIX shell) # dash myscript.sh Use shellcheck # shellcheck --shell=sh myscript.sh This will warn you about any non-POSIX features.\nReal-World Use Cases # Docker entrypoint scripts\nInit/system scripts in /etc/init.d\nCron jobs\nEmbedded systems with busybox\nCI pipelines that run across many environments\nConclusion # Getting comfortable with the POSIX shell is like learning a new superpower. It might seem a little cryptic at first, but once it clicks, you’ll wonder how you ever worked without it. From writing quick scripts to automating entire workflows, it’s a tool that quietly powers much of the tech world—and it’s right at your fingertips.\nAt its heart, the shell isn’t about being flashy. It’s about doing things clearly, simply, and well.\n“The Unix philosophy: Write programs that do one thing and do it well.”\n— Doug McIlroy\n","date":"13 May 2025","externalUrl":null,"permalink":"/posts/posix/","section":"Posts","summary":"","title":"Behind the Prompt","type":"posts"},{"content":"","date":"13 May 2025","externalUrl":null,"permalink":"/tags/posix-shell/","section":"Tags","summary":"","title":"POSIX Shell","type":"tags"},{"content":"","date":"13 May 2025","externalUrl":null,"permalink":"/tags/programming/","section":"Tags","summary":"","title":"Programming","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/a-star/","section":"Tags","summary":"","title":"A-Star","type":"tags"},{"content":" A* Algorithm Made Easy # When we want a computer, robot, or game character to move from one place to another, the biggest challenge is: how to find the shortest and best path?\nThe A* (A-Star) algorithm helps us do exactly that, in a smart and efficient way.\nWhat is A* (A-Star)? # The A* algorithm is a popular and efficient pathfinding and graph traversal algorithm used to find the shortest path between a start node and a goal node. It combines the benefits of Dijkstra’s algorithm and heuristics to efficiently navigate paths by considering both the cost to reach a node and an estimated cost from that node to the goal.\nKey Definitions for A* Algorithm # 1. g(n) – Actual Cost # The cost (or distance) from the start node to the current node. It keeps track of how far we’ve actually travelled in the path so far.\n2. h(n) – Heuristic Cost # The estimated cost from the current node to the goal node. It’s like a “smart guess” — helps the algorithm predict which direction looks promising.\n3. f(n) – Total Estimated Cost # The combination of both actual and estimated cost:\nf(n) = g(n) + h(n)\nIt represents the total cost if we were to take that path, so the node with the lowest f(n) is usually explored first.\n4. Open List # A collection of nodes that are yet to be explored but are known and reachable. Think of it as a “to-do list” for the algorithm.\n5. Closed List # A collection of nodes that the algorithm has already visited and processed. Once a node moves here, it’s not revisited again.\n6. Start Node # The node from where the search begins. Its g(n) = 0 because it costs nothing to reach itself.\n7. Target (Goal) Node # The destination node we’re trying to reach using the shortest (or least costly) path.\n8. Heuristic Function (h) # The heuristic function h is critical; it must underestimate the actual cost to ensure optimality. A function that estimates the cost to reach the goal, commonly calculated using distance metrics like Manhattan distance or Euclidean distance, depending on the grid or graph.\nHow A* Algorithm Works # The algorithm maintains two sets: # An open set (priority queue) of nodes to be evaluated, prioritized by the lowest f-value,\nA closed set of nodes already evaluated.\nSteps: # Initialize the open list with the start node.\nSelect the node from the open list with the lowest f.\nIf it is the goal, reconstruct the path.\nOtherwise, move it to the closed set and evaluate its neighbors.\nCalculate tentative g scores for neighbors.\nIf a better path is found (lower g), update the neighbor’s g, h, and f scores, and record its parent.\nRepeat until the goal is reached or no path exists.\nApplications of A* Algorithm # Navigation systems for shortest path routing.\nGame AI for pathfinding in virtual worlds.\nProtein Folding and Bioinformatics\nAutomated Theorem Proving\nNetwork routing protocols.\nPuzzle Solving (AI Games)\nRobotics Navigation in Dynamic Environments\n3D Animation and Cinematography\nNatural Language Processing\nWhere A* Stumbles (Yes, Even Smart Algorithms Have Bad Days) # Even smart algorithms have weak spots and A* is no exception.\n1. Inaccurate Heuristic: # If the heuristic misleads (overestimates), A* loses its sense of direction and may miss the optimal path.\n2. Large Graphs: # In huge maps, A* stores too many nodes, memory and time blow up fast.\n3. Dynamic Environments: # When the map keeps changing, A* can’t adapt, it must start over.\n4. Bad Heuristic Design: # If the heuristic isn’t admissible (never overestimates), A* can’t guarantee the best path.\n5. Real-Time Limits: # A* thinks a bit too much for live systems, slower when quick decisions matter.\nSummary # What sets A* apart from other algorithms is that it combines features of Dijkstra’s algorithm and Greedy Best-First Search by using a heuristic to estimate the cost to the goal. This balance of actual traveled cost (g-cost) and heuristic cost (h-cost) allows A* to explore fewer paths, making it both efficient and guaranteed to find the shortest path if the heuristic is admissible and consistent. Unlike uninformed search algorithms, A* uses problem-specific knowledge for faster solutions. Unlike purely greedy algorithms, it ensures optimality.\n","date":"10 May 2025","externalUrl":null,"permalink":"/posts/astar/","section":"Posts","summary":"","title":"A* Algorithm Made Easy","type":"posts"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/algorithm/","section":"Tags","summary":"","title":"Algorithm","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/beginner/","section":"Tags","summary":"","title":"Beginner","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/concurrency/","section":"Tags","summary":"","title":"Concurrency","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/graphs/","section":"Tags","summary":"","title":"Graphs","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/multithreading/","section":"Tags","summary":"","title":"Multithreading","type":"tags"},{"content":"","date":"10 May 2025","externalUrl":null,"permalink":"/tags/pathfinding/","section":"Tags","summary":"","title":"Pathfinding","type":"tags"},{"content":"\u0026ldquo;Threads are like tiny workers inside your program — when they cooperate well, your application becomes faster, smoother, and more responsive.\u0026rdquo;\nWhat is Multithreading? # Imagine your program is a big task. Wouldn’t it be more efficient if multiple parts of it could run at the same time instead of waiting for one to finish before the next begins? That’s exactly what multithreading allows.\nMultithreading is a technique where a single process can perform multiple tasks concurrently using threads. Think of threads as lightweight mini-programs that live inside a main program, sharing the same memory and resources.\nWhy Use Multithreading? # Faster Performance: Multiple tasks run in parallel, reducing total execution time. Smarter Resource Use: Threads share the same memory space, avoiding the overhead of separate processes. Better Responsiveness: Your app’s UI remains responsive even when doing heavy background work. Threading vs Multiprocessing? # Feature Multithreading Multiprocessing Memory Usage Low (shared memory) High (separate memory) Suitable for I/O-bound tasks CPU-bound tasks GIL Affected Not affected Complexity Simple Slightly complex How Does It All Work? # Each thread has:\nIts own program counter (tells it what to do next) Its own stack (for storing variables and function calls) Access to the shared heap memory (common data area) The system’s thread scheduler decides how and when threads run, sometimes switching between them rapidly, this is called context switching.\nWhere Do We Use Multithreading? # Games: Audio, rendering, physics, all handled by separate threads. Web servers: Manage thousands of user requests at once. Image editors: Apply filters to different image parts in parallel. Downloaders: Download file segments simultaneously. Writing Threads in Different Languages # Python # import threading def task(): print(\u0026#34;Running in thread\u0026#34;) thread = threading.Thread(target=task) thread.start() What’s Happening Here? # threading.Thread() creates a thread object.\n.start() begins execution in a new thread.\n.join() tells the main program to wait until the thread is done.\nBest Practices # Keep threads short-lived and task-specific Use .join() to avoid premature exits Avoid sharing mutable data unless protected Consider threading.Lock() when using shared resources What Makes Multithreading Hard? # Multithreading brings speed, but also complexity:\nRace Conditions: Threads compete to access shared data, leading to unpredictable results. Deadlocks: Two threads wait on each other forever. Starvation: One thread never gets a turn. Hard to Debug: Bugs can appear only in specific timings or conditions. Tips for Writing Thread-Safe Code # Use mutexes/locks to protect shared resources.\nPrefer immutable objects where possible.\nMinimize shared state.\nUse thread-safe libraries or higher-level concurrency tools like:\nconcurrent.futures (Python)\nExecutorService (Java)\nstd::async (C++) NOTE: I haven\u0026rsquo;t Explored this part though these are the possible solutions I found on Google.\nSummary # Multithreading in Python is a powerful tool, especially when working with I/O-bound operations. While the GIL (Global Interpreter Lock) limits its use for CPU-intensive work, multithreading is still a go-to choice for network calls, UI responsiveness, and parallel I/O.\n“Concurrency is not parallelism, but it’s a good place to start.” – Rob Pike\n","date":"10 May 2025","externalUrl":null,"permalink":"/posts/multithread/","section":"Posts","summary":"","title":"Threaded Realities: Beyond the Loop","type":"posts"},{"content":"\u0026ldquo;Zsh isn’t just a shell—it’s your terminal’s upgrade to first class.\u0026rdquo; If you\u0026rsquo;re someone who spends time in the terminal—whether you\u0026rsquo;re a developer, a student learning CLI, or a curious explorer—your shell environment is more than just text on black. It\u0026rsquo;s your workspace, your command center, your vibe.\nWhat is Zsh? # Zsh (Z Shell) is a powerful, interactive shell and scripting language for Unix-like systems. It’s like Bash’s cooler, more customizable sibling—think of it as Bash after a glow-up.\nIf you’ve ever typed the same long command 3 times, wished your terminal could autocomplete intelligently, or wanted your CLI to just feel aesthetic, Zsh is what you’re looking for.\nWhy Choose Zsh? # Let’s be honest—Bash is everywhere, but Zsh is a productivity and vibe booster. Here\u0026rsquo;s why:\n1. Autocompletion that’s actually helpful # Zsh offers powerful tab completion out of the box. You type gi\u0026lt;TAB\u0026gt;, and boom—git and its subcommands show up in style.\n2. Spelling correction # Mistyped a command? Zsh politely asks, “Did you mean…?” It’s like autocorrect, but helpful.\n3. Better history navigation # Search your command history with just a few keystrokes. Press Ctrl+R, and it\u0026rsquo;s like magic—your previous commands are right there.\n4. Themeable and Beautiful (thanks to Oh My Zsh) # You can customize Zsh with beautiful themes like agnoster, powerlevel10k, or your own handcrafted vibe. It\u0026rsquo;s terminal couture.\n5. Plugin Ecosystem # From syntax highlighting to autosuggestions, Zsh plugins make your terminal smarter.\nThink of Zsh as the upgrade your terminal didn’t know it needed.\nHow to Install Zsh # Step 1: Install Zsh # First run: and then: Oh My Zsh — The Zsh Framework That Changes Everything # Install it with one command: You’ll now have access to:\nOver 300+ plugins\n140+ themes\nEase of configuration\nCustomize it via your ~/.zshrc file . That’s your Zsh control center.\nCustomize Your Shell Vibe # Set Your Theme # Open your .zshrc file:\nnano ~/.zshrc Note: I\u0026rsquo;m using robbyrussell theme as it is. If you want to change it, follow the below guidelines: Find the line:\nZSH_THEME=\u0026#34;robbyrussell\u0026#34; Change it to something like:\nZSH_THEME=\u0026#34;agnoster\u0026#34; # or \u0026#34;powerlevel10k\u0026#34; (recommended) Want powerlevel10k? Install it:\ngit clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k Then set:\nZSH_THEME=\u0026#34;powerlevel10k/powerlevel10k\u0026#34; Restart your terminal. You\u0026rsquo;ll be guided through a beautiful setup wizard.\nUseful Plugins to Add # Inside your .zshrc, find the plugins=(\u0026hellip;) line. Add these:\nplugins=(git z zsh-autosuggestions zsh-syntax-highlighting) Quick Setup Guide: # Zsh Autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions Zsh Syntax Highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting Then restart your terminal or run:\nsource ~/.zshrc Mini Productivity Pack # Alias magic: Shorten your life’s work into 2-letter commands in .zshrc. Your .zshrc is your magic spellbook. Add some aliases to save time: alias gs=\u0026#39;git status\u0026#39; alias gaa=\u0026#39;git add .\u0026#39; alias zshconfig=\u0026#39;nano ~/.zshrc\u0026#39; alias ..=\u0026#39;cd ..\u0026#39; alias ...=\u0026#39;cd ../..\u0026#39; You just created shortcuts for your future self.\nPro Tips (But Still Beginner Friendly) # Fonts Matter: Install Nerd Fonts for icons and smooth glyphs.\nTheme Match: Choose a terminal theme (like Dracula, One Dark, or Solarized) that pairs well with your Zsh theme.\nTry a Plugin Manager: Tools like Zinit or Antidote let you manage plugins easily.\nFinal Thoughts: Make It Yours # \u0026ldquo;Your terminal reflects your mind,customize it with intention.\u0026rdquo; — Zenarch\nZsh isn’t just about speed or looks—it’s about crafting an environment that feels like you. Whether you\u0026rsquo;re a coding wizard or just dipping your toes into tech, your terminal should feel like home.\nSo don’t settle for default. Upgrade. Customize.\nBonus: TL;DR Setup Checklist # Here’s a quick summary of everything you need to get Zsh looking and working beautifully:\nStep Command Install Zsh sudo apt install zsh Set as default shell chsh -s $(which zsh) Install Oh My Zsh sh -c \u0026quot;$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\u0026quot; Change theme ZSH_THEME=\u0026quot;powerlevel10k/powerlevel10k\u0026quot; (inside ~/.zshrc) Add plugins plugins=(git z zsh-autosuggestions zsh-syntax-highlighting) ","date":"8 May 2025","externalUrl":null,"permalink":"/posts/zsh/","section":"Posts","summary":"","title":"Oh My Zsh!","type":"posts"},{"content":"","date":"8 May 2025","externalUrl":null,"permalink":"/tags/oh-my-zsh/","section":"Tags","summary":"","title":"Oh-My-Zsh","type":"tags"},{"content":"","date":"8 May 2025","externalUrl":null,"permalink":"/tags/zsh/","section":"Tags","summary":"","title":"Zsh","type":"tags"},{"content":"","date":"6 May 2025","externalUrl":null,"permalink":"/tags/coding/","section":"Tags","summary":"","title":"Coding","type":"tags"},{"content":"","date":"6 May 2025","externalUrl":null,"permalink":"/tags/greedy/","section":"Tags","summary":"","title":"Greedy","type":"tags"},{"content":"","date":"6 May 2025","externalUrl":null,"permalink":"/tags/huffman/","section":"Tags","summary":"","title":"Huffman","type":"tags"},{"content":"In a world drowning in data, how do we store and transmit information more efficiently? The answer lies in Huffman Coding — a beautifully simple yet powerful algorithm used for lossless data compression. It\u0026rsquo;s been a cornerstone since it was introduced.\nWhat Is Huffman Coding? # Huffman Coding is a greedy algorithm used to compress data without losing any information. The idea is simple:\nAssign shorter codes to more frequent characters and longer codes to less frequent ones. Ever tried zipping a file to save space? That magic trick behind the scenes? That’s compression — and Huffman Coding is one of the smartest ways to pull it off.\nIt’s like using nicknames. Instead of saying \u0026ldquo;Jonathanathan\u0026rdquo; every time, you just say \u0026ldquo;Jon\u0026rdquo;. Saves time. Saves space. No information lost. That\u0026rsquo;s the Huffman vibe.\nIt uses a binary tree structure to build optimal prefix codes (no code is a prefix of another), ensuring efficient encoding and decoding.\nTerminologies # Term What It Means Character Frequency How many times a character appers in the text. Leaf Node A tree piece that holds a character. It has no children. Internal Node A tree piece that connects other nodes. It doesn\u0026rsquo;t hold a character. Root Node The top part of the tree that connects everything. Min Heap A list that always gives the smallest number first. Binary Code Assignment Left turn = 0, right turn = 1. Used to make codes from the tree. Prefix-Free Code No code starts the same as another, so there\u0026rsquo;s no confusion when reading. Compression Making data smaller so it takes up less space. How It Works (Step-by-Step) # Calculate Frequencies\nCount how many times each character appears in the input data.\nBuild a Priority Queue\nEach character becomes a leaf node with its frequency as weight.\nBuild the Huffman Tree\nRepeatedly:\nTake two lowest-frequency nodes, Combine them into a new node with the sum of their frequencies, Insert the new node back into the queue. Continue until only one node (the root) is left. Assign Binary Codes\nTraverse the tree:\nGo left ➡️ append 0 Go right ➡️ append 1 Example # Let’s take a simple string:\n\u0026#34;beep boop beer\u0026#34; We’ll walk through how Huffman compresses this.\nStep 1: Frequency Count # We start by counting the frequency of each character in the string \u0026ldquo;beep boop beer\u0026rdquo;:\nb: 3 e: 4 o: 2 p: 2 r: 1 (space): 2 These frequencies help us decide which characters should get short or long codes.\nStep 2: Build a Min Heap # Next, we create a Min Heap (priority queue) from the characters and their frequencies:\n[ r:1, o:2, p:2, (space):2, b:3, e:4 ]\nWe repeatedly take out the two lowest frequency nodes, combine them, and put the result back into the heap. This process eventually forms our Huffman Tree.\nStep 3: Create the Huffman Tree # Keep merging the two smallest nodes until only one node (the root) remains. Let’s say we get this structure:\nStep 4: Assign Binary Codes # Now, we traverse the tree and assign binary codes. The rule is:\nLeft = 0 Right = 1 From the tree, we get the following codes:\ne → 10 b → 11 (space) → 000 p → 001 r → 1000 o → 1001 (Note: The exact codes may vary depending on how the tree was built, but they will always be prefix-free.)\nStep 5: Encode the Original String # Let’s encode the original string \u0026ldquo;beep boop beer\u0026rdquo; using the Huffman codes:\nOriginal:\nb e e p b o o p b e e r\nUsing the codes:\nb → 11 e → 10 p → 001 (space) → 000 o → 1001 r → 1000\nSo, we get the following binary string: 11 10 10 001 11 1001 1001 001 11 10 10 1000\nFinal Binary String: # 111010001111001100100010010110101000\nThis is much smaller than using 8-bit ASCII per character.\nWhere Is Huffman Coding Used? # Huffman coding is used extensively in:\nFile Compression: Formats like .zip, .gz Image Compression: JPEG (in entropy encoding stage) Video Compression: MPEG, H.264 codecs Text Compression: Unix compress, PDF text compression Data transmission: When minimizing bandwidth is critical Advantages # Lossless Compression — No data is lost during encoding.\nOptimal for symbol-by-symbol encoding — Based on frequency.\nFast and Simple — Efficient in both compression and decompression.\nPrefix-free codes — No ambiguity during decoding.\nDisadvantages # Requires Frequency Table — Needs to be stored/sent along with compressed data.\nNot Always Best — For small data sets or near-uniform frequencies, it might not compress well.\nStatic — Doesn’t adapt to changing data unless used in a dynamic/adaptive version.\nTree Overhead — Storing the tree adds some overhead for very small inputs.\nWhen Not to Use Huffman Coding # If you\u0026rsquo;re compressing already compressed files (like .mp4, .png) When your data has very little redundancy If you\u0026rsquo;re aiming for real-time compression with fast, adaptive techniques (like Arithmetic or LZ-based compression) Conclusion # Huffman Coding remains one of the most elegant examples of how theory meets practicality. It teaches us the value of frequency, greedy algorithms, and efficient data structures — all wrapped in a sweet little binary tree.\nWhether you’re building your own compression tool, diving into how JPEG works, or just brushing up for a comp-sci interview, Huffman Coding is a must-know classic.\n“The art of programming is the art of organizing complexity.” — Edsger Dijkstra\n","date":"6 May 2025","externalUrl":null,"permalink":"/posts/huffman/","section":"Posts","summary":"","title":"Huffman Coding: The Art of Compression","type":"posts"},{"content":"","date":"4 May 2025","externalUrl":null,"permalink":"/tags/fish/","section":"Tags","summary":"","title":"Fish","type":"tags"},{"content":"When it comes to shells, most of us are familiar with Bash, the default shell in many Linux distributions. However, for those looking for a more user-friendly, modern experience, Fish Shell is a great alternative.\nWhat is Fish Shell? # Fish, which stands for Friendly Interactive Shell, is a user-friendly shell designed to be easy to use and understand for both beginners and advanced users. Unlike other shells like Bash, Zsh, or Tcsh, Fish prioritizes simplicity, intuitive features, and efficiency. It’s often regarded as one of the most modern shells for Linux and macOS systems.\nFish has evolved as a great tool for developers and sysadmins who want a shell that works out-of-the-box with minimal configuration while still providing powerful features for daily use.\nUnique Features of Fish Shell # Autosuggestions based on command history, shown inline as you type. Syntax highlighting for commands and arguments — errors are visible instantly. Built-in web-based configuration tool via fish_config. User-friendly scripting syntax — no need for extra quoting or export. Smart tab completions for commands, options, files, and directories. Multi-line editing makes writing long commands easier and clearer. No external plugins required for basic features — works great out of the box. Disadvantages of Fish Shell # Not compatible with traditional Bash scripts — different syntax. Some third-party tools and scripts assume Bash or Zsh, which can cause issues. Not pre-installed or set as default in most systems — requires manual setup. Learning curve for users transitioning from Bash, especially for scripting. Community is smaller than Bash or Zsh, meaning fewer plugins and tutorials. Terminal Lit. Credit: Fish # What it means overall: # ~ main +3 !12 ?95 ❯ You\u0026rsquo;re inside a Git repository, on the main branch, with:\n3 staged\n12 unstaged\n95 untracked changes\nThat\u0026rsquo;s a busy Git workspace! 😅\nHere\u0026rsquo;s how you can set your own Fish:- # Setting Up Fish on Ubuntu # Getting started with Fish Shell is straightforward, and the setup process on Ubuntu is simple:\nInstall Fish: # Open a terminal and run the following command to install Fish from the default Ubuntu repositories:\nsudo apt update Set Fish as Your Default Shell: # To set Fish as your default shell, run:\nYou’ll need to log out and log back in for the change to take effect.\nTo Test It Now: # You can either:\n\u0026hellip;and then reopen your terminal.\nOr just type:\n\u0026hellip;to switch to Fish in the current session right away.\nInstall Fisher (Plugin Manager for Fish): # Fish has its own plugin manager called Fisher. To install it, run:\nStep 3: Install Tide Prompt (Optional but Awesome) # Once Fisher is installed, install Tide (a beautiful and customizable prompt):\nThen run the configuration wizard:\ntide configure \u0026hellip;and set the theme according to your flavor and taste.\nUse the Web-Based Configuration Tool: # You can also configure Fish through a web interface by running:\nfish_config This will open a browser window with interactive options for customizing Fish.\nNote: Tide v5 requires Fish 3.6 or newer version, you might see errors like:\n$(\u0026hellip;) is not supported. In fish, please use \u0026lsquo;(\u0026hellip;)\u0026rsquo; string length: Unknown option “-V” set: Unknown option “-f” Here\u0026rsquo;s how to fix it: # Upgrade Fish to the latest version # Add the official Fish repository:\nsudo apt update Upgrade Fish:\nCheck the version:\nConclusion # Fish Shell is a modern, powerful, and user-friendly shell designed to improve your terminal experience. Its intelligent features like autosuggestions, syntax highlighting, and a web-based configuration tool make it a top choice for developers, sysadmins, and anyone who spends significant time in the terminal.\nWhile Fish has some drawbacks, such as compatibility with Bash scripts and software, its overall features make it a standout in the world of Unix-like shells. If you’re looking for a new shell to explore or need a more efficient terminal experience, Fish is definitely worth considering.\n","date":"4 May 2025","externalUrl":null,"permalink":"/posts/fish/","section":"Posts","summary":"","title":"Shell Shocked? Try Fish!","type":"posts"},{"content":"","date":"4 May 2025","externalUrl":null,"permalink":"/tags/tide/","section":"Tags","summary":"","title":"Tide","type":"tags"},{"content":"","date":"1 May 2025","externalUrl":null,"permalink":"/tags/dijkstra/","section":"Tags","summary":"","title":"Dijkstra","type":"tags"},{"content":" Introduction # Dijkstra’s Algorithm is a popular and efficient algorithm used for finding the shortest path from a single source node to all other nodes in a weighted graph. It is widely used in network routing, mapping applications, and many areas of computer science.\nWhat Is Dijkstra’s Algorithm? # Dijkstra’s Algorithm solves the single-source shortest path problem in a graph with non-negative edge weights. It finds the shortest path from a starting node (source) to every other node in the graph.\nKey Characteristics # Graph Type: Works on both directed and undirected graphs. Directed Graph (Digraph) # A directed graph has edges with a direction — like a one-way street. Each edge goes from one node to another specific node. Example: If there’s an edge from A to B, it doesn\u0026rsquo;t mean you can go from B to A unless there\u0026rsquo;s a separate edge for that.\n🡒 Notation: A → B Undirected Graph # An undirected graph has edges without direction — like a two-way street. If there\u0026rsquo;s an edge between two nodes, you can move in both directions.\nExample: If there\u0026rsquo;s an edge between A and B, you can go from A to B and also from B to A.\n🡒 Notation: A — B\nEdge Weights: Requires all edge weights to be non-negative.\nOptimality: Guarantees the shortest path from the source to every other node.\nGreedy Approach: Selects the node with the smallest known distance at each step.\nTerminologies # Node/Vertex: A point in the graph. Edge: A connection between two nodes. Weight: The cost to travel between two connected nodes. Visited Set: Nodes whose shortest distance from the source is finalized. Distance Map: Stores the currently known shortest distance from the source to each node. How the Algorithm Works # Initialization # Set the distance to the source node as 0. Set the distance to all other nodes as ∞ (infinity). Keep all nodes as unvisited. Create a priority queue or min-heap to fetch the node with the smallest distance. Priority Queue: A priority queue is like a line where each item has a number (priority), and the item with the smallest number gets picked first — not just the one who came first. In Dijkstra’s Algorithm, it helps quickly find the next closest node to visit.\nMain Loop # Pick the unvisited node with the smallest known distance. For each of its neighbors: Calculate the new distance using:\nnew_distance = current_distance + edge_weight If new_distance is less than the known distance, update it. Mark the current node as visited. Repeat until all nodes are visited or the shortest path is found. Example # Given the following weighted graph:\nA ---3--- B | | 1 2 | | C ---4--- D Starting from A:\nInitial distances: A = 0, B = ∞, C = ∞, D = ∞ Visit A: Update B = 3, C = 1 Visit C: Update D = 1 + 4 = 5 Visit B: Update D = min(5, 3 + 2) = 5 (no change) Final distances: A = 0, B = 3, C = 1, D = 5 Why Dijkstra Does Not Support Negative Weights # Dijkstra’s Algorithm assumes that once the shortest path to a node is found, it will not change. This assumption fails with negative weights, where a shorter path might appear later. Therefore, the algorithm does not work correctly with negative-weight edges.\nComparison with Other Algorithms # Algorithm Handles Negative Weights Use Case Dijkstra No Fastest for non-negative weights Bellman-Ford Yes Used when graph may contain negative weights Floyd-Warshall Yes Computes all-pairs shortest paths A* Search (typically) Best for pathfinding with a known goal Applications # GPS and Navigation systems Network routing protocols (e.g., OSPF) Robot and AI pathfinding Traffic simulation Flight scheduling systems Summary # Dijkstra’s Algorithm is used to find the shortest paths from a single source node to all other nodes. It works only with non-negative edge weights. The algorithm uses a greedy approach and a priority queue for efficiency. It’s fast, reliable, and widely used in real-world applications. ","date":"1 May 2025","externalUrl":null,"permalink":"/posts/dijkstra/","section":"Posts","summary":"","title":"Dijkstra's Algorithm: Your GPS for the World of Graphs","type":"posts"},{"content":" Why Testing Your Code Matters # When we write code, we want it to work. But sometimes, it doesn’t. That’s where testing comes in.\nTesting helps us check if our code is doing what we want. It tells us if something is broken, so we can fix it early — before it becomes a big problem.\nWhy Should We Test? # Let’s say you make a function that adds two numbers. You think it works. But what if it doesn’t? You don’t want to find out later, when everything depends on it.\nTesting is like asking your code:\n“Hey, are you really doing your job?”\nTypes of Testing (The Basics) # Here are the basic ones you’ll encounter:\nType What it Tests Unit Testing Small pieces of code, like functions Integration How different parts of code work together Functional Whole features from a user perspective Regression Makes sure old features still work after changes As a beginner, we’ll mostly be doing unit testing.\nTools We Use: pytest # We\u0026rsquo;ll use pytest, which is a powerful and easy-to-use testing tool in Python.\n🔧 Install pytest: # If you don’t have it yet, run this command:\nA Simple Way to Test: pytest # In Python, there’s a tool called pytest. It helps you test your code easily.\nFor example:\nYou write a function: # def — Define a Function # def is short for define. It\u0026rsquo;s used to create a function in Python. assert — Check if Something is True # assert is used to check if a condition is true. If it is true, Python does nothing and continues. If it’s false, Python throws an AssertionError. This code is checking:\nDoes add(2, 3) give 5? Does add(0, 0) give 0? And so on. Testing with pytest # Put this in a file called test_add.py, then run this in your terminal:\nIf all is good, you’ll see a green message.\nIf something is wrong, pytest will show you what failed.\nWhy Use pytest? # It’s simple to use The code is easy to read You get clear messages when something fails Final Thoughts # Testing might feel boring at first.\nBut it saves you time and trouble later.\nStart small — test just one function.\nIt’s a good habit to build.\nYour code will thank you.\nAnd so will your future self.\n","date":"23 April 2025","externalUrl":null,"permalink":"/posts/test/","section":"Posts","summary":"","title":"Don’t Trust Your Code—Test It","type":"posts"},{"content":"","date":"23 April 2025","externalUrl":null,"permalink":"/tags/python/","section":"Tags","summary":"","title":"Python","type":"tags"},{"content":"","date":"23 April 2025","externalUrl":null,"permalink":"/tags/testing/","section":"Tags","summary":"","title":"Testing","type":"tags"},{"content":"","date":"23 March 2025","externalUrl":null,"permalink":"/tags/gh/","section":"Tags","summary":"","title":"Gh","type":"tags"},{"content":"","date":"23 March 2025","externalUrl":null,"permalink":"/tags/git/","section":"Tags","summary":"","title":"Git","type":"tags"},{"content":"","date":"23 March 2025","externalUrl":null,"permalink":"/tags/linux/","section":"Tags","summary":"","title":"Linux","type":"tags"},{"content":"GitHub CLI (Command Line Interface) is a powerful tool that allows developers to interact with GitHub directly from the terminal. Whether you want to create repositories, manage pull requests, or handle issues, GitHub CLI makes the process seamless and efficient.\nWhy Use GitHub CLI? # If you\u0026rsquo;re comfortable with the command line, GitHub CLI eliminates the need to switch between your browser and terminal. It integrates well with Git, making repository management faster and more intuitive. Some benefits include:\nFaster workflow – No need to open a browser for basic operations.\nAutomation – Easily script repetitive tasks.\nSeamless Git integration – Work within your existing Git environment.\nImproved efficiency – Manage repositories, issues, and pull requests quickly.\n1. Installing GitHub CLI # GitHub CLI supports multiple platforms, including Windows, macOS, and Linux. You can install it via package managers:\nMacOS (Using Homebrew) # brew install gh Windows (Using Scoop) # scoop install gh OR using Chocolatey: # choco install gh For Linux (Debian/Ubuntu-based systems): # sudo apt update Then run this command: To verify installation:\ngh --version 2. Authenticating with GitHub CLI # Before using GitHub CLI, authenticate it with your GitHub account:\nYou\u0026rsquo;ll be prompted to select a GitHub account type (GitHub.com or GitHub Enterprise) and a preferred authentication method (HTTPS or SSH). Follow the on-screen instructions to complete authentication. If you plan to use SSH (recommended), make sure you have an SSH key set up:\nCheck for an existing SSH key\nGenerate a new SSH key (if missing)\nssh-keygen -t ed25519 -C \u0026#34;your-email@example.com\u0026#34; Then, add your SSH key to GitHub:\ngh ssh-key add ~/.ssh/id_ed25519.pub Verify login:\nYou can also test your SSH connection by running the following command:\n3. Creating a GitHub Repository from the Terminal # Options: # --public: Makes the repo public.\n--private: Creates a private repo.\n--source=.: Uses the current directory as the source for the repository.\nClone an existing repository # gh repo clone username/repo-name Add the SSH Remote Manually(if needed) # If your repository doesn’t have a remote set up yet. You need to add the SSH remote manually.\n🔹 Step 1: Add the Remote Repository (SSH) # If you\u0026rsquo;re using SSH, add your GitHub repository as a remote with this command:\ngit remote add origin git@github.com:zenarchh/OOP.git Note: Replace OOP(my repo) with your actual repository name if different.\n🔹 Step 2: Verify the Remote URL # Now, check if the remote was added successfully:\nThis confirms that your Git repository is now connected to GitHub via SSH. ✅\n🔹 Step 3: Push Your Code # If you haven\u0026rsquo;t pushed your code yet, run:\ngit push -u origin master or\ngit push -u origin main (Use master or main depending on your branch name.)\nNow your Git setup is complete with GitHub CLI + SSH! 🚀\n🔹 Verify Everything # Once the push is successful, go to your GitHub repository (github.com/zenarchh/OOP) and check if your files are there.\nIf Everything Works: # You\u0026rsquo;re fully set up with Git + GitHub CLI + SSH! 🚀 From now on, you can commit and push changes without entering a password.\nMy pushed changes without passcode: 4. Managing Repositories # View a list of your repositories\ngh repo list Open a repository in the browser\ngh repo view --web Fork a repository\ngh repo fork username/repo-name Conclusion # GitHub CLI makes working with repositories, issues, and pull requests seamless. By using aliases, SSH authentication, and auto-completion, you can boost your productivity and streamline your GitHub workflow directly from the terminal. 🚀\n","date":"23 March 2025","externalUrl":null,"permalink":"/posts/githubcli/","section":"Posts","summary":"","title":"Master GitHub: A Beginner’s Guide to GitHub CLI","type":"posts"},{"content":"","date":"23 March 2025","externalUrl":null,"permalink":"/tags/ssh/","section":"Tags","summary":"","title":"Ssh","type":"tags"},{"content":" Introduction to SSH # SSH (Secure Shell) is a tool used to safely connect to remote computers and servers. It encrypts data, keeping your connection secure from hackers. Developers and system administrators use SSH for tasks like remote access, file transfers, and running commands on distant systems.\nAdvantages of SSH # Secure Communication – Encrypts data, preventing eavesdropping and attacks.\nRemote Access – Manage servers and systems from anywhere.\nKey-Based Authentication – Enables password-free and more secure logins.\nSecure File Transfers – Transfer files safely\nMulti-User Support – Allow multiple users to connect and manage a system securely.\nSSH makes remote access fast, safe, and hassle-free!\nConnection With Remote System # SSH (Secure Shell) allows secure remote access to a server or another computer. Here’s how you can set it up and use it on Ubuntu:\n1. Prepare Ubuntu # The first thing you need to do before you start installing SSH on Ubuntu is to update all apt packages to the latest versions. To do this, use the following command:\nsudo apt update \u0026amp;\u0026amp; sudo apt upgrade 2. Install SSH on Ubuntu # First, ensure SSH is installed on both the client (your local machine) and the server (remote machine).\nOn the server (remote machine), install the SSH server: Note: For this type of connection, both the client (local system) and the server (remote system) should be on the same network.\nTo check if SSH is running: If it’s not running, start it with:\nsudo systemctl start ssh 2. Allow SSH Through the Firewall # If you have a firewall enabled, allow SSH connections: Then, enable the firewall if it\u0026rsquo;s not already active: 3. Find the Server’s IP Address # To connect to your server, you need its IP address. Run:\nip a IP is usually something like 192.168.x.x.\n4. Connect to the Server via SSH # On your client machine, use this command to connect:\nNote: As it is a connection with remote system, you need to add the user name and IP-address of system with which you are building connection.\nEnter the password when prompted ( remember it is the password connection. For this type of SSH you need to know to password of remote system)\u0026gt;\nYou have now successfully built a connection with remote system through password!\nSet Up Passwordless SSH (Optional But Recommended) # If you don’t want to enter a password every time, set up SSH key authentication:\n🔹 Generate an SSH Key (Skip if you already have one) # On your local machine, run:\nssh-keygen -t ed25519 -C \u0026#34;SSHkey\u0026#34; Press Enter for all options.\n🔹 Copy the SSH Key to the New Remote System # ssh-copy-id username@remote_IP Enter the password once. After this, SSH should work without a password!\nLoopback SSH # If you want to connect to your own system using SSH (also called loopback SSH or local SSH connection), follow these steps:\nSteps: # Install SSH on Ubuntu\nAllow SSH Through the Firewall\nFind the Server’s IP Address Note: In this case, you need the IP-address of your own system.\nConnect to the Server via SSH\nEnter the password when prompted.\nDisconnect from SSH To exit the SSH session, type:\nexit You’ve successfully connected to your own system via SSH!\nConclusion # SSH isn’t just a tool—it’s your secret tunnel into remote (or even your own) system! With a secure setup and a few tweaks, you can connect like a pro. Now go forth and SSH into greatness!🚀\n","date":"7 March 2025","externalUrl":null,"permalink":"/posts/ssh/","section":"Posts","summary":"","title":"Install and Configure SSH on Ubuntu","type":"posts"},{"content":"","date":"5 March 2025","externalUrl":null,"permalink":"/tags/debugging/","section":"Tags","summary":"","title":"Debugging","type":"tags"},{"content":"","date":"5 March 2025","externalUrl":null,"permalink":"/tags/logging/","section":"Tags","summary":"","title":"Logging","type":"tags"},{"content":"Logging is a means of tracking events that happen when some software runs. It is an essential aspect of software development that helps in debugging, monitoring, and maintaining applications.\nPython provides a built-in logging module that makes it easy to track events and errors in your code\nWhy Use Logging? # Many beginners use print() statements for debugging, logging provides a better way to record messages, debug issues, and monitor applications.\nSeverity Levels: Logging allows categorization of messages by severity (DEBUG, INFO, WARNING, ERROR, CRITICAL).\nConfigurability: You can easily change logging levels, formats, and destinations without modifying the code.\nPerformance: Logging can be written to files, reducing console clutter and making debugging easier.\nAdvantages: # Logging is useful for:\nDebugging: Helps identify and fix issues in your code.\nMonitoring: Tracks application behavior over time.\nError Handling: Provides useful error messages and tracebacks.\nPerformance Analysis: Measures execution time and performance bottlenecks.\nStorage: Saves logs for future analysis.\nGetting Started with Logging # Basic Example: # Python’s logging module provides a simple way to log messages. For example:\nimport logging # configuring logging logging.basicConfig(level=logging.DEBUG) # log messages logging.info(\u0026#34;This is a debug message.\u0026#34;) logging.info(\u0026#34;This is an informational message\u0026#34;) logging.warning(\u0026#34;This is a warning message\u0026#34;) logging.error(\u0026#34;This is an error message\u0026#34;) logging.critical(\u0026#34;This is a critical message\u0026#34;) Understanding Log Levels # The logging module provides five different levels of severity:\nLevel Numeric Value Description DEBUG 10 Detailed information, useful for debugging INFO 20 General information about program execution WARNING 30 Indication of potential issues ERROR 40 A serious problem occurred CRITICAL 50 A critical error that may cause a system crash By default, Python’s logging module displays messages of level WARNING and above.\nConfiguring Logging # You can customize logging using basicConfig(). For example:\nlogging.basicConfig( level=logging.DEBUG, format=\u0026#39;%(asctime)s - %(levelname)s - %(message)s\u0026#39;, datefmt=\u0026#39;%Y-%m-%d %H:%M:%S\u0026#39; ) Logging to a File # Instead of printing logs to the console, you can save them to a file:\nlogging.basicConfig( filename=\u0026#39;app.log\u0026#39;, level=logging.DEBUG, format=\u0026#39;%(asctime)s - %(levelname)s - %(message)s\u0026#39;, datefmt=\u0026#39;%Y-%m-%d %H:%M:%S\u0026#39; ) Formatting Logs # You can customize the log message format using format:\nlogging.basicConfig( format=\u0026#39;%(levelname)s: %(message)s\u0026#39; ) logging.warning(\u0026#34;This is a formatted warning message.\u0026#34;) Common format specifiers: # %(asctime)s - Timestamp of the log message %(levelname)s - Log level (INFO, WARNING, etc.) %(message)s - The actual log message %(filename)s - Name of the source file %(lineno)d - Line number where the log was generated Advanced Logging Features # For more control over logs, the logging module allows creating separate loggers handlers, and formattersfor different modules\nBest Practices for Logging # Use appropriate log levels: Don\u0026rsquo;t log everything as DEBUG or INFO. Avoid logging sensitive data: Logs may be stored and accessed by others. Use structured logging: Format logs in a way that makes them easy to analyze. Rotate log files: Prevent logs from growing too large using RotatingFileHandler. Use separate log files for different purposes: Keep error logs separate from general logs. Conclusion # Logging in Python is a powerful tool that helps track, debug, and analyze code execution. By understanding logging levels, configurations, and best practices, you can improve debugging, monitoring, and error handling in your applications.\nStart implementing logging in your projects today and make your debugging process smoother! 🚀\n","date":"5 March 2025","externalUrl":null,"permalink":"/posts/pythonlog/","section":"Posts","summary":"","title":"The Art of Logging In Python!","type":"posts"},{"content":"Vim is more than just a text editor; it\u0026rsquo;s a powerful, lightweight, and highly customizable tool that can significantly enhance your productivity. Whether you\u0026rsquo;re a developer, system administrator, or just a curious enthusiast, learning Vim can be a game-changer.\nThis guide will introduce you to Vim, covering its basic commands, modes, customization options, installation, and essential plugins to optimize your workflow.\n1. Installing Vim # Before we dive in, let\u0026rsquo;s install Vim on your system:\nUbuntu/Debian:\nsudo apt update \u0026amp;\u0026amp; sudo apt install vim\nMacOS (using Homebrew):\nbrew install vim\nWindows: Download and install from vim.org or use WSL (Windows Subsystem for Linux).\nOnce installed, open a terminal and type:\nvim\nThis will launch Vim. Now, let’s explore its fundamental concepts.\n2. Understanding Vim’s Modes # Unlike traditional text editors, Vim has multiple modes. The three most important ones are:\nMode Description Shortcut to Enter Normal Default mode for navigation \u0026amp; commands Esc or open Vim Insert Mode for typing and editing text i, a, o Visual Mode for selecting and manipulating text v, V, Ctrl+v 3. Vim Commands # Navigation # h → Move left l → Move right j → Move down k → Move up Ctrl + d/u → Move half-page down/up gg → Jump to beginning of the file G → Jump to end of the file Editing # i → Insert mode before the cursor a → Insert mode after the cursor o → Open a new line and enter insert mode dd → Delete entire line yy → Copy (yank) a line p → Paste the copied line Saving \u0026amp; Exiting # :w → Save the file :q → Quit Vim :wq → Save and quit :q! → Quit without saving 4. Customizing Vim # To make Vim more comfortable, you can modify the ~/.vimrc configuration file. Open it with:\nvim ~/.vimrc\nHere are some useful settings:\nsyntax on # Enable syntax highlighting set number # Show line numbers set tabstop=4 # Set tab width to 4 spaces set expandtab # Convert tabs to spaces set shiftwidth=4 # Indentation size set autoindent # Enable automatic indentation Save and exit (:wq).\n5. Installing Plugins # Plugins enhance Vim’s capabilities. To manage plugins easily, use vim-plug.\nInstalling vim-plug # curl -fLo ~/.vim/autoload/plug.vim --create-dirs \\https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\nAdding Plugins to .vimrc # Edit ~/.vimrc and add:\ncall plug#begin(\u0026#39;~/.vim/plugged\u0026#39;) Plug \u0026#39;preservim/nerdtree\u0026#39; # File explorer Plug \u0026#39;vim-airline/vim-airline\u0026#39; # Better status bar Plug \u0026#39;junegunn/fzf\u0026#39; # Fuzzy file search Plug \u0026#39;morhetz/gruvbox\u0026#39; # Popular color scheme call plug#end() Save and install the plugins by running inside Vim:\n:PlugInstall 6. Tweaks to Boost Productivity # Better Split Navigation # nnoremap \u0026lt;C-h\u0026gt; \u0026lt;C-w\u0026gt;h nnoremap \u0026lt;C-l\u0026gt; \u0026lt;C-w\u0026gt;l nnoremap \u0026lt;C-j\u0026gt; \u0026lt;C-w\u0026gt;j nnoremap \u0026lt;C-k\u0026gt; \u0026lt;C-w\u0026gt;k Now, you can switch between split windows using Ctrl + h/l/j/k like in modern editors.\nAuto-save on focus lost\nau FocusLost * :wa This will automatically save all files when you switch windows.\nEnable Mouse Support\nset mouse=a Now, you can click and scroll inside Vim like in a normal text editor.\n7. Fun with Vim: The Hidden Gems # Vim Cowsay Easter Egg 🐄 # Run this in your terminal:\nvim -c 'echo \u0026quot;Moo! Vim is awesome!\u0026quot;'\nVim Tutor for Beginners # Run this in your terminal:\nvimtutor\nThis will launch an interactive Vim tutorial, perfect for beginners!\nFinal Thoughts # Vim is an incredibly powerful tool, but it takes time to master. The more you use it, the faster and more efficient you’ll become. Start with the basics, experiment with customizations, and soon Vim will feel like an extension of your mind. 🚀\nHappy Vimming! 🎩✨\n","date":"12 February 2025","externalUrl":null,"permalink":"/posts/vim/","section":"Posts","summary":"","title":"Mastering Vim: A Developer`s Swiss Army Knife","type":"posts"},{"content":"","date":"12 February 2025","externalUrl":null,"permalink":"/tags/vim/","section":"Tags","summary":"","title":"Vim","type":"tags"},{"content":"When it comes to crafting ultra-fast and secure static websites, Hugo emerges as a top contender. Its blend of speed, simplicity, and powerful features allows users to build exceptional websites without the complexity of traditional web development workflows. In this guide, we\u0026rsquo;ll dive into Hugo\u0026rsquo;s core benefits and walk you through deploying your site seamlessly.\nWhy Hugo is a Game-Changer # If you’re wondering why Hugo stands out, here are some key reasons:\nIncredible Speed: Hugo generates your website in the blink of an eye, making it perfect for frequent updates. Simple Setup: Minimal configuration and an intuitive file structure get you up and running quickly. Flexible Templates: With Go-based templates, you can create complex designs while keeping the content static. Markdown Simplicity: Write your content in clean, easy-to-read Markdown. SEO-Ready Features: Hugo helps optimize your site for search engines with metadata and canonical URLs. Community Support: A vibrant community and detailed documentation ensure help is always within reach. Step-by-Step Guide to Building with Hugo # 1. Installing Hugo # Getting Hugo onto your machine is a breeze:\nOn macOS\nbrew install hugo\nOn Linux\nsudo apt-get install hugo\nOn Windows\nHead over to Hugo Releases, download the appropriate package, and follow the instructions.\n2. Start a New Hugo Site # Creating your website is as simple as:\nhugo new site my-website 3. Add a Theme # 4. Create Content # To add your first post, use:\nhugo new posts/welcome.md Edit the generated Markdown file and craft your content.\n5. Preview Locally # Check your site’s look and feel:\nhugo server -D Head to http://localhost:1313 to see your site in action.\nDeploying Your Hugo Site # 1. Build Static Files # Once you\u0026rsquo;re satisfied with your content, build the static files:\nhugo This generates the complete website in the public directory.\n2. GitHub Pages Deployment # Step 1: Initialize a Git Repository # git init Step 2: Commit Your Files # git add . git commit -m \u0026#34;Initial commit\u0026#34; Step 3: Push to GitHub # Create a repository on GitHub and push your code:\ngit remote add origin https://github.com/username/repo.git git branch -M main git push -u origin main Step 4: Enable GitHub Pages # In your repository settings, enable GitHub Pages and select the appropriate branch.\nWrapping Up # Hugo allows you to craft and deploy blazing-fast websites effortlessly. Whether you prefer GitHub Pages, Netlify, or Vercel, deploying your site is straightforward and hassle-free. Embrace your creative side, build your online presence, and let Hugo handle the heavy lifting. Don’t forget to keep your site fresh with regular updates to engage your audience and improve your web footprint.\n","date":"7 February 2025","externalUrl":null,"permalink":"/posts/hugo/","section":"Posts","summary":"","title":"Crafting with Hugo: a Lightning-Fast Site Generator🔧!","type":"posts"},{"content":"HI! This is my first post but honestly this is my 7th try!\n","date":"7 February 2025","externalUrl":null,"permalink":"/posts/my-first-post/","section":"Posts","summary":"","title":"My First Post","type":"posts"},{"content":" Introduction # Ever felt like your code projects are a chaotic mess, with random files named \u0026ldquo;final_version_final_FINAL\u0026rdquo;? Don’t worry, you’re not alone! Enter Git and GitHub, the dynamic duo that’s here to save your projects from utter disarray. Let’s break them down in the simplest way possible, so you can join the cool kids and say things like, “I’ll just push it to GitHub.\u0026quot;\nWhat is Git # Picture this: You’re writing a novel, and every time you make changes, you wish you had a backup of the previous version. What if your brilliant idea turns out to be total garbage?\nGit is your fairy godparent here—a version control system that keeps track of every change you make to your files. It allows you to:\nSave different versions (called commits) of your project.\nCompare, undo, or revisit older versions whenever you want.\nCollaborate with others without yelling, “Who overwrote my code?!”\nIn short, Git is like a magical diary for your code that says, “Don’t worry, I remember what you did last summer (or last commit).”\nWhat about GitHub? # GitHub is where Git goes to show off. Think of it as Git’s social network—an online platform where your code can chill, collaborate, and even find fans.\nWith GitHub, you can:\nStore your Git-tracked projects (called repositories).\nWork with others by sharing your repo and combining your efforts.\nShow off your skills to the world (and maybe even impress recruiters).\nIf Git is your private library, GitHub is the world’s biggest code expo.\nThe Lingo You Need to Git (and GitHub): # Git knows what you did last summer!\nTo sound like you’ve been in this game for ages, here are some key terms:\nRepository (Repo): The folder where your project lives. But unlike boring folders on your laptop, this one remembers everything.\nCommit: Every time you save your work in Git, you create a commit. It’s like taking a snapshot of your project’s current state—great for time-traveling back to when things actually worked.\nBranch: Want to try something new but don’t want to mess up your main project? Create a branch, a parallel universe for experimenting.\nMerge: When you’re ready to bring your experiments into the main project, you merge the branch. If it works, you’re a genius. If it doesn’t, blame the branch.\nPush: Upload your changes to GitHub. It’s like saying, “World, here’s my masterpiece\u0026quot;.\nWhy You Should Care # Still not convinced? Here’s why Git and GitHub are a big dea\nYour projects won’t vanish into the void. Accidentally deleted something? Git’s got your back.\nCollaborate without chaos. No more overwriting someone else’s work or fighting over who broke the code.\nFlex your skills. Your GitHub profile is like a portfolio for coders. Employers love a well-maintained repo (hint: it’s a career booster).\nWork on real-world projects. GitHub is home to open-source projects. You can contribute to cool stuff and learn from the pros.\nHow to Git Started # Here’s a quick cheat sheet for getting up and running:\nInstall Git: Download and install Git on your computer by running this command on terminal: sudo apt update sudo apt install git Create a Repo: Either on GitHub (for a public project) or locally (for secret experiments). Here is how to do it: ","date":"12 January 2025","externalUrl":null,"permalink":"/posts/github/","section":"Posts","summary":"","title":"Git-ing It Together: Git Good with Git and GitHub","type":"posts"},{"content":" What Is a Personal Access Token? # Think of a Personal Access Token as a secret key or a VIP pass that gives you access to your GitHub account. Unlike passwords, which are meant for logging into the GitHub website, PATs are used for command-line operations (like pushing code) and integrations.\nWhy use them? Because PATs are more secure! Even if someone gets hold of your token, you can easily revoke it without changing your GitHub password.\nWhy Did GitHub Switch to PATs? # Better Security: Tokens are harder to hack and easier to manage.\nFine-Grained Control: You can create tokens that only do specific things, like pushing code but not deleting repositories.\nPassword-Free Future: GitHub is encouraging modern authentication methods like SSH keys and PATs.\nHow to Create a Personal Access Token (Step-by-Step) # Follow these easy steps to create your PAT:\n1. Log in to GitHub: Go to GitHub and log in.\n2. Go to Settings:\nClick on your profile picture (top-right corner). Select Settings from the dropdown menu. Navigate to Developer Settings \u0026gt; Personal Access Tokens. Click Generate new token. Select the scopes (permissions) you need. Click Generate token and copy it immediately. Using Your Token in Git # Replace Your Password: When Git prompts you for your GitHub username and password:\nEnter your username as usual. Paste your token instead of your password. Example:\ngit push origin main # Username: your-username # Password: paste-your-token-here Store It for Convenience: To avoid entering your token every time, you can cache it:\ngit config --global credential.helper store The next time you push code, Git will remember your credentials.\nPro Tips for Managing Your Token # Use Fine-Grained Tokens: They\u0026rsquo;re safer because you can set specific permissions and even limit access to certain repositories.\nRevoke Old Tokens: If you no longer need a token or think it\u0026rsquo;s compromised, delete it from the GitHub settings.\nSet Expiry Dates: Tokens can have expiration dates to reduce security risks. Create a new one when it expires.\nCommon Mistakes and How to Avoid Them # Losing Your Token: Always save it in a secure place. Use a password manager if possible.\nWrong Permissions: If your token doesn\u0026rsquo;t work, double-check the permissions you selected.\nToken Not Accepted: Ensure you\u0026rsquo;re using the token where a password is required, not your GitHub password.\nFinal Thoughts # Switching to Personal Access Tokens might feel like an extra step, but it\u0026rsquo;s a step towards better security and modern practices. Once you get the hang of it, it\u0026rsquo;ll feel as natural as typing your password—but way cooler!\nSo, go ahead and generate your first PAT. Trust me, your future self will thank you when your projects are secure and running smoothly.\nHappy coding! 🔐✨\n","date":"12 January 2025","externalUrl":null,"permalink":"/posts/pat/","section":"Posts","summary":"","title":"GitHub's Personal Access Token: Your Key to Secure Access","type":"posts"},{"content":"","date":"12 January 2025","externalUrl":null,"permalink":"/tags/ubuntu-cli/","section":"Tags","summary":"","title":"Ubuntu CLI","type":"tags"},{"content":"","date":"12 January 2025","externalUrl":null,"permalink":"/tags/version-control/","section":"Tags","summary":"","title":"Version Control","type":"tags"},{"content":"","date":"12 January 2025","externalUrl":null,"permalink":"/tags/latex/","section":"Tags","summary":"","title":"Latex","type":"tags"},{"content":"Welcome to the mystical world of LaTeX! It’s not a type of rubber, but rather the holy grail of document creation for nerds, academics, and anyone tired of Word’s unpredictable formatting tantrums. If you’ve ever wondered how professors produce those intimidatingly perfect papers, here’s the secret: LaTeX.\nBut beware: LaTeX is a bit like taming a dragon. Powerful, majestic, and occasionally a total nightmare. Let’s explore this magical tool together—complete with humor, tips, and (imagined) visuals to keep you smiling through the frustration.\nWhat Is LaTeX? # Imagine a world where your essays look like professional publications, your equations flow seamlessly, and your references magically align themselves. That’s LaTeX!\nInstead of clicking buttons, you code your documents. Yes, it’s intimidating at first. But once you conquer the learning curve, you’ll never go back. Plus, saying “I use LaTeX” sounds so much cooler than “I formatted this in Word.”\nVisual Idea: A split-screen image of a messy Word doc on one side vs. a flawless LaTeX-rendered thesis on the other, captioned: “You vs. the document she told you not to worry about.”\nWhy Use LaTeX? # Equations Done Right: LaTeX makes math look beautiful, like this classic: E = mc^2 (Word users are still trying to find the superscript button.) No Formatting Nightmares: In LaTeX, what you code is what you get. (Well, after a few tries and possibly some tears.) Flexibility for Everything: Resumes, books, presentations—LaTeX can handle it all. It’s like the Swiss Army knife of document creation. Visual Idea: An infographic of \u0026ldquo;What LaTeX Can Do\u0026rdquo; with icons for \u0026ldquo;Math,\u0026rdquo; \u0026ldquo;Theses,\u0026rdquo; \u0026ldquo;Resumes,\u0026rdquo; and \u0026ldquo;Books.\u0026rdquo;\nStep 1: Getting Started Without Crying # Option A: The Easy Way (Overleaf) # For the uninitiated, Overleaf is your best friend. It’s an online LaTeX editor that lets you skip the installation drama and dive straight into coding your masterpiece.\nOption B: The Hardcore Way (Local Installation) # Download TeX Live (Windows/Linux) or MacTeX (macOS). Warning: This path includes manually setting up your editor and possibly shouting at your computer. Recommended only if you enjoy challenges.\nStep 2: Your First LaTeX Document # Let’s start with the LaTeX equivalent of “Hello, World!”:\n\\documentclass{article} \\begin{document} Hello, World! This is my first LaTeX document. \\end{document} Compile this code, and BOOM! You’ve created a document that does absolutely nothing but look fancy. If it didn’t compile, double-check for typos or pray to the LaTeX gods.\nThe Good, The Bad, and The Hilarious # The Good: Why You’ll Fall in Love with LaTeX # Equations That Slap # Tired of clunky math formatting in Word? LaTeX delivers flawless results every time.\nHere’s an example:\n\\begin{equation} E = mc^2 \\end{equation} This produces:\nE=mc^2\nLooks like something straight out of Einstein’s notebook, right?\nBibliographies, Solved # Forget manually formatting your references. Just create a .bib file and let BibTeX do the hard work.\n\\bibliography{references} \\bibliographystyle{plain} Compile twice, and voilà—your citations are perfect. (Miss a step, and chaos will reign.)\nThe Bad: Tables (or, The True Test of Patience) # Ah, tables—the nemesis of many LaTeX users. They look beautiful when done, but writing them feels like solving a Rubik’s Cube blindfolded.\nExample:\n\\begin{tabular}{|c|c|} \\hline Column 1 \u0026amp; Column 2 \\\\ \\hline Data 1 \u0026amp; Data 2 \\\\ \\hline \\end{tabular} Rendered output?\nColumn 1\tColumn 2 Data 1\tData 2 Gorgeous. Writing it? Exhausting. Remember to add lines (\\hline) or the table police will come for you.\nThe Hilarious: Errors That Make You Question Life # When Things Go Wrong (And They Will)\nLaTeX errors are a special kind of pain:\n\u0026ldquo;Missing } inserted\u0026rdquo;: Somewhere, you forgot a curly brace. Time to play detective. \u0026ldquo;Overfull hbox\u0026rdquo;: Your text doesn’t fit in the box LaTeX designed. (Why? Nobody knows.) \u0026ldquo;File Not Found\u0026rdquo;: Did you spell your file name wrong? Of course you did. Visual Idea: A “LaTeX Error Survival Kit” graphic with icons for \u0026ldquo;Google,\u0026rdquo; \u0026ldquo;Coffee,\u0026rdquo; and \u0026ldquo;Stack Exchange.\u0026rdquo;\nStep 3: Advanced Wizardry # Custom Commands # Tired of typing the same thing over and over? Use shortcuts!\n\\newcommand{\\R}{\\mathbb{R}} Now, typing \\R will render as \\mathbb{R}. Efficiency unlocked.\nTikZ diagrams are so pretty, they’ll make your professor forget about your late submission.\nThe Emotional Journey of LaTeX # Let’s be real: LaTeX will break your spirit at least once. You’ll question your life choices, cry over a misplaced semicolon, and spend hours Googling. But when you finally compile a flawless document, you’ll feel like a genius.\nVisual Idea: A comic strip of a user going from “Frustrated with Errors” → “Triumphantly Compiled Document” → “Bragging to Friends.”\nWhy You’ll Stick With LaTeX # It’s Addictive: Once you master LaTeX, Word feels like a toy. The Results Speak for Themselves: Your documents will look so good, you’ll consider framing them. The Nerd Cred Is Real: “Oh, you’re still using Word? How quaint.” Conclusion: Tame the Beast, Enjoy the Glory # LaTeX isn’t just a tool—it’s a journey. A journey filled with curly braces, elegant equations, and the sweet satisfaction of a perfectly formatted document.\nSo dive in, stay persistent, and remember: the compile button is your friend.\nFinal Visual Idea: A motivational quote: “LaTeX doesn’t get easier. You just get better.”\nFinal Words # If this blog made you laugh, cry, or reconsider your life choices, share it with someone embarking on their LaTeX journey. Together, we can conquer curly braces and produce documents that truly impress.\nHappy typing—and may the compile button always be in your favor!\n","date":"12 January 2025","externalUrl":null,"permalink":"/posts/latex/","section":"Posts","summary":"","title":"LaTeX: Your Guide to Fancy Documents (and Surviving the Chaos)","type":"posts"},{"content":" LINUX # Linux is a best-known, versatile and most used open-source operating system initially developed by Linus Torvalds in 1991 as a \u0026lsquo;hobby\u0026rsquo;. There are many distributions or distros (different organizations and communities create their own versions e.g Ubuntu, Debian, Fedora etc.) of Linux, which include different software options. This means that Linux is incredibly customizable.\nUbuntu # Ubuntu was used after the African philosopher translated it to “Humanity to Other”. Ubuntu has been derived from Debian’s architecture and the Linux server. It is free of cost and comes with a built-in firewall system and user-friendly interface. With Ubuntu, you do not need to worry about hackers.\nWhat Windows\u0026rsquo; Get Wrong About Linux! VM\u0026rsquo;Foolproof Tactics # That\u0026rsquo;s what makes Linux so good: you put in something, and that effort multiplies. It\u0026rsquo;s a positive feedback cycle.\nStep-by-Step Installation # Laugh in the face of danger! here is the detailed explanation of how to do it:\nstep 1: Installing VirtualBox # VirtualBox is software that enables us to run operating systems like Ubuntu, Windows, and many other operating systems.This is particularly useful for testing software, experimenting with different configurations, and isolating environments for increased security.\nOpen the terminal and run the following command to update repositories. ","date":"27 October 2024","externalUrl":null,"permalink":"/posts/ubuntu/","section":"Posts","summary":"","title":"Avoid the Gates of Hell. Install Linux. ","type":"posts"},{"content":"","date":"27 October 2024","externalUrl":null,"permalink":"/tags/debian/","section":"Tags","summary":"","title":"Debian","type":"tags"},{"content":"","date":"27 October 2024","externalUrl":null,"permalink":"/tags/os/","section":"Tags","summary":"","title":"Os","type":"tags"},{"content":" Anohba | Zenarch # I build quietly.\nI learn relentlessly.\nYou\u0026rsquo;ll find no noise here — just presence, and purpose.\nBehind Zenarch is just Anohba, a curious mind.✨\nGot a bold idea? Let\u0026rsquo;s bring it to life together!💡\n","externalUrl":null,"permalink":"/about/","section":"Anohba Jehad","summary":"","title":"About Me","type":"page"},{"content":" Aspiring SoftDev ","externalUrl":null,"permalink":"/authors/anohbajhd/","section":"Authors","summary":"","title":"Anohba Jehad","type":"authors"},{"content":"","externalUrl":null,"permalink":"/archives/","section":"Anohba Jehad","summary":"","title":"Archives","type":"page"},{"content":"","externalUrl":null,"permalink":"/authors/","section":"Authors","summary":"","title":"Authors","type":"authors"},{"content":"","externalUrl":null,"permalink":"/categories/","section":"Categories","summary":"","title":"Categories","type":"categories"},{"content":"","externalUrl":null,"permalink":"/search/","section":"Anohba Jehad","summary":"","title":"Search","type":"page"},{"content":"","externalUrl":null,"permalink":"/series/","section":"Series","summary":"","title":"Series","type":"series"}]