<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Notes on mahroot's blog</title><link>https://mahroot.dev/ilt/</link><description>Recent content in Notes on mahroot's blog</description><generator>Hugo</generator><language>en-us</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Wed, 04 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://mahroot.dev/ilt/index.xml" rel="self" type="application/rss+xml"/><item><title>containerd vs OCI, and the k8s architecture</title><link>https://mahroot.dev/ilt/2026/03/04/04-03-26/</link><pubDate>Wed, 04 Mar 2026 00:00:00 +0000</pubDate><guid>https://mahroot.dev/ilt/2026/03/04/04-03-26/</guid><description>&lt;h1 id="what-is-the-different-between-containerd-and-oci-open-container-initiative"&gt;what is the different between containerd and OCI (open container initiative)&lt;/h1&gt;
&lt;p&gt;writing &amp;hellip;&lt;/p&gt;
&lt;h1 id="k8s-architecture"&gt;k8s architecture&lt;/h1&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260304201507.png" alt="Pasted image 20260304201507"&gt;&lt;/p&gt;
&lt;p&gt;thanks @djalal for explications &amp;lt;3
writing &amp;hellip;&lt;/p&gt;</description></item><item><title>Docker runtime stack, build cache and volumes</title><link>https://mahroot.dev/ilt/2026/03/03/03-03-2026/</link><pubDate>Tue, 03 Mar 2026 23:52:59 +0100</pubDate><guid>https://mahroot.dev/ilt/2026/03/03/03-03-2026/</guid><description>&lt;h1 id="docker-runtime-stack"&gt;Docker runtime stack&lt;/h1&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260303123027.png" alt="Pasted image 20260303123027"&gt;&lt;/p&gt;
&lt;h3 id="1--docker-cli"&gt;1- docker cli&lt;/h3&gt;
&lt;p&gt;translate commands to rest api and send it over unix socket&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker run ngnix &lt;span style="color:#f92672"&gt;===&lt;/span&gt;&amp;gt; POST /container/create &lt;span style="color:#f92672"&gt;{&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;Image&amp;#34;&lt;/span&gt;:&lt;span style="color:#e6db74"&gt;&amp;#34;nginx:latest&amp;#34;&lt;/span&gt;, ....&lt;span style="color:#f92672"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;===&lt;/span&gt;&amp;gt; sent to: /var/run/docker.sock
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;so we can talk to dockerd with it&lt;/p&gt;
&lt;p&gt;like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl --unix-socket /var/run/docker.sock http://localhost/containers/json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2--dockerd"&gt;2- dockerd&lt;/h3&gt;
&lt;p&gt;it&amp;rsquo;s an orchestrator&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;manage images (pull, build)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;manage volume (create net, mount)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;manage network (bridge creation, port mapping)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;docker run delegated to containerd not here&lt;/strong&gt; !!&lt;/p&gt;</description></item><item><title>Contains Duplicate (LeetCode 217)</title><link>https://mahroot.dev/ilt/2025/12/11/contains-duplicate-leetcode-217/</link><pubDate>Thu, 11 Dec 2025 00:42:08 +0100</pubDate><guid>https://mahroot.dev/ilt/2025/12/11/contains-duplicate-leetcode-217/</guid><description>&lt;h1 id="contains-duplicate-leetcode-217"&gt;Contains Duplicate (LeetCode 217)&lt;/h1&gt;
&lt;p&gt;the link of the problem &lt;a href="https://leetcode.com/problems/contains-duplicate/description/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Given an integer array &lt;code&gt;nums&lt;/code&gt;, return &lt;code&gt;true&lt;/code&gt; if any value appears &lt;strong&gt;at least twice&lt;/strong&gt; in the array, and return &lt;code&gt;false&lt;/code&gt; if every element is distinct.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;
&lt;strong&gt;Input:&lt;/strong&gt; nums = [1,2,3,1]
&lt;strong&gt;Output:&lt;/strong&gt; true
&lt;strong&gt;Explanation:&lt;/strong&gt;
The element 1 occurs at the indices 0 and 3.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;
&lt;strong&gt;Input:&lt;/strong&gt; nums = [1,2,3,4]
&lt;strong&gt;Output:&lt;/strong&gt; false
&lt;strong&gt;Explanation:&lt;/strong&gt;
All elements are distinct.
&lt;strong&gt;Example 3:&lt;/strong&gt;
&lt;strong&gt;Input:&lt;/strong&gt; nums = [1,1,1,3,3,4,3,2,4,2]
&lt;strong&gt;Output:&lt;/strong&gt; true&lt;/p&gt;</description></item><item><title>COMPUTER NETWORKS AND THE INTERNET</title><link>https://mahroot.dev/ilt/2025/10/14/computer-networks-and-the-internet/</link><pubDate>Tue, 14 Oct 2025 21:59:25 +0200</pubDate><guid>https://mahroot.dev/ilt/2025/10/14/computer-networks-and-the-internet/</guid><description>&lt;ul&gt;
&lt;li&gt;Our devices like PC, smartphones &amp;hellip; in the vocab of computer networks are called &amp;ldquo;hosts&amp;rdquo; or &amp;ldquo;end systems&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;the TCP and IP are the most important protocols in the computer networks that control the sending and receiving of information within the Internet&lt;/li&gt;
&lt;li&gt;TCP: &lt;strong&gt;T&lt;/strong&gt;ransmission &lt;strong&gt;C&lt;/strong&gt;ontrol &lt;strong&gt;P&lt;/strong&gt;rotocol.&lt;/li&gt;
&lt;li&gt;IP: &lt;strong&gt;I&lt;/strong&gt;nternet &lt;strong&gt;P&lt;/strong&gt;rotocol.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>The OS Manages The Hardware</title><link>https://mahroot.dev/ilt/2025/09/17/the-os-manages-the-hardware/</link><pubDate>Wed, 17 Sep 2025 17:09:33 +0200</pubDate><guid>https://mahroot.dev/ilt/2025/09/17/the-os-manages-the-hardware/</guid><description>&lt;h2 id="1-layered-view-of-a-computer-system"&gt;1) Layered view of a computer system&lt;/h2&gt;
&lt;p&gt;the os is a piece of software that is setting between the applications programs and the hardware&lt;/p&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020250917173342.png" alt="Pasted image 20250917173342"&gt;&lt;/p&gt;
&lt;p&gt;the role of the os is&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Protect the hardware from misuse by runaway the applications&lt;/li&gt;
&lt;li&gt;provide application with simple and uniform mechanisms&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="2-abstractions-provided-by-an-operating-system"&gt;2) Abstractions provided by an operating system&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;files&lt;/strong&gt; are abstraction for I/O devices
&lt;strong&gt;virtual memory&lt;/strong&gt; is an abstraction for the main memory + I/O devices
&lt;strong&gt;Processes&lt;/strong&gt; are abstraction for processor + main memory + I/O devices&lt;/p&gt;</description></item><item><title>Doubly Linked Lists</title><link>https://mahroot.dev/ilt/2025/09/08/doubly-linked-lists/</link><pubDate>Mon, 08 Sep 2025 23:23:40 +0200</pubDate><guid>https://mahroot.dev/ilt/2025/09/08/doubly-linked-lists/</guid><description>&lt;p&gt;In this blog we&amp;rsquo;ll see how we can implementing a doubly linked list
if you haven’t seen the Singly Linked List yet it&amp;rsquo;s better to check it &lt;a href="https://ayoubmah.github.io/ilt/2025/08/12/singly-linked-list/"&gt;here&lt;/a&gt; first, because the concept is almost the same with just a few changes.&lt;/p&gt;
&lt;p&gt;the main difference is in the node itself
this time a node referenced by the &lt;strong&gt;next&lt;/strong&gt; node and the &lt;strong&gt;prev&lt;/strong&gt; node
as you can see in this image&lt;/p&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/dob.jpeg" alt="dob"&gt;&lt;/p&gt;
&lt;p&gt;let&amp;rsquo;s implemented in java&lt;/p&gt;</description></item><item><title>Leet-Code-Day001</title><link>https://mahroot.dev/ilt/2025/09/04/leet-code-day001/</link><pubDate>Thu, 04 Sep 2025 23:34:00 +0200</pubDate><guid>https://mahroot.dev/ilt/2025/09/04/leet-code-day001/</guid><description>&lt;p&gt;you can see the problem here
&lt;a href="https://leetcode.com/problems/merge-two-sorted-lists/"&gt;Merge Two Sorted Lists&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The idea is that we have &lt;strong&gt;two sorted singly linked lists&lt;/strong&gt;
and we want &lt;strong&gt;a single merged linked list containing all the elements from the two original lists in sorted order&lt;/strong&gt; like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/WhatsApp%20Image%202025-09-04%20at%2011.50.26%20PM.jpeg" alt="WhatsApp Image 2025-09-04 at 11.50.26 PM"&gt;&lt;/p&gt;
&lt;p&gt;before looking at the steps of the solution, let&amp;rsquo;s see the implementation of the singly linked list with int value (you can see the generic version here &lt;a href="https://ayoubmah.github.io/ilt/2025/08/12/singly-linked-list/"&gt;Singularly Linked List&lt;/a&gt; )&lt;/p&gt;</description></item><item><title>Circularly Linked List</title><link>https://mahroot.dev/ilt/2025/09/04/circularly-linked-list/</link><pubDate>Thu, 04 Sep 2025 00:02:05 +0200</pubDate><guid>https://mahroot.dev/ilt/2025/09/04/circularly-linked-list/</guid><description>&lt;p&gt;Before to read about circularly linked lists i suggest to go to read bit about &lt;a href="https://ayoubmah.github.io/ilt/2025/08/12/singly-linked-list/"&gt;Singly Linked List&lt;/a&gt;, to better understanding circularly linked lists(CLL)&lt;/p&gt;
&lt;p&gt;so basically a CLL is a Singly linked list and instead of the its tail (last node of the list) point on null its point of the first element of the list (head). like this&lt;/p&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020250904001212.png" alt="Pasted image 20250904001212"&gt;&lt;/p&gt;</description></item><item><title>Singly Linked List</title><link>https://mahroot.dev/ilt/2025/08/12/singly-linked-list/</link><pubDate>Tue, 12 Aug 2025 00:00:00 +0000</pubDate><guid>https://mahroot.dev/ilt/2025/08/12/singly-linked-list/</guid><description>&lt;p&gt;Before you read this if you want a deep dive on Singly LinkedList and DSA with java in general please read the &amp;ldquo;Chapter 3. Fundamental Data Structures&amp;rdquo; p.122 by MICHEAL T.GOODRICH&lt;/p&gt;
&lt;h1 id="1-node"&gt;1. Node&lt;/h1&gt;
&lt;p&gt;First let&amp;rsquo;s define a node, so a node it&amp;rsquo;s a data structure that can store an object and point to another node&lt;/p&gt;
&lt;p&gt;like this
&lt;img src="https://mahroot.dev/images/Pasted%20image%2020250812133629.png" alt="Pasted image 20250812133629"&gt;&lt;/p&gt;
&lt;p&gt;we can define it in java like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Node&lt;/span&gt;&lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;E&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;private&lt;/span&gt; E data;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;private&lt;/span&gt; Node&lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;E&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt; next;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Node&lt;/span&gt;(E data){
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;this&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;data&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; data;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;this&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;next&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;null&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; E &lt;span style="color:#a6e22e"&gt;getData&lt;/span&gt;() {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; data;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;void&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;setData&lt;/span&gt;(E data) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;this&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;data&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; data;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; Node&lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;E&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;getNext&lt;/span&gt;() {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; next;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;void&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;setNext&lt;/span&gt;(Node&lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;E&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt; next) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;this&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;next&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; next;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;public&lt;/span&gt; String &lt;span style="color:#a6e22e"&gt;toString&lt;/span&gt;(){
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;(&amp;#34;&lt;/span&gt;&lt;span style="color:#f92672"&gt;+&lt;/span&gt;data&lt;span style="color:#f92672"&gt;+&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;) =&amp;gt;(null)&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see in the code, the constructor of the Node initializes the next pointer to null, which is what we want.&lt;/p&gt;</description></item></channel></rss>