<?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: Mikołaj Buchwald</title>
    <description>The latest articles on DEV Community by Mikołaj Buchwald (@mikolajbuchwald).</description>
    <link>https://dev.to/mikolajbuchwald</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%2F302806%2Faf2c8a93-acc9-476c-b53f-1d40fb7a7062.jpeg</url>
      <title>DEV Community: Mikołaj Buchwald</title>
      <link>https://dev.to/mikolajbuchwald</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikolajbuchwald"/>
    <language>en</language>
    <item>
      <title>Generating SSH key – the best way</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Tue, 04 Jul 2023 09:59:23 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/generating-ssh-key-the-best-way-3e54</link>
      <guid>https://dev.to/mikolajbuchwald/generating-ssh-key-the-best-way-3e54</guid>
      <description>&lt;p&gt;tl;rd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t rsa -b 2048 -C "user@institution" -f ~/.ssh/institution-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user&lt;/code&gt; is your identifier, e.g., "joe"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;institution&lt;/code&gt; is your workplace, or an indication that it is your personal key, e.g., "buchcorp", "personal", etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An additional step is to rename the private key to have a &lt;code&gt;*.pem&lt;/code&gt; extension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv ~/.ssh/institution-user ~/.ssh/institution-user.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't know the security standpoint/standards, but from the user experience/usability point of view I am a great fan of file extensions in general.&lt;/p&gt;




&lt;h2&gt;
  
  
  Important ingredients of a perfect &lt;code&gt;ssh-keygen&lt;/code&gt; command
&lt;/h2&gt;

&lt;p&gt;There are numerous tutorials on the web how to generate a pair of SSH keys. However, I didn't find a single one that covers all the arguments/parameters that in my opinion are essential when generating an SSH key pair via a terminal. What are these essential ingredients of a perfect &lt;code&gt;ssh-keygen&lt;/code&gt; command? Here they are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Comment –- needles to say, the comment doesn't seem that important, unless you are faced with an impossible task of disentangling a multiple keys sitting in &lt;code&gt;authorized_keys&lt;/code&gt; for months, if not years. Good luck guessing which key belong to who then :) In other words, always put a meaningful text that will allow others (as well as yourself) to identify the particular key as yours (unless you are a hacker, or whatever :D )&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Filename -- you want your private and public keys to have a meaningful name right away –- else they can get lost in a number of the default &lt;code&gt;id_rsa&lt;/code&gt; files, or worse –- you will overwrite an important key. Please note that I explicitly mention the path to the file: &lt;code&gt;-f ~/.ssh/key-name&lt;/code&gt; (instead of specifying just the file name).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The command
&lt;/h2&gt;

