<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mithil Poojary</title>
    <description>The latest articles on DEV Community by Mithil Poojary (@mithil467).</description>
    <link>https://dev.to/mithil467</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F362795%2F2769495a-8f2d-4887-920f-7bc63f9d75b0.png</url>
      <title>DEV Community: Mithil Poojary</title>
      <link>https://dev.to/mithil467</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mithil467"/>
    <language>en</language>
    <item>
      <title>Mitype ⌨️ - Typing Speed Test Right In Your Terminal</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Sun, 20 Sep 2020 20:07:38 +0000</pubDate>
      <link>https://dev.to/mithil467/mitype-typing-speed-test-right-in-your-terminal-13k6</link>
      <guid>https://dev.to/mithil467/mitype-typing-speed-test-right-in-your-terminal-13k6</guid>
      <description>&lt;p&gt;Who doesn't like to type fast? I made mitype with an intention to test typing speed and hence improve it at the ease of one command.&lt;/p&gt;

&lt;p&gt;Feel free to contribute 💚&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Mithil467" rel="noopener noreferrer"&gt;
        Mithil467
      &lt;/a&gt; / &lt;a href="https://github.com/Mithil467/mitype" rel="noopener noreferrer"&gt;
        mitype
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Typing speed test in terminal
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt; ⌨ Mitype ⌨ &lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
    Typing Speed Test in Terminal
    &lt;br&gt;
  &lt;br&gt;
&lt;a href="https://codeclimate.com/github/Mithil467/mitype/maintainability" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bf2d9764975b1ca53d010eb5483925d4b53614ed174687b465809b353cd61855/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34643033393764346337646433623831613230352f6d61696e7461696e6162696c697479"&gt;&lt;/a&gt;
&lt;a href="https://pypi.org/project/mitype/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/429d7eee05a0f02d3c2ace78768f1a4f1ee37c37cf76d400518216e27680a266/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6d69747970652e737667"&gt;&lt;/a&gt;
&lt;a href="https://github.com/Mithil467/mitypeLICENSE.txt" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/1e74d38879684f6aeea63a707f1fac3bd07402432fa01f31a20f81944d792fd1/68747470733a2f2f696d672e736869656c64732e696f2f707970692f6c2f6d69747970652e737667"&gt;&lt;/a&gt;
&lt;a href="https://github.com/ambv/black" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5bf9e9fa18966df7cb5fac7715bef6b72df15e01a6efa9d616c83f9fcb527fe2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667"&gt;&lt;/a&gt;
&lt;br&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/Mithil467/mitypedocs/source/_static/demo.gif"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FMithil467%2Fmitypedocs%2Fsource%2F_static%2Fdemo.gif" alt=""&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mitype&lt;/strong&gt; is a program to test (and hence improve) your typing speed right from the ease of your terminal.&lt;/p&gt;

&lt;p&gt;Written completely in python with no external dependencies!&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Main Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;🖥️ Cross-platform&lt;/li&gt;
&lt;li&gt;🎦 See your replay&lt;/li&gt;
&lt;li&gt;📝 Choose custom text input&lt;/li&gt;
&lt;li&gt;
🅰️ 6000 text samples&lt;/li&gt;
&lt;li&gt;🌈 Colored texts&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🔧 Install&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Mitype can be easily installed by:&lt;/p&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;pip install mitype&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📈 Usage&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;Once installed, you can run it simply as:&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;mitype
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also customize each run by specifying the following options as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-f FILENAME, --file FILENAME&lt;/code&gt;
Uses contents of file as sample text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-d N, --difficulty N&lt;/code&gt;
N can be in range [1, 5] with 1 being the easiest. This decides the length of the text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-i ID, --id ID&lt;/code&gt;
ID can be in range [1, 6000].&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can quit mitype anytime by pressing the &lt;code&gt;ESC&lt;/code&gt; key or &lt;code&gt;CTRL-C&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Mithil467/mitype" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Features-
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Supports several languages like English and German&lt;/li&gt;
&lt;li&gt;Choose your own text files&lt;/li&gt;
&lt;li&gt;Or randomly pick up a sample from 6000 entries&lt;/li&gt;
&lt;li&gt;View results and replay after every test&lt;/li&gt;
&lt;li&gt;Choose difficulty level&lt;/li&gt;
&lt;li&gt;Has cross-platform support&lt;/li&gt;
&lt;li&gt;Works with both python 2 and python 3&lt;/li&gt;
&lt;li&gt;Uses in-built python modules only&lt;/li&gt;
&lt;li&gt;Available on &lt;a href="https://pypi.org/project/mitype/" rel="noopener noreferrer"&gt;pypi&lt;/a&gt; allowing easy install&lt;/li&gt;
&lt;li&gt;Colored highlights&lt;/li&gt;
&lt;li&gt;Runs on &lt;a href="//mitype.mithil467.repl.run"&gt;web&lt;/a&gt;, although the latency is kinda high&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to get it?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;pip install mitype&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to run it?
&lt;/h3&gt;

