<?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: Babak K. Shandiz</title>
    <description>The latest articles on DEV Community by Babak K. Shandiz (@babakks).</description>
    <link>https://dev.to/babakks</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%2F228641%2Ff3cedaff-d6f0-4cf5-99dc-841dd1df8efa.jpeg</url>
      <title>DEV Community: Babak K. Shandiz</title>
      <link>https://dev.to/babakks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/babakks"/>
    <language>en</language>
    <item>
      <title>Godoc-Lint: a linter for Go Doc Comments (godocs) [RE#16]</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Sun, 09 Mar 2025 15:07:04 +0000</pubDate>
      <link>https://dev.to/babakks/godoc-lint-a-linter-for-go-doc-comments-godocs-re16-1elh</link>
      <guid>https://dev.to/babakks/godoc-lint-a-linter-for-go-doc-comments-godocs-re16-1elh</guid>
      <description>&lt;p&gt;I was in a break between jobs when I decided it’s time to tackle the idea I had for a long time; &lt;a href="https://github.com/godoc-lint/godoc-lint" rel="noopener noreferrer"&gt;Godoc-Lint&lt;/a&gt;, a linter for Go Doc Comments (godocs). But before getting to Godoc-Lint, let’s talk about the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Godocs and perfectionism
&lt;/h2&gt;

&lt;p&gt;As a bit of context, Golang supports inline documentations (godocs), similar to JavaScript’s JSDoc or C#’s triple-slash comments (&lt;code&gt;///&lt;/code&gt;). However, it’s much simpler/basic in features and structure. The thing is Golang (or &lt;code&gt;gofmt&lt;/code&gt; to be more precise) does not enforce any restrictions on how to write godocs. That’s why Go developers usually drift off the style, almost unknowingly. For example, they may forget to document what a package does, or what a particular function is meant to be used for. It’s frustrating for the end users of their library/module to open up the browser and search the web or read the docs for their questions. Let alone the inconsistency that annoys those perfectionist maintainers of the project.&lt;/p&gt;

&lt;p&gt;To see what I’m talking about, just imagine this simple file, &lt;code&gt;foo.go&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// This package helps with a bunch of things.&lt;/span&gt;
&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;

&lt;span class="c"&gt;// This prints a hey.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hey"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first sight, the it seems nicely documented with godocs. But in terms of standards and style, both godocs are &lt;strong&gt;not in a good shape&lt;/strong&gt;. If we run the &lt;code&gt;godoclint&lt;/code&gt; CLI, we’ll see why that is the case:&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="nv"&gt;$ &lt;/span&gt;godoclint ./...
foo.go:1:1: package godoc should start with &lt;span class="s2"&gt;"Package foo "&lt;/span&gt;
foo.go:4:1: godoc should start with symbol name &lt;span class="o"&gt;(&lt;/span&gt;pattern &lt;span class="s2"&gt;"((A|a|An|an|THE|The|the) )?%"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the right use of godocs is something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// Package foo helps with a bunch of things.&lt;/span&gt;
&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;

&lt;span class="c"&gt;// Foo prints a hey.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hey"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll be amazed to see how many times people are breaking the godoc standard, which is well described in this official Golang document, &lt;a href="https://go.dev/doc/comment" rel="noopener noreferrer"&gt;&lt;em&gt;Go Doc Comments&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Godoc-Lint
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/godoc-lint/godoc-lint" rel="noopener noreferrer"&gt;Godoc-Lint&lt;/a&gt; is now out to help with this issue. It comes with a number of predefined rules that aim to keep godocs consistent and in-style. To give it a try, you can download the CLI binary from the repo’s &lt;a href="https://github.com/godoc-lint/godoc-lint/releases" rel="noopener noreferrer"&gt;Releases&lt;/a&gt; page, or simply use the below &lt;code&gt;go install&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/godoc-lint/godoc-lint/cmd/godoclint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can navigate into your Golang project directory, and run it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;godoclint ./...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will run the linter on all packages in your project, with a sensible (i.e., less annoying, yet important) set of default rules. For more about the rules and configuration check out the repo’s &lt;a href="https://github.com/godoc-lint/godoc-lint/blob/main/README.md" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ℹ️ Note that on large code bases, when running &lt;code&gt;godoclint&lt;/code&gt; for the first time it might take a bit, but further runs will be much faster.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;About Regular Encounters&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course,&lt;/em&gt; &lt;strong&gt;&lt;em&gt;textually minimal.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>article</category>
      <category>go</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Optimize Postgres Containers for Testing [RE#15]</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Fri, 26 Jan 2024 00:31:00 +0000</pubDate>
      <link>https://dev.to/babakks/optimize-postgres-containers-for-testing-re15-2ge3</link>
      <guid>https://dev.to/babakks/optimize-postgres-containers-for-testing-re15-2ge3</guid>
      <description>&lt;p&gt;Recently, I had this task of transferring our tests from using in-memory SQLite instances to Postgres containers. It seemed a like a pretty straightforward set of changes, until I realized it’s not. I had to fix some random unexpected issues down the road. But the biggest (and to be fair, the most expected) one was the poor performance of the tests after fully migrating to Postgres.&lt;/p&gt;

&lt;p&gt;Long story short, after some Internet search and reading documentations, I ended up getting a good performance (very close to what we had with SQLite) using the &lt;code&gt;docker-compose.yaml&lt;/code&gt; configuration below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;5432:5432&lt;/span&gt;
    &lt;span class="c1"&gt;# Remove the `tmpfs` key below, either:&lt;/span&gt;
    &lt;span class="c1"&gt;# - If you don't want to lose the data after the container stops/restarts.&lt;/span&gt;
    &lt;span class="c1"&gt;# - If the data can be too large for the memory.&lt;/span&gt;
    &lt;span class="na"&gt;tmpfs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/var/lib/postgresql/data&lt;/span&gt;
    &lt;span class="c1"&gt;# Since it's mainly used for testing purposes, it's okay to set fsync=off for&lt;/span&gt;
    &lt;span class="c1"&gt;# improved performance.&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;-c fsync=off -c full_page_writes=off&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key points here are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Using &lt;code&gt;tmpfs&lt;/code&gt;&lt;/strong&gt; : With &lt;a href="https://docs.docker.com/storage/tmpfs" rel="noopener noreferrer"&gt;&lt;code&gt;tmpfs&lt;/code&gt; mounts&lt;/a&gt;, you can utilize memory (RAM) as the underlying filesystem storage for specific paths. Here I’ve used it to store Postgres data. This, of course, means there’s no real persistence in-place, therefore you will lose the data if the container stops/restarts. Also, you have to be careful with the size of the data, in case it could get close to your memory limits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Applying &lt;code&gt;-c fsync=off -c full_page_writes=off&lt;/code&gt;&lt;/strong&gt; : If you don’t disable the &lt;a href="https://www.postgresql.org/docs/current/runtime-config-wal.html" rel="noopener noreferrer"&gt;&lt;code&gt;fsync&lt;/code&gt; option&lt;/a&gt;, Postgres makes sure that updates are physically written to disk, which could be a great performance hit. As of official documentations, if you turn &lt;code&gt;fsync&lt;/code&gt; off, you should also consider disabling &lt;code&gt;full_page_writes&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;About Regular Encounters&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course,&lt;/em&gt; &lt;strong&gt;&lt;em&gt;textually minimal.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>productivity</category>
      <category>testing</category>
      <category>docker</category>
    </item>
    <item>
      <title>Living in the Shell #24; chmod (Modify file/directory permissions)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Fri, 06 Jan 2023 11:57:13 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-24-chmod-modify-filedirectory-permissions-472i</link>
      <guid>https://dev.to/babakks/living-in-the-shell-24-chmod-modify-filedirectory-permissions-472i</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;chmod&lt;/code&gt; 🔐
&lt;/h2&gt;

&lt;p&gt;Modifies file/directory permissions (See &lt;a href="https://linuxcommand.org/lc3_man_pages/chmod1.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Chmod" rel="noopener noreferrer"&gt;here&lt;/a&gt; for more details).&lt;/p&gt;

&lt;p&gt;Permission expressions are mostly formatted as &lt;code&gt;[ugoa][+-=][rwx]&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;r&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;w&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Write&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;x&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;u&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;User&lt;/strong&gt; (owner of the file/directory)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;g&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Group&lt;/strong&gt; (of the file/directory)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;o&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Other&lt;/strong&gt; users/groups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;All&lt;/strong&gt; users/groups&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Grant all permissions to everyone; &lt;code&gt;a+rwx&lt;/code&gt; or &lt;code&gt;777&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod a+rwx some-file
# or
chmod 777 some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make a file executable for everyone &lt;code&gt;+x&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x some-file
# or
chmod a+x some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make a file executable only for the &lt;em&gt;User&lt;/em&gt; (owner) &lt;code&gt;u+x&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod u+x some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Disallow &lt;em&gt;Group&lt;/em&gt; and &lt;em&gt;Others&lt;/em&gt; to read/write/execute &lt;code&gt;go-rwx&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod go-rwx some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Apply the same &lt;em&gt;User&lt;/em&gt; (owner) permissions to the &lt;em&gt;Group&lt;/em&gt; &lt;code&gt;=u&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod g=u some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rewrite permissions for the &lt;em&gt;Group&lt;/em&gt; and &lt;em&gt;Others&lt;/em&gt; &lt;code&gt;=&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod go=rw some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Clear permissions for the &lt;em&gt;Group&lt;/em&gt; and &lt;em&gt;Others&lt;/em&gt; &lt;code&gt;=&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod go= some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Clear all permissions &lt;code&gt;=&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod a= some-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;em&gt;About Living in the Shell&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Obsessed with doing things in the shell, I’ve decided to share my &lt;strong&gt;daily&lt;/strong&gt; struggles on living in the shell as &lt;strong&gt;terse&lt;/strong&gt; but &lt;strong&gt;informative&lt;/strong&gt; posts.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>environment</category>
      <category>discuss</category>
    </item>
    <item>
      <title>VS Code Extension to Pick Relevant Emojis for Git Commit Messages 🐛</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Fri, 19 Aug 2022 10:43:00 +0000</pubDate>
      <link>https://dev.to/babakks/vs-code-extension-to-pick-relevant-emojis-for-git-commit-messages-201c</link>
      <guid>https://dev.to/babakks/vs-code-extension-to-pick-relevant-emojis-for-git-commit-messages-201c</guid>
      <description>&lt;h2&gt;
  
  
  Emoji in git commit message
&lt;/h2&gt;

&lt;p&gt;If you're VS Code user and also a fan of emojis, this new VS Code extension might appeal to you, especially if you've read and liked &lt;a href="https://babakks.github.io/article/2020/07/03/emojis-in-git-commit-messages.html"&gt;&lt;em&gt;Emojis for Better Git Commit Messages&lt;/em&gt;&lt;/a&gt; for its exhaustive table of contextual emoji data which were gathered over years. This new extension is called &lt;strong&gt;Git-Emoji&lt;/strong&gt;. What it does is to provide you with relevant emoji suggestions to add to your git commit messages. This short screen capture would show you how this extension works:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KPYiWEFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://babakks.github.io/img/2022-08-19-capture.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KPYiWEFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://babakks.github.io/img/2022-08-19-capture.gif" alt="How to get relevant emojis for git commit message" width="608" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install it, search for “Git-Emoji” in the extension sidebar and click on the &lt;em&gt;Install&lt;/em&gt; button. Alternatively, you can also install it as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Press Ctrl+P
&lt;/li&gt;
&lt;li&gt;Type in &lt;code&gt;ext install git-emoji.vscode-git-emoji&lt;/code&gt; and press Enter/Return&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Dataset
&lt;/h2&gt;

&lt;p&gt;If you’re interested in the emoji/contextual data behind this extension, you can access the underlying dataset via &lt;a href="https://github.com/git-emoji/dataset-js"&gt;git-emoji/dataset-js&lt;/a&gt; repository on GitHub. It’s also available as a NPM package; &lt;a href="https://www.npmjs.com/package/@git-emoji/dataset-js"&gt;&lt;code&gt;@git-emoji/dataset-js&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope you like this extension. 🍏&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>vscode</category>
      <category>javascript</category>
      <category>git</category>
    </item>
    <item>
      <title>Living in the Shell #23; cut (Cut Text/Fields from Text Streams)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Fri, 24 Dec 2021 18:38:36 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-23-cut-cut-textfields-from-text-streams-166m</link>
      <guid>https://dev.to/babakks/living-in-the-shell-23-cut-cut-textfields-from-text-streams-166m</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;cut&lt;/code&gt; ✂️
&lt;/h2&gt;

&lt;p&gt;Cuts/extracts text/fields out of text streams.&lt;/p&gt;

&lt;p&gt;⚠️ Index values are one-based.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cut characters on a range &lt;code&gt;-c&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello World&lt;/span&gt;&lt;span class="se"&gt;\!\n&lt;/span&gt;&lt;span class="s2"&gt;Goodbye&lt;/span&gt;&lt;span class="se"&gt;\!&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-c2-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Takes characters at indices 2 through 5.&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ello
oodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Cut characters on a half-limited range &lt;code&gt;-c&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello World&lt;/span&gt;&lt;span class="se"&gt;\!\n&lt;/span&gt;&lt;span class="s2"&gt;Goodbye&lt;/span&gt;&lt;span class="se"&gt;\!&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-c3-&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Takes characters from indices 3 and afterwards.&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;llo World!
odbye!
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Cut fields split by any delimiter &lt;code&gt;-f&lt;/code&gt; &amp;amp; &lt;code&gt;-d&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"1,20,300&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;40,500,6000&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;700,8000,90000"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f2&lt;/span&gt;,3 &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;20,300
500,6000
8000,90000
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Change fields delimiter &lt;code&gt;--output-delimiter&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"1,20,300&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;40,500,6000&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;700,8000,90000"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f1-&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="nt"&gt;--output-delimiter&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1/20/300
40/500/6000
700/8000/90000
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Invert selection &lt;code&gt;--complement&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"1,20,300&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;40,500,6000&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;700,8000,90000"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f2&lt;/span&gt;,3 &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="nt"&gt;--complement&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
40
700
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #22; md5sum/shasum (Check/Compute MD5/SHA Checksum of Files)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Thu, 23 Dec 2021 15:48:52 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-22-md5sumshasum-checkcompute-md5sha-checksum-of-files-3med</link>
      <guid>https://dev.to/babakks/living-in-the-shell-22-md5sumshasum-checkcompute-md5sha-checksum-of-files-3med</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;md5sum&lt;/code&gt;/&lt;code&gt;shasum&lt;/code&gt; #️⃣
&lt;/h2&gt;

&lt;p&gt;Checks/computes MD5/SHA checksum of files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compute MD5 checksum &lt;code&gt;md5sum&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;md5sum&lt;/span&gt; ~/.bashrc ~/.zshrc ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fc4231f666b25990eefc1c51917d7bb1  /home/babak/.bashrc
6688207953bbd9d20d487a9509a6c297  /home/babak/.zshrc
43f7dc02e7bfb5d40703b5cb94e274ce  /home/babak/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Compute SHA1 checksum &lt;code&gt;shasum&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shasum ~/.bashrc ~/.zshrc ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;499460ce753fa4b02cbb8c7e0cb61b1a9583bcd9  /home/babak/.bashrc
2f195c1d8c86cf34e4bdbd947e76fc9cb0bc900e  /home/babak/.zshrc
63d1a74119f9a8a84fd930ed8341395e9ab867f0  /home/babak/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Compute other SHA checksums &lt;code&gt;-a&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shasum &lt;span class="nt"&gt;-a&lt;/span&gt; 256 ~/.bashrc ~/.zshrc ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;25d3d9737d0773dd6ece3a3536205784ce099314d68721eb5a865e82af66495c  /home/babak/.bashrc
5db662d84b785f026d6613e7e187a4a9c9333c9a38acf49ea7a5e15f4bb203c8  /home/babak/.zshrc
4c532d3d8bb0988d61ac334b1ffc6302ba0aac350b0d5c98102c3c4c443602f9  /home/babak/.profile
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;ℹ️ Supported SHA types are: 1 (default), 224, 256, 384, 512, 512224, 512256&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Create checksums file for later checks
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shasum ~/.bashrc ~/.zshrc ~/.profile &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; SHA1SUMS
&lt;span class="nb"&gt;md5sum&lt;/span&gt; ~/.bashrc ~/.zshrc ~/.profile &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; MD5SUMS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Check checksums &lt;code&gt;--check&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;shasum &lt;span class="nt"&gt;--check&lt;/span&gt; SHA1SUMS
&lt;span class="nb"&gt;md5sum&lt;/span&gt; &lt;span class="nt"&gt;--check&lt;/span&gt; MD5SUMS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/home/babak/.bashrc: OK
/home/babak/.zshrc: OK
/home/babak/.profile: OK
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>beginners</category>
      <category>bash</category>
    </item>
    <item>
      <title>Living in the Shell #21; head (Display File Content From Beginning)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Tue, 21 Dec 2021 20:41:12 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-21-head-display-file-content-from-beginning-4ekj</link>
      <guid>https://dev.to/babakks/living-in-the-shell-21-head-display-file-content-from-beginning-4ekj</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;head&lt;/code&gt; 📜
&lt;/h2&gt;

&lt;p&gt;Displays file content from beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Print first N lines of a file &lt;code&gt;-n&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5 ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Print all but N last lines &lt;code&gt;-n -N&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nt"&gt;-3&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Print first N bytes of a file &lt;code&gt;-c&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; 1k ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Prints first 1k of file binary content.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Print all but N last bytes &lt;code&gt;-c -N&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-1k&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #20; tail (Display/Follow File Content)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Mon, 20 Dec 2021 19:41:07 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-20-tail-displayfollow-file-content-3nm1</link>
      <guid>https://dev.to/babakks/living-in-the-shell-20-tail-displayfollow-file-content-3nm1</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;tail&lt;/code&gt; ⛵
&lt;/h2&gt;

&lt;p&gt;Display or follow file content.&lt;/p&gt;

&lt;p&gt;ℹ️ Here, &lt;em&gt;following&lt;/em&gt; means streaming a file while it's being updated (appended).&lt;/p&gt;

&lt;p&gt;ℹ️ You can use &lt;code&gt;-c&lt;/code&gt; in place of &lt;code&gt;-n&lt;/code&gt; in the following examples, to switch to binary offset selection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Print bottom N lines of a file &lt;code&gt;-n&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 5 ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Prints last 5 lines of &lt;code&gt;~/.bashrc&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Print from N-th line afterwards &lt;code&gt;-n +N&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; +3 ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Prints &lt;code&gt;~/.bashrc&lt;/code&gt; from the 3rd line until the end.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Following &lt;code&gt;syslog&lt;/code&gt; events &lt;code&gt;-f&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Follows system logs (on Debian/Ubuntu).&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #19; df (Report Disk Free Space)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Sat, 18 Dec 2021 19:55:20 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-19-df-report-disk-free-space-544p</link>
      <guid>https://dev.to/babakks/living-in-the-shell-19-df-report-disk-free-space-544p</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;df&lt;/code&gt; 💾
&lt;/h2&gt;

&lt;p&gt;Reports disk free space.&lt;/p&gt;

&lt;h2&gt;
  
  
  See disk free space
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem     1K-blocks      Used Available Use% Mounted on
tmpfs            1603540      2068   1601472   1% /run
/dev/nvme0n1p3 471738592 268747932 178957944  61% /
tmpfs            8017688    327492   7690196   5% /dev/shm
tmpfs               5120         4      5116   1% /run/lock
tmpfs               4096         0      4096   0% /sys/fs/cgroup
/dev/nvme0n1p1    244988      5304    239684   3% /boot/efi
tmpfs            1603536       120   1603416   1% /run/user/1000
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Note that the values are in kilobytes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Human-readable size values &lt;code&gt;-h&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.1M  1.6G   1% /run
/dev/nvme0n1p3  450G  257G  171G  61% /
tmpfs           7.7G  313M  7.4G   4% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup
/dev/nvme0n1p1  240M  5.2M  235M   3% /boot/efi
tmpfs           1.6G  120K  1.6G   1% /run/user/1000
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Include file-system type &lt;code&gt;-T&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-hT&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs  1.6G  2.1M  1.6G   1% /run
/dev/nvme0n1p3 ext4   450G  257G  171G  61% /
tmpfs          tmpfs  7.7G  296M  7.4G   4% /dev/shm
tmpfs          tmpfs  5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs  4.0M     0  4.0M   0% /sys/fs/cgroup
/dev/nvme0n1p1 vfat   240M  5.2M  235M   3% /boot/efi
tmpfs          tmpfs  1.6G  120K  1.6G   1% /run/user/1000
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Produce a grand total &lt;code&gt;--total&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="nt"&gt;--total&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used Avail Use% Mounted on
...
total           461G  257G  182G  59% -
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #18; du (Report Directory Size)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Fri, 17 Dec 2021 18:53:15 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-18-du-report-directory-size-pbh</link>
      <guid>https://dev.to/babakks/living-in-the-shell-18-du-report-directory-size-pbh</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;du&lt;/code&gt; 💽
&lt;/h2&gt;

&lt;p&gt;Reports disk usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  See summarized directory size &lt;code&gt;-s&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11732700        /home/babak/Downloads
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Note that the result is in kilobytes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Human-readable size values &lt;code&gt;-h&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; ~/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12G   /home/babak/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Exclude files by pattern &lt;code&gt;--exclude&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="nt"&gt;--exclude&lt;/span&gt; &lt;span class="s1"&gt;'*.iso'&lt;/span&gt; ~/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7.1G   /home/babak/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  See exhaustive sub-directory sizes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; ~/Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Limit recursion depth &lt;code&gt;-d&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; 1 ~/Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Include files in exhaustive size report &lt;code&gt;-a&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; ~/Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #17; curl (HTTP/S Client) (Part 2)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Thu, 16 Dec 2021 19:25:37 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-17-curl-https-client-part-2-48j2</link>
      <guid>https://dev.to/babakks/living-in-the-shell-17-curl-https-client-part-2-48j2</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;curl&lt;/code&gt; 🌐
&lt;/h2&gt;

&lt;p&gt;Makes requests in various protocols, including (but not limited to) HTTP/HTTPS/FTP/FTPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a custom header to request &lt;code&gt;-H&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://postman-echo.com/get &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'user-agent: curl'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;ℹ️ You can set any number of headers by repeating &lt;code&gt;-H&lt;/code&gt; options.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Make a &lt;code&gt;POST&lt;/code&gt; request with JSON body &lt;code&gt;-d&lt;/code&gt; &amp;amp; &lt;code&gt;-X&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://postman-echo.com/post &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"key":"value"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"value"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"files"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"x-forwarded-proto"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"x-forwarded-port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"443"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"host"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"postman-echo.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"x-amzn-trace-id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Root=1-61ba2f8f-304430e917ea20e7024a87c3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"content-length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"15"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user-agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"curl/7.74.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"accept"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"content-type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"json"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"value"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://postman-echo.com/post"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Read request body from file &lt;code&gt;-d@&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://postman-echo.com/post &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-d&lt;/span&gt; @data-file.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Read request headers from file &lt;code&gt;-H@&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://postman-echo.com/post &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-H&lt;/span&gt; @headers-file.txt &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-d&lt;/span&gt; @data-file.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ The headers file should be formatted as "key: value" per line.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Make a &lt;code&gt;HEAD&lt;/code&gt; request &lt;code&gt;-I&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://postman-echo.com/get
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;ℹ️ Alternatively, you can use &lt;code&gt;-X HEAD&lt;/code&gt; instead of &lt;code&gt;-I&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  See more detailed process logs &lt;code&gt;-v&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-v&lt;/span&gt; https://postman-echo.com/get
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This will print more low-level details, including protocol handshakes and negotiations.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
    <item>
      <title>Living in the Shell #16; curl (HTTP/S Client) (Part 1)</title>
      <dc:creator>Babak K. Shandiz</dc:creator>
      <pubDate>Wed, 15 Dec 2021 17:43:47 +0000</pubDate>
      <link>https://dev.to/babakks/living-in-the-shell-curl-part-1-ls16-3e8e</link>
      <guid>https://dev.to/babakks/living-in-the-shell-curl-part-1-ls16-3e8e</guid>
      <description>&lt;h2&gt;
  
  
  &lt;code&gt;curl&lt;/code&gt; 🌐
&lt;/h2&gt;

&lt;p&gt;Makes requests in various protocols, including (but not limited to) HTTP/HTTPS/FTP/FTPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make a simple &lt;code&gt;GET&lt;/code&gt; request
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&amp;gt;
&amp;lt;TITLE&amp;gt;301 Moved&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;
&amp;lt;H1&amp;gt;301 Moved&amp;lt;/H1&amp;gt;
The document has moved
&amp;lt;A HREF="https://www.google.com/"&amp;gt;here&amp;lt;/A&amp;gt;.
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Simple &lt;code&gt;GET&lt;/code&gt; request with following redirects &lt;code&gt;-L&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Write response to a file &lt;code&gt;-o&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://google.com &lt;span class="nt"&gt;-o&lt;/span&gt; content.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Include response headers &lt;code&gt;-i&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; https://google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/2 301 
location: https://www.google.com/
content-type: text/html; charset=UTF-8
date: Wed, 15 Dec 2021 17:45:16 GMT
expires: Fri, 14 Jan 2022 17:45:16 GMT
cache-control: public, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 0
x-frame-options: SAMEORIGIN
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Request via a HTTP proxy server &lt;code&gt;-x&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://google.com &lt;span class="nt"&gt;-x&lt;/span&gt; proxy-server:port
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Request via a SOCKS proxy server &lt;code&gt;--socks&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://google.com &lt;span class="nt"&gt;--socks&lt;/span&gt; proxy-server:port
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>productivity</category>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