&lt;p&gt;Here is the example command using the above-mentioned characteristics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t rsa -b 2048 -C "user@institution" -f ~/.ssh/institution-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user&lt;/code&gt; is your identifier, e.g., "joe"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;institution&lt;/code&gt; is your workplace, or an indication that it is your personal key, e.g., "buchcorp", "personal", etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv ~/.ssh/institution-user ~/.ssh/institution-user.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't know the security standpoint/standards, but from the user experience/usability point of view I am a great fan of file extensions in general.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.ssh.com/academy/ssh/keygen#specifying-the-file-name" rel="noopener noreferrer"&gt;https://www.ssh.com/academy/ssh/keygen#specifying-the-file-name&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.gitlab.com/ee/user/ssh.html" rel="noopener noreferrer"&gt;https://docs.gitlab.com/ee/user/ssh.html&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;: see how to manage multiple SSH keys in my other article: &lt;a href="https://dev.to/mikolajbuchwald/git-via-ssh-multiple-keys-management-3bkm"&gt;https://dev.to/mikolajbuchwald/git-via-ssh-multiple-keys-management-3bkm&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover image: photo by &lt;a href="https://unsplash.com/@lazycreekimages?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Michael Dziedzic&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/1bjsASjhfkE?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>git</category>
      <category>security</category>
      <category>development</category>
    </item>
    <item>
      <title>Conda equivalent of `pipenv run`</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Wed, 14 Jun 2023 13:54:24 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/conda-equivalent-of-pipenv-run-3min</link>
      <guid>https://dev.to/mikolajbuchwald/conda-equivalent-of-pipenv-run-3min</guid>
      <description>&lt;p&gt;If you wish to run a single command using a Python environment created with &lt;code&gt;conda&lt;/code&gt; (i.e., you don't want to &lt;code&gt;activate&lt;/code&gt; the environment first), you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conda run -n your_env_name some_command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;E.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conda run -n webprojects python --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conda run -n datascience jupyter lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure that you are using the &lt;code&gt;-n&lt;/code&gt; argument; &lt;code&gt;pipenv&lt;/code&gt; does not require specifying an "optional" argument, hence it took me some time to get this working (i.e., it works just like &lt;code&gt;pipenv run jupyter lab&lt;/code&gt;).&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.conda.io/projects/conda/en/latest/commands/run.html" rel="noopener noreferrer"&gt;https://docs.conda.io/projects/conda/en/latest/commands/run.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/57327966/what-is-the-syntax-for-invoking-conda-run-from-an-anaconda-installation-on-win" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/57327966/what-is-the-syntax-for-invoking-conda-run-from-an-anaconda-installation-on-win&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@thomasoldenburger?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Thomas Oldenburger&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/TeOc4DVDsH4?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>conda</category>
      <category>python</category>
      <category>cli</category>
      <category>pipenv</category>
    </item>
    <item>
      <title>Running Bash commands with Python</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Tue, 25 Apr 2023 20:54:36 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/running-bash-commands-with-python-34cg</link>
      <guid>https://dev.to/mikolajbuchwald/running-bash-commands-with-python-34cg</guid>
      <description>&lt;h2&gt;
  
  
  When plain Bash is not enough
&lt;/h2&gt;

&lt;p&gt;A while ago I read an excellent &lt;a href="https://dev.to/godcrampy/the-missing-shell-scripting-crash-course-37mk"&gt;introductory Bash tutorial&lt;/a&gt; on Dev.to by &lt;a href="https://dev.to/godcrampy"&gt;Sahil Bondre&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is a really great tutorial on shell scripting basics, but I remember when I was beginning my adventure with shell scripting, and when I was (over)fascinated with Bash. In time, when my neuroimaging scripts started becoming more and more complex, I slowly began loosing control over my code! &lt;/p&gt;

&lt;p&gt;Many times I felt like that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5upkv2496dlqak5fpef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5upkv2496dlqak5fpef.png" alt="Linux bash why won't you work - crying peter parker | Meme Generator" width="225" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Python era
&lt;/h2&gt;

&lt;p&gt;That was about that time when I discovered, that at some point, when more complicated logical expressions were needed (more conditionals, loops, and functions), it’s worth switching from Bash to Python. Hopefully, with Python you can wrap (almost) any bash command. And it is as simple as that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sp&lt;/span&gt;

&lt;span class="n"&gt;bash_command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ls ~/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Bash command:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;bash_command&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;process&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bash_command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;communicate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Bash command output:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bash command error:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(It works both for Linux and macOS.)&lt;/p&gt;

&lt;p&gt;Note the additional prints, as it is easier to debug the command before it is run. Additionally, you can see the output of the command (just like for a normal bash shell).&lt;/p&gt;

&lt;p&gt;The above example was inspired by &lt;a href="https://stackoverflow.com/a/4256153/8877692" rel="noopener noreferrer"&gt;this StackOverflow answer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It turned out that Python syntax is more readable and easier to maintain, yay! 🙂&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiluie66zp0h8uqiai1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiluie66zp0h8uqiai1y.png" alt="How To Write Better Python Code? - DEV Python is just a better “pseudocode compiler” than Bash." width="750" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Take &lt;code&gt;~/&lt;/code&gt; message
&lt;/h2&gt;

&lt;p&gt;Don't stick with a plain bash for too long — often all you really needed is Python! Nevertheless, for a very simple scripts, you can of course always make a use of a good ol’ Bash ;)&lt;/p&gt;




&lt;p&gt;See also my original post from 2020 (now it is already 2023 :) , but the knowledge is still a very much up-to-date): &lt;a href="https://www.mindyourdata.org/posts/when-plain-bash-is-not-enough/" rel="noopener noreferrer"&gt;https://www.mindyourdata.org/posts/when-plain-bash-is-not-enough/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover photo source: Photo by &lt;a href="https://unsplash.com/@iam_abhi?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Abhishek rana&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/snake-in-shell?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bash</category>
      <category>python</category>
      <category>linux</category>
      <category>systems</category>
    </item>
    <item>
      <title>Initializing a `git` repository with `git-lfs` (large file storage)</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Wed, 18 Jan 2023 14:53:25 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/initializing-a-git-repository-with-git-lfs-large-file-storage-1f7d</link>
      <guid>https://dev.to/mikolajbuchwald/initializing-a-git-repository-with-git-lfs-large-file-storage-1f7d</guid>
      <description>&lt;p&gt;As it happens, you would like to initialize a &lt;code&gt;git&lt;/code&gt; repository with &lt;code&gt;git-lfs&lt;/code&gt; (large file storage) functionality to store some really large files. For someone a file of a 10MB size may seem large, for somebody else it would have to be as 1GB in size, but regardless of that, this tutorial explains how to efficiently initialize a repository with &lt;code&gt;git-lfs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;First, make sure that you have &lt;code&gt;git lfs&lt;/code&gt; installed (how-to install for: &lt;a href="https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage" rel="noopener noreferrer"&gt;macOS&lt;/a&gt;, &lt;a href="https://github.com/git-lfs/git-lfs/wiki/Installation#debian-and-ubuntu" rel="noopener noreferrer"&gt;Linux&lt;/a&gt;). In short, for macOS: &lt;code&gt;brew install git-lfs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initializing &lt;code&gt;git-lfs&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Assuming that you have not initialized your repository with the "normal" &lt;code&gt;git&lt;/code&gt; command yet, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
