<?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: Manish Mishra</title>
    <description>The latest articles on Debug School by Manish Mishra (@manishmishra26).</description>
    <link>https://www.debug.school/manishmishra26</link>
    <image>
      <url>https://www.debug.school/images/ddFJRHTG7xByVsXaQJpxbKf1DmKQBJ5kjgxbYnBMDDI/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvdXNl/ci9wcm9maWxlX2lt/YWdlLzIwNy81YjBi/ZGI4ZC01MzhjLTQ3/MmMtYTIzMC0yMWIw/MTdiMzEwYjcucG5n</url>
      <title>Debug School: Manish Mishra</title>
      <link>https://www.debug.school/manishmishra26</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/manishmishra26"/>
    <language>en</language>
    <item>
      <title>Git Commands</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Fri, 18 Nov 2022 07:29:00 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/git-commands-3m59</link>
      <guid>https://www.debug.school/manishmishra26/git-commands-3m59</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Basic commands:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;to check installed version&lt;br&gt;
git --version&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to set user name and email for current repo &lt;br&gt;
git config user.name "Manish Mishra"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git config user.email "&lt;a href="mailto:manishsmishra97@gmail.com"&gt;manishsmishra97@gmail.com&lt;/a&gt;"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;to list the current configurations for a repo&lt;br&gt;
git config --list&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;first time to initialize a project (Run inside project Directory)&lt;br&gt;
git init &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;check status&lt;br&gt;
git status&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git Add - &amp;gt; adds selected changes  to staging area &lt;br&gt;
git add file1 file2 &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit without -m it will pop out editor for text message&lt;br&gt;
git commit &lt;br&gt;
git commit -m "Your Message"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add all changes to stage at once&lt;br&gt;
git add .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add and commit simultaneously&lt;br&gt;
git commit -a -m "message"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to view details about a particular commit&lt;br&gt;
git show &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to view commit history&lt;br&gt;
git log&lt;br&gt;
or &lt;br&gt;
git log --oneline&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;rename file&lt;br&gt;
git mv  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;remove file that is tracked&lt;br&gt;
git rm &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;remove a file that is not staged or committed (Untracked)&lt;br&gt;
git clean -fd &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;clone a repo&lt;br&gt;
git clone &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;pull a repro (pull = fetch + merge)&lt;br&gt;
git pull &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add repo link to the local repo&lt;br&gt;
git remote add origin &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After adding above , to push to a remote repo&lt;br&gt;
git push origin &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Undoing changes:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it will undo all the changes which are done to the file that are unstaged/uncommited&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it will revert the changes and reflect the changes per current HEAD&lt;br&gt;
git restore &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;remove file from stage area&lt;br&gt;
git restore --staged &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;revert creates a new commit to undo the changes as per the commit hash provided&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git revert &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git Diff:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-compares staging area and working directory&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;only show unsatged changes&lt;br&gt;
git diff&lt;br&gt;
git diff &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;get difference between two commits&lt;br&gt;
git diff  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;will list changes between tips of the two branch&lt;br&gt;
git diff  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Branching:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;view existing branches in current repo&lt;br&gt;
git branch &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;should not include spaces&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;just makes the branch&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;does not switch to the branch (Head does not change)&lt;br&gt;
git branch &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-checkout the branch&lt;br&gt;
git checkout -b &lt;br&gt;
or&lt;br&gt;
git checkout &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;to list remote tracking branch
git branch -r&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Merge&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;switch to the main branch, and use below
git merge 
e.g: if you want feature branch to be merged in main
git checkout main
git merge feature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;based on the commit histories; after creation of the feature branch from main: there are multiple cases of merge:&lt;br&gt;
Fast-Forward: simplest type &lt;br&gt;
In this the feature branch have single of multiple commit since creating the branch while the master branch does not have any commit in that period.&lt;/p&gt;

&lt;p&gt;cherry-pick:&lt;br&gt;
merge particular feature from feature branch to be merged into master&lt;/p&gt;

&lt;p&gt;git cherry-pick &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tags:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;creates a tag and attached it to the current commit&lt;br&gt;
git tag &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to tag a particular commit&lt;br&gt;
git tag  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete tag&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git tag -d &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;push all tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git push --tags&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;single tag&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git push origin &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;get details of tag&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git show &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Docker tmpfs mount</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Wed, 16 Nov 2022 05:12:00 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/docker-tmpfs-mount-2mig</link>
      <guid>https://www.debug.school/manishmishra26/docker-tmpfs-mount-2mig</guid>
      <description>&lt;ul&gt;
&lt;li&gt;It is one of the 3 options available for user to store data.
unlike volume &amp;amp; mountfs, the data stored under tmpfs mount is not persistent, it is stored in the host memory.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This is used when we don't want to write sensitive data or data that relates to non-persistent application state in the container layer or on the host FS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;usage:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1st Method:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;docker run -itd --name temp_alpine --tmpfs /u01/temp alpine&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2nd Method:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;docker run -itd --name temp_alpine --mount&lt;br&gt;
type=tmpfs,destination=/u01/temp  alpine&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Docker image</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Tue, 15 Nov 2022 06:43:00 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/docker-image-46f0</link>
      <guid>https://www.debug.school/manishmishra26/docker-image-46f0</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Docker Image is a collection of multiple Filesystems.&lt;/li&gt;