&lt;p&gt;Choose random text:&lt;br&gt;
&lt;code&gt;mitype&lt;/code&gt;&lt;br&gt;
To choose a sample file:&lt;br&gt;
&lt;code&gt;mitype -f &amp;lt;your_file&amp;gt;&lt;/code&gt;&lt;br&gt;
Choose a difficulty level:&lt;br&gt;
&lt;code&gt;mitype -d &amp;lt;N&amp;gt;&lt;/code&gt;&lt;br&gt;
Choose a text ID:&lt;br&gt;
&lt;code&gt;mitype -i &amp;lt;ID&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Built with
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; and all its inbuilt modules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Curses&lt;/strong&gt; library - Easily capture keystrokes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sqlite3&lt;/strong&gt; - Database for storing text&lt;/li&gt;
&lt;li&gt;Text provided by &lt;a href="//typeracerdata.com"&gt;typeracerdata.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mitype is open to feedback, contributions and new ideas 💡&lt;br&gt;
🌟 Star the repo on &lt;a href="https://github.com/Mithil467/mitype" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>hacktoberfest</category>
      <category>python</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Make your app appear on the start menu with just one file</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Tue, 28 Jul 2020 03:04:19 +0000</pubDate>
      <link>https://dev.to/mithil467/make-your-app-appear-on-the-start-menu-with-just-one-file-3i9p</link>
      <guid>https://dev.to/mithil467/make-your-app-appear-on-the-start-menu-with-just-one-file-3i9p</guid>
      <description>&lt;p&gt;You just made an awesome app! Now you want others to be able to install it, and use it. You may want it to appear on the main menu, it must be searchable, it must appear in the context menu as "open with ". You might further want to pin it to the dock or add it to favorites.&lt;/p&gt;

&lt;p&gt;Taking the example of &lt;a href="%5Bhttps://github.com/Mithil467/Coreavor%5D(https://github.com/Mithil467/Coreavor/blob/master/coreavor.desktop)"&gt;Coreavor&lt;/a&gt;, a simple image viewer that I made recently, I needed to associate the program with images so that I can right click and open it in &lt;code&gt;Coreavor&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;All of this is achieved with the help of a desktop file which is a simple text file with &lt;code&gt;.desktop&lt;/code&gt; extension.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Desktop Entry]
Type=Application
Name=Coreavor
Icon=/usr/share/icons/coreavor.png
Comment=A simple Image Viewer
Exec=/usr/local/bin/Coreavor %U
TryExec=/usr/local/bin/Coreavor
Terminal=false
MimeType=image/png;image/gif;image/jpg;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every desktop file must have this structure, although not all fields are compulsory, but messing up a field might result in unwanted results.&lt;br&gt;
Most of these fields are self explanatory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Exec&lt;/code&gt; takes in the instruction to be executed. The &lt;code&gt;%U&lt;/code&gt; at the end takes in command line arguments which are passed to your program.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TryExec&lt;/code&gt; is the file path to the executable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MimeType&lt;/code&gt; is used to associate your program with files of a certain type.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can read about the standard and information regarding more keys used in &lt;code&gt;.desktop&lt;/code&gt; file &lt;a href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Place this file in the &lt;code&gt;/usr/share/applications&lt;/code&gt; directory so that it is accessible system wide, or in &lt;code&gt;~/.local/share/applications&lt;/code&gt; to only make it accessible to a particular user.&lt;/p&gt;

