<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Basics on mahroot's blog</title><link>https://mahroot.dev/tags/basics/</link><description>Recent content in Basics 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>Thu, 19 Mar 2026 23:33:57 +0100</lastBuildDate><atom:link href="https://mahroot.dev/tags/basics/index.xml" rel="self" type="application/rss+xml"/><item><title>Day 0 - linux primitives that make k8s possible</title><link>https://mahroot.dev/posts/day-0---linux-primitives-that-make-k8s-possible/</link><pubDate>Thu, 19 Mar 2026 23:33:57 +0100</pubDate><guid>https://mahroot.dev/posts/day-0---linux-primitives-that-make-k8s-possible/</guid><description>&lt;h2 id="so-what-what-happen-when-we-install-k8s-"&gt;so what what happen when we install k8s ?&lt;/h2&gt;
&lt;p&gt;when we install k8s actually we get this processes
we can separate them logically (they are not separated physically like not namespaces or something)
they are just have a different roles :&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Our Physical Machine (or VM)
│
├── Control plan processes ← just Linux processes
│ ├── etcd (a process)
│ ├── kube-apiserver (a process)
│ ├── kube-scheduler (a process)
│ └── kube-controller-manager (a process)
│
└── Worker Node processes ← also just Linux processes
 ├── kubelet (a process)
 ├── kube-proxy (a process)
 └── containerd (a process)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="so-what-is-a-node-"&gt;so what is a node ?&lt;/h2&gt;
&lt;p&gt;a node it&amp;rsquo;s just a machine (VM/ cloud instance) that k8s know about it and can schedule a work onto it&lt;/p&gt;</description></item><item><title>etcd</title><link>https://mahroot.dev/posts/day-1---etcd/</link><pubDate>Thu, 19 Mar 2026 23:31:51 +0100</pubDate><guid>https://mahroot.dev/posts/day-1---etcd/</guid><description>&lt;h1 id="setup"&gt;setup&lt;/h1&gt;
&lt;p&gt;i have 3 VMs: vm1, vm2 and vm3&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Node&lt;/th&gt;
 &lt;th&gt;IP Address&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;node1&lt;/td&gt;
 &lt;td&gt;172.31.253.147&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;node2&lt;/td&gt;
 &lt;td&gt;172.31.250.205&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;node3&lt;/td&gt;
 &lt;td&gt;172.31.253.194&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260319171638.png" alt="Pasted image 20260319171638"&gt;&lt;/p&gt;
&lt;h1 id="step1-install-etcd-on-all-3-nodes-and-create-the-data-dir"&gt;step1: Install etcd on ALL 3 Nodes and create the data dir&lt;/h1&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260319171828.png" alt="Pasted image 20260319171828"&gt;&lt;/p&gt;
&lt;p&gt;let&amp;rsquo;s verify the version and create the data directory
&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260319171932.png" alt="Pasted image 20260319171932"&gt;&lt;/p&gt;
&lt;h1 id="step2-create-the-etcd-systemd-service"&gt;step2: Create the etcd systemd Service&lt;/h1&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020260319172432.png" alt="Pasted image 20260319172432"&gt;&lt;/p&gt;
&lt;p&gt;we do the same thing for other VMs changing just the ip add
for example for node1&lt;/p&gt;</description></item><item><title>Part 1 - Building a Mini Spring Framework (v0.1)-Dependency Injection Basics</title><link>https://mahroot.dev/posts/part-1---building-a-mini-spring-framework-v0.1-dependency-injection-basics/</link><pubDate>Wed, 10 Dec 2025 23:14:46 +0100</pubDate><guid>https://mahroot.dev/posts/part-1---building-a-mini-spring-framework-v0.1-dependency-injection-basics/</guid><description>&lt;h1 id="the-problem-spring-solves"&gt;The problem Spring solves&lt;/h1&gt;
&lt;p&gt;easy right ?
let&amp;rsquo;s see :)&lt;/p&gt;
&lt;p&gt;imagine you are building an e-commerce backend, and you have OrderService that needs to process payments&lt;/p&gt;
&lt;p&gt;the naive approach is: inside the OrderService you write for example&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;PaymentProcess process &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;new&lt;/span&gt; PaypalService();
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;if your boss comes and says &amp;ldquo;we&amp;rsquo;re switching the contract from PayPal to Stripe&amp;rdquo; what do you have to do to your code?&lt;/p&gt;
&lt;p&gt;The answer is use an interface&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;interface&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;PaymentProcess&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	&lt;span style="color:#66d9ef"&gt;void&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;pay&lt;/span&gt;(&lt;span style="color:#66d9ef"&gt;double&lt;/span&gt; amount);
&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;and the OrderService looks like&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>Collection Interface</title><link>https://mahroot.dev/posts/collection-interface/</link><pubDate>Tue, 14 Oct 2025 01:15:28 +0200</pubDate><guid>https://mahroot.dev/posts/collection-interface/</guid><description>&lt;p&gt;the collection interface extends Iterable interface from java.lang
we have a method
&lt;strong&gt;boolean add(E e)&lt;/strong&gt; that return true if the collection changed (the elem e added) and false if not
&lt;strong&gt;boolean addAdd(Collection &amp;lt; ? extends E&amp;gt; c)&lt;/strong&gt; , that take a collection of type E of subtype of E and return true if the collection changed (all elm added)&lt;/p&gt;
&lt;p&gt;So if you have a &lt;code&gt;Collection&amp;lt;Animal&amp;gt;&lt;/code&gt; and another &lt;code&gt;Collection&amp;lt;Dog&amp;gt;&lt;/code&gt;,&lt;br&gt;
you can add the &lt;code&gt;Dog&lt;/code&gt;s into the &lt;code&gt;Animal&lt;/code&gt; collection because &lt;code&gt;Dog&lt;/code&gt; &lt;strong&gt;extends&lt;/strong&gt; &lt;code&gt;Animal&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Create My Own JCF-week1</title><link>https://mahroot.dev/posts/create-my-own-jcf-week1/</link><pubDate>Sat, 11 Oct 2025 00:59:35 +0200</pubDate><guid>https://mahroot.dev/posts/create-my-own-jcf-week1/</guid><description>&lt;h3 id="jcf-java-collection-framework-hierarchy"&gt;JCF: Java Collection Framework Hierarchy&lt;/h3&gt;
&lt;p&gt;&lt;img src="https://mahroot.dev/images/Pasted%20image%2020251014010626.png" alt="Pasted image 20251014010626"&gt;&lt;/p&gt;
&lt;p&gt;_Bfore starting implementing JCF should you know the Iterable&lt;E&gt; interface&lt;/p&gt;
&lt;h1 id="1-iterable"&gt;1. Iterable&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Iterable interface is a builtin interface in java it allow us using &amp;ldquo;for-each&amp;rdquo; loop thanks to Iterator method&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;let&amp;rsquo;s take an example
if you work with arrays in java and suppose you create an new array&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;int&lt;/span&gt;&lt;span style="color:#f92672"&gt;[]&lt;/span&gt; arr &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;new&lt;/span&gt; Interger&lt;span style="color:#f92672"&gt;[]&lt;/span&gt;{1,2,3}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and you want to make the forEach loop like this &lt;code&gt;for(int n : arr)&lt;/code&gt; =&amp;gt; this will give you a compiler error&lt;/p&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></channel></rss>