<?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: João Vitor</title>
    <description>The latest articles on DEV Community by João Vitor (@joaovitor).</description>
    <link>https://dev.to/joaovitor</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%2F171139%2F05b3cb65-7255-4f78-9cc8-8a5751668bf3.jpeg</url>
      <title>DEV Community: João Vitor</title>
      <link>https://dev.to/joaovitor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joaovitor"/>
    <language>en</language>
    <item>
      <title>Keep man output in the screen</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Tue, 28 Dec 2021 17:31:26 +0000</pubDate>
      <link>https://dev.to/joaovitor/keep-man-output-in-the-screen-20lp</link>
      <guid>https://dev.to/joaovitor/keep-man-output-in-the-screen-20lp</guid>
      <description>&lt;p&gt;Reading &lt;a href="https://man7.org/linux/man-pages/man1/man.1.html"&gt;man man&lt;/a&gt; I found out that the pager used by man can be overridden.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; -P pager, --pager=pager
              Specify which output pager to use.  By default, man uses
              less, falling back to cat if less is not found or is not
              executable.  This option overrides the $MANPAGER
              environment variable, which in turn overrides the $PAGER
              environment variable.  It is not used in conjunction with
              -f or -k.

              The value may be a simple command name or a command with
              arguments, and may use shell quoting (backslashes, single
              quotes, or double quotes).  It may not use pipes to
              connect multiple commands; if you need that, use a wrapper
              script, which may take the file to display either as an
              argument or on standard input.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  MANPAGER variable
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MANPAGER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"less -FirSwX"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And after closing &lt;code&gt;man&lt;/code&gt; you can still read the man page that you were reading.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>man</category>
    </item>
    <item>
      <title>Git user config per path</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Tue, 22 Jun 2021 19:13:25 +0000</pubDate>
      <link>https://dev.to/joaovitor/git-user-config-per-path-aeo</link>
      <guid>https://dev.to/joaovitor/git-user-config-per-path-aeo</guid>
      <description>&lt;h1&gt;
  
  
  TIL git config core.sshCommand
&lt;/h1&gt;

&lt;p&gt;TIL &lt;a href="https://superuser.com/a/912281"&gt;here&lt;/a&gt; that git provides a config for &lt;code&gt;core.sshCommand&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I was already splitting my personal and work git user configuration by path with this setting in my &lt;code&gt;~/.gitconfig&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So adding the block below simplified my &lt;code&gt;.ssh/config&lt;/code&gt; and my cloning/pushing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[core]
       sshCommand = "ssh -i ~/.ssh/id_ed25519_personal -F /dev/null"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ~/.gitconfig
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[include]
    path = ~/dotfiles/gituser_work.include
[includeIf "gitdir/i:~/dotfiles/"]
    path = ~/dotfiles/gituser_personal.include
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  gituser_work.include
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
       name = Your Full Name
       email = your@work-email.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  gituser_personal.include
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
       name = Your Full Name
       email = your@personal-email.com

[core]
       sshCommand = "ssh -i ~/.ssh/id_ed25519_personal -F /dev/null"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
    </item>
    <item>
      <title>Clone github repos in parallel</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Sat, 13 Feb 2021 16:10:18 +0000</pubDate>
      <link>https://dev.to/joaovitor/clone-github-repos-in-parallel-3gpj</link>
      <guid>https://dev.to/joaovitor/clone-github-repos-in-parallel-3gpj</guid>
      <description>&lt;p&gt;It is possible to clone a list of github repositories in parallel.&lt;/p&gt;

&lt;p&gt;Given that the file is called &lt;code&gt;your_organization.txt&lt;/code&gt;.&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;cd&lt;/span&gt; ~/github-orgs/your-organization
&lt;span class="nb"&gt;cat &lt;/span&gt;your_organization.txt | parallel  &lt;span class="nt"&gt;-j&lt;/span&gt; 25 &lt;span class="s1"&gt;'clone-missing.sh {}; echo job {#} completed {};'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can generate a list of repositories of a github user or a github organization with these helper scripts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/github-print-organization-repos.sh"&gt;github-print-organization-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/github-print-organization-repos.sh"&gt;github-print-user-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>parallel</category>
      <category>git</category>
      <category>linux</category>
    </item>
    <item>
      <title>Clone azure repos in parallel</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Sat, 13 Feb 2021 16:01:04 +0000</pubDate>
      <link>https://dev.to/joaovitor/clone-azure-repos-in-parallel-3noa</link>
      <guid>https://dev.to/joaovitor/clone-azure-repos-in-parallel-3noa</guid>
      <description>&lt;p&gt;Azure repos are hosted inside devops projects.&lt;/p&gt;

