<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emad Anwer on Medium]]></title>
        <description><![CDATA[Stories by Emad Anwer on Medium]]></description>
        <link>https://medium.com/@emadanwer.official?source=rss-f0161575cfd6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CK2r9tBzJTX9DkWfoTFR3g.jpeg</url>
            <title>Stories by Emad Anwer on Medium</title>
            <link>https://medium.com/@emadanwer.official?source=rss-f0161575cfd6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:01:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emadanwer.official/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Journey to visit google.com]]></title>
            <link>https://medium.com/@emadanwer.official/journey-to-visit-google-com-2f589c36631b?source=rss-f0161575cfd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f589c36631b</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Emad Anwer]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 12:41:39 GMT</pubDate>
            <atom:updated>2023-10-15T12:41:39.126Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, Everyone, this is Emad, a student at ALX, interested in Backend technologies, today I would like to share with you what happens when you visit your favorite search engine <a href="https://www.google.com/">google.com</a>, let’s start.</p><h3>From google.com to https://www.google.com/</h3><p>when you type google.com into your browser’s address bar it automatically adds the “https://” and “www” to the URL, to ensure that the connection is secure, now our URL is ready,</p><p>So, let’s give each part a name on the URL a name in case you want to know more about it,</p><blockquote>https -&gt; <strong>protocol</strong></blockquote><blockquote>www -&gt; <strong>Subdomain</strong></blockquote><blockquote>google -&gt; <strong>Domain</strong></blockquote><blockquote>com -&gt; <strong>Top-Level Domain (TLD)</strong></blockquote><blockquote>Me: so now I have my URL, everything is ready give me google.com<br>Browser: not yet :)</blockquote><p>in order to communicate via the Internet you have to use a protocol</p><blockquote><strong><em>what is the protocol?</em></strong></blockquote><blockquote>A protocol is a set of rules and conventions that dictate how data is transmitted and received between devices or systems in a network, ensuring effective communication.</blockquote><p>we have to use <strong>IP (Internet Protocol)</strong> to connect the devices together, while you read this article you have a mobile phone or laptop or whatever device this device connected to your router using an IP address</p><blockquote>An <strong>IP (Internet Protocol) </strong>address is a unique numerical label assigned to each device on a network.</blockquote><p>when you go outside your local network to connect to google.com or whatever you have to have an <strong>IP address </strong>and also you have to know your target<strong> IP address </strong>in our case we have to know<strong> Google’s IP address </strong>to reach it.</p><h4>What does the IP address look like?</h4><blockquote><strong>there are two main formats:</strong></blockquote><blockquote>IPv4 (Internet Protocol version 4) ex: 192.168.0.1</blockquote><blockquote>IPv6 (Internet Protocol version 6) ex: 2001:0db8:85a3:0000:0000:8a2e:0370:7334</blockquote><p>you can read more about it <a href="https://en.wikipedia.org/wiki/IP_address"><strong>here</strong></a><strong> we </strong>will stick to this IPv4 for now</p><p>so, for example, my IP is 203.0.113.55 to connect to Google for example 172.217.6.238, we have some problems and things to explain.</p><p>1- as I said we have to have the <strong>IP address</strong> of the targeted website <em>google.com</em> or <em>https://www.google.com does not look like </em>IPv4 or IPv6 so we need IP to reach the target.</p><p>2- also if we have the <strong>IP address </strong>of our target we will not remember it.</p><p>3- if for any reason the owner of this website wants to change this <strong>IP address, </strong>How will he inform you of this?</p><h3>The magic of (DNS Domain Name System)</h3><h4>What is DNS?</h4><p><strong>it’s the phonebook of the Internet</strong>, we as humans can easily remember google.com or wikipedia.org but it’s hard to remember 172.217.6.238 or 203.0.113.55, by using DNS when we want to connect to google.com <strong>“readable domain names”</strong> it gives us the IP address <strong>“machine-readable address”</strong>, let’s explain it more.</p><h4>How DNS works?</h4><p>when you type <a href="https://www.google.com/">https://www.google.com/</a> on the browser’s address bar and press Enter, The browser needs to know the IP address of the server hosting that website to establish a connection.</p><p>google -&gt; <strong>Domain name</strong></p><p>com -&gt; <strong>Top-Level Domain (TLD)</strong></p><ul><li>The browser checks its cached website IP addresses, If the IP address is found we are done, it will skip the DNS process.</li><li>If the IP address is not found in the browser’s cache, the browser may check the operating system’s DNS cache.</li></ul><p>since they didn’t find google.com</p><p><strong>The Browser contacts the DNS Resolver</strong>, The DNS resolver is a server run by your internet service provider (ISP) or a public DNS service like Google’s DNS (8.8.8.8). The DNS resolver checks its own cache. If the resolver has the IP address for the requested domain, it sends it back to the browser. If not, it continues the DNS process.</p><p>The <strong>DNS resolver</strong> may not have the IP address for “google.com” in its cache, so it initiates a <strong>recursive proces</strong>s. It queries the <strong>root DNS servers</strong> to find the authoritative DNS servers for the <strong>“.com”</strong> top-level domain.</p><p>The root <strong>DNS servers</strong> <em>direct </em>the <strong>resolver </strong>to the <strong>authoritative DNS servers</strong> for the <strong>“.com”</strong> domain, These servers hold the specific DNS records for “google.com”</p><p>The <strong>authoritative DNS servers</strong> for “google.com” provide the <strong>IP address</strong> associated with “google.com” to the resolver.</p><p>The <strong>DNS resolver</strong> receives the <strong>IP address</strong> and sends it back to the user’s browser.</p><blockquote>you can check <a href="https://howdns.works/"><strong>this</strong></a><strong> website to have a fun and colorful explanation of how DNS works.</strong></blockquote><h3>The magic of Using (Load Balancer)</h3><blockquote>Me: so now I have the IP address of google.com</blockquote><blockquote>Browser: Yes now I’m ready to connect to google.com let’s connect to 172.217.6.238</blockquote><blockquote>“the browser doesn’t rewrite the IP address it keeps google.com in the address bar to keep it clean for the user but it established the connection using the IP address of google.com ex 172.217.6.238”</blockquote><p>usually, the reserved IP address is not the IP address of the server that holds the content of google.com or whatever website you want to reach, usually, it’s the IP address of the <strong>Load balancer, </strong>and the load balancer will redirect<strong> </strong>your <strong>request</strong> to an appropriate server that can handle it, so let’s talk a little bit about <strong>what is a Load balancer and why we need it.</strong></p><p>let’s assume we don’t have a load balancer and our server can handle 10k requests and we have a lot of requests, what we can do?</p><p>assume we upgrade the server and the server can handle 50k requests, it was the maximum upgrade we can do, our website went viral and we want to handle more than 200k requests, also you think about if the server is down for any reason, we will not serve any more clients,</p><p>someone came up with a good idea Why not have more than one server, if one server is down we can serve the clients using another one also if we have more clients why not have more servers, this idea of having more servers to manage the load leads us to use load balancer</p><h4><strong>What is the load balancer?</strong></h4><p>A load balancer is a network device or software component that evenly distributes incoming web traffic and user requests across multiple servers. It enhances the availability, scalability, and performance of web applications by preventing the overloading of any single server, ensuring high availability, and optimizing the distribution of traffic to backend servers. Load balancers play a vital role in modern web infrastructure, making websites and online services more reliable and responsive.</p><blockquote>Me: so now you have the load balancer IP let’s connect to google.com</blockquote><blockquote>Browsers: yes let’s connect to <a href="https://www.google.com/">https://www.google.com/</a> we have to handske the server firts then send and reseive requests and resopnses</blockquote><h3>High-Level Overview of HTTPS and the Handshake Process</h3><p>HTTPS, or Hypertext Transfer Protocol Secure, is a critical technology that secures your online communication. At its core, it ensures that when you visit a website, the information exchanged between your web browser and the site’s server is shielded from prying eyes.</p><p>The process begins with a TLS Handshake, also known as an SSL Handshake. This handshake is like a secret handshake between your browser and the web server, creating a secure environment for your data.</p><ol><li><strong>Client and Server Introduction:</strong> Your browser sends a “Hello” message to the web server, announcing its presence and the encryption methods it supports. The server responds in kind, selecting the best encryption method they both can understand.</li><li><strong>Key Exchange:</strong> Think of this as a secure key swap. Your browser and the server exchange keys that only they can understand. These keys are used to encrypt and decrypt your data, ensuring that no one in between can read it.</li><li><strong>Authentication:</strong> The server proves its identity to your browser by presenting a digital certificate. Your browser checks this certificate to ensure it’s valid, preventing any impersonation attempts.</li><li><strong>Confirmation:</strong> Both your browser and the server confirm that they’re ready to securely communicate. The handshake is successful, and your data can now be transmitted in a secure, encrypted manner.</li><li><strong>Secure Communication: </strong>With the handshake complete, all data sent between your browser and the server is protected. It’s like speaking in a secret language that only your browser and the server understand.</li></ol><p>so after the Handshake Process, we have a TCP connection open between the browser and the server</p><h3><strong>Let’s quickly recap what happened</strong></h3><ul><li>You write <strong>googe.com</strong> into the user browser address bar and press <strong>Enter</strong></li><li>your browsers added the protocol automatically because It didn’t exist</li><li>The browser looks for google.com locally if it&#39;s not found it will make a DNS query to get the IP address of google.com</li><li>Now we have the IP address of the load balancer, it will redirect the connection to the server using its IP address.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*1s8ubDoPvFigmBK37Y-voA.png" /><figcaption><strong>a simple diagram explains what happened</strong></figcaption></figure><blockquote>I don’t want to make this article long so I will go very quick, in this section</blockquote><p>The first point of contact is the <strong>Web Server</strong>, It receives the user’s request and retrieves the necessary web pages, at the end of our URL if you noted there was a “/” it means I want to root page or the first configured page of google.com, the web server can serve it back to user, but maybe there some logic like user data or whatever so this page is not a static page, it’s dynamically changed so here is the role of</p><p><strong>Application Server, </strong>The application server manages the business logic and dynamic content of the website. It processes user requests, interacts with databases, and generates responses. For Google, this includes complex algorithms for search queries.</p><p>The <strong>Application Server </strong>may want to read data or save “write” data so it should save have <strong>database</strong>,</p><p>The <strong>Database </strong>stores and manages the vast amounts of data required for the website’s functionality. In Google’s case, it stores indexes of web pages, search history, and user preferences.</p><p>here we are at the end of the article I really enjoyed it while I wrote it, I hope you like it and feel free to contact me, if there is a mistake or something to improve</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f589c36631b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memory leak and the delivery guy ‍⚕️]]></title>
            <link>https://medium.com/@emadanwer.official/memory-leak-and-the-delivery-guy-%EF%B8%8F-3678e402cfa0?source=rss-f0161575cfd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3678e402cfa0</guid>
            <dc:creator><![CDATA[Emad Anwer]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 22:33:19 GMT</pubDate>
            <atom:updated>2023-07-06T22:33:19.527Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Lod_LrbLdxcnfnxw5M6Ngw.jpeg" /></figure><ul><li><strong>What is Memory leak ?</strong></li><li><strong>How to avoid ?</strong></li></ul><h3>story time ⏲️✨</h3><p>Emad works as a delivery guy 🛵👨‍⚕️, his boss told him “ be ready you have an order”, Emad go and run 🔥his motorcycle after 3min, his boss told him “the order cancelled” ❌, Emad says okay and he forgot about the motorcycle 🔥<br>after 1h Emad gets another order his motorcycle 🛵was ready ✅…. but on the half of the way the fuel tank is empty 📛, He couldn’t deliver the order in time because it was ice cream 🍦 and it melted 🫠 , he got fired from his job 🥲</p><h3><strong>What is Memory leak ?</strong></h3><p>The <a href="https://www.linkedin.com/feed/hashtag/?keywords=memory&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#Memory</a> looks like a Fuel ⛽️it is a limited resource you have to <a href="https://www.linkedin.com/feed/hashtag/?keywords=allocate&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#allocate</a> it when needed also if you <a href="https://www.linkedin.com/feed/hashtag/?keywords=allocate&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#allocate</a> it and not longer needed it so you have to <a href="https://www.linkedin.com/feed/hashtag/?keywords=free&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#free</a> it to be ready for the next allocation, even if you don’t need it maybe another program need it ✅</p><p>so simple (Memory leak) is wasting of memory when you have a bad📛memory <a href="https://www.linkedin.com/feed/hashtag/?keywords=allocations&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#allocations</a> with out freeing it 🆓 to avoid this you have to <a href="https://www.linkedin.com/feed/hashtag/?keywords=free&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#free</a> the memory when you aren’t longer need this amount of <a href="https://www.linkedin.com/feed/hashtag/?keywords=allocated&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7054269102810365952">#allocated</a> memory ✅</p><h3><strong>How to avoid ?</strong></h3><p>here is an example of bad 📛 memory practice</p><pre>#include &lt;stdlib.h&gt;<br><br>void f(int n) {<br>char *str = (char*)malloc(n * sizeof(char)); <br>do_some_work(str);<br>/*work done */<br>return;<br>}</pre><p>here is an example of good✅ memory practice</p><pre>#include &lt;stdlib.h&gt;<br><br>void f(int n) {<br>char *str = (char*)malloc(n * sizeof(char)); <br>do_some_work(str); /*work done */<br>free(str);<br>return;<br>}</pre><p>at the end I wish you get the idea about the memory leaking if you want to learn more about its concept check this</p><p><strong>resources</strong></p><ul><li><a href="https://www.geeksforgeeks.org/what-is-memory-leak-how-can-we-avoid/">What is Memory Leak? How can we avoid? - GeeksforGeeks</a></li><li><a href="https://www.scaler.com/topics/memory-leak-in-c/">What is Memory Leak in C? | Scaler Topics</a></li><li><a href="https://en.m.wikipedia.org/wiki/Memory_leak">Memory leak - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3678e402cfa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Fix “Python.h not found”]]></title>
            <link>https://medium.com/@emadanwer.official/how-to-fix-python-h-not-found-909a552e84d?source=rss-f0161575cfd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/909a552e84d</guid>
            <dc:creator><![CDATA[Emad Anwer]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 15:10:08 GMT</pubDate>
            <atom:updated>2023-06-12T22:14:24.327Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Chat GPT</h4><h4>This is how an error looks like..</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*V1AiDG4EcoINbb9NW7-0RA.png" /></figure><blockquote>it means gcc can’t find the “Python.h” library to compile your code.</blockquote><p>I did a lot of search on google it didn&#39;t solve it, so i asked chat GPT his answer solved my problem, his answer was very close to the previous answers</p><h3>Why these answers did not works?</h3><p>I forgot to <strong>“update the package list</strong>s” and all articles I saw before didn’t mention this also, maybe you installed <strong>“Python.h”</strong> library in <strong>“non-standard location”</strong>.</p><p>so now I will share with you chat GPT answers to solve this problem you can use someone else article to get the commands for your destruction, on my situation was <strong>Ubuntu 20.04.5 LTS</strong></p><h3>Chat GPT Answers</h3><h4>first answer</h4><p>If you’re encountering the error message “Python.h not found” on Ubuntu 20.04.5 LTS, it means that the development files for Python are missing. The “Python.h” file is part of the Python development package, which is required for compiling and linking Python extension modules.</p><p>To resolve this issue, you can install the necessary packages by following these steps:</p><ul><li>Open a terminal window.</li><li>Update the package lists by running the following command:</li></ul><pre>sudo apt update</pre><ul><li>Install the Python development package along with the required build tools:</li></ul><pre>sudo apt install python3-dev build-essential</pre><p>This command installs the “python3-dev” package, which includes the “Python.h” file, and the “build-essential” package, which includes the necessary build tools like the C compiler.</p><ul><li>Wait for the installation to complete.</li><li>After the installation finishes, you can try compiling or linking Python extension modules again, and the “Python.h not found” error should no longer appear.</li></ul><h4>second answer</h4><p>If you’re still encountering the “Python.h: No such file or directory” error even after installing the required packages, it’s possible that the Python development headers are installed in a non-standard location.</p><p>To address this issue, you can try the following steps:</p><ul><li>Determine the version of Python you are using by running the command:</li></ul><pre>python3 --version</pre><p>Make a note of the Python version, for example, `3.8`.</p><ul><li>Check if the `python3.x-dev` package is installed, replacing `x` with the minor version number of Python you noted in the previous step. Run the following command:</li></ul><pre>dpkg -l | grep python3.x-dev</pre><p>If it doesn’t return any output, the package is not installed. In that case, proceed to the next step. If it does return output, skip to step 4.</p><ul><li>Install the `python3.x-dev` package by running the following command, replacing `x` with the minor version number of Python you noted earlier:</li></ul><pre>sudo apt install python3.x-dev</pre><p>If the `python3.x-dev` package is already installed, you need to locate the `Python.h` file manually. Run the following command to search for the file:</p><pre>sudo find /usr -name Python.h</pre><ul><li>If the `Python.h` file is found, note the directory where it is located. It could be something like `/usr/include/python3.x` or `/usr/include/python3.xm`, where `x` is the major version number and `m` is the minor version number.</li><li>Set the appropriate include path for the `Python.h` file. Open the terminal and run the following command, replacing the path with the one you found in the previous step:</li></ul><pre>export C_INCLUDE_PATH=/path/to/Python.h</pre><pre>export C_INCLUDE_PATH=/usr/include/python3.x</pre><ul><li>Now try compiling or linking the Python extension modules again. The error message should no longer appear.</li></ul><p>By following these steps, you should be able to resolve the “Python.h: No such file or directory” error and successfully compile or link Python extension modules on your Ubuntu system.</p><p>That&#39;s it for todays article about see you in the next articles Happy Coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=909a552e84d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>