<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dariusz Mydlarz on Medium]]></title>
        <description><![CDATA[Stories by Dariusz Mydlarz on Medium]]></description>
        <link>https://medium.com/@darekmydlarz?source=rss-8b6d43d69889------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cUKJCvd8D5Lc1lwnsq9GQw.jpeg</url>
            <title>Stories by Dariusz Mydlarz on Medium</title>
            <link>https://medium.com/@darekmydlarz?source=rss-8b6d43d69889------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:32:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@darekmydlarz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stop using curl -u “user:password”!]]></title>
            <link>https://medium.com/@darekmydlarz/stop-using-curl-u-user-password-2e83a40f0bc5?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e83a40f0bc5</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Sat, 03 Oct 2020 19:25:39 GMT</pubDate>
            <atom:updated>2020-10-03T19:25:39.629Z</atom:updated>
            <content:encoded><![CDATA[<p>When you are calling endpoint hidden behind Basic Auth you might use -u user:password option in curl.</p><pre>curl -u &quot;darek@sztukakodu.pl:iCantTellYou&quot; <a href="http://api.myapplication.com/data">http://api.myapplication.com/data</a></pre><p>But, actually <strong>it’s not the best approach</strong>.</p><p>The credentials are then stored in your shell history and are security risk.</p><p>Although, <strong>there’s a simple solution for it</strong>!</p><p>You can create file in your home directory named .netrc like this:</p><pre>machine api.myapplication.com<br>  login darek@sztukakodu.pl<br>  password iCantTellYou</pre><p>Then when invoking curl simply add -n and credentials will be read from the prepared file.</p><pre>curl -n <a href="http://api.myapplication.com/data">http://api.myapplication.com/data</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e83a40f0bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Efficiently Download Remote Directories and Files to local machine?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-efficiently-download-remote-directories-and-files-to-local-machine-63c129cc9962?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/63c129cc9962</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Wed, 13 May 2020 20:24:07 GMT</pubDate>
            <atom:updated>2020-05-13T20:25:45.049Z</atom:updated>
            <content:encoded><![CDATA[<p>Use rsync.</p><pre>rsync -avzh <a href="/service/mailto:darek@remotehost.com">darek@remotehost.com</a>:/home/darek/database/backup db_backup</pre><p>This command will efficiently copy content of /home/darek/database/backup directory from darek@remotehost.com host to your local machine todb_backup directory.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63c129cc9962" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Display Count of Changed Files And Lines in Git to Terminal?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-display-count-of-changed-files-and-lines-in-git-to-terminal-d90318b0f8b?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/d90318b0f8b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 10:57:40 GMT</pubDate>
            <atom:updated>2020-04-21T10:57:40.286Z</atom:updated>
            <content:encoded><![CDATA[<pre>$ git --no-pager diff --shortstat master<br>139 files changed, 7914 insertions(+), 445 deletions(-)</pre><ul><li>--no-pager prints directly to standard output</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d90318b0f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Connect to Remote Database from a Local Database Client?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-connect-to-remote-database-from-a-local-database-client-4a15ab960cd6?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a15ab960cd6</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 09:38:30 GMT</pubDate>
            <atom:updated>2020-04-17T09:38:30.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Use SSH Tunnelling.</p><pre>ssh -N -L 6432:127.0.0.1:5432 <a href="/service/mailto:nfjadmin@docker-22.nofluffjobs.com">john@remotehost.com</a></pre><p>Now open connection to the 6432 port in your client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4F9dyXUKfL6cXuo2l0thCQ.png" /><figcaption><a href="https://eggerapps.at/postico/">https://eggerapps.at/postico/</a></figcaption></figure><p>Database that listens on 127.0.0.1:5432 address/port on the remote host john@remotehost.com is now accessible on your local machine on port 6432 .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a15ab960cd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Append Text To File From Standard Input With cat Command]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-append-text-to-file-from-standard-input-with-cat-command-912ad15ce030?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/912ad15ce030</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Fri, 28 Feb 2020 15:24:34 GMT</pubDate>
            <atom:updated>2020-02-28T15:24:34.530Z</atom:updated>
            <content:encoded><![CDATA[<p>You can safely append text from standard input in a terminal to a file with cat command like this.</p><pre>$ cat &gt;&gt; ~/.ssh/authorized_keys<br>YOUR_INPUT<br>^C</pre><p>^C — meaning CTRL+C from your keyboard.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=912ad15ce030" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Record And Share Your Terminal Output?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-record-and-share-your-terminal-output-b653b9d8b0dc?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/b653b9d8b0dc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Fri, 28 Feb 2020 15:15:32 GMT</pubDate>
            <atom:updated>2020-02-28T15:15:32.894Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>Install <a href="https://github.com/asciinema/asciinema">asciinema</a></li></ol><pre>brew install asciinema</pre><p>2. Start recording your terminal</p><pre>asciinema rec hello-world.cast</pre><p>3. Stop recording with CTRL+D or typing exit</p><p>4. Convert hello-world.cast to gif file with</p><pre>docker run --rm -v $PWD:/data asciinema/asciicast2gif hello-world.cast hello-world.gif</pre><p>5. Done :)</p><p>You can see example below 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ID7CPXln6_L9pudQ_597Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b653b9d8b0dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Install ZSH Docker Completion on macOS Catalina (Official)]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-install-zsh-docker-completion-on-macos-catalina-official-332e8420809d?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/332e8420809d</guid>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Fri, 28 Feb 2020 14:54:23 GMT</pubDate>
            <atom:updated>2020-02-28T15:12:21.260Z</atom:updated>
            <content:encoded><![CDATA[<p>Installing Docker completion for ZSH on macOS Catalina doesn’t work out of the box as stated in the official docs.</p><p>Here is the answer to solve the problem.</p><ol><li>Follow the instruction from the <a href="https://docs.docker.com/compose/completion/">official docs</a>. For instance add plugins to you .zshrc file</li></ol><pre>plugins=(... docker docker-compose<br>)</pre><p>2. Then at the end of the .zshrc file add this line</p><pre>### Fix for making Docker plugin work<br>autoload -U compinit &amp;&amp; compinit<br>###</pre><p>3. Reload your session, and you’re done.</p><pre>source ~/.zshrc</pre><p>Proof of working solution 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ID7CPXln6_L9pudQ_597Q.gif" /></figure><p>Best!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=332e8420809d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Clean Local Git Branches That Were Removed On The Remote?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-clean-local-git-branches-that-were-removed-on-the-remote-4d76f7de93ac?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d76f7de93ac</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Wed, 25 Sep 2019 15:26:01 GMT</pubDate>
            <atom:updated>2019-11-07T08:54:56.054Z</atom:updated>
            <content:encoded><![CDATA[<p>There isn’t a simple command to clean your local git branches that were removed on the remote, but… we can create a one!</p><p>So if you want to remove local branches, that does not exist any longer on the remote you can run this simple command.</p><pre>git fetch -p &amp;&amp; git branch -vv | grep &#39;origin/.*: gone]&#39; | awk &#39;{print $1}&#39; | xargs git branch -D</pre><p>Let’s analyse it step by step.</p><ol><li>git fetch -p — fetch newest information about remote branches and -p (or --prune) remove any remote-tracking references that no longer exist on the remote,</li><li>git branch -vv list all local branches with a state on a remote repository,</li><li>grep &#39;origin/.*: gone]&#39; grep branches that are no longer present on the remote (marked by gone marker),</li><li>awk &#39;{print $1}&#39; select branches names,</li><li>xargs git branch -D remove those branches on the local machine.</li></ol><p>That’s it. Remember you can put this command into alias, so it becomes shorter, e.g. gitgone</p><pre>alias gitgone=&quot;git fetch -p &amp;&amp; git branch -vv | grep &#39;origin/.*: gone]&#39; | awk &#39;{print \$1}&#39; | xargs git branch -D&quot;</pre><p>*beware of escaping $1 in awk part</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d76f7de93ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Set Up SSH So You Aren’t Asked For Password?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-set-up-ssh-so-you-arent-asked-for-password-36e92f9353d8?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/36e92f9353d8</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 06:26:30 GMT</pubDate>
            <atom:updated>2019-09-06T06:26:30.708Z</atom:updated>
            <content:encoded><![CDATA[<p><em>ssh-copy-id</em> can be used to easily append your id_rsa.pub to ~/.ssh/authorized_keys on the remote server.</p><p>If you have ~./ssh/id_rsa.pub already generated you can use it to connect to remote server via ssh with ssh-copy-id with single command.</p><pre>$ ssh-copy-id user@host.com</pre><p>You’ll be asked for the password once, and then you can ssh without typing password again.</p><pre>$ ssh user@host.com</pre><p>Your’s id_rsa.pub will be automatically appended to ~/.ssh/authorized_keys on the remote machine.</p><p><em>ssh-copy-id</em><strong><em> </em></strong>can be installed on Mac with <em>brew</em><strong>.</strong></p><pre>$ brew install ssh-copy-id</pre><p>Otherwise you can <em>manually</em> append your key to host machine with below command.</p><pre>ssh user@host.com tee -a .ssh/authorized_keys &lt; ~/.ssh/id_rsa.pu</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e92f9353d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Count JSON Array Length from Command Line?]]></title>
            <link>https://medium.com/@darekmydlarz/how-to-count-json-array-length-from-command-line-3748ac0fce12?source=rss-8b6d43d69889------2</link>
            <guid isPermaLink="false">https://medium.com/p/3748ac0fce12</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Dariusz Mydlarz]]></dc:creator>
            <pubDate>Tue, 03 Sep 2019 13:57:00 GMT</pubDate>
            <atom:updated>2019-09-03T14:02:22.474Z</atom:updated>
            <content:encoded><![CDATA[<p><em>jq</em> can be used in order to efficiently count JSON array length from command line.</p><p>Given JSON file out.json like this.</p><pre>{<br>  &quot;meta&quot;: {},<br>  &quot;data&quot;: [<br>    {<br>      &quot;id&quot;: 1<br>    },<br>    {<br>      &quot;id&quot;: 2<br>    }<br>  ]<br>}</pre><p>In order to count data length, you can use <a href="https://github.com/stedolan/jq">jq</a>.</p><pre>$ cat out.json | jq &#39;.data | length&#39;<br>19226</pre><p>For 57 MB file it takes 1.97 seconds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3748ac0fce12" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>