Posts

                                                          DOCKER Mongo run virtually use Docker  docker run -d -p 27017:27017 mongo docker run    ======   Create container -d ==============  Run Container as Detach Mode  -p 27017:27017=====  First Port is use for Host Port and 2nd one is Container Port mongo===========  Pull original Image on Official Website on Docker Hub  Create image code  # FROM: Base image FROM node:18 # WORKDIR: Set working directory inside the container WORKDIR /app # COPY again for the rest of the source files COPY . . # RUN: Execute a command (e.g., install dependencies) RUN npm install # Build  RUN npm run build # EXPOSE: Open a port (for external access) EXPOSE 3000 # CMD: Final command to run the app CMD ["npm", "start"] Build Image docker build -t image_name ....
                                   AI System Prompting System Prompting: System Prompting is Many way: Zero-Shot Prompting:  You ask the model to perform a task without giving it any examples. import openai # Set your OpenAI API key openai.api_key = "your-api-key" # Zero-shot prompt prompt = "Translate the following sentence into Spanish: 'I am going to the market.'" # API call response = openai.Completion.create(     engine = "text-davinci-003" ,   # or "gpt-3.5-turbo-instruct"     prompt = prompt,     max_tokens = 60 ,     temperature = 0.5 ) # Print the result print (response.choices[ 0 ].text.strip()) import openai openai.api_key = "your-api-key" response = openai.ChatCompletion.create(     model = "gpt-3.5-turbo" ,     messages = [         { "role" : "user" , "content" : "Translate the following se...
Image
   DOCKER Docker Engine Docker CLI - Command line interface Docker registry Docker Engine is an open-source containerization technology that allows developers to package applications into container Containers are standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment. 2. Docker CLI The command line interface lets you talk to the docker engine and lets you start/stop/list containers docker run -d -p 27017 : 27017 mongo \4 3. Docker registry The docker registry is how Docker makes money. It is similar to github , but it lets you push images rather than sourcecode Images vs containers Docker Image A Docker image is a lightweight, standalone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files. Docker Container A container is a running instance of an im...
  GIT: Conflict Resolve 3 Ways ๐Ÿง  Problem Scenario: User A and User B both change the same file User B pushes to main first ✅ User A did not pull latest main before pushing ❌ ❗️Conflict occurs when A tries to push ๐Ÿ› ️ Way 1: Manual Merge (Safe and Clear) ✅ Pull latest changes from main : git pull origin main ๐Ÿง  Manually resolve conflicts in files (look for <<<<<<< , ======= , >>>>>>> ) ✅ Check status: git status ✅ Stage resolved files: git add . ✅ Commit the merge : commit -m "Resolved merge conflict manually" ✅ Push to your branch: git push origin your-branch-name ๐Ÿงน Way 2: Discard Your Changes & Start Fresh Steps: ❌ Discard current changes (danger: will delete uncommitted changes!) git reset --hard HEAD 2.✅ Switch to main and pull latest: git checkout main, git pull origin main 3.✅ Switch back to your branch, re-do your changes: git checkout your-branch-name Make your changes again git status git add . git commit -m ...