&lt;p&gt;All your other apps' desktop files are present here. You can have a look at any of these files to understand and learn from them.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.gnome.org/integration-guide/stable/desktop-files.html.en"&gt;Gnome's guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://techbase.kde.org/Development/Tutorials/Desktop_File"&gt;KDE's guide&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>beginners</category>
    </item>
    <item>
      <title>3 Things I Wish I Knew Before Publishing My First Python Package on PyPi</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Tue, 16 Jun 2020 16:48:46 +0000</pubDate>
      <link>https://dev.to/mithil467/3-things-i-wish-i-knew-before-publishing-my-python-package-on-pypi-lej</link>
      <guid>https://dev.to/mithil467/3-things-i-wish-i-knew-before-publishing-my-python-package-on-pypi-lej</guid>
      <description>&lt;p&gt;&lt;strong&gt;I&lt;/strong&gt; published my &lt;em&gt;first&lt;/em&gt; python package &lt;a href="https://pypi.org/project/mitype/"&gt;Mitype&lt;/a&gt;.&lt;br&gt;
&lt;code&gt;PyPI&lt;/code&gt; and &lt;code&gt;pip&lt;/code&gt; have made it so easy to install software!&lt;br&gt;
This is all it takes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;pip&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;package_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is equally easy to share and distribute your awesome program through PyPI. Or is it?&lt;br&gt;
I tried and failed multiple times. Publishing the package is the easy part. Getting it working the way you want it to be is not.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. A version once published can't be reused❗
&lt;/h2&gt;

&lt;p&gt;Say you published version 0.1 for your project. And then when you tested it out you realized that you missed to include that important database file! You have no option other than re-publishing a later version. Be careful whenever you publish that version on pypi. The same version cannot be edited or reused. You can delete it, but you cannot reuse it, even when deleted.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. &lt;a href="https://test.pypi.org/"&gt;TestPyPI&lt;/a&gt; is your best friend
&lt;/h2&gt;

&lt;p&gt;I so badly wish that I knew this earlier. You can first publish your package to test pypi, without affecting the actual index. You can also test the package version by installing it just like a regular python package.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Getting that sweet version update takes time
&lt;/h2&gt;

&lt;p&gt;I would publish the version and get the success message. But then when I tried installing that version, I would get an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ERROR&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Could&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;find&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;satisfies&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;requirement&lt;/span&gt; &lt;span class="nx"&gt;mitype&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'd get so upset thinking "What went wrong?!".&lt;br&gt;
But then it would work! It just takes time, sometimes about 20 minutes. No need to worry!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I&lt;/strong&gt; am just a beginner, and &lt;a href="https://github.com/Mithil467/mitype"&gt;Mitype&lt;/a&gt; was my very first project on PyPI. It was one of my very proud moments!&lt;br&gt;
All of you have your own different story! What is something that you wish you knew before publishing a python package?&lt;/p&gt;

</description>
      <category>python</category>
      <category>pypi</category>
      <category>beginners</category>
      <category>pip</category>
    </item>
    <item>
      <title>How To Make A .deb For Your Program</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Sun, 14 Jun 2020 12:15:15 +0000</pubDate>
      <link>https://dev.to/mithil467/how-to-make-a-deb-for-your-program-3n0d</link>
      <guid>https://dev.to/mithil467/how-to-make-a-deb-for-your-program-3n0d</guid>
      <description>&lt;p&gt;&lt;strong&gt;I&lt;/strong&gt; developed &lt;a href="https://github.com/Mithil467/mitpick"&gt;mitpick&lt;/a&gt;, a tool to capture the &lt;em&gt;terminal&lt;/em&gt; output screenshot, right from the terminal, and copy it to the clipboard. All you need to run is &lt;code&gt;mitpick&lt;/code&gt;. I am just using mitpick as an example, and the reason that I explored deb packaging in the first place.&lt;/p&gt;

&lt;p&gt;Let's get straight into how I packaged it into a &lt;code&gt;.deb&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;You'll need a folder to store all contents of the package. Let's call this folder &lt;code&gt;mitpick_1.0-1&lt;/code&gt; (package-name). This folder is like the &lt;code&gt;root&lt;/code&gt; of the target system.&lt;/p&gt;