&lt;p&gt;You can list azure projects with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az devops project list &lt;span class="nt"&gt;--detect&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list repositories in azure from one specific &lt;em&gt;az devops project&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az repos list &lt;span class="nt"&gt;--project&lt;/span&gt; project_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To grab the repo list from multiple projects in parallel and save it to a file:&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;org&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; az devops project list &lt;span class="nt"&gt;--detect&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.value[]|.id'&lt;/span&gt; | parallel &lt;span class="nt"&gt;-j&lt;/span&gt; 10 &lt;span class="s2"&gt;"az repos list --project {} | jq -r '.[]|.sshUrl'"&lt;/span&gt; | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;org&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the repo ssh url is different from the github one the clone-missing.sh script had to be changed in a not compatible way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference
&lt;/h2&gt;

&lt;p&gt;github ssh url: &lt;code&gt;git@github.com:${githuborg}/${repo}.git&lt;/code&gt;&lt;br&gt;
azure repo url: &lt;code&gt;git@ssh.dev.azure.com:v3/${devopsorg}/${devopsproject}/${repo}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;New &lt;code&gt;azure-clone-missing.sh&lt;/code&gt; command added to the parallel_commands to handle this url difference.&lt;/p&gt;
&lt;h2&gt;
  
  
  Cloning azure repositories in parallel
&lt;/h2&gt;

&lt;p&gt;Given that you created the org.txt file the command below clones only the missing repositories.&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;cd&lt;/span&gt; ~/azure-orgs/azuredevopsorg/
&lt;span class="nv"&gt;org&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;org&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.txt | parallel  &lt;span class="nt"&gt;-j&lt;/span&gt; 25 &lt;span class="s1"&gt;'azure-clone-missing.sh {}; echo job {#} completed {};'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to exclude some repositories from your clone.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS&lt;/em&gt; change the regex that excludes the repo.&lt;br&gt;
&lt;code&gt;grep -Ev '(repo1|repo2)' ${org}.txt&lt;/code&gt;&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;cd&lt;/span&gt; ~/azure-orgs/azuredevopsorg/
&lt;span class="nv"&gt;org&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-Ev&lt;/span&gt; &lt;span class="s1"&gt;'(repo1|repo2)'&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;org&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.txt | parallel  &lt;span class="nt"&gt;-j&lt;/span&gt; 25 &lt;span class="s1"&gt;'azure-clone-missing.sh {}; echo job {#} completed {};'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/repos?view=azure-cli-"&gt;az repos list&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/devops/project?view=azure-cli-latest#ext_azure_devops_az_devops_project_listlatest#ext_azure_devops_az_repos_list"&gt;az devops project list&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.gnu.org/software/parallel/"&gt;gnu-parallel&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/azure-clone-missing.sh"&gt;azure-clone-missing.sh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
      <category>git</category>
      <category>parallel</category>
      <category>linux</category>
    </item>
    <item>
      <title>Update git repos in parallel</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Thu, 29 Oct 2020 13:54:46 +0000</pubDate>
      <link>https://dev.to/joaovitor/parallel-git-pull-284a</link>
      <guid>https://dev.to/joaovitor/parallel-git-pull-284a</guid>
      <description>&lt;p&gt;Are you living in a microservices world?&lt;br&gt;
Do you need to keep multiple git repositories in sync?&lt;/p&gt;

&lt;p&gt;How much time would it take to update &lt;strong&gt;63 repositories&lt;/strong&gt;?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/update-repos.sh"&gt;update-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;update-repos.sh&lt;/code&gt; script uses gnu-parallel and execute the &lt;code&gt;git pull --rebase&lt;/code&gt; and &lt;code&gt;git fetch --prune&lt;/code&gt; in parallel.&lt;/p&gt;
&lt;h1&gt;
  
  
  Update repositories in parallel
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/github-orgs/PacktPublishing
&lt;span class="nb"&gt;time &lt;/span&gt;update-repos.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[truncated]
job 56 completed ./Develop-and-Operate-Microservices-on-Kubernetes
Already up to date.
job 55 completed ./DevOps-Puppet-Docker-and-Kubernetes
Already up to date.
job 62 completed ./-Kubernetes-for-Absolute-Beginners---Hands-on
[truncated]

real    0m9,083s
user    0m6,321s
sys     0m2,668s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you do that synchronously it would have taken near 4 minutes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;real    4m53,583s
user    0m6,480s
sys     0m4,776s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>parallel</category>
      <category>git</category>
    </item>
    <item>
      <title>Using gnu parallel to save time</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Thu, 29 Oct 2020 05:52:36 +0000</pubDate>
      <link>https://dev.to/joaovitor/using-gnu-parallel-to-save-time-26b0</link>
      <guid>https://dev.to/joaovitor/using-gnu-parallel-to-save-time-26b0</guid>
      <description>&lt;p&gt;As a developer I'm constantly reading code, specially from github.&lt;/p&gt;

