<?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 Purujit S on Medium]]></title>
        <description><![CDATA[Stories by Purujit S on Medium]]></description>
        <link>https://medium.com/@ipurujit?source=rss-9a85747b4c83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1XU_xJNlw0-UcJIYmT9kZg.jpeg</url>
            <title>Stories by Purujit S on Medium</title>
            <link>https://medium.com/@ipurujit?source=rss-9a85747b4c83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:11:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ipurujit/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[Linux Terminal Essentials]]></title>
            <link>https://ipurujit.medium.com/linux-terminal-essentials-91f872d0ed67?source=rss-9a85747b4c83------2</link>
            <guid isPermaLink="false">https://medium.com/p/91f872d0ed67</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[cybsersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bash-scripting]]></category>
            <dc:creator><![CDATA[Purujit S]]></dc:creator>
            <pubDate>Sun, 25 Dec 2022 17:30:49 GMT</pubDate>
            <atom:updated>2022-12-25T17:55:02.065Z</atom:updated>
            <content:encoded><![CDATA[<p>A command line interface (CLI) is the primordial UI for infrastructure and computing devices: <em>lightweight, fast, secure, and powerful</em>. Anyone planning to work/currently working in tech must be familiar with the basics of using CLI to work more efficiently.</p><h4>To begin with, some terminologies explained…</h4><ul><li><strong>CLI</strong>: Any kind of text-based interface for entering/running commands</li><li><strong>Terminal</strong>: The computer application or part of it which runs to display a CLI</li><li><strong>Prompt</strong>: An interface which allows user to provide an input</li><li><strong>Shell</strong>: An interpreter for running a specific set of commands or scripts provided by the user in human-readable form. The shell executes the scripts written in its corresponding scripting language and performs related system operations internally.</li><li><strong>Bash</strong>: “<strong>B</strong>ourne-<strong>a</strong>gain <strong>sh</strong>ell”, a commonly used shell for Unix-based systems</li></ul><h4><em>Why Linux?</em></h4><p>Linux is the preferred OS for running independent servers, containers, etc., be it on cloud or on premise. Linux style commands are an inseparable part of programming. Linux has a <a href="https://distrowatch.com/images/other/distro-family-tree.png">colossal family tree</a> spanning across a variety of domains.</p><figure><img alt="Two penguins with the caption “Linux in the 90’s vs Linux today”. To the left is Tux, the official Linux kernel mascot. It is sitting with legs extended towards the viewer and one arm on its left foot paddle. To the right is a muscular penguin flexing biceps and abs. This is a comparison of Linux’s popularity and usage today." src="https://cdn-images-1.medium.com/max/1024/1*d25GNpPKPzIHfguMJ793HQ.png" /><figcaption>To the left is Tux, the official Linux mascot; to the right is a muscular penguin. This depicts a comparison of Linux’s popularity and usage in the past vs. today</figcaption></figure><h4>Where can I do some hands-on practice?</h4><p>For Unix-based OS (MacOS and all flavours of Linux), you can start a terminal right away. For Windows, you can use Linux Containers LXD online Linux shell: <a href="https://linuxcontainers.org/lxd/try-it/">https://linuxcontainers.org/lxd/try-it/</a> for short term use. If you’re looking for something long term, I recommend installing ‘<a href="https://git-scm.com/download/win">Git bash</a>’ on Windows.</p><h4>First look: On opening the terminal</h4><p>Terminals are by default configured to open up in the “home” directory of the current user. This is denoted by the<strong>~</strong> i.e. tilde character.</p><figure><img alt="A breakdown of what is visible in a Linux terminal on opening it: the username to the left, then a “@” character, then the system name, then a “:” (colon), then the current path, usually the home directory. Here, it is showing the “Home/Documents” directory." src="https://cdn-images-1.medium.com/max/1024/1*TPe7iFHyQfNGKwDDk0T7zQ.png" /><figcaption>First look at the terminal</figcaption></figure><h3>Basic usage and navigation</h3><h4>Scrolling through recent command history:</h4><ol><li><strong>Up</strong> Arrow Key: Go to the previous command executed</li><li><strong>Down</strong> Arrow Key: Go to the next command executed</li></ol><h4>Navigating within the current command:</h4><ol><li><strong>Left</strong> Arrow Key: Move cursor to the left by one character</li><li><strong>Right</strong> Arrow Key: Move cursor to the right by one character</li><li><strong>Backspace</strong> Key: Remove character to the left of the cursor</li><li><strong>Delete</strong> Key: Remove character to the right of the cursor</li><li><strong>Tab</strong> Key: <strong>Autocomplete</strong> available option<br><em>e.g. type </em>cd /e<em> and press </em>Tab Key<em> to autocomplete to </em>cd /etc <em>or some other directory starting with e</em></li><li><strong>Home</strong> Key: Go to the beginning of the current line</li><li><strong>End</strong> Key: Go to the end of the current line</li></ol><h4>Running the command:</h4><ol><li><strong>Enter/Return</strong> Key: Executes command</li><li><strong>Ctrl+C/Command+C</strong>: Terminates the command (sends a <a href="https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html#index-SIGTERM">SIGTERM</a> signal to the shell)</li></ol><h3>Introduction to the command structure and syntax</h3><p>Type the following and press Enter/Return key</p><pre>ls -lah --color=always /bin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGyY6kt3Jl4xpEdhtjKzyg.png" /></figure><h4>Dissecting the command:</h4><ul><li><strong>ls</strong> command is for <em>listing contents of one or more directory/files</em></li><li><strong>-lah</strong> passes 3 options with a single hyphen and shortcut letter<br>- “<strong><em>l” </em></strong>stands for <em>show a long, detailed list </em><br>- “<strong><em>a”</em></strong> for <em>show all contents</em> i.e. include hidden files/directories<br>- “<strong><em>h”</em></strong> for <em>show in human-readable size format</em> e.g. 12G for 12GB<br>You can pass options in any order. And also separately:</li></ul><pre>ls -a -l -h /bin</pre><ul><li><strong>--color=always</strong> is the long option format (with 2 hyphens). Here, we are passing a specific <strong>value</strong> “always” to the <strong>option</strong> “color”</li><li><strong>/bin</strong> is the first argument passed to ls command. You can also pass multiple arguments</li></ul><pre># Here we have bin, usr and current user&#39;s home directory for listing<br>ls -lah --color=always /bin /usr ~</pre><h4>Specifying options</h4><ol><li><strong>-</strong> Single hyphen: For short options, usually 1 letter<br>E.g. -h</li><li><strong>--</strong> Double hyphen: For long options, complete word(s)<br>E.g. --help , --no-target-directory</li><li>Passing a value to options: Some options expect a = between the option and its value while others expect a whitespace ‘ ‘. Generally, short options take value as space separated while long options take value as = separated</li></ol><h3>Standard I/O streams associated with the terminal</h3><ol><li><strong>stdin</strong><em> Standard Input stream</em>: When a command requires user to provide some input during execution, such as entering password, the text entered goes in the stdin stream buffer</li><li><strong>stdout</strong> <em>Standard Output stream</em>: Information during execution and the result of a command are written to stdout stream buffer<br><em>E.g. output of </em><em>ls command as shown in the image above in previous section</em></li><li><strong>stderr</strong> <em>Standard Error stream</em>: Any diagnostic information, such as when execution is interrupted due to an error, is written into stderr stream buffer<br><em>E.g. trying to run </em><em>ls on a file/directory which doesn’t exist: </em>ls non-existent-dir</li></ol><h4>13 commonly used Linux commands</h4><ol><li><strong>bash</strong>: execute a script file (.sh file)</li><li><strong>ls</strong>: list directory contents</li><li><strong>cd</strong>: change directory</li><li><strong>pwd</strong>: print working (current) directory</li><li><strong>mkdir</strong>: create directories</li><li><strong>rm</strong>: Remove (delete) files/directories (<strong>Careful, this is irreversible!</strong>)</li><li><strong>cat</strong>: Print contents of the specified input file to <strong>stdout</strong>. If no file is specified, read from <strong>stdin</strong> by default</li><li><strong>echo</strong>: Prints specified text to <strong>stdout</strong></li><li><strong>grep</strong>: Search for a particular string/expression in a file. Supports regex searches</li><li><strong>history</strong>: Display history of commands executed — this data is usually stored as a file <strong>.bash_history</strong> in user’s home directory</li><li><strong>vim</strong>: Vim editor — a powerful CLI text editor <a href="https://web.stanford.edu/class/cs107/resources/vim">https://web.stanford.edu/class/cs107/resources/vim</a></li><li><strong>nano</strong>: Nano editor — another CLI text editor, more beginner-friendly</li><li><strong>man</strong>: Provides the documentation for a particular command (not available in Windows Git Bash nor in online Linux shell LXD). Alternately, you can use --help option to get more info on the command</li></ol><h3>Bash operators</h3><h4>Path operators</h4><ol><li><strong>.</strong> — Single dot refers to the <strong>current</strong> directory in context</li><li><strong>..</strong> — Double dots refer to the <strong>parent</strong> directory in context</li><li><strong>~</strong> — Tilde character refers to the home directory of the current logged-in user<br><em>e.g. </em>/home/alice<em> for Alice</em></li><li><strong>/</strong> — Forward slash is to separate directories as a delimiter. It also has a special meaning:<br><strong>/</strong> by itself or at the beginning of a path means <em>starting from root directory</em>.<br><em>e.g. </em>cd /<em> means change directory to the root directory<br></em>cd <strong>/home/alice</strong><em> means change directory to the alice directory under home directory </em><strong><em>under root directory (absolute path)</em></strong><em><br></em>But! cd <strong>home/alice</strong><em> means change directory to the alice directory under home directory </em><strong><em>inside current folder (relative path)</em></strong></li><li><strong>*</strong> — Wildcard character is to match <strong>zero or more</strong> possible character(s)<br><em>e.g. if you have 3 files </em>pic1.png<em>, </em>picture_2.png<em> and </em>picture_picture3.png<em>, then </em>pic*<em> matches all these file names and any other file/directory name starting with </em>“pic”</li><li><strong>?</strong> — Single character wildcard, is to match <strong>exactly one</strong> possible character<br><em>e.g. if you have 3 files </em>pic1.png<em>, </em>picture_2.png<em> and </em>picture_picture3.png<em>, then </em>pic?.png<em> matches only </em>pic1.png<em>, not the other two</em></li></ol><p>What is the resultant directory after executing the last command given below?</p><pre># Create the directories<br>mkdir -p /home/alice/Documents/hello/world<br>mkdir -p /home/alice/hello/world<br>mkdir -p /home/hello/world<br><br># Change current directory to first created one<br>cd /home/alice/Documents/hello/world<br><br># Current directory is /home/alice/Documents/hello/world<br># Where will we go after executing below command?<br>cd ./.././../h?ll?/w*d</pre><h4>Redirecting input / output streams</h4><p>The streams <strong>stdin</strong>, <strong>stdout</strong> and <strong>stderr</strong> have a respective <em>file descriptor index</em>, namely <strong>0</strong>, <strong>1</strong> and <strong>2</strong> respectively. You can use this index for redirecting I/O streams. The general format for using redirection is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkcVu7GE-5cDJSJJYpiUHg.png" /></figure><p><em>e.g. Above command redirects the output (</em><strong>stdout</strong><em> output) of </em>ls -lah /bin<em> to the file </em>my_binaries.txt<em> under </em>/home/alice<em>. The left-hand-side of the operator can also be a complex command expression.</em></p><pre>ls -lah /bin 1&gt; ~/my_binaries.txt</pre><p>Points to note:</p><ul><li>If destination file doesn’t exist, then it gets created.</li><li>If the file descriptor index for &gt; or &gt;&gt; is not specified, then it is considered as 1 by default i.e. <strong>stdout</strong>.<br><em>E.g. </em>ls /bin <strong>1&gt;</strong> ~/foo.txt<em> is same as </em>ls /bin <strong>&gt;</strong> ~/foo.txt</li></ul><p>Operators:</p><ol><li><strong>&gt;</strong>: Write the output of the left-hand-side (LHS) of the operator to the specified destination. If file exists, it gets overwritten.</li><li><strong>&gt;&gt;</strong>: Append the output of the LHS of the operator to the specified destination file. If file exists, its final content will be its existing content and then the currently appended output.</li><li><strong>&amp;</strong>: When used before the operators &gt;, &gt;&gt;, it means redirect both <strong>stdout</strong> and <strong>stderr</strong> to the specified destination.<br><em>E.g. </em>ls /bin <strong>&amp;</strong>&gt; ~/foo.txt<em> redirects both </em><strong>stdout</strong><em> and </em><strong>stderr</strong><em> output to </em>~/foo.txt<br>When used immediately after &gt;, it means redirect to another file-descriptor by the specified index.<br><em>E.g. </em>ls non-existent-dir <strong>2&gt;&amp;1</strong><em> redirects the </em><strong>stderr</strong><em> (file descriptor 2) output to the </em><strong>stdout</strong><em> (file descriptor 1)</em></li><li><strong>&lt;</strong>: Take input from the specified file instead of from <strong>stdin</strong><br><em>E.g. Execute below commands to see how </em>grep<em> reads input from a file instead of </em><strong>stdin</strong></li></ol><pre># First create a file to search in<br>echo &#39;I use nano editor&#39; &gt; file_to_search_in.txt<br><br># Use the &lt; operator to use this file as stdin<br># Here --color option is passed to grep to color search result(s)<br>grep nano &lt; file_to_search_in.txt --color<br><br># You can see the text nano highlighted in red</pre><h4>Chaining commands</h4><p>We can use the following operators to execute multiple commands sequentially or in parallel.</p><ol><li><strong>|</strong> <em>Single pipe</em>: Passes the <strong>stdout</strong> output of the command in its LHS as <strong>stdin</strong> input to the command in its RHS<br><em>E.g. </em>ls ~ <strong>|</strong> grep txt<em> passes the output of </em>ls ~<em>as input to </em>grep txt<em> command, thus </em>grep<em> will search for ‘</em>txt<em>’ in the output of the </em>ls<em> command</em></li><li><strong>&amp;</strong> <em>Single Ampersand</em>: When occurring at the end of any command, it immediately starts running that command in the background. This can be used to run multiple commands in parallel i.e. each command starts executing <strong>without waiting for the previous one to complete</strong>. If any one such background command fails, other commands will still execute.<br><em>E.g. </em>mkdir aa <strong>&amp;</strong> mkdir bb/mm <strong>&amp;</strong> mkdir cc<em> fires all three </em>mkdir<em> commands without waiting for any to complete execution. You can press </em>Enter/Return Key <em>and run </em>ls<em> to see which folders got created</em></li><li><strong>||</strong> <em>Double pipe</em>: OR Chaining of commands i.e. execute the next command ONLY IF current command <strong>fails</strong>. As soon as first successful execution, stop the chain<br><em>E.g. </em>mkdir aa <strong>||</strong> mkdir ee <strong>||</strong> mkdir ff <em>first tries to execute </em>mkdir aa<em>, if this fails (some error occurs), </em><strong><em>only then continue to execute</em></strong><em> </em>mkdir ee<em>. If </em>mkdir aa<em> succeeds, then </em>mkdir ee<em> will </em><strong><em>NOT</em></strong><em> be executed. You can run </em>ls<em> to see which folders got created</em></li><li><strong>&amp;&amp;</strong> <em>Double ampersand</em>: AND Chaining of commands i.e. execute the next command ONLY IF current command <strong>runs successfully</strong>. As soon as first failure in execution, stop the chain<br><em>E.g. </em>mkdir aa <strong>&amp;&amp;</strong> mkdir oo <strong>&amp;&amp;</strong> mkdir pp <em>first tries to execute </em>mkdir aa<em>, if this fails (some error occurs), </em><strong><em>then stop executing</em></strong><em> and return its exit code. If </em>mkdir aa<em> succeeds, then proceed to execute </em>mkdir oo<em> and so on. You can run </em>ls<em> to see which folders got created</em></li><li><strong>;</strong> <em>Semi-colon</em>: Always execute the next command after the current command completes execution — irrespective of whether current command succeeds or fails<br><em>E.g. </em>mkdir rr <strong>;</strong> mkdir ee <strong>;</strong> mkdir gg <em>first tries to execute </em>mkdir rr<em>, </em><strong><em>waits for it to finish, then continues to execute</em></strong><em> </em>mkdir ee<em>, waits for this to complete, then proceeds to next command i.e. </em>mkdir gg<em>. It doesn’t matter whether the command fails or succeeds. You can run </em>ls<em> to see which folders got created</em></li></ol><h4>Special characters</h4><ol><li><strong>$</strong> <em>For variables</em>: When it is immediately followed by an alphanumeric string (whose first character is an alphabet, not a number), it acts as <strong>reference to a variable</strong> i.e. to access the variable’s value<br><em>E.g. </em>export myData=’custom value’ ; echo <strong>$</strong>myData ;<em> first creates a variable </em>myData<em>, and then </em><strong>$</strong>myData<em> is used to access its value</em></li><li><strong>$</strong> <em>For positional arguments</em>: When immediately followed by numeric value, it refers to the positional command line argument passed in a script<br><em>E.g. Execute the following commands and see the values printed for 1st, 2nd, 3rd param and cmd.</em></li></ol><pre># See the use of $1 $2 $3 and $0<br># Below command creates a bash .sh file<br>export myData=&#39;time to go&#39;<br>echo &#39;echo 1stparam=$1, 2ndparam=$2, 3rdparam=$3, cmd=$0, $myData&#39; &gt; myprint.sh<br>bash myprint.sh &#39;one one one&#39; two three</pre><ol><li>$(&lt;bash command(s)&gt;): Contents of the parentheses is executed as command(s) and its <strong>stdout</strong> output is substituted in place<br><em>E.g. </em>echo we have $(echo foo) <em>evaluates to </em>echo we have foo<em> and prints </em>we have foo<em> to </em><strong>stdout</strong></li><li>$((&lt;arithmetic-expression&gt;)): Contents of the double parentheses is evaluated as an arithmetic expression and the answer is substituted in place<br><em>E.g. </em>echo $((2 * 3 + 5)) + 5<em> evaluates to </em>echo 11 + 5<em> and prints </em>11 + 5<em> to </em><strong>stdout</strong></li><li><strong>!</strong> <em>Exclamation</em>: It acts as command selector from your command history when not part of a script file (.sh file)<br>E.g.:<br>!5 to execute the 5th command in your command line history<br>!-2 executes the second-last command you executed<br>!! is a shortcut for !-1, executes the last command you executed<br>Try above commands after echo like echo !5</li><li><strong>\</strong> <em>Backslash</em>: Escape a special character or operator<br><em>E.g. </em>echo this is <strong>\</strong>$myData<em> prints </em>this is $myData<em> to </em><strong>stdout</strong><em> i.e. the dollar $ is not considered as a special character</em></li></ol><h4>Using quotes in Linux terminal</h4><ol><li><strong>&#39;</strong><em>Single quote</em>: Any value within single quotes is purely text and is not parsed as script<br><em>E.g. </em>echo <strong>&#39;</strong>$(ls -l)<strong>&#39;</strong><em> just prints </em>$(ls -l)<em> to </em><strong>stdout</strong><em> as it is</em></li><li><strong>&quot;</strong><em>Double quote</em>: Special characters (excluding * ? [ ]) are parsed as script allowing variable or command substitution<br><em>E.g. </em>echo <strong>&quot;</strong>$(ls -l)<strong>&quot;</strong><em> first executes </em>ls -l<em> as a command and then prints its output to </em><strong>stdout<br></strong><em>E.g. </em>echo <strong>&quot;</strong>in double quotes = $myData<strong>&quot;</strong><em> first evaluates value of </em>$myData<em> as a variable and then substitutes its value to print </em>in double quotes &lt;$myData’s value&gt;<em>to </em><strong>stdout</strong></li><li><strong>`</strong><em>Backtick</em>: Any value within backticks is executed as script<br><em>E.g. </em>echo <strong>`</strong>ls -l<strong>`</strong><em> executes </em>ls -l<em> as a command and then prints its output to </em><strong>stdout</strong></li></ol><h4>Exit codes of commands</h4><blockquote>“There is only a single reason that a command runs successfully, but a thousand possible reasons for it to fail.”</blockquote><p>Linux commands return an exit code of “0” to indicate success. Any non-zero exit code indicates unsuccessful execution.</p><h3>Conclusion</h3><p>Linux terminals have evolved over time making them faster and easier to use. This article was just an introduction. Hope it gave enough information for you to get a hang of Linux terminals. For those looking to delve deeper, I would recommend taking up NDG Linux courses on Cisco Networking Academy.</p><h4>References:</h4><ol><li>Some terminologies: <a href="http://www.it.uu.se/education/course/homepage/os/vt18/module-0/shell-and-terminal/">http://www.it.uu.se/education/course/homepage/os/vt18/module-0/shell-and-terminal/</a></li><li>Pipeline operator precedence: <a href="https://www.gnu.org/software/bash/manual/html_node/Lists.html">https://www.gnu.org/software/bash/manual/html_node/Lists.html</a></li><li>Special characters: <a href="https://tldp.org/LDP/abs/html/special-chars.html">https://tldp.org/LDP/abs/html/special-chars.html</a></li><li>Bash operators: <a href="https://eng.libretexts.org/Bookshelves/Computer_Science/Operating_Systems/Linux_-_The_Penguin_Marches_On_(McClanahan)/13%3A_Working_with_Bash_Scripts/2.04%3A_Shell_Operators">https://eng.libretexts.org/Bookshelves/Computer_Science/Operating_Systems/Linux_-_The_Penguin_Marches_On_(McClanahan)/13%3A_Working_with_Bash_Scripts/2.04%3A_Shell_Operators</a></li><li>File descriptors and streams: <a href="https://www.gnu.org/software/libc/manual/html_node/Streams-and-File-Descriptors.html">https://www.gnu.org/software/libc/manual/html_node/Streams-and-File-Descriptors.html</a></li><li>Redirecting I/O streams: <a href="https://tldp.org/LDP/abs/html/io-redirection.html#IOREDIRREF">https://tldp.org/LDP/abs/html/io-redirection.html#IOREDIRREF</a></li><li>Cheatsheet for redirecting input/output: <a href="https://www.codecademy.com/learn/learn-the-command-line/modules/learn-the-command-line-redirection/cheatsheet">https://www.codecademy.com/learn/learn-the-command-line/modules/learn-the-command-line-redirection/cheatsheet</a></li></ol><h4>External images used:</h4><ol><li>Tux (Linux mascot): <a href="https://en.wikipedia.org/wiki/File:Tux_Classic_flat_look_3D.svg">https://en.wikipedia.org/wiki/File:Tux_Classic_flat_look_3D.svg</a></li><li>Muscular penguin: Image by <a href="https://pixabay.com/users/openclipart-vectors-30363/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=149971">OpenClipart-Vectors</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=149971">Pixabay</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91f872d0ed67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Privacy on the Internet: A Lie]]></title>
            <link>https://ipurujit.medium.com/privacy-on-the-internet-a-lie-e0e9998144c7?source=rss-9a85747b4c83------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0e9998144c7</guid>
            <category><![CDATA[online]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Purujit S]]></dc:creator>
            <pubDate>Sat, 30 Oct 2021 17:52:37 GMT</pubDate>
            <atom:updated>2021-10-30T17:52:37.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Many eyes looking at the viewer" src="https://cdn-images-1.medium.com/max/960/1*RNYijoAlBryi6K3pRd9ILw.png" /><figcaption>Eye See You</figcaption></figure><p>“Alexa, call John Doe.”<br>Alexa : “Calling John Doe…”</p><p>To respond to someone saying “Alexa”, Alexa must be constantly listening to whatever is being said around it — all the time. Moreover, smart devices often record anonymous data for improving themselves. This could very well mean, that anything spoken around Alexa may be recorded for performance reasons. Same goes for any other voice assistant which is connected over internet.</p><figure><img alt="Google Voice Assistant (onIPhone)" src="https://cdn-images-1.medium.com/max/1024/1*GGCcnlvntB3a00OkLgeNRQ.jpeg" /><figcaption>Google Voice Assistant (on IPhone)</figcaption></figure><p>Almost every “smart” device or software is gathering data to learn and improve itself — and that’s amazing! You get customized recommendations — curated just for you!</p><p><em>Wouldn’t you prefer video recommendations similar to what you have watched? Or relevant job recommendations based on your previous applications or searches?</em></p><p>And the software, device or its maker clearly specifies which data may be collected, stored and shared with third-parties in its terms and conditions (the part where there’s some huge, complex text followed by an “I accept” checkbox). The good part is that this makes human life easier. The debatable part is: to what extent are we willing to share such data?</p><p><strong>Privacy vs Protection vs Personalization — the Trade-off</strong></p><p>Absolute privacy is when you precisely decide who may know what about you. But to enforce protection over the internet, one mandatorily needs some identification information. E.g. If someone logs into your account without your knowledge, it is easier to identify such a login if your account stores information about which devices you have logged into before: An unknown device generates an alert. Coming to personalization, we need things narrowed down and it’s simply too tedious to do so by ourselves. E.g. Your Google search history is one factor determining which search result is more relevant to you. That being said, can we ever reach an optimum balance between these three?</p><p><strong>How Private is Privacy right now?</strong></p><blockquote>“You are being watched. Every move. Every word. Everyday.”</blockquote><figure><img alt="All seeing eye" src="https://cdn-images-1.medium.com/max/1024/1*Z30sVQhBBX1Jen2XGz9wDw.png" /><figcaption>All Seeing I</figcaption></figure><p>Right now, while you are reading this, medium.com is aware of the following and there’s not much that you can do to hide it:<br>1. Your current browser (with its version)<br>2. Your current device and operating system<br>3. Your IP address (which can be used to trace your location)<br>4. How long you spend reading this article (I need to know that too!)<br>5. Which other Medium articles you may have accessed from the same device<br>6. Maybe even your service provider</p><p>Further points to note!</p><ol><li>The default configuration for social media accounts often prefers collection of data. E.g. Take a deep dive into your Facebook account settings to check what you are sharing with third parties or for better ads.</li><li>When we report something e.g. a user, chat or an account, then someone (a human or machine) must check whether you have correctly reported the content and if it is ill-fit for the platform. And the software (or person) should be able to judge you as fake reporter if you keep reporting incorrectly. Thus, such a reporting may include: the reported content/account (<strong>even if it’s private</strong>), the reporting user, and the reported user connected with the content.</li><li>The only thing between you and your private content is a password. <br><em>(You can check out </em><a href="https://ipurujit.medium.com/password-security-a-myth-df881c35a17c"><em>my previous post on passwords</em></a><em> for more…) </em>And the HOPE that your followers or others who can view your content won’t share it elsewhere.</li></ol><p>To put it simply: <strong>Anything that has been shared or done online is no longer private.</strong></p><p><strong>What can we do?</strong></p><p>Here are some solutions and their drawbacks—</p><figure><img alt="Solutions on how to be more private and their drawbacks. Solution: Staying offline, Drawback: Sounds lonely; Solution: Manually setting which data to share, Drawback: Needs time; Solution: Using Incognito surfing, Drawback: No browser history; Solution: Using less personalized (e.g. DuckDuckGo, Ecosia, Brave, Tor browser), Drawback: Possibly slower speed or less relevnant results; Solution: Accept there is no privacy, Drawback: hard to digest" src="https://cdn-images-1.medium.com/max/1024/1*BxOF92iY3_nSdWFIQ3JY6A.png" /><figcaption>Answer to Privacy</figcaption></figure><p><em>Do you have any suggestions to improve Privacy? Do share in the comments! (Anonymously, of course)</em></p><p><strong>The Future of Privacy</strong> — <em>if it isn’t the Present already</em></p><p>Every person has a unique identity associated with all their health &amp; financial records, social media accounts or any service they may have used. Devices around us know us all too well — much better than we know ourselves. In fact, you only need to think of something — say to buy a watch (if we still need those in the Future) — and your smart assistant shows you the most relevant results. Your assistant even tells you how to spend your money more wisely. Matchmaking has never been easier — smart assistants communicate with each other to find you the One, the One most compatible with your interests and personality, based on everything they know about you (which is, everything there <em>is</em> to know).</p><p><em>Footnote</em>:<br>This post is not to criticize collection of data. I myself need personalization and I’m willing to share data — to some extent. That is an individual choice, which I request, that you make after understanding exactly what it implies.<br> — <br>Signing off, Purujit S :)</p><p><em>References</em>:<br>1. Chapter 9 ‘Privacy’ from <em>Security in Computing</em> by Charles P. Pfleeger, Shari Lawrence Pfleeger, Jonathan Margulies<br>2. <a href="https://theworldnews.net/gb-news/amazon-alexa-records-your-private-chats-here-s-who-can-listen-to-them">https://theworldnews.net/gb-news/amazon-alexa-records-your-private-chats-here-s-who-can-listen-to-them</a></p><p><em>Links to the awesome original images used:<br></em>1. <a href="https://pixabay.com/de/illustrations/augen-b%c3%b6ser-blick-blau-muster-4751572/">https://pixabay.com/de/illustrations/augen-b%c3%b6ser-blick-blau-muster-4751572/</a><br>2. <a href="https://pixabay.com/photos/voice-control-voice-commands-2598422/">https://pixabay.com/photos/voice-control-voice-commands-2598422/</a><br>3. <a href="https://pixabay.com/de/vectors/cia-echelon-fbi-f%c3%bcnf-augen-2026426/">https://pixabay.com/de/vectors/cia-echelon-fbi-f%c3%bcnf-augen-2026426/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0e9998144c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password Security: A Myth?]]></title>
            <link>https://ipurujit.medium.com/password-security-a-myth-df881c35a17c?source=rss-9a85747b4c83------2</link>
            <guid isPermaLink="false">https://medium.com/p/df881c35a17c</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[awareness]]></category>
            <dc:creator><![CDATA[Purujit S]]></dc:creator>
            <pubDate>Fri, 01 Oct 2021 15:58:34 GMT</pubDate>
            <atom:updated>2021-10-01T15:58:34.958Z</atom:updated>
            <content:encoded><![CDATA[<p><em>It’s Cybersecurity Awareness Month (October)! The perfect occasion to look at some central aspects of security which make up a substantial part of our daily life. This blog is intended for everyone — you, your family, your colleagues, and… well, anyone who has (or will) ever set a password.</em></p><p>Ages ago, someone somewhere thought, “Hey, a sentry should allow entry only to VIPs based on something secret that only these VIPs know!” And voila! We started using secret word(s) which laid the foundation of majority of prevalent identity verification systems. A creative idea in those days, but not in this century or ever after. Here’s why:</p><p>Computers are growing with faster-than-lightning processing powers — it’ll take just few seconds for an average modern computer to try out every possible PIN to unlock a 4-digit PIN secured device. Even complex alphanumeric passwords can be guessed, provided enough time. This realization dawned on people some time ago and they starting coming up with ideas to enhance the security provided by passwords. You see, the very concept of a pass “word” is restrictive: A single word can never suffice to thwart even the most basic attacks which use a dictionary of known words and passwords. Thus, a new term started surfacing, which has yet failed to take over the stature of “password” — have you heard of a “passphrase”?</p><figure><img alt="In 1980s, password, in 2010, passphrase, in 2030, pass-paragraph, in 2040, pass-essay?" src="https://cdn-images-1.medium.com/max/500/1*hWhXQB0kKlAK3PW-EpAkig.jpeg" /><figcaption>Pass-what?</figcaption></figure><p>A passphrase is a reminder to use longer passwords. However, this is just one of the many ways to improve password security. Let us first look at common insecure practices for passwords. Try counting how many of these points describe your password hygiene.</p><ol><li>Having one password for multiple accounts</li><li>Using birth-date / month / year OR username / your name / your initials / name or initials of someone close to you in the password</li><li>Not changing the default password</li><li>Not updating the password periodically: How old is your password?</li><li>Sharing your password with others</li><li>Typing the password while sharing screen</li><li>Storing password in “Notes” in your phone</li><li>Storing password in your browser</li><li>Writing password on something accessible on your desk</li><li>Staying logged into shared devices</li><li>Entering passwords in public places where anyone can peek</li><li>Using common patterns — e.g. linear order of keys as given on keyboard (qwerty, 5678)</li><li>Reusing passwords</li><li>Commenting accurately on social media posts like these:</li></ol><figure><img alt="A social media post with a cute photo of a pet animal with the caption “What’s the name of your first pet! Comment below” — This way someone can get answers to your security questions." src="https://cdn-images-1.medium.com/max/640/1*7kjLHYbZZqStTrq3EtDO6g.jpeg" /><figcaption>“Hey! Here’s the answer to one of my security questions!”</figcaption></figure><p>What’s your score? Comment below!<br>Feel free to share other insecure practices which I may have missed.</p><p>Now, let us look at some features which enhance security. If any of your accounts provide or enforce these aspects, make sure to use it!</p><ol><li>Multi-factor Authentication (MFA) — an additional layer of security, such as using a one-time-password (OTP) after entering the password</li><li>Limiting failed login attempts — if someone enters the wrong password too many times, then account is temporarily locked or password is forcefully reset</li><li>Mandatory use of special characters</li></ol><figure><img alt="Some letters can be represented as numbers and vice-versa. E.g. A as 4; O as 0; B as 6; S as 5 or $; E as 3; T as 7 or +; G as 8 or 9; W as vv; H as #; X as %; I or L as 1 or !; Z as 2." src="https://cdn-images-1.medium.com/max/1024/1*ykxpFM9B2gX13sgfpvOyNg.png" /><figcaption>Translating letters to numbers and vice-versa</figcaption></figure><p>Tip: A password may contain blank spaces — anywhere except the beginning or the end.</p><p>4. Notification on login using a new device</p><p>5. Password-less login — sending an OTP for every login to a verified device or email</p><p>Security professionals are in a fix. Some argue that passwords are dead. But it seems that the Password Era still has many years to go. This brings us to the most important question, for which each one of us should regularly seek an up-to-date answer — How can I make my password more secure, but at the same time remember it?</p><ol><li>Be you. Develop your own unique encoding technique to generate secure passwords. Never reveal this technique and, if possible, update it with time.<br>E.g. Using the lyrics of some song (but it must NOT be an obvious song, such as your ringtone) — e.g. UP! vv#3n 17&#39;5 0v3r (Wake me up, Avicii)</li><li>Practise your password. Regularly log out and login again to check whether you remember the password. Update it periodically.</li><li>If possible, avoid using passwords altogether.<br>E.g. Logging in using Google account, however, it is essential to properly understand exactly which data from your Google account will be shared with the third-party or vice-versa</li><li>Only as a last resort — write down your password; but only in a secure manner. Do not write it as it is, instead adopt some cryptic methods.<br>E.g. Write some clue which will help you remember the entire password</li><li>Never trust anyone with your passwords — not even the website where you create the password.<br>E.g. I once registered on a portal, where I later came to know that all passwords are visible to the IT team behind the portal!</li></ol><p>Remember, your password is only as strong as its weakest link. Moreover, scammers prey on people through social media, phones, messages, etc. pretending to be someone trustworthy. Hence, <em>never</em> believe anyone over the internet unless you verify their identity and their claims multiple times through multiple reliable sources.</p><p>With that, I wish you a more secure virtual life! I hope the above points motivate you to adopt more secure habits, and hopefully usher in the Era of Passphrases — in hope of a safer internet!</p><p>Do you know any other methods for improving password security. I’d love to know about them! Do share in the comments!<br>- Purujit S S</p><p><em>References</em>:<br>1. <a href="https://www.mcafee.com/blogs/enterprise/cloud-security/how-to-create-a-strong-password-you-actually-remember/">https://www.mcafee.com/blogs/enterprise/cloud-security/how-to-create-a-strong-password-you-actually-remember/</a><br>2. <a href="https://en.wikipedia.org/wiki/Password">https://en.wikipedia.org/wiki/Password</a></p><p><em>Thanks to these sources for the original images used in this post</em>:<br>1. imgflip — <a href="https://imgflip.com/memegenerator/Expanding-Brain">https://imgflip.com/memegenerator/Expanding-Brain</a> <br>2. pixabay — <a href="https://pixabay.com/images/id-4390885/">https://pixabay.com/images/id-4390885/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df881c35a17c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Networks 101]]></title>
            <link>https://ipurujit.medium.com/computer-networks-101-fb615bd9c7e0?source=rss-9a85747b4c83------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb615bd9c7e0</guid>
            <category><![CDATA[computer-networking]]></category>
            <category><![CDATA[computer-network]]></category>
            <category><![CDATA[network-protocols]]></category>
            <category><![CDATA[network-topology]]></category>
            <dc:creator><![CDATA[Purujit S]]></dc:creator>
            <pubDate>Mon, 21 Jun 2021 10:21:15 GMT</pubDate>
            <atom:updated>2021-06-21T10:21:15.689Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Take a look around you. Are you using a smartphone or a computer? Do you have a TV at home? Do you talk over the telephone to your relatives? Wherever we look, we can find some or the other application of computer networks. Computer networks constitute the fundamental infrastructure which connect devices and enable communication between them. Not only can we connect to another person on the other side of the planet, but we can also communicate with a satellite orbiting the moon! We can have private networks at home or within a hospital. We can have public networks, like a television broadcaster or FM Radio. All these wonders implement computer networking at their core.</em></p><p>Consider the following example –</p><p>You wish to visit a website for certain information. If you’re connected to the internet, you can directly type the Universal Resource Locator (URL) — <a href="https://medium.com/@ipurujit">medium.com</a> — in the address bar or search for the website on a search engine. Once you find the website, you can navigate to any section or page through links provided on that website.</p><p>Computer networks are the backbone of the entire process mentioned above. An overview of the role they play is as follows –</p><p>1. Firstly, connecting to the Internet: From whichever device you’re accessing the website, there’s a Network Interface Card (NIC) which connects to the internet from within a smaller network such as your home Wi-Fi or Ethernet cable.</p><p>2. On entering <a href="https://medium.com/">medium.com</a> in the address bar, there is a Domain Name Server (DNS) query fired in the background, which translates the ‘human readable name’ (<a href="https://medium.com/">medium.com</a>) to its corresponding ‘machine readable’ Internet Protocol (IP) address.</p><p>3. The connection to the <a href="https://medium.com/">medium.com</a> server is then established through a series of networking devices such as connecting cables or routers and over the internet.</p><p>4. Your browser sends a request to the <a href="https://medium.com/">medium.com</a> server, saying, “Hey, can you GET the webpage corresponding to this address (e.g. <a href="http://54.12.48.163/home)">http://54.163.84.114:80/)</a> for me?”</p><p>5. The <a href="https://medium.com/">medium.com</a> server responds with the requested webpage, and this gets rendered in your browser.</p><p>6. For every further navigation within <a href="https://medium.com/">medium.com</a> website, your browser requests the <a href="https://medium.com/">medium.com</a> server asking for the content for specified URL.</p><p>7. All of this happens within the blink of an eye!</p><p><em>Tip: Can you think of any other example where computer networks are implemented? Try to understand the flow of such a process to get a better insight into the working of computer networks.</em></p><p>[Note: There are more steps involved (such as ISP for internet access, details of DNS lookup and reply, etc.), I’ll leave those for now, you may explore them.]</p><p><strong>What is a computer network?</strong></p><p>A number of hardware devices are connected to each other through some kind of connecting device such as a cable, or wireless devices like satellites or network towers. Such a system of interconnected devices which can communicate with one another is called a computer network. It is not necessary that there must be a computer within the network, for instance, consider a network of satellite dishes for television broadcasting.</p><p>A number of questions arises now that we know what a network is –</p><ol><li>How do the devices communicate?</li><li>How do they understand each other?</li></ol><p><em>Tip: Try to answer the above questions by yourself before proceeding to the next section.</em></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>All devices in a network send signals to one another. These signals are transmitted in the form of analog or digital signals. However, there arises a need to define protocols so that these signals can be understood by everyone within the network. Thus, a network itself is made of up hardware networking devices but the communication within is defined by protocols.</p><p><strong>What are protocols?</strong></p><p>A protocol is a set of rules which determine how particular operations are to be performed. Networking protocols define network-specific operations and help to maintain a standard across networking devices. They provide the basis on which other operations can be carried out.</p><p>Consider the following example –</p><p>Transmission Control Protocol (TCP) is used to establish a proper connection before starting exchange of data. The following figure demonstrates a three-way TCP Handshake, which is used initially to establish the connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*FCMcWaoYKdmVZUf-M4qQdQ.png" /><figcaption>Fig. 1: Three-way TCP Handshake (Overview)</figcaption></figure><p><strong>Why do we need protocols?</strong></p><ol><li><em>Standardization</em>: A standardized method for any operation ensures compatibility with devices manufactures by different vendors over different periods of time, having different hardware configuration. Protocols provide such standards to follow.</li><li><em>Modelling</em>: It becomes easier to program hardware, once we know the set of rules to be followed. Protocols thus provide a model for implementation.</li><li><em>Expansion</em>: Once we decide the basis of a protocol, future protocols can be built on top of existing ones or by expanding them. This feature is crucial as it ensures backward compatibility of existing protocols.</li><li><em>Security</em>: Network security is incorporated using protocols which make the connection more secure. Protocols are always defined keeping in mind security principles. They must not be vulnerable to attacks.</li></ol><p><strong>Maintaining network protocol standards</strong></p><p>If protocols define standards, then there must be some entity ensuring that the protocol itself follows specific standards. Several organizations have been established which define and maintain protocol standards. These organizations do not fall under a single country, but act globally. Some of them are <a href="https://www.ietf.org/">Internet Engineering Task Force (IETF)</a>, <a href="https://www.w3.org/">World Wide Web Consortium (W3C)</a>, <a href="https://www.iso.org/home.html">International Standards Organization (ISO)</a>, <a href="https://www.nist.gov/">National Institute of Standards and Technology (NIST)</a>, <a href="https://www.ieee.org/">Institute of Electrical and Electronics Engineers (IEEE)</a>.</p><p><strong>What are networking hardware devices?</strong></p><p>Any device which is a part of a network is a networking hardware device. These devices define the physical network. They can send, receive or forward data in a network on their own or with the help of other devices. They use buffers to store and process the data. Each device consists of one or more ports. These may be hardware ports (USB Port, Ethernet Port, etc.) or software ports (separate ports for email, file transfer, etc.). Generally, these ports are configured to work for specific protocols.</p><p>Some networking devices only act as a carrier or to facilitate data transmission. These are also called connecting devices. These include cables, satellite dishes, amplifiers, etc. Generally, they consist only of hardware components which transmit signals without processing them. On the other hand, devices such as routers process signals to take decisions such as the where to forward the data or whether to forward it.</p><p><strong>Network topologies</strong></p><p>A network topology is a layout of how the devices in the network are connected. A topology can be physical or logical — the physical topology defines how the devices are physically connected whereas a logical topology defined how they are virtually connected. A topology can also be categorized as follows based on how the devices are interconnected –</p><p><em>1.Bus topology</em>: One of the simplest topologies, here a single or continuous cable is used to connect to multiple hosts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*alTuZx5Y4foUnwRSw1DzqA.png" /><figcaption>Fig. 2: Bus topology</figcaption></figure><p><em>2. Star topology</em>: A central device acts as an intermediary to other devices. This device can be a switch or a hub. All devices are connected directly to the central device. Hence the name “star” topology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*lDZ1PS2IpsPw-RH61BYk0A.png" /><figcaption>Fig. 3: Star topology</figcaption></figure><p><em>3. Ring topology</em>: All devices are connected to the nearest neighbouring device on either side. Thus it forms a ring-like topology. A token is passed from one device to the next one in a circular manner. Only the device which holds the token can send a message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*4Vnc3VfZQ30rLQl6IRfZlg.png" /><figcaption>Fig. 4: Ring Topology</figcaption></figure><p><em>4. Mesh topology</em>: This is almost never used. Here every device is connected directly to every other device. Although this is efficient in terms of directly sending data, but it is infeasible in terms of cabling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*ALDEbu0phWeDIdFaD6NaaQ.png" /><figcaption>Fig. 5: Mesh topology</figcaption></figure><p><em>5. Hybrid topology</em>: When one or more of the above topologies are combined together, it forms a hybrid topology (e.g. a hybrid star bus topology consists of one or more star topologies wherein the central device of each star is connected to form a bus topology).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*MI1EyvL-tbMWQe3PBw3FHA.png" /><figcaption>Fig. 6: Hybrid Star-Bus topology</figcaption></figure><blockquote>References:</blockquote><blockquote><em>1. Computer Networks (5th Edition)</em> by A. Tannenbaum, D. Wetherall [Prentice Hall]</blockquote><blockquote><em>2. Computer Networking : A Top-Down Approach</em> <em>(6th Edition)</em> by J. Kurose, K. Ross [Pearson]</blockquote><p><strong><em>~ Purujit S S</em></strong></p><p><strong>Thanks for reading!<br>If you liked it, please leave a “clap”, a comment, or even better, follow me for further technical posts on a variety of topics!</strong></p><p>You can also connect with me here -<br>Linked-In — <a href="https://www.linkedin.com/in/purujit-srinivasan">https://www.linkedin.com/in/purujit-srinivasan</a><br>GitHub — <a href="https://github.com/mockingmoon">https://github.com/mockingmoon</a><br>Blog (For creative writing) — <a href="https://mockingmoon.wordpress.com/">https://mockingmoon.wordpress.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb615bd9c7e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>