Posts

GitHub Copilot with GPT-4o vs Cursor with Claude Sonnet 3.7: A Developer's Perspective

As AI- powered coding assistants continue to evolve, developers are spoiled for choice. Among the top contenders today are: GitHub Copilot , recently upgraded with GPT- 4o , OpenAI’s fastest and most powerful model yet. Cursor , an AI- first code editor powered by Claude Sonnet 3.7 from Anthropic. Having used both tools in real development environments, I wanted to share a practical comparison— focusing on code completion accuracy , context awareness , workflow integration , and real- world usefulness . ⚔️ Quick Overview Feature GitHub Copilot ( GPT- 4o) Cursor ( Claude Sonnet 3.7) Model GPT- 4o Claude Sonnet 3.7 Editor Integration VS Code, JetBrains, Neovim Custom AI- powered code editor Local context awareness Basic ( via file open buffers) Deep file tree + git- aware Code Completion Accuracy High Very high Chat + Commands Yes ( in sidebar) Yes, deeply integrated Works offline? No No Price Paid ( via GitHub) Free tier + Paid plans 🤖 Code Completion: Who Understands Me...

Deploy a Next.js Application on Azure Web App ( Part 1)

Image
Today, we are going to deploy a very simple web application build using Next.JS framework on Microsoft Azure Web App. This blog is split into two parts - Part 1: covers local web app development and deployment to azure web app using local machine. Part 2: covers deployment using Gitlab CI Prerequisites Before starting, ensure you have the following prerequisites: Azure Account Subscription : If you don't have one, you can sign up for a free account here . Node.js and NPM : Make sure Node.js and NPM are installed on your local machine. Download them here . Git and Azure CLI : Install Git and the Azure CLI. Git can be found here and Azure CLI here . Docker : You’ll need Docker for building and running your Next.js app in a container. Get it here . (It is optional, we can build image directly on azure also) Table of Contents Setup Boilerplate Repo Build Docker Image (optional) Create an Azure Web App Deploy Web App using Azure CLI Step 1: Setup Repository To get started, yo...

Cybersecurity Essential: OpenSSL

In today’s digital landscape, securing data is paramount. Whether you’re building web applications, managing servers, or developing software that handles sensitive information, understanding cryptography is essential. OpenSSL is a powerful toolkit that software engineers can leverage for a variety of cryptographic functions. In this blog, we’ll explore what OpenSSL is, its core functionalities, and how you can effectively use it in your projects. What is OpenSSL? OpenSSL is an open-source implementation of the SSL and TLS protocols. It provides libraries for secure communication and a suite of command-line tools for performing various cryptographic operations, such as encryption, decryption, certificate management, and generating keys. Its versatility makes it a staple for software engineers and system administrators alike. Core Features of OpenSSL Encryption and Decryption : OpenSSL allows you to encrypt and decrypt files and data using various algorithms, includin...

Top AI Tools

Download and Install Python Download and Install Pycharm Install Jupyter > pip install jupyter Install Transformers > pip install transformers > pip install transformers[sentencepiece] Install Pytorch (Preferred for dev)/TensorFlow (preferred for prod) > pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

MongoDb CheatSheet

CRUD Operations: Create :  db.products.insert({item:"TV",aqty:200,soldqty:1200,avail:true}) db.createCollection("Name") Read : db.products.find({<Condition>},{<Projection>}) Get single document - db.products.findOne() Get all documents - db.products.find() Get documents based on filters - db.products.find({aqty:0}) Get documents with particular fields - db.products.find({aqty:0},{item:1,soldqty:1}) Reading the data with limit(), sort(), skip() functions: db.products.find().sort({aqty:1}).limit(5) db.products.find().sort({aqty:1}).skip(5) Operators : in, ne, nin, lt, gt, lte, gte, or, and IN -  db.products.find({aqty:{$in:[0,200]}}) Less Than & And - db.products.find({aqty:{$lt:200},soldqty:1800}) OR - db.products.find({$or:[{aqty:200},{soldqty:3000}]})            db.products.find({$or:[{aqty:{$lt:200}},{soldqty:{$gt:1800}}]}) Update : add/update property - db.products.updateMany({},{$set:{price:100}}) remove property...

Deep Dive in Asynchronous Programming in Javascript