&lt;p&gt;Binary files or executables go into the &lt;code&gt;bin&lt;/code&gt; folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;mitpick_1.0-1/usr/local/bin &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &amp;lt;executable_path&amp;gt; mitpick_1.0-1/usr/local/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-p&lt;/code&gt; flag takes care that the directory is made with all parent directories as well. Otherwise, the command gives error &lt;em&gt;no such file or directory exists&lt;/em&gt;.&lt;br&gt;
Other resource files go into the &lt;code&gt;share&lt;/code&gt; folder. Like in my case, I needed an external bash file as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;mitpick_1.0-1/usr/local/share/mitpick &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &amp;lt;resource_file&amp;gt; mitpick_1.0-1/usr/local/share/mitpick
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, you need to make a text file called &lt;code&gt;control&lt;/code&gt; which includes all metadata information about the package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;mitpick_1.0-1/DEBIAN
nano mitpick_1.0-1/DEBIAN/control
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;mitpick&lt;/span&gt;
&lt;span class="nx"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nx"&gt;Architecture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;amd64&lt;/span&gt;
&lt;span class="nx"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;xdotool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;xclip&lt;/span&gt;
&lt;span class="nx"&gt;Maintainer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Mithil&lt;/span&gt; &lt;span class="nx"&gt;Poojary&lt;/span&gt; &lt;span class="nx"&gt;mithil467&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;gmail&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;com&lt;/span&gt;
&lt;span class="nx"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;mitpick&lt;/span&gt;
 &lt;span class="nx"&gt;When&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;need&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;screenshot&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;terminal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;just&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;
 &lt;span class="nx"&gt;small&lt;/span&gt; &lt;span class="nx"&gt;program&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line in the description should start with a single space.&lt;br&gt;
Read about metadata options &lt;a href="https://www.debian.org/doc/debian-policy/ch-controlfields.html"&gt;here&lt;/a&gt;.&lt;br&gt;
Lastly, you need to package it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dpkg-deb &lt;span class="nt"&gt;--build&lt;/span&gt; mitpick_1.0-1

dpkg-deb: building package &lt;span class="s1"&gt;'mitpick'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s1"&gt;'mitpick_1.0-1.deb'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can install it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; ./mitpick_1.0-1.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all for this guide 💖.&lt;/p&gt;

&lt;h4&gt;
  
  
  Motivation to make mitpick
&lt;/h4&gt;

&lt;p&gt;I have assignments which involve taking screenshots (a lot of them) of the terminal output for certain commands. The screenshot tools work just fine, but it is really tedious to perform those 4-5 clicks. Mitpick captures the screenshot of the terminal and copies it to the clipboard. All I need to do is execute &lt;code&gt;mitpick&lt;/code&gt;, and boom, the screenshot is taken and copied to the clipboard to be pasted onto your google doc. It is not that good with the boundaries of the terminal and is in no means a perfect tool.&lt;/p&gt;

&lt;p&gt;| Cover pic - screenshot of &lt;a href="https://github.com/Swordfish90/cool-retro-term"&gt;cool-retro-term&lt;/a&gt; on my PC&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>c</category>
      <category>bash</category>
    </item>
    <item>
      <title>10 Useful GCC Flags That I Use Regularly</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Sat, 13 Jun 2020 16:11:02 +0000</pubDate>
      <link>https://dev.to/mithil467/10-useful-gcc-flags-that-i-use-regularly-4lcb</link>
      <guid>https://dev.to/mithil467/10-useful-gcc-flags-that-i-use-regularly-4lcb</guid>
      <description>&lt;p&gt;C++ was my first programming language. I have been learning and using it for a little less than 2 years now. I have been of the idealogy (which is silly) that if something can be done in c++, do it in c++. Yes, I am slowly moving towards other feasible solutions for certain use cases.&lt;br&gt;
Here are my frequently used gcc flags.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. -o
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc example.c &lt;span class="nt"&gt;-o&lt;/span&gt; outfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The default executable name is &lt;code&gt;a.exe&lt;/code&gt; or &lt;code&gt;a.out&lt;/code&gt; or something similar depending on the host machine. You can easily set the executable name to, for example, &lt;code&gt;outfile&lt;/code&gt; in this case. Other file names are also affected, like object files, assembler files.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. -Wall, -Wextra
&lt;/h2&gt;

