<?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 Luis Enrique Sanjuan Melo on Medium]]></title>
        <description><![CDATA[Stories by Luis Enrique Sanjuan Melo on Medium]]></description>
        <link>https://medium.com/@luiscode92?source=rss-88050d08a0d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K0f7-1qGXSor8edJCl_Zrw.jpeg</url>
            <title>Stories by Luis Enrique Sanjuan Melo on Medium</title>
            <link>https://medium.com/@luiscode92?source=rss-88050d08a0d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:37:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luiscode92/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[What happens when you type https://www.holbertonschool.com in your browser and press 'Enter']]></title>
            <link>https://medium.com/@luiscode92/what-happens-when-you-type-https-www-holbertonschool-com-in-your-browser-and-press-enter-27027ad67cd2?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/27027ad67cd2</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 16:56:54 GMT</pubDate>
            <atom:updated>2020-08-23T17:17:02.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wyeu2H_doqQx2WkY8l96zg.jpeg" /></figure><p>We use the internet for almost everything, it has become a natural behavior since the early browsers and all-in-one platforms like AOL back in the 90s to the social network and IoT boom.<br>It has evolved from a trend the state of the art of the world by 2020, it rules the global economy, and anything would work properly without it.<br>This socio-economic change is supported on a very simple but powerful idea to connects people through a “web page”.<br>I will address this idea in this article, get ready for this amazing story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AedqNyipjlKfnXsFNq8Kyw.png" /></figure><h3>The client-server model</h3><p>Many have been the types of web infrastructure used along the way, but in 2020 de client-serves model is the most used around the world. In this model, the <strong>clients </strong>request the data from the user, could be a web-app or a mobile app, and the <strong>server</strong>, stores, manages, and process the data.</p><p>There are several layers between the <strong>client</strong> and the <strong>server, </strong>lets break it down this layer.</p><h3>The DNS request</h3><p>When we type <a href="https://www.holbertonschool.com/">https://www.holbertonschool.com</a> into our browser, the first thing that the browser does is split the URL into pieces. it considers the <a href="http://www.holbertonschool.com/">www.holbertonschool.com</a> the first part, it’s the <strong>Domain name. </strong>If the browser doesn’t know the domain name( it’s not stored in its cache). it is going to ask the <strong>Domain Name System </strong>for the IP address corresponding to its particular domain name.<br>The IP address is actually the real address of the main server hosting the website</p><blockquote>The IP is a suite of four numbers ranging from 0 to 255, separated by dots.</blockquote><p>The reason we have domain names in the first place is that humans remember words better than numbers.</p><h3>Protocols: TCP/IP</h3><p>We mentioned how domain names actually represent IP addresses, but IP is not the only type of protocol used by the internet. The <strong>Internet Protocol Suite </strong>is often referred to as TCP/IP(TCP stand for transmission control protocol), and it also contains other types of protocols. ITa a set of rules that define how servers and clients interact over the network, and how data would be transferred, broken into packets, received, etc.</p><h3>The Firewall</h3><p>to protect themselves from hackers and attacks, servers are often equipped with a firewall. A firewall is a software that sets rules about what can enter or leave a part of a network. In the case of our example, when the browser ask for the website at the address 35.196.114.247, that request has been processed by a firewall which will decide if it&#39;s safe, or if its a thread to the server’s security.<br>the browser can also have a firewall to detect if the IP given by the DNS request is a potential malicious agent.</p><h3>Security and Encryption: HTTPS/SSL</h3><p>Now that the browser has the IP address, it is going to take care of the other part of the URL, the “ https:// ” https stands for “Hypertext Transfer Protocol Secure”, it is a more secure version fo the HTTP. This transfer protocol defines different types of requests and responses served to clients and serves over a network.<br>These requests include GET, PUT POST, and others, they are the main way of transfer data between the browser and the web page.</p><p>The other key component ins secure websites is the SSL certificate. SSL stands for “Secure Sockets Layer”. The certificate needs to be issued from a trusted Certificate authority, like the Let’s Encrypt, when a website has this certificate we can see a lock icon next to the website name in the search bar.</p><h3>Load-balancer</h3><p>As websites live on servers. For most websites is impossible to be hosted on a single server, this is also dangerous and would create a Single Point of Failure(SPOF) because it would be easy for a hacker to take the whole place down.</p><h3>The web server</h3><p>Once the requests are distributed to the serves, they will be processed by one or more web servers. A web server is a software program that serves static content, like simple HTML pages or images.<br>The main web servers are Nginx or Apache. The web server is responsible for finding the static content corresponding to the address asked for is living, and serving it as an HTTPS response.</p><h3>The Application server</h3><p>Most websites are <strong>dynamic</strong>. That means that it’s possible to interact with the site, save the information into it, log in with a user name and a password, etc.</p><p>This is possible by using application serves. This software is responsible for operating web apps, communicate with databases, and manages user info.<br>They work behind web servers and will be able to serve dynamic applications using static content from the webserver.</p><h3>The Database</h3><p>A Database is a collection of data. It is accessible by a <strong>Data Base Manager System (DBMS)</strong> which is the program that interacts with de database in order to retrieve, add, modify data in it.</p><p>There are several types of databases. The main ones are Relational databases and Non-relational databases, In The Relational database the data is organized in tables representing objects where each column is an attribute and each row is an instance of that object. A Non-Relational database organized data in collections but the insertion has not a particular schema. They are called NoSQL databases.</p><p>This is just the surface of the layers of the web stack. I encourage you to keep learning and studying about how everything happens behind the scenes of a web browser.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27027ad67cd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mutable, Immutable… Everything is an Object!]]></title>
            <link>https://medium.com/@luiscode92/mutable-immutable-everything-is-an-object-5fd175b6b037?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fd175b6b037</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[c]]></category>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Thu, 28 May 2020 04:23:09 GMT</pubDate>
            <atom:updated>2020-05-28T04:28:35.816Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hLSC-U5y3j9uAUYXfdzmg.png" /></figure><h3>Introduction</h3><p>In this post, we are going to talk about important functions in python, and about the differences in how C programing language and python manage storage.</p><h3>ID and Type</h3><p>They are very important functions in python</p><p>id() -&gt; is a builtin that returns an object identifier, this function helps us check if we are recreating an object, or checking a new me</p><pre>&gt;&gt;&gt; a = 98<br>&gt;&gt;&gt; b = 98<br>&gt;&gt;&gt; id(a)<br>101020<br>&gt;&gt;&gt;id(b)<br>101020</pre><p>in this example, we are creating two variables, a and b, and set them to 98.<br>With the command id() we can see that they have the same identifier.<br>This means that a and b are pointing to the same instance.</p><p>The type() function is used to return the type of object.</p><pre>&gt;&gt;&gt;a = ()<br>&gt;&gt;&gt;b = (1)<br>&gt;&gt;&gt;c = (1, 1)<br>&gt;&gt;&gt;d = (1, )<br>&gt;&gt;&gt;type(a)<br>&lt;class ‘tuple’&gt;<br>&gt;&gt;&gt;type(b)<br>&lt;class ‘int’&gt;<br>&gt;&gt;&gt;type(c)<br>&lt;class ’tuple’&gt; <br>&gt;&gt;&gt;type(d)<br>&lt;class ‘tuple’&gt;</pre><p>The variables a, c and d are all tuples but variable b is an int. This shows that an empty tuple, a tuple with two integers, and a tuple with one integer followed by a comma are all stored as tuples. However, a single integer between two parentheses will just be stored as an integer.</p><h3>Mutable Objects</h3><p>Mutable objects are objects that can be changed, In Python. the only objects that are mutable list, set, and dicts.</p><pre>&gt;&gt;&gt;a = [1,  2,  3]<br>&gt;&gt;&gt;a.append(4)<br>&gt;&gt;&gt;a<br>1, 2, 3, 4]<br>&gt;&gt;&gt;a[2] = 5<br>&gt;&gt;&gt;a<br>[1, 2, 5, 4]</pre><p>In this example, a is a list of integers, We can append tone more integer to the end of this list, we can also use item assignment to set the value of element #2 to 5.</p><h3>Immutable Objects</h3><p>Immutable objects are objects that cannot be changed. in Python, this would include ints, floats, strings, user classes, and more. These data types cannot be modified.</p><pre>&gt;&gt;&gt;a = “Holberton”<br>&gt;&gt;&gt;a[2] = “x”<br>Traceback (most recent call last)<br>    File ”&lt;stdin&gt;”, line 1, in &lt;module&gt;<br>TypeError: ‘str’ object does not support item assignment</pre><p>We can’t change element a[2] in the string ”Holberton” to the letter x because strings are immutable, they can’t be changed.</p><h3>why does it matter and how differently does Python treat mutable and immutable objects</h3><p>Everything is an object in python, and this makes a huge change, like this</p><pre>&gt;&gt;&gt; a = 1<br>&gt;&gt;&gt;id(a)<br>1010508<br>&gt;&gt;&gt;a += 1<br>&gt;&gt;&gt; a<br>2<br>&gt;&gt;&gt;id(a)<br>1010103 </pre><p>In python assignment is not mutation. In a language like C if you change the value of a variable, you are mutating the object stored. But in python writing a += 1 does not change anything in a. instead, it means that 2 is stored in an instance stored in a different memory location.</p><p>Variables are different in C and python. A variable in C is a space in memory, if the variable is a integer there are 4 bytes located in a memory, when we change the value of the variable the new data is stored in those 4 bytes of memory.</p><p>In python a variable is a name of an object there is an object for var1 and another object for var2, the variable is not 4 bytes of memory represented as an integer, but it is the name that points to the object.</p><h3>how arguments are passed to functions and what does that imply for mutable and immutable objects</h3><p>In Python everything is an object- All variables are treated as references to the object. This means that all variables store the memory address of the actual object, It is like pointers in C, The address of the actual object is stored in the python named variable, not the value itself.</p><p>When passing an argument to functions by reference in python. The caller and function code blocks share the same object. When you change the value of an argument inside a function, the value of that variable also changes in the caller. let’s look at an example with a function that increments an int</p><pre>&gt;&gt;&gt;def increment(a):<br>··· a += 1<br>··· print(‘id of a:’, id(a))<br>··· return a<br>··· <br>&gt;&gt;&gt; x = 1<br>&gt;&gt;&gt; y = increment(x)<br>id of a: 101051<br>&gt;&gt;&gt; print(&#39;x: &#39;,  x)<br>x: 1<br>&gt;&gt;&gt;print(&#39;y: &#39;, y)<br>y: 2<br>&gt;&gt;&gt;print(&#39;id of x: &#39;, id(x))<br>id of x: 101080<br>&gt;&gt;&gt;print(&#39;id of y:&#39;, id(y))<br>id of y: 101051</pre><p>In this example, we can see that the id of y matches the id of a inside the increment function. This is because both y and a are variables pointing at the same integer object.</p><p>Variables are handled completely different in C and in Python, and it&#39;s very important to understand differences for the correct use of the languages</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fd175b6b037" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Differences between static and dynamic libraries]]></title>
            <link>https://medium.com/@luiscode92/differences-between-static-and-dynamic-libraries-2ec93f4e3ba4?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ec93f4e3ba4</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Tue, 05 May 2020 04:40:21 GMT</pubDate>
            <atom:updated>2020-05-06T01:41:29.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*d6q35h93Dv6O0lCOYIz0Kg.jpeg" /></figure><h3>A library in Linux</h3><p>A library is a collection of pre-compiled pieces of code that we call <strong>functions</strong>. a package of function is called <strong>a library. </strong>Functions are blocks of code that get reused throughout the program, this saves a lot of time and keeps the programmer from rewriting code several times. Libraries provide reusable functions, data structures, and classes.</p><p>A library is not executable, this is the key difference between processes and applications. Libraries play their role at run time or compile time.<br>In the C programming language, we have two types of libraries: Dynamics libraries and static libraries.</p><p>Librariesneeds objective files, this kind of files are created by using:</p><pre>gcc -c .c</pre><p>This command compiles C files but does not link them, which means that they are partially compiled. As a result, the output, “.o” files are created, they contain definitions in binary form.</p><h3>Differences between Dynamic and Static libraries</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*QI-LJC2bVLwDMT9VTpnjtg.png" /></figure><p>that you can call on your program. they are very useful because you can save much time by reusing work from other people, and also because most of the time this code has already been checked for bugs</p><p>The most straight forward way of using a library is</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ec93f4e3ba4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to code simple shell in C]]></title>
            <link>https://medium.com/@luiscode92/how-to-code-simple-shell-in-c-312ee5dbe154?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/312ee5dbe154</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 17:57:57 GMT</pubDate>
            <atom:updated>2020-04-17T00:31:57.359Z</atom:updated>
            <content:encoded><![CDATA[<h3>How We code a simple shell in C.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hia91dfhKA5q_qmpl_AFVA.jpeg" /></figure><p>This post explains how to build a simple shell with limited functionality<br>Before guide you through the step-by-step of how to build a simple shell<br>I will briefly explain what is a shell.</p><h3><strong>WHAT IS A SHELL?</strong></h3><p>Most of us are used to navigate through a computer via a graphical user interface(GUI), files, folders, and clicks. but there is another to navigate the shell is a command-line interface(CLI), this program that takes commands from the keyboard and gives them to the operating system to perform, in this case, to navigate and do pretty much everything that you can do by clicking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qfPaHzRjqLiQp5pGla8lNw.png" /></figure><p>In the picture above you can see the two ways to navigate in a computer, in the left you will see a normal GUI from Ubuntu a Linux distribution, in the right, you will see the Linux command line, as you can appreciate in the picture both are in the same folder.</p><p>To understand better how to code a simple shell we are going to use “ls -l” as an example of how the shell execute every command that is entered in the command line.</p><blockquote>In this project, we are going to build an interpreter, which means that we are going to read the command, look for the executable file and execute it, this is not about building each command</blockquote><h3>Aliases</h3><p>when we type a command in the terminal and hit enter, your shell program checks for any aliases associated with the commands you’ve entered. If an alias is found, it expands that alias before it executes.</p><h3>Built-in</h3><p>After switching out any aliases, we want to next look for built-in commands. Built-in commands are commands that exist within the shell. They aren’t outside programs living in other directories. Theoretically. In the simple shell, some of the built-ins include <strong>exit</strong> and <strong>env</strong>. In our case, <em>ls</em> is not built-in.</p><p>Ok now, In the next screenshot, we will see the command typed in the shell, ready to be processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l64Nm9bAMtgpC5H48Cz2uA.png" /></figure><p>Once we write the command, followed by the ENTER</p><p>The shell reads the line, this is done by using a function called getline(), it also puts a NULL at the end, it indicates the end of the text.</p><pre>line = getline(&amp;buffer, &amp;line_size, stdin);</pre><p>The <a href="https://linux.die.net/man/3/getline">getline()</a> reads the text entered and save it a char pointer variable like this. Remember it also adds the NULL</p><pre>char *buffer = [ls -l\0];</pre><p><strong>Creating tokens</strong></p><p>The next step in the data processes to make shell works is tokenize the buffer, we take the entered command and split it in tokens, using the “space” as a delimiter using the <a href="http://man7.org/linux/man-pages/man3/strtok_r.3.html">strtok()</a> function.</p><pre> char *token = strtok(buffer, “ “); </pre><p>Now that strtok() give as every token one by one we have to save it token by token into a double-pointer of arrays, with each token being saved as a char pointer, followed by a NULL, like this.</p><pre>char **token_holder = [*token, *token, NULL];</pre><pre>char **commands = [&quot;ls&quot;, &quot;-l&quot;, NULL];</pre><p>One thing that we have to consider at this point is that we actually don&#39;t know how many commands or tokens will be entered in the CLI, this is why we have to save **commands and *token in the Heap memory, in order to prevent a StackOverflow. We need to allocate enough memory to **commands and *token.<br>We do this created the _realloc() function (<a href="https://github.com/AndrewB4y/simple_shell/blob/master/_realloc.c"><em>source code)</em>,</a> this function allocates a new block of memory, which is very useful because we allocate this block every time that strtok() give us a token.</p><blockquote>Now, one thing that I forget to mention is that strtok() has an inner malloc. with the use of a loop we canmake that every token mallocs it self into the allocated space created by _realloc.</blockquote><p>Cool, now to this point we have received the command, split it into tokens, and saves every token in the heap memory in a double-pointer array.<br>But this process by itself is not enough to make the shell work properly, at the same time that the shell does this process there is another process ongoing, and it has to do with the PATH.</p><p><strong>PATH</strong></p><p>So at this point, we have:</p><pre>**commands = [“ls”, “-l”, “NULL]</pre><p>but if we pass in just the “ls” our shell won&#39;t work, because the shell does not know where to find the command the “ls -l”</p><p>We need to check our PATH variable to find it. Yes, we have to check directory by directory, for those who don&#39;t know what is a PATH its basically this</p><pre>PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/:bin</pre><p>as you can see the PATH is a variable that storage directories we have to check each directory in the PATH to see if the command exits in one of them.</p><blockquote>Remember that commands are executable files, which means that are looking for a executable</blockquote><p>Our Shell looks through each directory separated by a “ : ” to see if the “ ls “ executable exist inside of one of them, we do this using a function called <a href="https://linux.die.net/man/2/stat">stat()</a> that see if the executable file exists in each directory. <br>When the shell has managed to find the executable file, it replaces the first string with the path of the directory that has “ ls”, like this</p><pre>**commands = [“/bin/ls”, “-l”, ”\0&quot;] </pre><p>We did this in order to have the location of “ls” otherwise how can we know where it is? remember we are building an interpreter, our goal is to read, parse, find and execute.</p><p>Until this point, we have read the CLI, parsed the information, stored the information, validated the PATH of our command, and now, we have to execute it.</p><p>This is the last main step in the process, now we have to fork the process, and I know this is confusing, but there is a very good reason for this, let talk a little bit about this…</p><blockquote>We have to understand that computers have many processes ongoing, processes are like stories they have a beginning, a knot, and an outcome. The shell is a process itself this is why we can&#39;t execute the command in the same process (the shell process), if we do this we would finish this process and kill the shell, and we don&#39;t want that, we want to keep entering commands as much as we want, so we need to fork the process and execute the command in to the child process created, once the command is executed the child process will be killed, and we will back to the parent process, let see this more in detail…</blockquote><h3>Creating New Processes</h3><p>Once you have entered the command “ls -l”, the shell has already validated the PATH and is ready to run from “/bin/ls”, we create a new process using a function called <a href="http://man7.org/linux/man-pages/man2/fork.2.html">fork( )</a>, this is where the child process appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*Qdn6uayFB-sEIA02IuOdIg.png" /></figure><p>After the child process is created, its time to execute de command “ /bin/ls -l” in the child process, we use the function <a href="http://man7.org/linux/man-pages/man2/execve.2.html">execve()</a>, this function goes to the PATH, finds the executable file and execute it, <em>it also looks for the flags.<br></em>Once the successful execution is confirmed by execve() we kill the child process.</p><p>At last but not least we use the wait() function which is responsible for check that everything was right with the child process and return to the parent process</p><p>When it’s all said and done, your newly created simple shell should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3P9eDUC95LUCSYfBh6Plw.png" /></figure><p>The source code for the Simple Shell can be found <a href="https://github.com/AndrewB4y/simple_shell">here</a>.</p><p>Made with love from Colombia to Holberton school community and to the world by Andres Bayona and Luis Sanjuan</p><p>Fell free to leave your comment thanks for reading, regards!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=312ee5dbe154" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C static libraries]]></title>
            <link>https://medium.com/@luiscode92/c-static-libraries-797711f14c6c?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/797711f14c6c</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 03:07:09 GMT</pubDate>
            <atom:updated>2020-03-02T03:07:09.258Z</atom:updated>
            <content:encoded><![CDATA[<p>loading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=797711f14c6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type GCC main.c]]></title>
            <link>https://medium.com/@luiscode92/what-happens-when-you-type-gcc-main-c-6009c0e5f4de?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6009c0e5f4de</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Thu, 06 Feb 2020 04:31:44 GMT</pubDate>
            <atom:updated>2020-02-06T16:57:50.692Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*PLRRHHNXjrIScCHwyBN3eg.png" /></figure><p>If you don’t know or just don’t remember anything about the terminal, please check my last post in which I talk about it in more detail.</p><p>For the purpose of this blog, I first want to give you a summary of C programming language, C is a compiled language, which means it must be run through a compiler. The source code then undergoes some steps before the compiler returns an <strong><em>executable program</em></strong>. It’s one of the most famous languages and one of the most important too</p><p><strong>GCC </strong>is a compiler that C uses, it’s also used by other languages such a C++, Objective-C, Go, Java, FORTRAN, and ADA.</p><pre>gcc main.c</pre><p>Now we have to understand how GCC compiler works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*rJQ1RYtW9RWLOsikvz0wLA.png" /></figure><p>The first stage is the <strong>Preprocessing</strong>, here the headers and the macros are expanded into the lines of code that represents, In C, one of ht most common header is &lt;stdio.h&gt;, which stores the code that gives the user input and output functionality.<br>If you want to only run the code through the preprocessor and not the entire compiling process, you can use the -E flag:</p><pre>gcc -E main.c</pre><p>The second step is the <strong>Compilation</strong>, here the compiler converts the preprocessed code into <strong><em>assembly</em></strong> language, which is a closer to the machine understand language, we call it low-level programming eve though is not low enough.<br>To compile the code and no more, you can use the -S flag.</p><pre>gcc -S main.c</pre><p>The third step is the <strong>Assembly</strong>, where the compiler “assemble” the above code into machine-readable object code. to create object code from the original code, use</p><pre>gcc -c main.c</pre><p>after doing this the code has been translated into binary which is the language that the computer can understand and send to the processor.</p><p>The last step is <strong>Linking</strong> this is the step in which pieces of object code linked together into an executable file. If you want to get an executable file</p><pre>gcc main.c</pre><p>this is it ! .. oh btw</p><p>By default, our executable file will be called <strong><em>a.out</em></strong>. As mentioned before, we can use the -o flag to specify the output file name, so the following command would produce the executable file called ‘main’.</p><pre>gcc -o main main.c</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6009c0e5f4de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hard link vs symbolic link]]></title>
            <link>https://medium.com/@luiscode92/hard-link-vs-symbolic-link-6b61d5c78dfa?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b61d5c78dfa</guid>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Tue, 04 Feb 2020 01:55:56 GMT</pubDate>
            <atom:updated>2020-02-04T01:55:56.544Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to my second post, of the shell fo no coders</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ZrYoClzRj0eHzb3mGtDMnw.jpeg" /></figure><p>Today I want to talk about a concept that is going to help you understand very simple action of your computer “hard link and symbolic link” or (shortcut files vs real copy)</p><p>For this purpose, we have to start understanding how the files are saved into the hard disk, every space created into the hard drive has the numerical equivalent of a full address, this number is known as an inode, (the address of the file into the hard drive)</p><p><strong>Hard link</strong></p><p>its a reference to a file’s inode, which means that the connection is created to a file address, not the file itself, so when a copy of the original file is created the new file has a different inode, which means a different space into the hard drive</p><p><strong>The symbolic link / soft link</strong></p><p>its a reference to an original file, no the inode of the original file, in this order, when a copy is created, the connection is not created to the inode (address into the hard drive), but to the file. in this order, if the original file is deleted the connection won have where to go, It will be null.</p><p>this is the way a pc creates shortcuts, and copies, so never forget that if you want to keep safe your information, you must create a copy of a file, or saying in software engineer words, open a new space into the hard drive, with a new inode.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b61d5c78dfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type ls *.c]]></title>
            <link>https://medium.com/@luiscode92/what-happens-when-you-type-ls-c-47c928b9fc7a?source=rss-88050d08a0d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/47c928b9fc7a</guid>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Luis Enrique Sanjuan Melo]]></dc:creator>
            <pubDate>Tue, 04 Feb 2020 00:59:10 GMT</pubDate>
            <atom:updated>2020-02-04T00:59:10.651Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“In order to fully understand this article, you must have previous knowledge about the shell and the terminal in general”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*6w2Cy2DlAyaxJUtYa1mbMg.png" /></figure><p>what is going on here??</p><p>Ok so basically you are about to read an article about the shell, which is the black window with white words full of strange codes that sometimes you watch on the PC. If you are interested in all this software kind of thing, cool! , but if you don´t, keep reading until the end I will try to do my best to explain to you what is all this about…</p><p>Ok, let&#39;s start!</p><p>As I was telling you the black window or the shell is a program that reads whatever you type on the keyboard in order to you communicate with the pc, but here is the first problem, YOU HAVE TO TALK THE COMPUTER’S LANGUAGE, you do this by coding but don’t worry, I am here to help you with this, I will talk you about the ‘ ls’ command.</p><p>‘ls’ stands for “lists”, this means that this is going to display a list of files from the current working directory (the folder that you are in)on the shell, and just like that you can see a list of files, but that is not all ‘ls’ has a lot of tools that are going to help us to understand the information in a better way let me show you</p><p>$ls -l <em>// long format, it will show you more information about each file</em></p><p>$ls -S <em>//sort the files by size</em></p><p><em>if you want to know more options around ‘ls’ you should read this </em><a href="https://linux.die.net/man/1/ls">https://linux.die.net/man/1/ls</a></p><p>Said that and for the purpose of this article I will talk to you now about the ‘*’, this is a wildcard, it basically filters the extension of the files in a directory… what I mean with this is that if we have ‘ls *.docx’ it will display just the files that were made with Microsoft word</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47c928b9fc7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>