git lfs install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the sake of the example (to show you some difficulties you may encounter), let's assume that the files that you wish to add to &lt;code&gt;git-lfs&lt;/code&gt; are stored in two separate directories (e.g., &lt;code&gt;data&lt;/code&gt; and &lt;code&gt;supplementary_materials&lt;/code&gt;). The tree of your repository looks somehow like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── ...
├── README.md
├── data
│   ├── data1.png
│   ├── data2.zip
│   └── label.txt
├── images
│   └── some_pict.png
└── supplementary_materials
    ├── first_subdir
    │   └── somefile.png 
    ├── second_subdir
    │   └── somefile.png 
    └── third_subdir
        └── somefile.zip 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, some basic stuff about synchronizing with your remote repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin https://github.com/mikbuch/your-repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -M main
git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, there are basically two ways of adding files to &lt;code&gt;git-LFS&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The first (recommended) method
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;.gitattributes&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and add the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data/**/* filter=lfs diff=lfs merge=lfs -text
supplementary_materials/**/* filter=lfs diff=lfs merge=lfs -text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note!&lt;/strong&gt; In our example we have two separate directories that you wish to add to &lt;code&gt;git-lfs&lt;/code&gt; in which you have some subdirectories. (1) The syntax has to be exactly like the one in the code above, or else you won't add all files in all subdirectories. (2) If you have several directories, from the point of view of your current working directory, you have to list them all, one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  The second (not recommended) method
&lt;/h3&gt;

