<?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 Brian kiplangat on Medium]]></title>
        <description><![CDATA[Stories by Brian kiplangat on Medium]]></description>
        <link>https://medium.com/@brianbryan0125?source=rss-95b85fb3af39------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*urrh5fsbVityQK-C</url>
            <title>Stories by Brian kiplangat on Medium</title>
            <link>https://medium.com/@brianbryan0125?source=rss-95b85fb3af39------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:04:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brianbryan0125/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_your_type_google_com_in_your_browser_and_press_enter.]]></title>
            <link>https://medium.com/@brianbryan0125/what-happens-when-your-type-google-com-in-your-browser-and-press-enter-d68beba33291?source=rss-95b85fb3af39------2</link>
            <guid isPermaLink="false">https://medium.com/p/d68beba33291</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[safaricom]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[moringa]]></category>
            <category><![CDATA[holberton-school]]></category>
            <dc:creator><![CDATA[Brian kiplangat]]></dc:creator>
            <pubDate>Thu, 12 May 2022 10:23:52 GMT</pubDate>
            <atom:updated>2022-05-12T10:25:36.079Z</atom:updated>
            <content:encoded><![CDATA[<p>what happens when you type a URL in the browser?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFCesupmK0S6B1ccdmX7tA.jpeg" /></figure><figure><img alt="Type https://www.google.com/" src="https://cdn-images-1.medium.com/max/299/1*EitzlcuOdAUg5if9gD0Zig.png" /><figcaption><a href="https://www.google.com/">https://www.google.com/</a></figcaption></figure><blockquote><em>Suppose you want to visit the website of Holberton School. So you type </em><a href="https://www.google.com/">https://www.google.com/</a><em> in the address bar of your browser. When you type any URL you basically want to reach the server where the website is hosted. So how is it all happening?</em></blockquote><h3>DNS request</h3><p>DNS is a list of URLs and their corresponding IP address just like the telephone book has phone numbers corresponding to the names of the people. We can access the website directly by typing the IP address but imagine remembering a group of numbers to visit any website. So, we only remember the name of the website, and the mapping of the name with the IP address is done by the DNS.</p><p>The DNS checks at the following places for the IP address.</p><blockquote><strong><em>Check Browser Cache</em></strong><em>: The browser maintains a cache of the DNS records for some fixed amount of time. It is the first place to run a DNS query.</em></blockquote><blockquote><strong><em>Check OS Cache</em></strong><em>: If the browser doesn’t contain the cache then it requests to the underlying Operating System as the OS also maintains a cache of the DNS records.</em></blockquote><blockquote><strong><em>Router Cache</em></strong><em>: If your computer doesn’t have the cache, then it searches the routers as routers also have the cache of the DNS records.</em></blockquote><blockquote><strong><em>ISP(Internet Service Provider) Cache</em></strong><em>: If the IP address is not found at the above three places then it is searched at the cache that ISP maintains of the DNS records. If not found here also, then ISP’s </em><strong><em>DNS recursive search</em></strong><em> is done. In “DNS recursive search”, a DNS server initiates a DNS query that communicates with several other DNS servers to find the IP address.</em></blockquote><p>So In this case we can request our page by typing the domain name <a href="https://www.holbertonschool.com/"><em>https://www.google.com</em></a>!</p><h3>Protocols: TCP/IP</h3><p>TCP/IP is a suite of protocols used by devices to communicate over the Internet and most local networks. It is named after two of its original protocols — the <strong>Transmission Control Protocol (TCP) </strong>and the I<strong>nternet Protocol (IP)</strong>. TCP provides apps a way to deliver (and receive) an ordered and error-checked stream of information packets over the network. The <strong>User Datagram Protocol (UDP)</strong> is used by apps to deliver a faster stream of information by doing away with error-checking. When configuring some network hardware or software, you may need to know the difference. The Browser initiates a TCP connection with the server. When the browser receives the IP address, it will build a connection between the browser and the server using the internet protocol. The most common protocol used is the TCP protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*h1HJPxzvL_dBZ156.jpeg" /></figure><p>TCP/UDP workers</p><h3>Firewall</h3><p>A firewall is a division between a private <a href="https://www.webopedia.com/definitions/network/">network</a> and an outer network, often the <a href="https://www.webopedia.com/definitions/internet/">internet</a>, that manages traffic passing between the two networks. It’s implemented through either <a href="https://www.webopedia.com/definitions/hardware/">hardware</a> or <a href="https://www.webopedia.com/definitions/software/">software</a>. Firewalls allow, limit, and block network traffic based on preconfigured rules in the hardware or software, analyzing data <a href="https://www.webopedia.com/definitions/packet/">packets</a> that request entry to the network. In addition to limiting access to computers and networks, a firewall is also useful for allowing remote access to a private network through secure <a href="https://www.webopedia.com/definitions/authentication/">authentication</a> certificates and logins.</p><p>when the browser asks for the website at a specific address that request is processed by a firewall which will decide if it’s safe, or if it’s a threat to the server’s security.</p><h3>HTTPS/SSL</h3><h3>What happens when you don’t secure your website traffic?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*cDPvkCdt3FmsjGqi.gif" /></figure><p>don’t forget to check the keys</p><p>When you request an HTTPS connection to a webpage, the website will initially send its SSL certificate to your browser. This certificate contains the public key needed to begin the secure session. Based on this initial exchange, your browser and the website then initiate the ‘SSL handshake’. The SSL handshake involves the generation of shared secrets to establish a uniquely secure connection between yourself and the website.</p><p>When a trusted SSL Digital Certificate is used during an HTTPS connection, users will see a padlock icon in the browser address bar. When an Extended Validation Certificate is installed on a web site, the address bar will turn green.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*xMXvgHqt9yXayKNC.png" /></figure><p>http vs https</p><blockquote><em>Hyper Text Transfer Protocol Secure (HTTPS) is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The ‘S’ at the end of HTTPS stands for ‘Secure’. It means all communications between your browser and the website are encrypted. HTTPS is often used to protect highly confidential online transactions like online banking and online shopping order forms. Web browsers such as Internet Explorer, Firefox and Chrome also display a padlock icon in the address bar to visually indicate that a HTTPS connection is in effect.</em></blockquote><h3>Load-balancer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*b5YPCEcI40qJRBa2.png" /></figure><p>The load balancer will distribute the work-load of your system to multiple individual systems, or groups of systems to reduce the amount of load on an individual system, which in turn increases the reliability, efficiency, and availability of your enterprise application or website.</p><h3>The following are the advantages of load balancing your application:</h3><blockquote><em>Reduced the work-load on an individual server.</em></blockquote><blockquote><em>Large amount of work done in same time due to concurrency.</em></blockquote><blockquote><em>Increased performance of your application because of faster response.</em></blockquote><blockquote><em>No single point of failure. In a load balanced environment, if a server crashes the application is still up and served by the other servers in the cluster.</em></blockquote><blockquote><em>When appropriate load balancing algorithm is used, it brings optimal and efficient utilization of the resources, as it eliminates the scenario of some server’s resources are getting used than others.</em></blockquote><blockquote><em>Scalability: We can increase or decrease the number of servers on the fly without bringing down the application</em></blockquote><blockquote><em>Load balancing increases the reliability of your enterprise application</em></blockquote><blockquote><em>Increased security as the physical servers and IPs are abstract in certain cases.</em></blockquote><h3>Web server</h3><p>Web server is software and hardware that uses <a href="https://whatis.techtarget.com/definition/HTTP-Hypertext-Transfer-Protocol">HTTP</a> (Hypertext Transfer Protocol) and other protocols to respond to <a href="https://searchenterprisedesktop.techtarget.com/definition/client">client</a> requests made over the World Wide Web. A web server is a software program that serves static content, like simple HTML pages, images, or plain text files. once requests reach servers The web server will respond, sending the browser the requested page, again, through HTTP. If the requested page does not exist or if something goes wrong, the web server will respond with an error message. The browser will then be able to display the webpage.</p><h3>Application server</h3><p>Unlike web servers, An application server is a program that resides on the server-side, and it’s a server programmer providing business logic behind any application. This server can be a part of the network or the distributed network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mW-4vKuvkZA9puBq.png" /></figure><p>overall description of servers</p><blockquote><em>The client first makes a request, which goes to the webserver. The web server then sends it to the middle tier, i.e. the application server, which further gets the information from 3rd tier (e.g. database server) and sends it back to the webserver. The web server further sends back the required information to the client. Different approaches are being utilized to process requests through the web servers, and some of them are approaches like JSP (Java server pages), CGI, ASP (Active Server Pages), Java Scripts, Java servlets, etc.</em></blockquote><h3>Database</h3><p>A database is a collection of structured information organized in a way that it can be easily accessed, managed, and updated by computer programs. Complex databases often use more formalized structures and design patterns, typically defined by a Database Management System (DBMS). There are many different types of common database management systems, some using design patterns like the <a href="https://www.digitalocean.com/community/tutorials/what-is-the-relational-model">Relational Model</a> and <a href="https://www.digitalocean.com/community/tutorials/a-comparison-of-nosql-database-management-systems-and-models">NoSQL</a>, with query languages like <a href="https://www.digitalocean.com/community/tutorials/what-is-sql">SQL</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d68beba33291" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Server.]]></title>
            <link>https://medium.com/@brianbryan0125/apache-server-cf4375c9c6e1?source=rss-95b85fb3af39------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf4375c9c6e1</guid>
            <category><![CDATA[maarten-van-der-kamp]]></category>
            <category><![CDATA[barack-obama]]></category>
            <category><![CDATA[medium-brasil]]></category>
            <category><![CDATA[alx-james]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Brian kiplangat]]></dc:creator>
            <pubDate>Wed, 04 May 2022 07:35:14 GMT</pubDate>
            <atom:updated>2022-05-04T07:35:14.869Z</atom:updated>
            <content:encoded><![CDATA[<p>Postmortem Project,</p><p>by Brian Kiplangat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gTJ6vZkMy4LCNH6X.jpg" /><figcaption>Error for all GET Requests.</figcaption></figure><p>Below is a postmortem for a web stack debugging assignment for Alx School. A simple website utilizing was returning a 400 status code to any GET requests. Identifying the problem and creating a Puppet script for the solution.</p><p><strong><em>Summary:</em></strong></p><p>Apache server was returning a 400 error for all GET requests. The website consists of one HTML page so the problem with MySQL or PHP was identified as the likely culprit.</p><p><strong><em>Timeline:</em></strong></p><ul><li>19–03–2022, 12:00 AM PDT: Project release</li><li>20–03–2022, 1:00 PM PDT: Begin project. First, check for error logs.</li><li>20–03–2022, 1:20 PM PDT: Find that error logging for PHP was disabled. Error logging re-enabled, server restarted, ‘no such file’ error found.</li><li>20–03–2022, 1:45 PM PDT: Typographical error found in PHP file. Manually fix. Server restarted. Request returns 200 status code.</li><li>20–03–2022, 2:30 PM PDT: Puppet script began and testing for proper fix begins</li><li>20–03–2022, 4:00 PM PDT: Puppet script finished and able to be deployed across all servers. Script pushed to GitHub.</li></ul><p><strong><em>Impact:</em></strong></p><p>Users were unable to access the website from at least midnight 19–03–2020 to 4:00 PM 20–03–2018. All servers were affected by the outage.</p><p><strong><em>Root Cause:</em></strong></p><p>problem was a typographical error for file name at line 137 of the file /var/www/html/wp-settings.php. Line read: require_once( ABSPATH . WPINC . ‘/class-wp-locale.phpp’ );.</p><p><em>the file should have been ‘.php’ Error likely caused by human error in updated settings and subsequent lack of testing to ensure the server was still functional</em>.</p><p><strong><em>Solution:</em></strong></p><p>A manual fix on one server was first completed to ensure the fix would work. A puppet file was then created to distribute across all servers.</p><p><strong><em>Prevention:</em></strong></p><p>An error could have been easily prevented by a user who updated the config file to test that the server was still functional before exiting. The fix was quite obvious when error logging was turned back on. Testing procedures must be more strictly enforced for production environments in future situations as well as more stringent monitoring and protection of who has access to write to config files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf4375c9c6e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type ls -l *.c in the shell.]]></title>
            <link>https://medium.com/@brianbryan0125/what-happens-when-you-type-ls-l-c-in-the-shell-18e6356072c8?source=rss-95b85fb3af39------2</link>
            <guid isPermaLink="false">https://medium.com/p/18e6356072c8</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Brian kiplangat]]></dc:creator>
            <pubDate>Wed, 03 Nov 2021 20:49:06 GMT</pubDate>
            <atom:updated>2021-11-03T20:49:06.378Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Co-authored by @</em><a href="https://medium.com/@brianbryan0125"><em>Brian kiplangat</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*juJW8WlWe63MCgy0.png" /></figure><p>example of ls -l *.c</p><p>This blog describes the step-by-step of what happens when you type <em>ls -l *.c</em> in a shell terminal.</p><p>For us to write and execute a command like <em>ls -l *.c</em> we must be in a shell terminal. But before we proceed we have to explain what a shell terminal is and what the above command means.</p><h3>Shell</h3><p>Simply put, the shell is a program that takes commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a Unix-like system such as Linux. Nowadays, we have <em>graphical user interfaces (GUIs)</em> in addition to <em>command-line interfaces (CLIs)</em> such as the shell. The Shell wraps around the delicate interior of an Operating system protecting it from accidental damage. Hence the name <strong>Shell</strong>.</p><h3>Terminal</h3><p>It’s a program called a <em>terminal emulator</em>. This is a program that opens a window and lets you interact with the shell.</p><h3>What is ls -l?</h3><p>The<em> ls</em> command lists files and directories in a Unix system. It has a lot more functionality underneath it.</p><p>One such example is<em> ls -l </em>which lists the contents in a long format. It provides you with detailed information about each file and subdirectory in the current folder. The <em>ls -l</em> Unix command reveals seven facts about each item in a directory. It starts with the file permissions, moving on to the ownership of the file, then to the last time the file was modified, and finally the name of the file.</p><p>When talking about permissions, there are three entities or bodies directly associated with the files and directories in your system. They are as follows:</p><ul><li><strong>Owner</strong>: User who owns the file, directory, or symbolic link, usually also the one who created the file.</li><li><strong>Group</strong>: Group of users who have some level of access to the file, directory, or symbolic link</li><li><strong>Others</strong>: Other users who may or may not have any level of access to the file/directory.</li></ul><p>Each user has three possible types of permission, also known as “-rwx” and are described as follows:</p><ul><li><strong>r</strong>: Stands for read and it is the permission type that allows users to read a file, directory, or symbolic link.</li><li><strong>w</strong>: Stands for write and it is the permission type that allows users to edit a file, directory, or symbolic link.</li><li><strong>x</strong>: Stands for executing and it is the permission type that allows users to execute a file, directory, or symbolic link.</li><li><strong>-</strong>: Stands for 0 and it is a permission type that prohibits users from reading, writing, or executing a file, directory, or symbolic link</li></ul><p><strong>What is *?</strong></p><p>* is a wildcard and Wildcards are a set of building blocks that can allow you to create a pattern defining a set of files or directories.</p><h3>Now about ls -l *.c</h3><p>As presented above the * represents any character and can be used with any other set of characters to form patterns for example <strong>*.c </strong>represents any file or directory that contains 0 or more characters and end with .c what this means is when we execute this command <strong>ls -l *.c </strong>it will list any file or directory that ends with .c</p><h3>General operation of the shell.</h3><p>A shell in a Linux operating system takes input from you in the form of commands, processes it, and then gives an output. It is the interface through which a user works on the programs, commands, and scripts. A shell is accessed by a terminal that runs it.</p><p>When you run the terminal, the Shell issues <strong>a command prompt (usually $),</strong> where you can type your input, which is then executed when you hit the Enter key. The output or the result is thereafter displayed on the terminal.</p><p>Shell language is an interpreted language, in which lines of text (ending in \n) are read, analyzed, and processed. With the lines read, the shell performs the following steps (in this order):</p><ol><li><strong>Initialize</strong></li><li><strong>Interpret</strong></li><li><strong>Terminate</strong></li></ol><p>But really the most important thing happens in the Interpret, which implements an infinite loop, which does the following: It reads the command from the standard input, makes a parse separating the command string into a program and arguments to finally execute the analyzed command.</p><p>Now focusing on our ls command and contextualizing it within what we just said, ls means “list”, and according to the manual, lists information about the files in the current directory by default.</p><h3>Split command by tokens.</h3><p>We enter a string, but for the execution in the shell, you need the parts of this line separated. So the shell separates it into tokens. In other words, it separates each word and puts it in an array of strings. You can implement this behavior in get line and strtok.</p><h3>Check alias.</h3><p>Bash aliases are those that allow you to set a shortcut command for a longer command. They have the following structure.</p><p>alias [alias_name]=”[command_to_alias]”</p><p>Bash aliases are those that allow you to set a shortcut command for a longer command. They have the following structure.</p><p>After implementing the structure of the alias, when using it, below the shell will exchange the command introduced as an alias by the real command with the corresponding arguments for its correct execution.</p><h3>Finds the command in the PATH.</h3><h3>Call the program ls with -l</h3><ul><li>Fork: creates a child process (PID), when the function is called, for which the operating system duplicates the process being executed, running simultaneously. In order to differentiate them, the original process is called the parent and the new process is called the child.</li><li>Execve: Performs the execution of the program, for this the executables of the programs replace the parent program that is currently running by the new child program, for this the operating system stops the process, loads the new program, and starts it.</li><li>Wait: Stops the parent process while the running child process ends.</li></ul><h3>When the “ls -l *.c” command is done, print the prompt.</h3><p>The prompt is the character or characters that indicate that the terminal is ready to receive a new command. Which prints the standard output (Stdout: default file descriptor [1] where a process can write the output.)</p><h3>Wait for a new command.</h3><p>In this step of the command execution process, the loop starts again, so the shell is waiting for user input at the prompt.</p><p>That’s all.</p><h3>Annotations</h3><p>This article is the product of a long project that consisted of making a simple shell programmed in C.</p><h3>References</h3><ol><li><a href="/service/mailto:bshotts@users.sourceforge.net">William E. Shotts, Jr.</a> What is “the Shell”? Retrieved from <a href="https://www.linuxcommand.org/lc3_lts0010.php">https://www.linuxcommand.org/lc3_lts0010.php</a></li></ol><h3>Authors</h3><p><a href="https://www.linkedin.com/in/brian-kiplangat/">Brian Kiplangat</a></p><p><a href="http://www.linkedin.com/in/joywanjiru879">Joy Wanjiru</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18e6356072c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>