<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Debug School: Mohammed Zaid</title>
    <description>The latest articles on Debug School by Mohammed Zaid (@zaid1822).</description>
    <link>https://www.debug.school/zaid1822</link>
    <image>
      <url>https://www.debug.school/images/7JgDeS3_CINL8tFQeZZH-P9F2hA370oxxsMLQQMmZuU/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvdXNl/ci9wcm9maWxlX2lt/YWdlLzM2NC85YjM0/YzJkMy01NDc3LTRm/NjUtODk0MS05Zjky/ODE5Nzk0ZTcucG5n</url>
      <title>Debug School: Mohammed Zaid</title>
      <link>https://www.debug.school/zaid1822</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/zaid1822"/>
    <language>en</language>
    <item>
      <title>Git Assignment # 2</title>
      <dc:creator>Mohammed Zaid</dc:creator>
      <pubDate>Mon, 27 Feb 2023 21:25:57 +0000</pubDate>
      <link>https://www.debug.school/zaid1822/git-assignment-2-1cdo</link>
      <guid>https://www.debug.school/zaid1822/git-assignment-2-1cdo</guid>
      <description>&lt;ol&gt;
&lt;li&gt;What is Git and why is it important in software development?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GIT is a version control system. It records the changes made to our code in its repository. We can see the history of the changes made, and can see who has made changes, when and why the changes were made. With GIT we can easily revert back to previous version of code, if the new version does not work properly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Explain the difference between Git and GitHub.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GIT is a version control system that records the changes made to our code in its repository whereas GitHub serves as a location for uploading copies of a Git repository&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How does Git handle version control?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git records the changes made in our code and stores it in repository, so that a specific version can be called later if needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Discuss the three main states of a Git file: committed, modified, and staged.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;committed: This state indicates that the file is safely stored in the local repository.&lt;/li&gt;
&lt;li&gt;modified: When we make any change to an already committed file, the state of the file changes from committed to modified.&lt;/li&gt;
&lt;li&gt;staged: it means that the file is now ready to be added to the local git repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;How can you create a new Git repository and clone it to your local machine?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To create a new git repository, we use the git init command.&lt;br&gt;
To clone the repository to local machine, we use git clone command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between a Git branch and a tag?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The difference between tag and branch is that a branch always points to the top of a development line and will change when a new commit is pushed whereas a tag will not change. Tags always point to the same object and they do not change.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How do you merge changes from one branch to another in Git?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To merge changes from on branch to another, we use "git merge" command. Before using this command we use "git checkout" to checkout the current branch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Explain the purpose of the .gitignore file in Git.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The gitignore makes sure that that certain files that we do not want to be tracked by Git remain untracked.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Discuss the Git workflow for a team of developers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Developers first clone the central repository.&lt;br&gt;
In their own local copies of the project, they edit files and commit changes. These new commits are stored on local repository.&lt;br&gt;
To publish changes to the official project, they push their local main branch to the central repository.&lt;br&gt;
Other developer can pull the latest file from the repository.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How can you resolve a Git conflict when merging branches?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;To resolve a merge conflict, edit the conflicted file in the editor(like VS Code).&lt;/li&gt;
&lt;li&gt;Once the file has been edited use git add merge.txt to stage the new merged content.&lt;/li&gt;
&lt;li&gt;To finalize the merge create a new commit by executing "git commit" command.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;What is the significance of the Git HEAD pointer?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The HEAD pointer always points to the top of the current branch in the repository. In Git, only one branch can be checked out at a time and this branch is called the "HEAD" branch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Discuss the difference between a Git pull and a Git fetch.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The Git pull command is used to fetch the contents from remote repository and merge with another repository or local branch.&lt;/li&gt;
&lt;li&gt;The git fetch command is used to fetch ,or to download the content from a remote repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Explain the difference between Git rebasing and Git merging.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git merge is a command that is used to merge Git branches while the logs of commits on branches remain intact whereas Git rebase is used to integrate changes from one branch to another, and the logs are modified once the action is complete.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How can you recover a deleted branch in Git?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Use the command "git reflog" and find the SHA1 for the commit at the tip of your deleted branch.&lt;/li&gt;
&lt;li&gt;Now, use "git checkout [sha1]", where [sha1] is sha of deleted branch.&lt;/li&gt;
&lt;li&gt;Once we at that commit, use "git checkout -b [branchname]" to recreate the branch.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Docker Assignment 1</title>
      <dc:creator>Mohammed Zaid</dc:creator>
      <pubDate>Mon, 27 Feb 2023 20:28:40 +0000</pubDate>
      <link>https://www.debug.school/zaid1822/docker-assignment-1-2jgn</link>
      <guid>https://www.debug.school/zaid1822/docker-assignment-1-2jgn</guid>
      <description>&lt;ol&gt;