Image
JavaScript is single threaded language.  Synchronous programming is execution of functions in order. Asynchronous programming is executing a long running process outside the main thread. It does not block code execution on main thread. Although it is achieved usually by running asynchronous function on separate thread. Though javascript is a single threaded language it supports aysnchronous behaviour, to understand how we need to understand JS runtime.  

What is makefile and how to use it.

Image
A Makefile is a special file used in Unix and Unix-like operating systems to automate the building and compilation of programs or projects. It contains a set of rules and dependencies that specify how to build a target, typically an executable program or a collection of files. .SILENT : all : first second last # .DEFAULT_GOAL:= last first :     echo "hello world" second :     echo "hello Gaurav" last :     echo "hello world Gaurav"   Refer  here  for more details

Setup Minikube on Windows using WSL

Image
 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube Start a cluster -  minikube start Start second cluster - minikube start -p cluster2 List all minikube cluster running: minikube profile list Set second cluster as current profile- Kubectl: Set kubectl alias to run kubectl commands for minikube if kubectl is not installed locally: alias kubectl = "minikube kubectl --" View kubernetes config: kubectl config view To access minikube from windows command prompt -  Update kube config file as per config on WSL running minikube apiVersion : v1 clusters : - cluster :     certificate-authority : \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt     server : https://127.0.0.1:49159   name : cluster2 - cluster :     certificate-authority : \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt     server : https://127.0.0.1:49154   name :...

Setup Docker Engine on Windows using WSL2

Image
Steps to setup docker on Windows 10/11 system without installing Docker Desktop application, which is just a GUI for docker. First, you need to install WSL (Windows subsystem for Linux) if not already installed - wsl --install Note: It will install ubuntu linux as default linux flavour. If you need to check and install any other use below command:          wsl --list --online          wsl --install kali-linux Next, install docker using below commands # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the repository to Apt sources: echo \   "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \   "$(. /etc/os-rele...

Setup MongoDB on Docker

Image
Setup MongoDB community server as a single node. $ docker pull mongodb/mongodb-community-server Verify MongoDB image is downloaded successfully:  $ docker images Run docker image $ docker run --name mongo -p 27017:27017 -d mongodb/mongodb-community-server:latest Setup MongoDB 3 node cluster on docker The steps to create a docker cluster are as follows. Create a Docker network.                $ docker network create mongoCluster Start three instances of MongoDB. docker run -d --rm -p 27017:27017 --name mongo1 --network mongoCluster mongo mongod --replSet myReplicaSet --bind_ip localhost,mongo1 docker run -d --rm -p 27018:27017 --name mongo2 --network mongoCluster mongo mongod --replSet myReplicaSet --bind_ip localhost,mongo2   docker run -d --rm -p 27019:27017 --name mongo3 --network mongoCluster mongo mongod --replSet myReplicaSet --bind_ip localhost,mongo3 Initiate the Replica Set. docker exec -it mongo1 mongosh --eval "r...

OWASP Security

 API Security Broken Object Level Authorization Aka IDOR (In-secured Direct Object Reference) - Accessing unauthorized objects using same token due to lack of authorization checks Mitigation implement authorization checks with user policies and hierarchy dont rely on IDs sent from client. Use IDs from session Check authorization each time there is client request to access database Use random non guessable IDs (UUIDs) Broken Authentication Due to Lack of best practices.  Mitigation Check all possible ways to authenticate to all APIs  Password reset APIs and one-time links also allow users to get authenticated and should be protected just as seriously  Use standard authentication, token generation, password storage, MFA  Use short-lived access tokens  Authenticate your apps (so you know who is talking to you)  OAuth token is not authentication (hotel key analogy) Use stricter rate-limiting for authentication, implement lockout policies and weak password ...

Code Review Best Practices

Some hate it and some love it. It depends on style and intent of code review done by reviewer or understanding of reviewee.  A great code review can reduce overall development cycle by minimizing bug leaks to higher environments and lead to a high-quality final product. On the other hand, poor code reviewing strategy can add unnecessary latencies in development cycle without mitigating any bugs.  What is code review? A manual process of reviewing source code developed by a fellow programmer of a team. It can be performed by multiple people or be performed multiple times by the same person for a thorough analysis. Fews steps can be automated using code analysis tools available. Why do we need code review? The most apparent benefit is making sure bad code is not leaked to production. Other benefits of good code reviews are standardization, knowledge sharing, security checks, and building a sense of teamwork and collaboration. How-to do-good code reviews? There are several aspect...