&lt;p&gt;Wall and Wextra turn on certain warning flags, that are almost certainly errors in my experience.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. -O2
&lt;/h2&gt;

&lt;p&gt;gcc optimizes code for compilation speeds by default. You can enable this flag and optimize the code for runtime. The compiler optimization step is crazy and can optimize the code to extents one cannot imagine! I have read somewhere the compiler optimized a for loop which was adding some element each iteration to a single multiplication statement!&lt;/p&gt;
&lt;h1&gt;
  
  
  4. -g
&lt;/h1&gt;

&lt;p&gt;Produces debugging information. Helpful when debugging with &lt;code&gt;gdb&lt;/code&gt; as variable names, function names are listed which otherwise are not.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. -S
&lt;/h2&gt;

&lt;p&gt;Your C source code is compiled down to assembly first. The assembly output is stored in a file with the help of the &lt;code&gt;-S&lt;/code&gt; flag.&lt;/p&gt;
&lt;h2&gt;
  
  
  6. -E
&lt;/h2&gt;

&lt;p&gt;Do preprocessing only, and output the entire source code. You include a lot of headers inside your code, all that does is copying the content of the header into the source. This outputs the preprocessed source code.&lt;/p&gt;
&lt;h2&gt;
  
  
  7. -Wfloat-equal
&lt;/h2&gt;

&lt;p&gt;Directly comparing floats is a bad idea. If you execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Not equal"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will get the output &lt;code&gt;Not equal&lt;/code&gt;. This is because of precision issues. This can be caught by the compiler by using &lt;code&gt;-Wfloat-equal&lt;/code&gt; flag. I will soon write a post explaining this behavior, and how to tackle it. For now, just understand it is bad.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. -std=XXX
&lt;/h2&gt;

&lt;p&gt;Set a language standard. Very useful when you strictly want features from a particular standard. For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;c99&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. -I
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Iexample_dir_name&lt;/span&gt; example.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, gcc looks in the current working directory. You can also include multiple other directory locations with &lt;code&gt;-I&lt;/code&gt; flag.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. -D
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Dmacro_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;definition
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Define a macro with a value. This is helpful when you want to run the same code in multiple ways such that the code depends on that macro, or maybe for debugging.&lt;/p&gt;

&lt;p&gt;For a (very long) list of other such flags, refer to the manpage of gcc (&lt;code&gt;man gcc&lt;/code&gt;).&lt;br&gt;
Mention your top gcc flags down in the comments section!&lt;/p&gt;

&lt;p&gt;| Cover Pic by Taras Shypka on Unsplash&lt;/p&gt;