&lt;li&gt;What is Docker and why is it used?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Docker is a platform that is used for developing, shipping, and running applications. It provides the ability to package and run an application in a a virtual environment called "container".&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is a Docker image and how is it different from a Docker container?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A Docker image contains set of instructions for creating a container that can run on the Docker.&lt;br&gt;
The difference between Docker image and a Docker container is that a Docker image defines how a container will be built whereas a Docker container is an instance of a Docker image.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How do you create a Docker image and run a Docker container?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are two ways to create docker image:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Existing Container:
Image = Ubuntu + git +  + apache2 + java&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;784  docker run -itd --name zaid ubuntu&lt;br&gt;
  785  docker ps&lt;br&gt;
  786  docker exec -it c60e9072a1b0 /bin/bash&lt;br&gt;
  787  docker ps&lt;br&gt;
  788  docker exec c60e9072a1b0 zaid&lt;br&gt;
  789  docker exec c60e9072a1b0 git&lt;br&gt;
  790  clear&lt;br&gt;
  791  ls&lt;br&gt;
  792  docker ps&lt;br&gt;
  793  docker exec c60e9072a1b0 which apache2&lt;br&gt;
  794  docker commit -m"ub-up-git-apa" -a"Zaid" c60e9072a1b0 ub-up-git-apa&lt;br&gt;
  795  docker images&lt;br&gt;
  796  docker run -itd ub-up-git-apa&lt;br&gt;
  797  docker ps&lt;br&gt;
  798  docker exec d823ff6a026b git&lt;br&gt;
  799  docker exec d823ff6a026b which apache2&lt;/p&gt;

&lt;p&gt;INSIDE A CONTAINER&lt;br&gt;
 1  apt-get install git&lt;br&gt;
    2  apt-get update&lt;br&gt;
    3  clear&lt;br&gt;
    4  git&lt;br&gt;
    5  apt-get install git&lt;br&gt;
    6  git&lt;br&gt;
    7  clear&lt;br&gt;
    8  apt-get install apache2&lt;br&gt;
    9  clear&lt;br&gt;
   10  which git&lt;br&gt;
   11  which apache2&lt;br&gt;
   12  exit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Dockerfile:
FROM ubuntu
MAINTAINER Zaid &lt;a href="mailto:DevOps@rajeshkumar.xyz"&gt;DevOps@rajeshkumar.xyz&lt;/a&gt;
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install apache2 -y&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FROM ubuntu&lt;br&gt;&lt;br&gt;
MAINTAINER Zaid &lt;a href="mailto:DevOps@zaid.xyz"&gt;DevOps@zaid.xyz&lt;/a&gt;&lt;br&gt;
RUN apt-get update &amp;amp;&amp;amp; apt-get install git -y &amp;amp;&amp;amp; apt-get install apache2 -y&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is a Dockerfile and how do you use it to create a Docker image?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A Dockerfile is a script that contains instructions using which a Docker image can be built.&lt;br&gt;
To create a image using dockerfile:&lt;/p&gt;

&lt;p&gt;FROM ubuntu&lt;br&gt;&lt;br&gt;
MAINTAINER Zaid &lt;a href="mailto:DevOps@rajeshkumar.xyz"&gt;DevOps@rajeshkumar.xyz&lt;/a&gt;&lt;br&gt;
RUN apt-get update&lt;br&gt;
RUN apt-get install git -y&lt;br&gt;
RUN apt-get install apache2 -y&lt;/p&gt;

&lt;p&gt;FROM ubuntu&lt;br&gt;&lt;br&gt;
MAINTAINER Zaid &lt;a href="mailto:DevOps@zaid.xyz"&gt;DevOps@zaid.xyz&lt;/a&gt;&lt;br&gt;
RUN apt-get update &amp;amp;&amp;amp; apt-get install git -y &amp;amp;&amp;amp; apt-get install apache2 -y&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How can you inspect the contents of a Docker container and the changes made to a container while it was running?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using "inspect command", we can the contents of a Docker container and the changes made to it.&lt;/p&gt;

