<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ubuntu on Matus Stafura</title>
    <link>https://stafura.dev/tags/ubuntu/</link>
    <description>Recent content in Ubuntu on Matus Stafura</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Thu, 16 Jul 2026 07:59:24 +0200</lastBuildDate>
    <atom:link href="https://stafura.dev/tags/ubuntu/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Automatically Restart MariaDB on Crash in Ubuntu with systemd</title>
      <link>https://stafura.dev/auto-restart-mariadb-ubuntu-systemd/</link>
      <pubDate>Thu, 16 Jul 2026 07:59:24 +0200</pubDate>
      <guid>https://stafura.dev/auto-restart-mariadb-ubuntu-systemd/</guid>
      <description>&lt;h2 id=&#34;why-do-you-need-to-autorestart-db&#34;&gt;Why do you need to autorestart DB?&lt;/h2&gt;&#xA;&lt;p&gt;Database can crash from any problems like when the system runs out of memory, full disk and so on. And the website will be down until you notice it and restart the database manually.&lt;/p&gt;&#xA;&lt;p&gt;The bare minimum you can do is to set it to restart automatically in Linux with systemd.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Note that this will not start DB when it is manually stopped.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Automatically Update a Git Repo on Login in Linux</title>
      <link>https://stafura.dev/how-to-automatically-update-a-git-repo-on-login-in-linux/</link>
      <pubDate>Tue, 16 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://stafura.dev/how-to-automatically-update-a-git-repo-on-login-in-linux/</guid>
      <description>&lt;h2 id=&#34;why-would-you-want-to-do-this&#34;&gt;Why would you want to do this?&lt;/h2&gt;&#xA;&lt;p&gt;Yeah, yeah, it happens even to the best of us.&lt;/p&gt;&#xA;&lt;p&gt;You start committing changes to your repo, and then you forget to push them.&lt;/p&gt;&#xA;&lt;p&gt;Then you go to another machine, and you realize that your repo is outdated.&lt;/p&gt;&#xA;&lt;p&gt;BRUH!&lt;/p&gt;&#xA;&lt;p&gt;To prevent this, you can easily set up a systemd user service that runs a script to &lt;code&gt;git pull&lt;/code&gt; your repo every time you log in.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install and Configure Redis on a Separate DigitalOcean Droplet for Magento</title>
      <link>https://stafura.dev/how-to-install-and-configure-redis-on-a-separate-digitalocean-droplet-for-magento/</link>
      <pubDate>Thu, 23 Jan 2025 00:00:00 +0000</pubDate>
      <guid>https://stafura.dev/how-to-install-and-configure-redis-on-a-separate-digitalocean-droplet-for-magento/</guid>
      <description>&lt;p&gt;Install redis on separate droplet to offload Redis from the Magento monolith.&lt;/p&gt;&#xA;&lt;h3 id=&#34;create-a-droplet-for-redis&#34;&gt;Create a Droplet for Redis&lt;/h3&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s create a droplet for Redis in DigitalOcean (DO from now on).&lt;/p&gt;&#xA;&lt;p&gt;I chose the following minimal parameters (you can scale later):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Basic Droplet&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Premium AMD&lt;/strong&gt;: 1GB RAM, 25GB NVMe SSD, 1000GB transfer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;IMPORTANT: Make sure the new droplet is within the same VPC and Region as your Magento server.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;redis-installation&#34;&gt;Redis installation&lt;/h3&gt;&#xA;&lt;p&gt;Once the droplet is successfully created, SSH into the droplet and install Redis:&lt;/p&gt;</description>
    </item>
    <item>
      <title>My first homelab</title>
      <link>https://stafura.dev/my-first-homelab/</link>
      <pubDate>Mon, 20 Jan 2025 00:00:00 +0000</pubDate>
      <guid>https://stafura.dev/my-first-homelab/</guid>
      <description>&lt;p&gt;Finally, I found the time to set up my first homelab. To get hands-on experience with advanced Linux topics, virtualization, and Kubernetes, I needed a dedicated server. The truth is, you don’t need anything fancy—an old laptop can work just fine. I opted for a mini version since I might need to carry it to different locations.&lt;/p&gt;&#xA;&lt;h3 id=&#34;specs&#34;&gt;Specs&lt;/h3&gt;&#xA;&lt;p&gt;Let me introduce the HP EliteDesk 800 i5-6500T. It&amp;rsquo;s second-hand but in excellent condition.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install man pages on an ubuntu docker image</title>
      <link>https://stafura.dev/how-to-install-man-pages-on-an-ubuntu-docker-image/</link>
      <pubDate>Thu, 19 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://stafura.dev/how-to-install-man-pages-on-an-ubuntu-docker-image/</guid>
      <description>&lt;p&gt;As I am preparing for a Linux exam, I need to practice various commands on a separate Docker image and refer to manuals while using it.&lt;/p&gt;&#xA;&lt;p&gt;By default, Docker images are minimal, and the Ubuntu image does not include &lt;code&gt;man&lt;/code&gt; pages.&lt;/p&gt;&#xA;&lt;p&gt;For instance, when you try to access a manual page, you encounter the following message:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;root@54354b49f7a9:/# man man&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;This system has been minimized by removing packages and content that are&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;not required on a system that users &lt;span style=&#34;color:#ff79c6&#34;&gt;do&lt;/span&gt; not log into.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;To restore this content, including manpages, you can run the &lt;span style=&#34;color:#f1fa8c&#34;&gt;&amp;#39;unminimize&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;command. You will still need to ensure the &lt;span style=&#34;color:#f1fa8c&#34;&gt;&amp;#39;man-db&amp;#39;&lt;/span&gt; package is installed.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To address this, you can use the &lt;code&gt;unminimize&lt;/code&gt; command in the Dockerfile to restore the missing components. Here&amp;rsquo;s how:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to encrypt and decrypt files with AES-256 with OpenSSL</title>
      <link>https://stafura.dev/how-to-encrypt-and-decrypt-files-with-aes-256-with-openssl/</link>
      <pubDate>Thu, 28 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://stafura.dev/how-to-encrypt-and-decrypt-files-with-aes-256-with-openssl/</guid>
      <description>&lt;p&gt;The worst nightmare is sending and storing sensitive or private data in plain text.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s improve that by encrypting the files with AES-256.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-openssl&#34;&gt;Install OpenSSL&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# Let&amp;#39;s check if we have OpenSSL installed&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;openssl version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# If not, let&amp;#39;s install openssl&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo apt update &lt;span style=&#34;color:#ff79c6&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt install openssl -y&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;encrypt-file&#34;&gt;Encrypt File&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# create a file with some content&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8be9fd;font-style:italic&#34;&gt;echo&lt;/span&gt; &lt;span style=&#34;color:#f1fa8c&#34;&gt;&amp;#34;hello&amp;#34;&lt;/span&gt; &amp;gt; test.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# Encrypt the file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;openssl enc -aes-256-cbc -salt -pbkdf2 -iter &lt;span style=&#34;color:#bd93f9&#34;&gt;100000&lt;/span&gt; -in test.txt -out example.enc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;#### help ################################################################&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# -salt     - Ensures that the same plaintext encrypted multiple &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;#             times with the same key produces different ciphertexts&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# -pbkdf2   - Password-Based Key Derivation Function 2 &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;#             algorithm used to derive the encryption key from a password&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# -iter     - Specifies the number of iterations for the algorithm&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;##########################################################################&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# check if we have encrypted file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ls&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# test.txt example.enc&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# let&amp;#39;s see the contents of encrypted file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cat example.enc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6272a4&#34;&gt;# Salted__�!ei��/�+�΀O��l3%&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Yay, no one can read that.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