&lt;p&gt;Use the following commands to add directory and all files in this directory and its subdirectories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs track data/**/*
git lfs track supplementary_materials/**/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note!&lt;/strong&gt; The command &lt;code&gt;git lfs track supplementary_materials/**&lt;/code&gt; will not be sufficient to add all files in all subdirectories.&lt;/p&gt;

&lt;p&gt;Why this method is &lt;strong&gt;not&lt;/strong&gt; recommended?: It will list/add &lt;strong&gt;all&lt;/strong&gt; tracked files to your &lt;code&gt;.gitattributes&lt;/code&gt; (one by one!), e.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➜  git:(main) ✗ cat .gitattributes

data/data1.png filter=lfs diff=lfs merge=lfs -text
data/data2.zip filter=lfs diff=lfs merge=lfs -text
data/label.txt filter=lfs diff=lfs merge=lfs -text
...
supplementary_materials/first_subdir/somefile.png filter=lfs diff=lfs merge=lfs -text
supplementary_materials/second_subdir/somefile.png filter=lfs diff=lfs merge=lfs -text
supplementary_materials/third_subdir/somefile.zip filter=lfs diff=lfs merge=lfs -text
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What you would like to have in your &lt;code&gt;.gitattributes&lt;/code&gt; is just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data/**/* filter=lfs diff=lfs merge=lfs -text
supplementary_materials/**/* filter=lfs diff=lfs merge=lfs -text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is much more clearer approach. See the first (recommended) method described above.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preview the &lt;code&gt;.gitattributes&lt;/code&gt; file
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add all files to your repository:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show which files are tracked with (&lt;code&gt;git lfs ls-files&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs ls-files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note!&lt;/strong&gt; &lt;code&gt;git lfs ls-files&lt;/code&gt; works only after you have added the files to the repository with &lt;code&gt;git add&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Show which files were added to the repository (regardless of whether LFS or not):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure that the files are tracked with &lt;code&gt;git-LFS&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh .git
du -sh .git/lfs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Note on &lt;code&gt;GitHub&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;If you are using &lt;code&gt;GitHub&lt;/code&gt;, please make sure that you are using the proper SSH file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;GitHub&lt;/code&gt;, also make sure that your key is added to you profile (not just one repository!). See the output of a command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -T -ai ~/.ssh/my-key.pem git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source: &lt;a href="https://superuser.com/a/232406/950943" rel="noopener noreferrer"&gt;https://superuser.com/a/232406/950943&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you used this key for one repository only you will see somethink like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi mikbuch/your-repository! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see output like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi mikbuch! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Committing and pushing to the server
&lt;/h3&gt;

&lt;p&gt;Commit the files (both LFS and "normal"):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -a -m "Initializing commit with git LFS"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, you can push your reporitory to the remote server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;In order to reset (if needed/optional) during the process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf .git
rm .gitattributes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;And that's it, I hope you will find this tutorial useful, have a nice day!&lt;/p&gt;




&lt;h2&gt;
  
  
  Additional resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;045 Introduction to Git LFS (Large File Storage) by Dan Gitschooldude: &lt;a href="https://youtu.be/xPFLAAhuGy0" rel="noopener noreferrer"&gt;https://youtu.be/xPFLAAhuGy0&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example use: &lt;a href="https://github.com/git-lfs/git-lfs/wiki/Installation#debian-and-ubuntu" rel="noopener noreferrer"&gt;https://github.com/git-lfs/git-lfs/wiki/Installation#debian-and-ubuntu&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Source for the cover photo image: Photo by &lt;a href="https://unsplash.com/it/@wesleyphotography?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Wesley Tingey&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/snNHKZ-mGfE?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>programming</category>
      <category>datascience</category>
      <category>gitlfs</category>
    </item>
    <item>
      <title>EasySSH - GUI host manager for Linux</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Wed, 03 Aug 2022 20:43:00 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/easyssh-gui-host-manager-for-linux-4bac</link>
      <guid>https://dev.to/mikolajbuchwald/easyssh-gui-host-manager-for-linux-4bac</guid>
      <description>&lt;p&gt;If you like to have your virtual servers catalogued and available quickly with SSH, a decent GUI for host manager may come in handy.&lt;/p&gt;

&lt;p&gt;On macOS I absolutely love using &lt;a href="https://codinn.com/shell/" rel="noopener noreferrer"&gt;Core Shell&lt;/a&gt;, but I struggled a bit to find a decent Linux (Ubuntu) alternative for that. Until I came across &lt;a href="https://www.linux.com/topic/networking/three-ssh-guis-linux/" rel="noopener noreferrer"&gt;this post and review&lt;/a&gt; by &lt;a href="https://www.linux.com/author/jlwallen/" rel="noopener noreferrer"&gt;Jack Wallen&lt;/a&gt; at linux.com, and I finally found out about &lt;a href="https://github.com/muriloventuroso/easyssh" rel="noopener noreferrer"&gt;EasySSH&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;EasySSH is a decent piece of software, and it has all functionalities I have been looking for.&lt;/p&gt;

&lt;p&gt;Configuring a host:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjvi72cymj7qahi7bkjw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjvi72cymj7qahi7bkjw.png" alt="Configuring a host" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connecting:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flegdxhohmpodmx8rb5jc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flegdxhohmpodmx8rb5jc.png" alt="Connecting with EasySSH" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the review and more screenshots please see the &lt;a href="https://www.linux.com/topic/networking/three-ssh-guis-linux/" rel="noopener noreferrer"&gt;post I linked above&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing
&lt;/h2&gt;

&lt;p&gt;The best part is that EasySSH that it is available via &lt;code&gt;apt&lt;/code&gt;, so installing it is as simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get -y install easyssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Give it a try and let me know what you think in the comments!&lt;/p&gt;




&lt;p&gt;Source of the graphics in the cover: Photo by &lt;a href="https://unsplash.com/@erol?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Erol Ahmed&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/library-catalogue?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>gui</category>
      <category>cloud</category>
      <category>vps</category>
    </item>
    <item>
      <title>Conda tip from a `requirements.txt` type of person</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Sat, 23 Jul 2022 13:39:32 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/conda-tip-from-a-requirementstxt-type-of-person-235p</link>
      <guid>https://dev.to/mikolajbuchwald/conda-tip-from-a-requirementstxt-type-of-person-235p</guid>
      <description>&lt;p&gt;I am a &lt;code&gt;requirements.txt&lt;/code&gt; (&lt;code&gt;venv&lt;/code&gt;/&lt;code&gt;pipenv&lt;/code&gt;) type of person. I have my reasons for that, but I won't mention these reasons here (well, technically, problems such as the one described in this post is one of these reasons).&lt;/p&gt;

&lt;p&gt;At some point, I finally need to get familiar with &lt;code&gt;conda&lt;/code&gt;. The first surprise: installing &lt;code&gt;conda&lt;/code&gt; on linux is not as simple as &lt;code&gt;sudo apt-get install ...&lt;/code&gt; or &lt;code&gt;sudo pip install ...&lt;/code&gt;. You need to download a bash installer and run it. But I was cool with that. After choosing some installation options, and adding &lt;code&gt;conda&lt;/code&gt; to the &lt;code&gt;PATH&lt;/code&gt; (it was also not mentioned explicitly in the installation guides that you have to do it &lt;a href="https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html" rel="noopener noreferrer"&gt;[1]&lt;/a&gt;&lt;a href="https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html" rel="noopener noreferrer"&gt;[2]&lt;/a&gt;) I was ready to go.&lt;/p&gt;

&lt;p&gt;In the repository of a project I wanted to start working on, I had an &lt;code&gt;environment.yml&lt;/code&gt; file (which is an equivalent of a &lt;code&gt;requirements.py&lt;/code&gt;). Now comes the most tricky part:&lt;/p&gt;

&lt;p&gt;The official documentation says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create the environment from the environment.yml file:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conda env create -f environment.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok, so I did run this command, but I got the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CondaValueError: prefix already exists: /home/user/anaconda3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is unfortunate. Anyways, I googled the error, and here's what I found:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/conda/conda/issues/6973" rel="noopener noreferrer"&gt;Conda bug: CondaValueError: prefix already exists: /home/user/anaconda2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Long story short, if your &lt;code&gt;.yml&lt;/code&gt; file have an empty name field, you have to explicitly specify environment name when creating the environment with &lt;code&gt;conda&lt;/code&gt; command, like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conda env create -f environment.yml -n environmentName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I followed this advice and my environment has been successfully created.&lt;/p&gt;




&lt;p&gt;To sum up, my tip, as a &lt;code&gt;requiements.txt&lt;/code&gt; type of person, is that &lt;code&gt;conda&lt;/code&gt; is less "user friendly" in the sense that you have to be more aware what is going on, in terms of command execution and naming of the environments. To compare this to the &lt;code&gt;pipenv&lt;/code&gt;'s behavior: by default &lt;code&gt;pipenv&lt;/code&gt; creates a directory with your virtual environment in the &lt;code&gt;~/local/share/virtualenvs/&lt;/code&gt; which comprises of the name of the directory where you invoke &lt;code&gt;pipenv&lt;/code&gt; command, and a hash. So, the entry level is lower, you just run the command and it works, but then you have to know where the environment is located (you get that information also in the &lt;code&gt;pipenv&lt;/code&gt;'s output log). Conda, on the other hand, is harder to use because of the more enigmatic error information, and the conventions you have to be aware of, before even running the command.&lt;/p&gt;