</description>
      <category>c</category>
      <category>gcc</category>
      <category>tricks</category>
    </item>
    <item>
      <title>Firefox Shortcuts That I Use Daily</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Fri, 12 Jun 2020 02:26:09 +0000</pubDate>
      <link>https://dev.to/mithil467/firefox-shortcuts-that-i-use-daily-1m7j</link>
      <guid>https://dev.to/mithil467/firefox-shortcuts-that-i-use-daily-1m7j</guid>
      <description>&lt;p&gt;Through all the years of using Firefox as my primary browser, I have gathered an intuition to do most of my operations through keyboard shortcuts. Some of these might apply to Chrome as well. I have roughly sorted this list based on the frequency of my usage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. CTRL + R
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2. CTRL + (click on link)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Opens the corresponding link in a new tab. I hate going back on a webpage. I always use this feature when I feel the need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3. ALT + num_key (1,2,3...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch Tabs.&lt;br&gt;
Changes the active tab to the nth tab in the series. If you press a key that exceeds the count of the currently opened tab, it automatically sets the last tab as the active tab. I like to press some random num_key such as num_7 when I want to move to the last active tab.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4. CTRL + ENTER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While typing the URL of your favorite site, you can skip the .com part by pressing CTRL+ENTER while your cursor is inside the address field.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5. CTRL + SHIFT + DEL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean Up.&lt;br&gt;
I usually clean up my firefox sessions when I am about to go off for a break. This is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5. Ctrl + Shift + P
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Private Mode.&lt;br&gt;
Really handy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6. ESC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stops Loading.&lt;br&gt;
You wait for the vital parts of the site to load, but then decide to hit refresh as you see no hope and bam that is when it But you already hit refresh. Happened to you? Just hit ESC.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7. ALT + LEFT_ARROW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go back.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8. CTRL + H
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View History.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;9. CTRL + O
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open File.&lt;br&gt;
I like to open certain files in firefox itself, maybe a PDF or an image, firefox can handle them really well. This shortcut allows you to choose a file from the file picker.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10. CTRL + D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bookmark current page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11. CTRL + SHIFT + T
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Undo closed tab.&lt;/p&gt;

&lt;h1&gt;
  
  
  BONUS COMBO!
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Duplicate Tab
CTRL + L - Select current URL in address bar
CTRL + C - Copy it.
CTRL + T - Open new tab.
CTRL + V - Paste.
ENTER - Go!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Did I miss something cool?! What's your favorite keyboard shortcuts?&lt;/p&gt;

&lt;p&gt;| Cover Image by &lt;a href="https://pixabay.com/users/200degrees-2051452/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=1666995"&gt;200 Degrees&lt;/a&gt; from &lt;a href="https://pixabay.com/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=1666995"&gt;Pixabay&lt;/a&gt;&lt;/p&gt;

</description>
      <category>firefox</category>
      <category>tricks</category>
      <category>shortcuts</category>
    </item>
    <item>
      <title>How To Write Better Git Commits</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Thu, 11 Jun 2020 15:10:18 +0000</pubDate>
      <link>https://dev.to/mithil467/how-to-write-better-git-commits-1lpj</link>
      <guid>https://dev.to/mithil467/how-to-write-better-git-commits-1lpj</guid>
      <description>&lt;p&gt;Git plays a very important role in software development. It allows for collaboration across the globe. In such an ecosystem, git commits must show what the other developer's thought process was while working. Maybe that other developer is your self from 3 months back.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;title&lt;/code&gt; must start with a &lt;strong&gt;capital&lt;/strong&gt; letter unless it is an identifier.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;body&lt;/code&gt; and the &lt;code&gt;title&lt;/code&gt; must be separated by &lt;strong&gt;2 blank lines&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;title&lt;/code&gt; should not end with a period.&lt;/li&gt;
&lt;li&gt;Each line in the body shouldn't exceed &lt;strong&gt;75 characters&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Use the imperative form of verbs (&lt;code&gt;Add&lt;/code&gt; not &lt;code&gt;Added&lt;/code&gt;, &lt;code&gt;Remove&lt;/code&gt; not &lt;code&gt;Removed&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;title&lt;/code&gt; shouldn't exceed &lt;strong&gt;72 characters&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The commit's &lt;code&gt;body&lt;/code&gt; must explain the entire thought process behind the changes or further details.&lt;/li&gt;
&lt;li&gt;Your git commit must have a &lt;code&gt;title&lt;/code&gt; that briefly sums up the changes made to the codebase.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You could visit any successful open source project and view their git commits.&lt;br&gt;
For example, &lt;a href="https://github.com/atom/atom/commit/9e8b0b14faea0b2d08ffadbe44272c386749dd53"&gt;this commit&lt;/a&gt; is a good example of a well-written commit.&lt;/p&gt;

&lt;p&gt;I would like to quote what &lt;strong&gt;Atom&lt;/strong&gt; says in their contributing guidelines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;These are mostly guidelines, not rules. Use your best judgment.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a summary of these resources:&lt;br&gt;
&lt;a href="https://wiki.gnome.org/Git/CommitMessages"&gt;Gnome guidelines&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages"&gt;Atom guidelines&lt;/a&gt;&lt;br&gt;
I highly encourage to read these. 😄&lt;/p&gt;

&lt;p&gt;| Photo by Yancy Min on Unsplash&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>6 Python Built-in Modules You Need To Know About</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Wed, 10 Jun 2020 14:15:03 +0000</pubDate>
      <link>https://dev.to/mithil467/6-interesting-python-built-in-modules-38pd</link>
      <guid>https://dev.to/mithil467/6-interesting-python-built-in-modules-38pd</guid>
      <description>&lt;h1&gt;
  
  
  1. Convert Python2 code to Python3 with 2to3
&lt;/h1&gt;

&lt;p&gt;How many times did you turn down a python script just because it was written in Python2? 2to3 converts Python2 code to Python3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;2to3 &lt;span class="nt"&gt;-w&lt;/span&gt; example.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;center&gt;Before | After&lt;/center&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs3fv2sz0jw8ahy7d9exp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs3fv2sz0jw8ahy7d9exp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Create an HTTP server with http.server
&lt;/h1&gt;

&lt;p&gt;Place your index.html file and start a local webserver.&lt;br&gt;
In the same directory as the index file, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; http.server 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can visit &lt;a href="https://dev.tolocalhost:8000"&gt;localhost:8000&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Pretty Print JSON using json.tool
&lt;/h1&gt;

&lt;p&gt;I like to deal with most of my developer things inside the terminal, as it is generally faster to implement. Ever had to deal with JSON in your terminal? You must have if you used &lt;code&gt;curl&lt;/code&gt; before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://dev.to/api/articles&lt;span class="se"&gt;\?&lt;/span&gt;&lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;mithil467
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx51dl6e39asnk7rr556w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx51dl6e39asnk7rr556w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output is not pretty printed and it's impossible to make anything out of the result. Python's json.tool has got your back!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.github.com/users/Mithil467 | python &lt;span class="nt"&gt;-m&lt;/span&gt; json.tool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqwl3vz712gqls55ynfky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqwl3vz712gqls55ynfky.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
I further piped the output to &lt;code&gt;pygmentize -l javascript&lt;/code&gt; for better visual impact.&lt;/p&gt;
&lt;h1&gt;
  
  
  4. Better text wrapping with textwrap
&lt;/h1&gt;

&lt;p&gt;Back then when I was developing &lt;a href="https://github.com/mithil467/mitype" rel="noopener noreferrer"&gt;Mitype&lt;/a&gt;, I had this exact problem. I had to do text wrapping based on the width of the terminal.&lt;br&gt;
I ended up writing my algorithm, but now I have found this!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I have started my journey into blogging! Can I call myself a writer now?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;S_wrapped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;textwrap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;started&lt;/span&gt;
&lt;span class="n"&gt;my&lt;/span&gt; &lt;span class="n"&gt;journey&lt;/span&gt;
&lt;span class="n"&gt;into&lt;/span&gt; &lt;span class="n"&gt;blogging&lt;/span&gt;&lt;span class="err"&gt;!&lt;/span&gt;
&lt;span class="n"&gt;Can&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;
&lt;span class="n"&gt;myself&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="err"&gt;?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  5. Print tokens for your code with tokenize
&lt;/h1&gt;

&lt;p&gt;Tokenizing is a stage in the compilation phase where source code elements are converted into tokens. Let's tokenize the same file that we used in our 2to3 example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; tokenize app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffq1m4uiprfspws0f8p57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffq1m4uiprfspws0f8p57.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You might want to have a look at some more builtin modules here  &lt;a href="https://docs.python.org/3/py-modindex.html" rel="noopener noreferrer"&gt;https://docs.python.org/3/py-modindex.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;| Cover pic by Chris Ried on Unsplash&lt;/p&gt;

</description>
      <category>python</category>
      <category>shell</category>
      <category>module</category>
    </item>
    <item>
      <title>The bit-wise similarity between the character cases</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Tue, 09 Jun 2020 16:13:06 +0000</pubDate>
      <link>https://dev.to/mithil467/the-bit-wise-similarity-between-the-character-cases-2omh</link>
      <guid>https://dev.to/mithil467/the-bit-wise-similarity-between-the-character-cases-2omh</guid>
      <description>&lt;p&gt;&lt;strong&gt;T&lt;/strong&gt;he ASCII value of 'a' in binary is 1100001.&lt;br&gt;
The ASCII value of 'A' in binary is 1000001.&lt;/p&gt;

&lt;p&gt;Notice the similarity?&lt;/p&gt;

&lt;p&gt;The 6th LSB is set for lowercase chars and reset for uppercase chars. Rest all bits are the same.&lt;/p&gt;

&lt;p&gt;This can be fun to play around with. For example, you can lower the case by simply doing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c | 32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you can toggle the case (that is uppercase to lowercase and vice versa) by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c ^ 32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combining the above two actions, you can upper the case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(c | 32) ^ 32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another point to observe is that the difference between these ASCII values for any uppercase char and corresponding lowercase char is 32.&lt;/p&gt;

&lt;p&gt;Oh, and by the way, &lt;code&gt;man ASCII&lt;/code&gt; provides a nice table for ASCII values.&lt;/p&gt;

&lt;h3&gt;
  
  
  The investigation phase
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;W&lt;/strong&gt;hile doing some crypto exercise, I had a string that was encrypted such that each character of the original string was &lt;em&gt;XORed&lt;/em&gt; with some (unknown) character, to form the new character for the encrypted string.&lt;br&gt;
The task was to &lt;em&gt;decrypt&lt;/em&gt; and get the original string. Now it is a known fact that the actions of XOR can be reversed by &lt;em&gt;XORing&lt;/em&gt; once again with the same number (a character is a number).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(a ^ b) ^ b = a ^ (b ^ b) = a ^ 0 = a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are only &lt;strong&gt;128&lt;/strong&gt; ASCII character values. So, a simple brute-force, and then by observing the output, you can make out the original string (given that it made sense originally). &lt;/p&gt;

&lt;p&gt;When I experimented with the above logic, with arbitrary character &lt;em&gt;'x'&lt;/em&gt;, I realized that the decryption made sense 2 times. Once at &lt;em&gt;'x'&lt;/em&gt; and the second time at &lt;em&gt;'X'&lt;/em&gt;. But the thing was, the case had been toggled for &lt;em&gt;'X'&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This led to some further investigations, and I came to the above conclusions.&lt;/p&gt;

</description>
      <category>ascii</category>
      <category>character</category>
      <category>bits</category>
    </item>
    <item>
      <title>6 Unix tools you need to know about</title>
      <dc:creator>Mithil Poojary</dc:creator>
      <pubDate>Tue, 09 Jun 2020 11:08:42 +0000</pubDate>
      <link>https://dev.to/mithil467/6-unix-tools-you-need-to-know-about-3p41</link>
      <guid>https://dev.to/mithil467/6-unix-tools-you-need-to-know-about-3p41</guid>
      <description>&lt;h1&gt;
  
  
  1. column
&lt;/h1&gt;

&lt;p&gt;I, as a programmer, do not mind those nastily formatted tabular data, like...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pid Name %CPU
1230 Firefox 15
600 Code 12
809 Terminal 1.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But when I learnt about column, I was pretty fascinated by how easy it is to make it neat!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;column &amp;lt;file_name&amp;gt; -t

Pid   Name       %CPU
1230  Firefox    15
600   Code       12
809   Terminal  1.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2. less
&lt;/h1&gt;

&lt;p&gt;How many times did you feel disgusted by the mess you made on your terminal screen? Maybe you printed a huge file or did ps aux. I have been there.&lt;br&gt;
A very neat solution is to use less. The text is displayed upon applying a filter for paging through text one screenful at a time.&lt;/p&gt;

&lt;p&gt;You don't have any clutter on your terminal once you exit less.&lt;/p&gt;
&lt;h1&gt;
  
  
  3. sort
&lt;/h1&gt;

&lt;p&gt;Imagine having a file with ID and Names like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;16  Siri
20  Cortana
13  Mithil
9   Jarvis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick sort on the IDs would be super helpful right?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sort &amp;lt;file_name&amp;gt; -n

9   Jarvis
13  Mithil
16  Siri
20  Cortana
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  4. tr
&lt;/h1&gt;

&lt;p&gt;I can't really think of a better situation to use this right now, but hey it works.&lt;br&gt;
Say you have to replace the occurence of a character. tr (translate) does this for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "This is a sentence" | tr " " "\n"

This
is
a
sentence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  5. head and tail
&lt;/h1&gt;

&lt;p&gt;Head and tail themselves are pretty solid tools, but together they have their own use case.&lt;/p&gt;

&lt;p&gt;Say you want the 11th line in a text file. You can do this by :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head &amp;lt;file_name&amp;gt; -n 11 | tail -n 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  That was all for this post. What are your preferred helpful Unix tools?
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;Photo by Karl Pawlowicz on Unsplash&lt;/code&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>unix</category>
      <category>terminal</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
