<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Systems on Mmoumni</title><link>https://mmoumni.com/categories/systems/</link><description>Recent content in Systems on Mmoumni</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 15 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://mmoumni.com/categories/systems/index.xml" rel="self" type="application/rss+xml"/><item><title>FluentPython - DataModel</title><link>https://mmoumni.com/posts/fluent-python-datamodel/</link><pubDate>Sun, 15 Mar 2026 00:00:00 +0000</pubDate><guid>https://mmoumni.com/posts/fluent-python-datamodel/</guid><description>&lt;p&gt;Every Python object consists of specific methods called magic methods or dunder methods.
These methods allow your custom objects to interact with fundamental language constructs like collections, iteration, and operator overloading.&lt;/p&gt;
&lt;p&gt;For example: &lt;code&gt;len&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The len function is the result of implementing the &lt;strong&gt;len&lt;/strong&gt; magic method.&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-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; collections
&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;Card &lt;span style="color:#f92672"&gt;=&lt;/span&gt; collections&lt;span style="color:#f92672"&gt;.&lt;/span&gt;namedtuple(&lt;span style="color:#e6db74"&gt;&amp;#39;Card&amp;#39;&lt;/span&gt;, [&lt;span style="color:#e6db74"&gt;&amp;#39;rank&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;suit&amp;#39;&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;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;FrenchDeck&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ranks &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [str(n) &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; n &lt;span style="color:#f92672"&gt;in&lt;/span&gt; range(&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;, &lt;span style="color:#ae81ff"&gt;11&lt;/span&gt;)] &lt;span style="color:#f92672"&gt;+&lt;/span&gt; list(&lt;span style="color:#e6db74"&gt;&amp;#39;JQKA&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; suits &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;spades diamonds clubs hearts&amp;#39;&lt;/span&gt;&lt;span style="color:#f92672"&gt;.&lt;/span&gt;split()
&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;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;__init__&lt;/span&gt;(self):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;_cards &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [Card(rank, suit) &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; suit &lt;span style="color:#f92672"&gt;in&lt;/span&gt; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;suits
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; rank &lt;span style="color:#f92672"&gt;in&lt;/span&gt; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;ranks]
&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;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;__len__&lt;/span&gt;(self):
&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; len(self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;_cards)
&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;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;__getitem__&lt;/span&gt;(self, position):
&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; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;_cards[position]
&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;deck &lt;span style="color:#f92672"&gt;=&lt;/span&gt; FrenchDeck()
&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;print(len(deck)) &lt;span style="color:#75715e"&gt;## 52&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;print(deck[&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;]) &lt;span style="color:#75715e"&gt;## Card(rank=&amp;#39;4&amp;#39;, suit=&amp;#39;spades&amp;#39;)&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;Those methods are meant to be called by the Python interpreter, not by the programmer. If you implement the &lt;strong&gt;len&lt;/strong&gt; method, you should call len(my_obj) directly — it will automatically invoke &lt;strong&gt;len&lt;/strong&gt; through the interpreter.&lt;/p&gt;</description></item><item><title>ft_nmap</title><link>https://mmoumni.com/projects/ft_nmap/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://mmoumni.com/projects/ft_nmap/</guid><description>&lt;h1 id="ft_nmap"&gt;ft_nmap&lt;/h1&gt;
&lt;p&gt;A small project that re-implements parts of an &lt;code&gt;nmap&lt;/code&gt;-style port scanner in C. The goal is educational: to understand how a port scanner works (socket usage, scan strategies, parallelism, parsing IP lists, etc.) and to produce a compact, self-contained scanner executable.&lt;/p&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;In this project, I re-coded a part of the nmap port scanner to deepen my understanding of network scanning techniques, socket programming, and low-level networking concepts.&lt;/p&gt;
&lt;h2 id="features"&gt;Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;TCP port scanning over a range of ports&lt;/li&gt;
&lt;li&gt;Processing multiple IPs from a file&lt;/li&gt;
&lt;li&gt;Modular architecture with separate components for scanning, parsing, and network mapping&lt;/li&gt;
&lt;li&gt;CLI binary implemented in C&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="technologies-used"&gt;Technologies Used&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;C&lt;/strong&gt; - Core implementation language&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Socket Programming&lt;/strong&gt; - Raw sockets and network communication&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make&lt;/strong&gt; - Build system&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="repository"&gt;Repository&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/Mohamed-Moumni/ft_nmap"&gt;View on GitHub&lt;/a&gt;&lt;/p&gt;</description></item><item><title>ft_ping</title><link>https://mmoumni.com/projects/ft_ping/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://mmoumni.com/projects/ft_ping/</guid><description>&lt;h1 id="ft_ping"&gt;ft_ping&lt;/h1&gt;
&lt;p&gt;A complete reimplementation of the &lt;code&gt;ping&lt;/code&gt; command in C, built to understand how network diagnostics work at a low level. This project dives deep into the ICMP protocol, raw sockets, and the fundamentals of network programming.&lt;/p&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ping&lt;/code&gt; command is a network administration utility used to test the reachability of a host on a network. Reimplementing it from scratch provides invaluable insights into how network protocols operate, how packets are constructed and sent, and how the operating system handles network communication.&lt;/p&gt;</description></item></channel></rss>