&lt;p&gt;Often I choose to clone repos from some user or organization and I've been using &lt;a href="https://www.gnu.org/software/parallel/"&gt;parallel&lt;/a&gt; to save me some time  cloning and updating code.&lt;/p&gt;

&lt;h2&gt;
  
  
  List repos
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/github-print-organization-repos.sh"&gt;github-print-organization-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/github-print-organization-repos.sh"&gt;github-print-user-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Clone missing repos
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/clone-missing.sh"&gt;clone-missing.sh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Update repos from a directory &lt;strong&gt;in parallel&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/joaovitor/parallel_commands/blob/master/bin/update-repos.sh"&gt;update-repos.sh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;There are more details in &lt;a href="https://github.com/joaovitor/parallel_commands"&gt;parallel_commands readme&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;The workflows / scripts defined below assumes that you already have a GITHUB_TOKEN environment variable capable of listing github repositories and that you have the &lt;a href="https://github.com/joaovitor/parallel_commands/bin"&gt;parallel_commands/bin&lt;/a&gt; in your PATH.&lt;/p&gt;




&lt;p&gt;&lt;code&gt;update-repos.sh&lt;/code&gt; is the one that I most use daily.&lt;/p&gt;

&lt;p&gt;It does a &lt;code&gt;git pull --rebase&lt;/code&gt; and &lt;code&gt;git fetch --prune&lt;/code&gt; in all repositories inside a directory in &lt;strong&gt;parallel&lt;/strong&gt;. This can save you and your team &lt;strong&gt;lots of time&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Offline studing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/PacktPublishing"&gt;PacktPublishing&lt;/a&gt; and &lt;a href="https://github.com/oreillymedia"&gt;oreillymedia&lt;/a&gt; have lots of quality repos to be used in studies.&lt;/p&gt;

&lt;p&gt;Imagine that you want to study kubernetes and clone all repositories from PacktPublishing that contains kubernetes in the name.&lt;/p&gt;

&lt;p&gt;Filtering &lt;a href="https://github.com/PacktPublishing?q=kubernetes&amp;amp;type=&amp;amp;language="&gt;kubernetes from PacktPublishing&lt;/a&gt; shows 63 repositories. Cloning 63 repositories by hand would be at least &lt;strong&gt;slow&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is an nicer way of doing this:&lt;/p&gt;

&lt;p&gt;1- Create a list of repos from PacktPublishing&lt;/p&gt;

&lt;p&gt;You can use the &lt;strong&gt;static file&lt;/strong&gt; in &lt;a href="https://gist.github.com/joaovitor/e1658abc0946ec9e5528c533f2f502a8"&gt;this gist&lt;/a&gt;.&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; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/github-orgs/PacktPublishing
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/github-orgs/PacktPublishing
curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; PacktPublishing.txt https://gist.githubusercontent.com/joaovitor/e1658abc0946ec9e5528c533f2f502a8/raw/88df9a43c2f9253d686b4ca6eb45bf50c047678b/PacktPublishing.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or get it with the &lt;code&gt;github-print-organization-repos.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This one take a while PacktPublishing has more than 6000 repositories. &lt;code&gt;github-print-organization-repos.sh&lt;/code&gt; makes around 600 github api calls to generate the file with the list of repos.&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; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/github-orgs/PacktPublishing
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/github-orgs/PacktPublishing
&lt;span class="nv"&gt;gh_owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; github-print-organization-repos.sh &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;gh_owner&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;gh_owner&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2- Clone the missing repos that match kubernetes&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;cd&lt;/span&gt; ~/github-orgs/PacktPublishing
&lt;span class="nv"&gt;gh_owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-Ei&lt;/span&gt; kubernetes &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;gh_owner&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.txt | parallel  &lt;span class="nt"&gt;-j&lt;/span&gt; 25 &lt;span class="s1"&gt;'clone-missing.sh {}; echo job {#} completed {};'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3- Study offline&lt;/p&gt;

</description>
      <category>linux</category>
      <category>parallel</category>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>fd instead of find</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Fri, 06 Dec 2019 12:44:46 +0000</pubDate>
      <link>https://dev.to/joaovitor/fd-instead-of-find-1a3c</link>
      <guid>https://dev.to/joaovitor/fd-instead-of-find-1a3c</guid>
      <description>&lt;p&gt;I've been using &lt;a href="https://github.com/sharkdp/fd"&gt;fd&lt;/a&gt; instead of find locally.&lt;/p&gt;

&lt;p&gt;It describe itself as "A simple, fast and user-friendly alternative to 'find'".&lt;/p&gt;