</description>
      <category>conda</category>
      <category>environment</category>
      <category>venv</category>
      <category>python</category>
    </item>
    <item>
      <title>Git via SSH - multiple keys management</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Thu, 23 Jun 2022 21:11:27 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/git-via-ssh-multiple-keys-management-3bkm</link>
      <guid>https://dev.to/mikolajbuchwald/git-via-ssh-multiple-keys-management-3bkm</guid>
      <description>&lt;p&gt;In order to use &lt;code&gt;git&lt;/code&gt; over &lt;code&gt;ssh&lt;/code&gt;, you need ssh keys. When you want to use multiple keys for different domains, you have to know where and how to configure it. I always forget where this configuration file is stored, so here I make a short note about it. Just edit &lt;code&gt;~/.ssh/config&lt;/code&gt;, e.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then put there something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host github.com
 HostName github.com
 IdentityFile ~/.ssh/id_rsa_github
Host gitlab.com
 HostName gitlab.com
 IdentityFile ~/.ssh/id_rsa_gitlab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Et violà!&lt;/p&gt;




&lt;p&gt;Source: &lt;a href="https://superuser.com/a/232406/950943" rel="noopener noreferrer"&gt;https://superuser.com/a/232406/950943&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Edit: Troubleshooting&lt;/strong&gt;: On AWS' EC2 machines you may get an &lt;code&gt;Bad owner or permissions on /home/ec2-user/.ssh/config&lt;/code&gt; error when trying to clone a repository, e.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ec2-user@ip-my-ip ~]$ git clone git@gitlab.com:mikbuch/my-repo-name.git
Cloning into 'my-repo-name'...
Bad owner or permissions on /home/ec2-user/.ssh/config
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have to make sure that you have &lt;code&gt;400&lt;/code&gt; permission on your &lt;code&gt;~/.ssh/config&lt;/code&gt; file, i.e.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ec2-user@ip-my-ip ~]$ ls -la ~/.ssh/
total 12
drwx------ 2 ec2-user ec2-user   73 Dec 29 19:51 .
drwx------ 7 ec2-user ec2-user  175 Dec 29 19:52 ..
-r-------- 1 ec2-user ec2-user 1831 Dec 29 19:50 my-deployment-key.pem
-rw------- 1 ec2-user ec2-user  957 Dec 20 20:25 authorized_keys
-rw-rw-r-- 1 ec2-user ec2-user   81 Dec 29 19:51 config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the following command to change the permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ec2-user@ip-my-ip ~]$ chmod 400 ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ec2-user@ip-my-ip ~]$ ls -la ~/.ssh/
total 16
drwx------ 2 ec2-user ec2-user   92 Dec 29 19:53 .
drwx------ 8 ec2-user ec2-user  196 Dec 29 19:53 ..
-r-------- 1 ec2-user ec2-user 1831 Dec 29 19:50 my-deployment-key.pem
-rw------- 1 ec2-user ec2-user  957 Dec 20 20:25 authorized_keys
-r-------- 1 ec2-user ec2-user   81 Dec 29 19:51 config
-rw-r--r-- 1 ec2-user ec2-user  207 Dec 29 19:53 known_hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the clonning should work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ec2-user@ip-my-ip ~]$ git clone git@gitlab.com:mikbuch/my-repo-name.git
Cloning into 'my-repo-name'...
The authenticity of host 'gitlab.com (2606:4700:90:0:f22e:fbec:5bed:a9b9)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
ECDSA key fingerprint is MD5:f1:d0:fb:46:73:7a:70:92:5a:ab:5d:ef:43:e2:1c:35.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.com,2606:4700:90:0:f22e:fbec:5bed:a9b9' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 287, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 287 (delta 37), reused 200 (delta 36), pack-reused 81
Receiving objects: 100% (287/287), 1.25 MiB | 3.19 MiB/s, done.
Resolving deltas: 100% (64/64), done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>ssh</category>
      <category>cicd</category>
      <category>config</category>
    </item>
    <item>
      <title>How to update Firefox on Ubuntu Linux</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Sun, 12 Jun 2022 11:54:06 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/how-to-update-firefox-on-ubuntu-linux-1h03</link>
      <guid>https://dev.to/mikolajbuchwald/how-to-update-firefox-on-ubuntu-linux-1h03</guid>
      <description>&lt;p&gt;tldr;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Backup the old version