&lt;li&gt;Each docker Image consist of 1 Root FS + 1 User FS which forms the Base Image and it can have multiple number of application specific FS.&lt;/li&gt;
&lt;li&gt;Each of this Filesystem corresponds to a layer, and each layer are identified by a unique Layer ID.&lt;/li&gt;
&lt;li&gt;Each of the Layers have a corresponding Parent layer except the root layer.&lt;/li&gt;
&lt;li&gt;When a container is created, all of the layers defined in the images are merged into a single Mount which is then attached to the runtime user.&lt;/li&gt;
&lt;li&gt;Once the container is running , any file related changes made into the container gets recorded in two location diff and merged.&lt;/li&gt;
&lt;li&gt;diff directory is persistent, while the merged directory is removed when the container is stopped/killed.&lt;/li&gt;
&lt;li&gt;If the stopped container is started back again a new merged is created from the layers defined in image and the changes from the diff directory is applied to that merged and is then mounted to the runtime user.&lt;/li&gt;
&lt;li&gt;Docker Root Dir can be located by using docker info command.&lt;/li&gt;
&lt;li&gt;Docker uses Sha2-256 algorithm to hash and manage the FS.&lt;/li&gt;
&lt;li&gt;Depending on the Storage driver, the FS are created in the corresponding storage driver's name folder e.g. overlay2 under docker root directory.&lt;/li&gt;
&lt;li&gt;The Meta data related to the container is stored under Image directory.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Docker Commands 2</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Tue, 15 Nov 2022 04:51:00 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/docker-commands-2-5h2j</link>
      <guid>https://www.debug.school/manishmishra26/docker-commands-2-5h2j</guid>
      <description>&lt;p&gt;&lt;strong&gt;Docker Update:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It Dynamically updates container configuration. With the use of this command we can set a limit on the resource that a container can consume. Resources such as memory size, no. of cpu, cpu shares, swap memory size, pid limit and more. Most of the this limits can be set on a running container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Wait:&lt;/strong&gt;&lt;br&gt;
The ‘docker wait’ is a command that is used to wait or block until one or more containers stop, and then it outputs their exit codes. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Docker Commands</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Mon, 14 Nov 2022 10:06:59 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/docker-commands-48p0</link>
      <guid>https://www.debug.school/manishmishra26/docker-commands-48p0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Docker pause:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker pause suspends all the process in the container by sending SIGSTOP signal, but the contents of the memory remains intact and will be available yo use when the container is unpaused&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker unpause:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker unpause will subsequently resumse all the suspended process by docker pause.&lt;br&gt;
Docker &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker stop:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Docker stop command will first send a SIGTERM Signal which allows the main process a grace period to clean up the processing, after some time a SIGKILL signal is sent to stop the main process. We can specify the time duration before the docker send the SIGKILL&lt;/p&gt;

&lt;p&gt;use: --time 10s , this will allow application 10 sec to gracefully termiate , before sending the KIll signal.&lt;/p&gt;

&lt;p&gt;When a process is gracefully ended by SIGTERM, the exit code for the operation is 0&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker kill:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When Docker kill command is fired a SIGKILL signal is sent to the main process of the container. The SIGKILL signal kills the process in the container immediately thereby stopping all the running processing.&lt;br&gt;
When a process is kill via SIGKILL the exit code for the operation is 137&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Docker Summary</title>
      <dc:creator>Manish Mishra</dc:creator>
      <pubDate>Mon, 14 Nov 2022 07:27:01 +0000</pubDate>
      <link>https://www.debug.school/manishmishra26/docker-summary-469a</link>
      <guid>https://www.debug.school/manishmishra26/docker-summary-469a</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Docker&lt;/strong&gt;?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker is an container orchestration/management Tools.&lt;/li&gt;
&lt;li&gt;With Docker we can perform various management operations on 
containers such as create, start, stop, kill, restart.
&lt;strong&gt;Why Docker?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Buy creating containers using docker we can 

&lt;ul&gt;
&lt;li&gt;save cost - hardware requirement is minimal.&lt;/li&gt;
&lt;li&gt;save time - from provisioning to booting to management, the 
time taken is far less than that taken by VM's or physical 
machines.&lt;/li&gt;
&lt;li&gt;improve work quality - with the effective utilization of the 
resources and easy management of containers.
&lt;strong&gt;What is Container?&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Containers allow us to isolate kernel process and help us to run applications using images.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Docker workflow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker run - docker client - docker daemon - registry docker hub - image is pulled - container is created.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How container created?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker image parts - BOOT FS , ROOT FS , USERS , Applications&lt;/li&gt;
&lt;li&gt;Using the Docker base image, docker initializes namespaces and runs the application&lt;/li&gt;
&lt;/ul&gt;

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