&lt;p&gt;From &lt;a href="https://github.com/sharkdp/fd/blob/master/README.md"&gt;their readme&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Convenient syntax: &lt;code&gt;fd PATTERN&lt;/code&gt; instead of &lt;code&gt;find -iname '*PATTERN*'&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Colorized terminal output (similar to &lt;em&gt;ls&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;It's &lt;em&gt;fast&lt;/em&gt; (see &lt;a href="https://github.com/sharkdp/fd/blob/master/README.md#benchmark"&gt;benchmarks&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Smart case: the search is case-insensitive by default. It switches to
case-sensitive if the pattern contains an uppercase
character&lt;a href="http://vimdoc.sourceforge.net/htmldoc/options.html#'smartcase'"&gt;*&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Ignores hidden directories and files, by default.&lt;/li&gt;
&lt;li&gt;Ignores patterns from your &lt;code&gt;.gitignore&lt;/code&gt;, by default.&lt;/li&gt;
&lt;li&gt;Regular expressions.&lt;/li&gt;
&lt;li&gt;Unicode-awareness.&lt;/li&gt;
&lt;li&gt;The command name is &lt;em&gt;50%&lt;/em&gt; shorter&lt;a href="https://github.com/ggreer/the_silver_searcher"&gt;*&lt;/a&gt; than
&lt;code&gt;find&lt;/code&gt; :-).&lt;/li&gt;
&lt;li&gt;Parallel command execution with a syntax similar to GNU Parallel.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it out.&lt;/p&gt;

</description>
      <category>fd</category>
      <category>find</category>
      <category>linux</category>
    </item>
    <item>
      <title>rg instead of grep</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Fri, 06 Dec 2019 12:18:15 +0000</pubDate>
      <link>https://dev.to/joaovitor/rg-instead-of-grep-1hji</link>
      <guid>https://dev.to/joaovitor/rg-instead-of-grep-1hji</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/BurntSushi/ripgrep"&gt;ripgrep&lt;/a&gt; aka rg provides great defaults to search inside files.&lt;/p&gt;

&lt;p&gt;It automatically skip .git directories and files ignored by git reducing the amount of data being searched.&lt;/p&gt;

&lt;p&gt;These are sane defaults to have and can safe you a lot of development time.&lt;/p&gt;

&lt;p&gt;Searching for the same word inside the same directory gives me this.&lt;/p&gt;

&lt;h2&gt;
  
  
  With rg
&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;time &lt;/span&gt;rg &lt;span class="nt"&gt;-li&lt;/span&gt; &lt;span class="s1"&gt;'pattern'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;real    0m17.514s
user    0m15.610s
sys     0m8.822s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  With grep
&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;time grep&lt;/span&gt; &lt;span class="nt"&gt;-ilR&lt;/span&gt; &lt;span class="s1"&gt;'pattern'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;real    1m9.520s
user    0m29.768s
sys     0m8.352s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>rg</category>
      <category>grep</category>
      <category>linux</category>
    </item>
    <item>
      <title>exa instead of ls</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Fri, 06 Dec 2019 12:07:08 +0000</pubDate>
      <link>https://dev.to/joaovitor/exa-instead-of-ls-1onl</link>
      <guid>https://dev.to/joaovitor/exa-instead-of-ls-1onl</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/ogham/exa"&gt;exa&lt;/a&gt; describe itself as the "A modern version of ‘ls’. &lt;a href="https://the.exa.website/"&gt;https://the.exa.website/&lt;/a&gt;".&lt;/p&gt;

&lt;p&gt;I'm using exa instead of ls locally.&lt;/p&gt;

&lt;p&gt;Here are my aliases making this official.&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;alias &lt;/span&gt;&lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'exa'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;la&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'exa -a'&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;ll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'exa -lah'&lt;/span&gt;
&lt;span class="nb"&gt;alias ls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'exa --color=auto'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it out.&lt;/p&gt;

</description>
      <category>exa</category>
      <category>ls</category>
      <category>linux</category>
    </item>
    <item>
      <title>bat instead of cat</title>
      <dc:creator>João Vitor</dc:creator>
      <pubDate>Fri, 06 Dec 2019 12:03:42 +0000</pubDate>
      <link>https://dev.to/joaovitor/bat-instead-of-cat-a86</link>
      <guid>https://dev.to/joaovitor/bat-instead-of-cat-a86</guid>
      <description>&lt;p&gt;I replaced my cat in linux with &lt;a href="https://github.com/sharkdp/bat"&gt;bat&lt;/a&gt;.&lt;br&gt;
I'm using this alias in my shell environment.&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;alias cat&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'bat --style=plain'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;bat gives me syntax highlight, pagination, search in the file being printed and more.&lt;/p&gt;

&lt;p&gt;Give it a try.&lt;/p&gt;

</description>
      <category>cat</category>
      <category>bat</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