sudo mv /opt/firefox /opt/firefox_bak

# Untar the new Firefox
sudo tar xjf firefox-*.tar.bz2 -C /opt

# Remove the tar from Downloads
rm -r ~/Downloads/firefox-*.tar.bz2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I installed Firefox on Kubuntu with tarball (no &lt;code&gt;snap&lt;/code&gt; nor &lt;code&gt;flatpak&lt;/code&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I went to: &lt;a href="https://www.mozilla.org/en-US/firefox/new/" rel="noopener noreferrer"&gt;https://www.mozilla.org/en-US/firefox/new/&lt;/a&gt; , and downloaded the tarball&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo tar xjf ~/Downloads/firefox-*.tar.bz2 -C /opt/
&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo ln -s /opt/firefox/firefox /usr/bin/firefox&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rm -r ~/Downloads/firefox-*.tar.bz2&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;When it came to updating Firefox (I got a pop-up in top right corner of the application), I downloaded a new version (used to have 100.x, now I downloaded 101.x), and I used the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Backup the old version
sudo mv /opt/firefox /opt/firefox_bak

# Untar the new Firefox
sudo tar xjf firefox-*.tar.bz2 -C /opt

# Remove the tar from Downloads
rm -r /Downloads/firefox-*.tar.bz2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Graphic from: &lt;a href="https://en.wikipedia.org/wiki/Red_fox" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Red_fox&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Integrating Django framework with Matomo web analytics platform</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Tue, 05 Apr 2022 12:42:33 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/integrating-django-framework-with-matomo-web-analytics-platform-4hch</link>
      <guid>https://dev.to/mikolajbuchwald/integrating-django-framework-with-matomo-web-analytics-platform-4hch</guid>
      <description>&lt;p&gt;Recently I wanted to integrate a web application we are working on with Matomo analytics functionalities. Django web framework was used in this application on the backend side. It turned out that there was a package for integrating Matomo with Django -- injecting JavaScript via Django's template mechanism. However, this package was from 2013 (9yo), and it was written for &lt;code&gt;piwik&lt;/code&gt; -- the former name of the Matomo.&lt;/p&gt;

&lt;p&gt;So I decided to refresh the package and I created &lt;code&gt;django-matomo&lt;/code&gt;. The module is available at &lt;code&gt;pip&lt;/code&gt;, with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install django-matomo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://pypi.org/project/django-matomo/" rel="noopener noreferrer"&gt;PyPi website of the package&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source code is available at the &lt;a href="https://github.com/mikbuch/django-matomo" rel="noopener noreferrer"&gt;&lt;code&gt;django-matomo&lt;/code&gt; GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I contacted the Matomo Team, and they agreed to update the official support for the integration for Django to &lt;code&gt;django-matomo&lt;/code&gt;! It is now listed at their website: &lt;a href="https://matomo.org/integrate/" rel="noopener noreferrer"&gt;https://matomo.org/integrate/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is also &lt;a href="https://forum.djangoproject.com/t/django-matomo-integrating-django-with-matomo-analytics/12890/2" rel="noopener noreferrer"&gt;a post I created on Django forums&lt;/a&gt;, if anyone have questions regarding the integration on the Django side.&lt;/p&gt;




&lt;p&gt;Credits for the &lt;a href="https://github.com/jasjukaitis/django-piwik" rel="noopener noreferrer"&gt;&lt;code&gt;django-piwik&lt;/code&gt;&lt;/a&gt; (legacy package) goes to its creator Raphael Jasjukaitis.&lt;/p&gt;

</description>
      <category>django</category>
      <category>matomo</category>
      <category>analytics</category>
      <category>python</category>
    </item>
    <item>
      <title>Drawing a rectangle in OpenCV Python</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Sun, 27 Mar 2022 22:19:37 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/drawing-rectangle-in-opencv-python-27cj</link>
      <guid>https://dev.to/mikolajbuchwald/drawing-rectangle-in-opencv-python-27cj</guid>
      <description>&lt;h2&gt;
  
  
  How to draw a rectangle in OpenCV Python
&lt;/h2&gt;

&lt;p&gt;A simplistic example for beginners on how to draw a rectangle using OpenCV in Python. Example as a &lt;a href="https://colab.research.google.com/drive/1f5_TTNKFDBmcZvsAUR4QtSJW9AoRL-nk#scrollTo=4A_dfKrzW0Dl" rel="noopener noreferrer"&gt;Google Colaboratory notebook&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Part of &lt;a href="https://www.facebook.com/groups/python/posts/1150573239116572/" rel="noopener noreferrer"&gt;my answer&lt;/a&gt; to FB post at Python's group.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opencv</category>
      <category>computervision</category>
      <category>goooglecolab</category>
    </item>
    <item>
      <title>Python Django `dbshell`</title>
      <dc:creator>Mikołaj Buchwald</dc:creator>
      <pubDate>Fri, 25 Mar 2022 12:08:54 +0000</pubDate>
      <link>https://dev.to/mikolajbuchwald/python-django-dbshell-4dl3</link>
      <guid>https://dev.to/mikolajbuchwald/python-django-dbshell-4dl3</guid>
      <description>&lt;p&gt;Python Django's &lt;a href="https://docs.djangoproject.com/en/4.0/ref/django-admin/#dbshell" rel="noopener noreferrer"&gt;&lt;code&gt;dbshell&lt;/code&gt;&lt;/a&gt; is a very useful tool for SQL database debugging when working on a Django application.&lt;/p&gt;

&lt;p&gt;To run SQL shell interactively:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python manage.py dbshell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQLite version 3.32.3 2020-06-18 14:16:19
Enter ".help" for usage hints.
sqlite&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful Django &lt;code&gt;sqlite&lt;/code&gt; commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;help&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example SQL command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;django_migrations&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to see the names of the columns (the header) of the table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;mode&lt;/span&gt; &lt;span class="k"&gt;column&lt;/span&gt;
&lt;span class="n"&gt;pragma&lt;/span&gt; &lt;span class="n"&gt;table_info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'django_migrations'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;sqlite&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pragma&lt;/span&gt; &lt;span class="n"&gt;table_info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'django_migrations'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;cid&lt;/span&gt;         &lt;span class="n"&gt;name&lt;/span&gt;        &lt;span class="k"&gt;type&lt;/span&gt;        &lt;span class="k"&gt;notnull&lt;/span&gt;     &lt;span class="n"&gt;dflt_value&lt;/span&gt;  &lt;span class="n"&gt;pk&lt;/span&gt;        
&lt;span class="c1"&gt;----------  ----------  ----------  ----------  ----------  ----------&lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt;           &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="nb"&gt;integer&lt;/span&gt;     &lt;span class="mi"&gt;1&lt;/span&gt;                       &lt;span class="mi"&gt;1&lt;/span&gt;         
&lt;span class="mi"&gt;1&lt;/span&gt;           &lt;span class="n"&gt;app&lt;/span&gt;         &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;  &lt;span class="mi"&gt;1&lt;/span&gt;                       &lt;span class="mi"&gt;0&lt;/span&gt;         
&lt;span class="mi"&gt;2&lt;/span&gt;           &lt;span class="n"&gt;name&lt;/span&gt;        &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;  &lt;span class="mi"&gt;1&lt;/span&gt;                       &lt;span class="mi"&gt;0&lt;/span&gt;         
&lt;span class="mi"&gt;3&lt;/span&gt;           &lt;span class="n"&gt;applied&lt;/span&gt;     &lt;span class="nb"&gt;datetime&lt;/span&gt;    &lt;span class="mi"&gt;1&lt;/span&gt;                       &lt;span class="mi"&gt;0&lt;/span&gt;      
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See also &lt;a href="https://stackoverflow.com/a/18757996/8877692" rel="noopener noreferrer"&gt;this&lt;/a&gt; StackOverflow answer.&lt;/p&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>sql</category>
      <category>debug</category>
    </item>
  </channel>
</rss>