&lt;p&gt;Ex: docker inspect eef958b5b633&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How can you share a Docker image with others and pull an image from a Docker registry?'&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Create a repository on any registry such as hub.docker.com&lt;/li&gt;
&lt;li&gt;Login to the repository on terminal using "docker login"&lt;/li&gt;
&lt;li&gt;The name of the docker image that you want to share and the repository should be the same. If not the create an alias of the image with the same name as of the repository using command "docker tag imagename repositoryname". Ex- docker tag ub-up-git-ap-db devopsschools/wed22023.&lt;/li&gt;
&lt;li&gt;Push the image on the repository using the command "docker push imagename".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can pull an image from a Docker registry by using "docker pull" command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What are the different network modes available in Docker and how do you choose the right network mode for your application?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are three different network modes available in Docker:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bridge networks-&amp;gt; it is used within a single host&lt;/li&gt;
&lt;li&gt;overlay networks-&amp;gt; it is used for multi-host communication&lt;/li&gt;
&lt;li&gt;macvlan networks-&amp;gt; it is used to connect Docker containers directly to host network interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;How can you mount a volume in a Docker container and share data between the host and container?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To mount a volume in a docker container, we use the command "docker run itd -v path", where path is the location of volume.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between a Docker Compose file and a Dockerfile, and how are they used in deploying multi-container applications?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A Dockerfile is a text file that contains the commands that a user can execut to build an image. &lt;br&gt;
Docker Compose is a tool for defining and running multi-container Docker applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How can you monitor the performance of a Docker container and diagnose issues with it?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can monitor the performance of a docker container by executing the command "docker stats".&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Components of Docker and its Brief Summary.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Docker Engine: Docker Engine is a containerization technology that is used to  build and containerize applications.&lt;/li&gt;
&lt;li&gt;Docker Image: A Docker image contains set of instructions that are used to create a container.&lt;/li&gt;
&lt;li&gt;Docker Registry: A Docker registry is a storage system for Docker images.&lt;/li&gt;
&lt;li&gt;Docker container: Docker containers are standardized, executable components that combine application source code with the operating system and dependencies that are required to run the code in any environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;What is the different between docker pause and unpause?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The docker pause command is used to suspend all processes in the specified containers.&lt;/li&gt;
&lt;li&gt;The docker unpause command un-suspends all processes in the specified containers.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;What is the different between docker stop and kill?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The docker stop command stops the container and provides a safe way to stop the container whereas docker kill command kills one or more containers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the different between docker exec and attach?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The docker exec command is used to run a new command in a running container whereas docker attach command is used to attach the terminal's standard input, output, and error to a running container.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List of dockerfile instructions and its Brief Summary?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;FROM: This command is used to create a base image such as an operating system, a programming language, etc.&lt;/li&gt;
&lt;li&gt;RUN: A RUN instruction is used to run specified commands.&lt;/li&gt;
&lt;li&gt;COPY: This instruction is used to copy a directory from our local machine to the docker container.&lt;/li&gt;
&lt;li&gt;WORKDIR: It is used to specify our working directory inside the container.&lt;/li&gt;
&lt;li&gt;CMD:This command is used to run a docker container by specifying a default command that gets executed for all the containers of that image by default.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;What is the differenet between CMD vs Entrypoint?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CMD: This command is used to run a docker container by specifying a default command that gets executed for all the containers of that image by default.&lt;br&gt;
Entrypoint: This instruction is used to configure the executables that will always run after the container is initiated.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Git Assignment - 1</title>
      <dc:creator>Mohammed Zaid</dc:creator>
      <pubDate>Tue, 24 Jan 2023 09:44:24 +0000</pubDate>
      <link>https://www.debug.school/zaid1822/git-assignment-1-1ehn</link>
      <guid>https://www.debug.school/zaid1822/git-assignment-1-1ehn</guid>
      <description>&lt;p&gt;Q1. What is Git?&lt;/p&gt;

&lt;p&gt;GIT is a version control system. It records the changes made to our code in its repository. We can see the history of the changes made, and can see who has made changes, when and why the changes were made. With GIT we can easily revert back to previous version of code, if the new version does not work properly.&lt;/p&gt;

&lt;p&gt;Q2. How Git works? Explain the architecture of Git.&lt;/p&gt;

&lt;p&gt;GIT records the changes made to a project file and stores these changes to a local repository and a remote repository. Developer can pull changes from other developers and make changes in local as well as remote repository.&lt;br&gt;
By using the command "git add", a change in working directory is added to staging area. The "git commit" command then captures the state of changes in the staging area and saves this snapshot in the local repository. "git push" command is then used to upload local repository content to a remote repository.&lt;br&gt;
GIT falls in decentralized category, where every developer has a copy of the project with its history on their machines.&lt;/p&gt;

&lt;p&gt;Q3. Explain why Git is distributed?&lt;/p&gt;

&lt;p&gt;GIT is distributed because each developer has a copy of the project with its history on their local machines. If the central server is offline, developers can synchronize their work directly.&lt;/p&gt;

&lt;p&gt;Q4. Explain Git workflow with image.&lt;/p&gt;

&lt;p&gt;The changes made to a project file in working directory are first added to staging area by using the command "git add". files in staging area are marked to be committed, but not yet committed.&lt;br&gt;
When we execute the command "git commit", all the files that are staged, their changes will be committed to the local repository. At this point all the changes are safely stored on the local repository.&lt;br&gt;
Now we have to push the files from local repository to remote repository. To do this we use "git push" command. This command pushes all the changes in local repository to remote repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/6NEuNEq7uwAUe5Vl73aUnSNuJprqcjoSA-TqZ65719o/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvdTlwY3d4/cGdnZGF3cTlncWd6/bDIucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/6NEuNEq7uwAUe5Vl73aUnSNuJprqcjoSA-TqZ65719o/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvdTlwY3d4/cGdnZGF3cTlncWd6/bDIucG5n" alt="Image description" width="880" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Q5. List top 10 Git commands.&lt;/p&gt;

&lt;p&gt;git clone&lt;br&gt;
git add&lt;br&gt;
git commit&lt;br&gt;
git push&lt;br&gt;
git pull&lt;br&gt;
git checkout&lt;br&gt;
git branch&lt;br&gt;
git status&lt;br&gt;
git merge&lt;br&gt;
git log&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
