<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>.</title>
    <link>https://blog.tr00ls.dk/</link>
    <description>blog</description>
    <pubDate>Fri, 05 Jun 2026 08:55:52 +0200</pubDate>
    <item>
      <title>Unattended upgrades on Debian </title>
      <link>https://blog.tr00ls.dk/unattended-upgrades-on-debian</link>
      <description>&lt;![CDATA[You don&#39;t have to manually install security updates on all your boxes.&#xA;Debian has some recommended solutions here&#xA;&#xA;You can configure automated security updates like this:&#xA;&#xA;sudo apt update &amp;&amp; sudo apt install unattended-upgrades -y&#xA;&#xA;The frequency of unattended-upgrades is controlled by the settings in this file:&#xA;/etc/apt/apt.conf.d/20auto-upgrades&#xA;&#xA;!--more--&#xA;&#xA;Inside it we want to paste in the following:&#xA;&#xA;APT::Periodic::Update-Package-Lists &#34;1&#34;;&#xA;APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;&#xA;APT::Periodic::AutocleanInterval &#34;7&#34;;&#xA;APT::Periodic::Unattended-Upgrade &#34;1&#34;;&#xA;&#xA;-----------------------------------&#xA;&#xA;Meaning of the values&#xA;APT::Periodic::Update-Package-Lists &#34;1&#34;;&#xA; → Updates the list of available packages daily (1 = every day).&#xA;&#xA;APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;&#xA; → Downloads upgradable packages daily.&#xA;&#xA;APT::Periodic::Unattended-Upgrade &#34;1&#34;;&#xA; → Actually runs unattended-upgrades daily.&#xA;&#xA;APT::Periodic::AutocleanInterval &#34;7&#34;;&#xA; → Cleans the local package cache once every 7 days.&#xA;&#xA;Setting 0 as a value will disable that entry.&#xA;&#xA;Want to check when it last ran, and what was installed?&#xA;You can check the log like this:&#xA;sudo cat /var/log/unattended-upgrades/unattended-upgrades.log&#xA;`]]&gt;</description>
      <content:encoded><![CDATA[<p>You don&#39;t have to manually install security updates on all your boxes.
Debian has some recommended solutions <a href="https://wiki.debian.org/UnattendedUpgrades">here</a></p>

<p>You can configure automated security updates like this:</p>

<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt install unattended-upgrades -y
</code></pre>

<p>The <strong>frequency</strong> of unattended-upgrades is controlled by the settings in this file:
<code>/etc/apt/apt.conf.d/20auto-upgrades</code></p>



<p>Inside it we want to paste in the following:</p>

<pre><code class="language-bash">APT::Periodic::Update-Package-Lists &#34;1&#34;;
APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;
APT::Periodic::AutocleanInterval &#34;7&#34;;
APT::Periodic::Unattended-Upgrade &#34;1&#34;;
</code></pre>

<hr>

<h2 id="meaning-of-the-values">Meaning of the values</h2>

<p><code>APT::Periodic::Update-Package-Lists &#34;1&#34;;</code>
 → Updates the list of available packages daily (1 = every day).</p>

<p><code>APT::Periodic::Download-Upgradeable-Packages &#34;1&#34;;</code>
 → Downloads upgradable packages daily.</p>

<p><code>APT::Periodic::Unattended-Upgrade &#34;1&#34;;</code>
 → Actually runs unattended-upgrades daily.</p>

<p><code>APT::Periodic::AutocleanInterval &#34;7&#34;;</code>
 → Cleans the local package cache once every 7 days.</p>

<p>Setting <code>0</code> as a value will <strong>disable</strong> that entry.</p>

<h2 id="want-to-check-when-it-last-ran-and-what-was-installed">Want to check when it last ran, and what was installed?</h2>

<p>You can check the log like this:</p>

<pre><code class="language-bash">sudo cat /var/log/unattended-upgrades/unattended-upgrades.log
</code></pre>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/unattended-upgrades-on-debian</guid>
      <pubDate>Sat, 19 Jul 2025 21:22:14 +0200</pubDate>
    </item>
    <item>
      <title>Set up a headless torrent box behind a VPN</title>
      <link>https://blog.tr00ls.dk/set-up-a-headless-torrent-box-behind-a-vpn</link>
      <description>&lt;![CDATA[From this guide you will get:&#xA;A box with qbittorrent web-ui reachable on LAN, behind a Mullvad VPN&#xA;SMB share to host your files on LAN&#xA;A script to test for dns leaks :)&#xA;&#xA;This quick project is great for eg. a spare laptop or a VM!&#xA;&#xA;I would recommend installing this on a dedicated Debian server instance. No need for a desktop environment. I would also recommend using LVM + LUKS encryption.&#xA;&#xA;That said this will work on any Debian or Ubuntu-based system.&#xA;&#xA;!--more--&#xA;&#xA;---------------------------------------------&#xA;&#xA;Let&#39;s install some packages&#xA;&#xA;sudo apt update &amp;&amp; sudo apt install curl screen samba avahi-daemon avahi-discover libnss-mdns qbittorrent-nox -y&#xA;&#xA;To install Mullvad VPN:&#xA;&#xA;sudo curl -fsSLo /usr/share/keyrings/mullvad-keyring.asc https://repository.mullvad.net/deb/mullvad-keyring.asc&#xA;echo &#34;deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main&#34; | sudo tee /etc/apt/sources.list.d/mullvad.list&#xA;sudo apt update&#xA;sudo apt install mullvad-vpn -y&#xA;&#xA;---------------------------------------------&#xA;&#xA;Mullvad account&#xA;&#xA;If you haven&#39;t already, please create a Mullvad account at https://mullvad.net/en&#xA;&#xA;Then in your terminal:&#xA;&#xA;sudo mullvad account login &#39;account number&#39;&#xA;sudo mullvad auto-connect set on&#xA;sudo mullvad lan set allow&#xA;&#xA;Now let&#39;s create a SMB share!&#xA;&#xA;To begin with you need to create a dir that we want to share. Then we will change the permissions to 0775&#xA;I recommend placing it in /home. &#xA;For this example we will call it share:&#xA;&#xA;mkdir share&#xA;sudo chmod 0775 share&#xA;&#xA;To tweak the .conf:&#xA;&#xA;sudo nano /etc/samba/smb.conf&#xA;&#xA;Paste the following at the bottom of the file:&#xA;&#xA;[share]&#xA;path = /home/&#39;username&#39;/share&#xA;read only = no&#xA;guest ok = no&#xA;valid users = &#39;username&#39;&#xA;&#xA;Then set the smb password and restart the service:&#xA;&#xA;sudo smbpasswd -a &#39;username&#39;&#xA;sudo systemctl restart smbd nmbd&#xA;sudo systemctl restart smbd.service&#xA;&#xA;Last but not least, dns leak test:&#xA;&#xA;curl https://raw.githubusercontent.com/macvk/dnsleaktest/master/dnsleaktest.sh -o dnsleaktest.sh &amp;&amp; sudo chmod +x dnsleaktest.sh&#xA;&#xA;To run the script:&#xA;&#xA;sudo ./dnsleaktest.sh&#xA;&#xA;---------------------------------------------&#xA;&#xA;Setting up and using qbittorrent:&#xA;&#xA;Mental Outlaw actually has a great video about this and from 6:36 it&#39;s possible to follow along with some of these steps&#xA;&#xA;Earlier we installed qbittorrent-nox which is great for headless systems, since we can access the app from a web-ui over LAN.&#xA;&#xA;I recommend using screen to run qbittorrent-nox, since i think it is unwise to keep your box logged in 24/7. &#xA;What if someone &#34;broke in&#34; to your network closet and gained access to your (encrypted?) system? &#xA;&#xA;If it&#39;s just logged in, no point in securing anything.&#xA;&#xA;It is safer to SSH into the box, launch and detach the qbittorrent-nox process and terminate the connection.&#xA;&#xA;If you just ran qbittorrent-nox without screen, the app would close every time you terminated your session.&#xA;&#xA;Either way:&#xA;&#xA;screen qbittorrent-nox&#xA;As qbittorrent launches, take note of the IP+port displayed in the message on screen.&#xA;Press Ctrl+A and then D to detach the process.&#xA;&#xA;Open a browser and go to the IP&#xA;&#xA;Last time i checked the default credentials were admin:adminadmin&#xA;&#xA;In qbittorrent, go to preferences and change your password.&#xA;&#xA;Then change your default download folder to the SMB share we created.&#xA;This way you can stream from the box anywhere on your LAN.&#xA;&#xA;Then at last go to Preferences   Advanced   Network Interface and change it to your Mullvad connection: tun0&#xA;&#xA;That&#39;s it! Enjoy ]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="from-this-guide-you-will-get">From this guide you will get:</h2>
<ul><li>A box with qbittorrent web-ui reachable on LAN, behind a Mullvad VPN</li>
<li>SMB share to host your files on LAN</li>
<li>A script to test for dns leaks :)</li></ul>

<p>This quick project is great for eg. a <strong>spare laptop</strong> or a <strong>VM</strong>!</p>

<p>I would recommend installing this on a dedicated Debian server instance. No need for a desktop environment. I would also recommend using LVM + LUKS encryption.</p>

<p>That said this will work on any Debian or Ubuntu-based system.</p>



<hr>

<h2 id="let-s-install-some-packages">Let&#39;s install some packages</h2>

<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt install curl screen samba avahi-daemon avahi-discover libnss-mdns qbittorrent-nox -y
</code></pre>

<p>To install <strong>Mullvad VPN</strong>:</p>

<pre><code class="language-bash">sudo curl -fsSLo /usr/share/keyrings/mullvad-keyring.asc https://repository.mullvad.net/deb/mullvad-keyring.asc
</code></pre>

<pre><code class="language-bash">echo &#34;deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main&#34; | sudo tee /etc/apt/sources.list.d/mullvad.list
</code></pre>

<pre><code class="language-bash">sudo apt update
</code></pre>

<pre><code class="language-bash">sudo apt install mullvad-vpn -y
</code></pre>

<hr>

<h2 id="mullvad-account">Mullvad account</h2>

<p>If you haven&#39;t already, please create a Mullvad account at <a href="https://mullvad.net/en">https://mullvad.net/en</a></p>

<p>Then in your terminal:</p>

<pre><code class="language-bash">sudo mullvad account login &#39;account number&#39;
</code></pre>

<pre><code class="language-bash">sudo mullvad auto-connect set on
</code></pre>

<pre><code class="language-bash">sudo mullvad lan set allow
</code></pre>

<h2 id="now-let-s-create-a-smb-share">Now let&#39;s create a SMB share!</h2>

<p>To begin with you need to create a <code>dir</code> that we want to share. Then we will change the permissions to <code>0775</code>
I recommend placing it in <code>/home</code>.
For this example we will call it <strong>share</strong>:</p>

<pre><code class="language-bash">mkdir share
</code></pre>

<pre><code class="language-bash">sudo chmod 0775 share
</code></pre>

<h2 id="to-tweak-the-conf">To tweak the <code>.conf</code>:</h2>

<pre><code class="language-bash">sudo nano /etc/samba/smb.conf
</code></pre>

<p>Paste the following at the bottom of the file:</p>

<pre><code class="language-bash">[share]
path = /home/&#39;username&#39;/share
read only = no
guest ok = no
valid users = &#39;username&#39;
</code></pre>

<p>Then set the smb password and restart the service:</p>

<pre><code class="language-bash">sudo smbpasswd -a &#39;username&#39;
</code></pre>

<pre><code class="language-bash">sudo systemctl restart smbd nmbd
</code></pre>

<pre><code class="language-bash">sudo systemctl restart smbd.service
</code></pre>

<h2 id="last-but-not-least-dns-leak-test">Last but not least, dns leak test:</h2>

<pre><code class="language-bash">curl https://raw.githubusercontent.com/macvk/dnsleaktest/master/dnsleaktest.sh -o dnsleaktest.sh &amp;&amp; sudo chmod +x dnsleaktest.sh
</code></pre>

<p>To run the script:</p>

<pre><code class="language-bash">sudo ./dnsleaktest.sh
</code></pre>

<hr>

<h2 id="setting-up-and-using-qbittorrent">Setting up and using qbittorrent:</h2>

<p><a href="https://www.youtube.com/channel/UC7YOGHUfC1Tb6E4pudI9STA">Mental Outlaw</a> actually has a great <a href="https://youtu.be/Z9y29Wxo060">video</a> about this and from 6:36 it&#39;s possible to follow along with some of these steps</p>

<p>Earlier we installed <code>qbittorrent-nox</code> which is great for headless systems, since we can access the app from a web-ui over LAN.</p>

<p>I recommend using <code>screen</code> to run <code>qbittorrent-nox</code>, since i think it is unwise to keep your box logged in 24/7.
What if <em>someone</em> “broke in” to your network closet and gained access to your <strong>(encrypted?)</strong> system?</p>

<p>If it&#39;s just logged in, no point in securing anything.</p>

<p>It is safer to SSH into the box, launch and detach the <code>qbittorrent-nox</code> process and terminate the connection.</p>

<p>If you <strong>just</strong> ran <code>qbittorrent-nox</code> without <code>screen</code>, the app would close every time you terminated your session.</p>

<h2 id="either-way">Either way:</h2>

<pre><code class="language-bash">screen qbittorrent-nox
</code></pre>

<p>As qbittorrent launches, take note of the IP+port displayed in the message on screen.
Press <code>Ctrl+A</code> and then <code>D</code> to detach the process.</p>

<p>Open a browser and go to the IP</p>

<p>Last time i checked the default credentials were <code>admin:adminadmin</code></p>

<p>In qbittorrent, go to <strong>preferences</strong> and <strong>change your password</strong>.</p>

<p>Then change your <strong>default download folder</strong> to the SMB share we created.
This way you can stream from the box anywhere on your LAN.</p>

<p>Then at last go to <strong>Preferences</strong> &gt; <strong>Advanced</strong> &gt; <strong>Network Interface</strong> and change it to your Mullvad connection: <code>tun0</code></p>

<h2 id="that-s-it-enjoy">That&#39;s it! Enjoy</h2>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/set-up-a-headless-torrent-box-behind-a-vpn</guid>
      <pubDate>Sat, 19 Jul 2025 19:50:36 +0200</pubDate>
    </item>
    <item>
      <title>Restore Your LUKS-Encrypted LMDE 6 or Debian-based system with Timeshift</title>
      <link>https://blog.tr00ls.dk/restore-your-luks-encrypted-lmde-6-or-debian-based-system-with-timeshift</link>
      <description>&lt;![CDATA[If you&#39;re using LMDE, Linux Mint, or Ubuntu with full-disk LUKS encryption and backing up with Timeshift, this guide is for that day your system breaks, your drive dies, or your laptop disappears. Here&#39;s how to bring everything back—with encryption, system settings, and sanity intact.&#xA;&#xA;---&#xA;&#xA;Before You Begin: Back Up Personal Files!&#xA;&#xA;If you have important personal data not included in your Timeshift snapshots (like documents, photos, or anything in /home), salvage and back it up now before continuing.&#xA;&#xA;If you’ve already done that—or can’t—read on.&#xA;&#xA;!--more--&#xA;&#xA;---&#xA;&#xA;Step-by-Step Restore Process&#xA;&#xA;1. Fresh Install on Target Drive&#xA;&#xA;Boot from your Live LMDE USB.&#xA;Install LMDE 6, selecting LVM with full-disk encryption (LUKS) mimicking your old setup. &#xA;After installation, boot into the new system once to verify it works, then shut it down.&#xA;&#xA;2. Boot Back Into Live USB&#xA;&#xA;Plug in your backup drive and unlock it if it’s encrypted.&#xA;&#xA;3. Launch Timeshift &amp; Start Restore&#xA;&#xA;Open Timeshift from the menu (LMDE includes it).&#xA;Select your snapshot → click Restore.&#xA;&#xA;Target Device Selection&#xA;&#xA;/ → Select the encrypted root partition from your fresh install.&#xA;  Timeshift will ask for your encryption passphrase.&#xA;  Click the refresh button to display the LVM volume (e.g., vg-root or dm-2 ext4).&#xA;  This is typically slightly smaller than the full size of your drive.&#xA;&#xA;/boot → Set to “Keep on root device”&#xA;&#xA;/home → Set to “Keep on root device” (unless restoring separately)&#xA;&#xA;4. Configure Bootloader (Advanced)&#xA;&#xA;Click Advanced, then:&#xA;&#xA;Reinstall GRUB2 → Select the small, unencrypted boot partition&#xA;Update initramfs → Leave unchecked&#xA;Update GRUB menu → Make sure this is checked&#xA;&#xA;Let Timeshift restore your system.&#xA;&#xA;---&#xA;&#xA;If You Restored to the Same Drive&#xA;&#xA;Great! Just reboot — you’re done.&#xA;&#xA;---&#xA;&#xA;Restoring to a Different Drive?&#xA;&#xA;Your new disk will have a different LUKS UUID than your old one. The restored system still points to the old UUID in /etc/crypttab, which means it won’t boot unless you update it.&#xA;&#xA;Step 1: Find the Correct Partition&#xA;&#xA;lsblk&#xA;&#xA;Look for your new encrypted LUKS partition, like /dev/sda5 or /dev/nvme0n1p3.&#xA;&#xA;Step 2: Get the New UUID&#xA;&#xA;Replace sdX with the correct device name:&#xA;&#xA;sudo cryptsetup luksUUID /dev/sdX&#xA;&#xA;Step 3: Update crypttab&#xA;&#xA;Mount your restored system:&#xA;&#xA;sudo cryptsetup luksOpen /dev/sdX mycrypt&#xA;sudo vgchange -ay&#xA;sudo mount /dev/mapper/your-root-volume /mnt&#xA;&#xA;Edit the crypttab file:&#xA;&#xA;sudo nano /mnt/etc/crypttab&#xA;&#xA;Replace the old UUID with the new one from step 2.&#xA;&#xA;Step 4: Update GRUB&#xA;&#xA;sudo mount --bind /dev /mnt/dev&#xA;sudo mount --bind /proc /mnt/proc&#xA;sudo mount --bind /sys /mnt/sys&#xA;sudo chroot /mnt&#xA;update-grub&#xA;exit&#xA;&#xA;All Done — Reboot!&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>If you&#39;re using <strong>LMDE</strong>, <strong>Linux Mint</strong>, or <strong>Ubuntu</strong> with full-disk <strong>LUKS encryption</strong> and backing up with <strong>Timeshift</strong>, this guide is for that day your system breaks, your drive dies, or your laptop disappears. Here&#39;s how to bring everything back—with encryption, system settings, and sanity intact.</p>

<hr>

<h2 id="before-you-begin-back-up-personal-files">Before You Begin: Back Up Personal Files!</h2>

<p>If you have important personal data not included in your Timeshift snapshots (like documents, photos, or anything in <code>/home</code>), salvage and back it up now before continuing.</p>

<p>If you’ve already done that—or can’t—read on.</p>



<hr>

<h2 id="step-by-step-restore-process">Step-by-Step Restore Process</h2>

<h3 id="1-fresh-install-on-target-drive">1. Fresh Install on Target Drive</h3>
<ul><li>Boot from your <strong>Live LMDE USB</strong>.</li>
<li>Install <strong>LMDE 6</strong>, selecting <strong>LVM with full-disk encryption (LUKS)</strong> mimicking your old setup.</li>
<li>After installation, boot into the new system once to verify it works, then shut it down.</li></ul>

<h3 id="2-boot-back-into-live-usb">2. Boot Back Into Live USB</h3>
<ul><li>Plug in your backup drive and <strong>unlock it</strong> if it’s encrypted.</li></ul>

<h3 id="3-launch-timeshift-start-restore">3. Launch Timeshift &amp; Start Restore</h3>
<ul><li>Open <strong>Timeshift</strong> from the menu (LMDE includes it).</li>
<li>Select your snapshot → click <strong>Restore</strong>.</li></ul>

<h4 id="target-device-selection">Target Device Selection</h4>
<ul><li><p><code>/</code> → Select the <strong>encrypted root partition</strong> from your fresh install.
Timeshift will ask for your encryption passphrase.
Click the <strong>refresh</strong> button to display the LVM volume (e.g., <code>vg-root</code> or <code>dm-2 ext4</code>).
This is typically slightly smaller than the full size of your drive.</p></li>

<li><p><code>/boot</code> → Set to <strong>“Keep on root device”</strong></p></li>

<li><p><code>/home</code> → Set to <strong>“Keep on root device”</strong> (unless restoring separately)</p></li></ul>

<h3 id="4-configure-bootloader-advanced">4. Configure Bootloader (Advanced)</h3>

<p>Click <strong>Advanced</strong>, then:</p>

<p><strong>Reinstall GRUB2</strong> → Select the <strong>small, unencrypted boot partition</strong>
<strong>Update initramfs</strong> → Leave <strong>unchecked</strong>
<strong>Update GRUB menu</strong> → Make sure this is <strong>checked</strong></p>

<p>Let Timeshift restore your system.</p>

<hr>

<p>If You Restored to the Same Drive</p>

<p>Great! Just reboot — you’re done.</p>

<hr>

<p>Restoring to a <em>Different</em> Drive?</p>

<p>Your new disk will have a different <strong>LUKS UUID</strong> than your old one. The restored system still points to the old UUID in <code>/etc/crypttab</code>, which means it won’t boot unless you update it.</p>

<h3 id="step-1-find-the-correct-partition">Step 1: Find the Correct Partition</h3>

<pre><code class="language-bash">lsblk
</code></pre>

<p>Look for your new <strong>encrypted LUKS partition</strong>, like <code>/dev/sda5</code> or <code>/dev/nvme0n1p3</code>.</p>

<h3 id="step-2-get-the-new-uuid">Step 2: Get the New UUID</h3>

<p>Replace <code>sdX</code> with the correct device name:</p>

<pre><code class="language-bash">sudo cryptsetup luksUUID /dev/sdX
</code></pre>

<h3 id="step-3-update-crypttab">Step 3: Update <code>crypttab</code></h3>

<p>Mount your restored system:</p>

<pre><code class="language-bash">sudo cryptsetup luksOpen /dev/sdX mycrypt
</code></pre>

<pre><code class="language-bash">sudo vgchange -ay
</code></pre>

<pre><code class="language-bash">sudo mount /dev/mapper/&lt;your-root-volume&gt; /mnt
</code></pre>

<p>Edit the crypttab file:</p>

<pre><code class="language-bash">sudo nano /mnt/etc/crypttab
</code></pre>

<p>Replace the <strong>old UUID</strong> with the <strong>new one</strong> from step 2.</p>

<h3 id="step-4-update-grub">Step 4: Update GRUB</h3>

<pre><code class="language-bash">sudo mount --bind /dev /mnt/dev
</code></pre>

<pre><code class="language-bash">sudo mount --bind /proc /mnt/proc
</code></pre>

<pre><code class="language-bash">sudo mount --bind /sys /mnt/sys
</code></pre>

<pre><code class="language-bash">sudo chroot /mnt
</code></pre>

<pre><code class="language-bash">update-grub
</code></pre>

<pre><code class="language-bash">exit
</code></pre>

<h2 id="all-done-reboot">All Done — Reboot!</h2>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/restore-your-luks-encrypted-lmde-6-or-debian-based-system-with-timeshift</guid>
      <pubDate>Sat, 19 Jul 2025 16:32:57 +0200</pubDate>
    </item>
    <item>
      <title>How to backup a YunoHost VPS to S3 compatible bucket.</title>
      <link>https://blog.tr00ls.dk/how-to-backup-a-yunohost-vps-to-s3-compatible-bucket</link>
      <description>&lt;![CDATA[So, i wrote a blog post about automatically creating and storing YunoHost backups, on a remote VPS.&#xA;Read it here&#xA;&#xA;My friend needed a similar solution, but needed to sync the backup files to an S3 bucket.&#xA;&#xA;For this solution we will modify this guide, provided by Contabo&#xA;&#xA;This guide is actually awesome, and you should read it. &#xA;We will be changing some things, since we are backing up from the YunoHost core, and not the entire filesystem.&#xA;&#xA;!--more--&#xA;&#xA;----------------------------------&#xA;&#xA;First of all, we need to set up automatic backups of your YunoHost VPS:&#xA;&#xA;sudo crontab -e&#xA;&#xA;Add this line, save and exit:&#xA;&#xA;11 0    yunohost backup create&#xA;&#xA;This will create a full backup each night. If you want a different solution, please see the official YunoHost documentation&#xA;&#xA;-----------------------------------&#xA;&#xA;To install rclone enter:&#xA;&#xA;sudo apt update &amp;&amp; sudo apt install rclone -y&#xA;&#xA;To configure Rclone with your S3 credentials please see this guide&#xA;&#xA;----------------------------------&#xA;&#xA;To automate rclone we will make a script.&#xA;&#xA;Either choose to copy the backups to the S3 bucket each night, keeping the files on your YunoHost VPS:&#xA;&#xA;/usr/bin/rclone sync -P --update --verbose --transfers 30 --log-file=/var/log/upload.log &#34;/home/yunohost.backup/archives/&#34; &#34;eu2:backup/&#34;&#xA;&#xA;Or move the files to S3, deleting them from the YunoHost VPS after the upload:&#xA;&#xA;/usr/bin/rclone move -P --update --verbose --transfers 30 --log-file=/var/log/upload.log &#34;/home/yunohost.backup/archives/&#34; &#34;eu2:backup/&#34;&#xA;&#xA;Make a file with one of the above commands, save it as rclone.sh and voila you have a script.&#xA;&#xA;Make the script executable by entering:&#xA;&#xA;sudo chmod +x /path/to/rclone.sh&#xA;&#xA;---------------------------------&#xA;&#xA;To make the script run every night we need to create a cronjob:&#xA;&#xA;sudo crontab -e&#xA;&#xA;Paste in this line at the bottom, save and exit:&#xA;&#xA;0 2    /path/to/rclone.sh&#xA;&#xA;---------------------------------&#xA;&#xA;If you chose to copy rather than to move your backup files to your S3 bucket, you might end up filling your precious drives rather quickly.&#xA;&#xA;Consider using move if you do not want to keep any backups on your YunoHost VPS.&#xA;&#xA;If you want to keep some backups on the VPS, consider using copy and follow the steps, in the last part of my previous post, to delete backups older than &#39;x&#39; days&#xA;&#xA;----------------------------------]]&gt;</description>
      <content:encoded><![CDATA[<p>So, i wrote a blog post about automatically creating and storing YunoHost backups, on a remote VPS.
Read it <a href="https://blog.tr00ls.dk/so-you-want-to-backup-your-yunohost-vps-to-a-remote-server">here</a></p>

<p>My friend needed a similar solution, but needed to sync the backup files to an S3 bucket.</p>

<p>For this solution we will modify <a href="https://contabo.com/blog/linux-server-backup-using-rclone/">this</a> guide, provided by Contabo</p>

<p>This guide is actually awesome, and you should read it.
We will be changing some things, since we are backing up from the YunoHost core, and not the entire filesystem.</p>



<hr>

<h2 id="first-of-all-we-need-to-set-up-automatic-backups-of-your-yunohost-vps">First of all, we need to set up automatic backups of your YunoHost VPS:</h2>

<pre><code class="language-bash">sudo crontab -e
</code></pre>

<p>Add this line, save and exit:</p>

<pre><code class="language-bash">11 0 * * * yunohost backup create
</code></pre>

<p>This will create a full backup each night. If you want a different solution, please see the official <a href="https://yunohost.org/en/backup#automatic-or-remote-backup">YunoHost documentation</a></p>

<hr>

<h2 id="to-install-rclone-enter">To install rclone enter:</h2>

<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt install rclone -y
</code></pre>

<p>To configure Rclone with your S3 credentials please see <a href="https://docs.contabo.com/docs/products/Object-Storage/Tools/rclone/">this guide</a></p>

<hr>

<h2 id="to-automate-rclone-we-will-make-a-script">To automate rclone we will make a script.</h2>

<p>Either choose to <code>copy</code> the backups to the S3 bucket each night, keeping the files on your YunoHost VPS:</p>

<pre><code class="language-bash">/usr/bin/rclone sync -P --update --verbose --transfers 30 --log-file=/var/log/upload.log &#34;/home/yunohost.backup/archives/&#34; &#34;eu2:backup/&#34;
</code></pre>

<p>Or <code>move</code> the files to S3, deleting them from the YunoHost VPS after the upload:</p>

<pre><code class="language-bash">/usr/bin/rclone move -P --update --verbose --transfers 30 --log-file=/var/log/upload.log &#34;/home/yunohost.backup/archives/&#34; &#34;eu2:backup/&#34;
</code></pre>

<p>Make a file with one of the above commands, save it as <code>rclone.sh</code> and voila you have a script.</p>

<p>Make the script executable by entering:</p>

<pre><code class="language-bash">sudo chmod +x /path/to/rclone.sh
</code></pre>

<hr>

<h2 id="to-make-the-script-run-every-night-we-need-to-create-a-cronjob">To make the script run every night we need to create a cronjob:</h2>

<pre><code class="language-bash">sudo crontab -e
</code></pre>

<p>Paste in this line at the bottom, save and exit:</p>

<pre><code class="language-bash">0 2 * * * /path/to/rclone.sh
</code></pre>

<hr>

<p>If you chose to <code>copy</code> rather than to <code>move</code> your backup files to your S3 bucket, you might end up filling your precious drives rather quickly.</p>

<p>Consider using <code>move</code> if you do not want to keep any backups on your YunoHost VPS.</p>

<p>If you want to keep some backups on the VPS, consider using <code>copy</code> and follow the steps, in the last part of my <a href="https://blog.tr00ls.dk/so-you-want-to-backup-your-yunohost-vps-to-a-remote-server/edit">previous post</a>, to delete backups older than &#39;x&#39; days</p>

<hr>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/how-to-backup-a-yunohost-vps-to-s3-compatible-bucket</guid>
      <pubDate>Sun, 24 Mar 2024 09:15:22 +0100</pubDate>
    </item>
    <item>
      <title>How to automatically backup and sync a YunoHost VPS, to a remote storage VPS (not running YunoHost).</title>
      <link>https://blog.tr00ls.dk/so-you-want-to-backup-your-yunohost-vps-to-a-remote-server</link>
      <description>&lt;![CDATA[On the remote server, that is to store the backup:&#xA;&#xA;    I started by creating an ECDSA key pair of 384 bits, with this command:&#xA;&#xA;ssh-keygen -t ecdsa -b 384&#xA;&#xA;Then i sent it to the YunoHost VPS with this command:&#xA;ssh-copy-id -i ~/.ssh/your-key-name.pub &#39;username&#39;@&#39;host-domain&#39;&#xA;&#xA;Then i created a cronjob that will sync two directories, over SSH, using rsync.&#xA;&#xA;!--more--&#xA;&#xA;    To do this, you first have to create a cronjob with this command:&#xA;&#xA;sudo crontab -e&#xA;&#xA;Then modify and paste this line into the crontab, save and exit:&#xA;&#xA;11 1    rsync -avz -e &#34;ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null&#34; &#39;username&#39;@&#39;host-domain&#39;:/home/yunohost.backup/archives/ /home/&#39;username&#39;/archives/&#xA;&#xA;----------------------------&#xA;&#xA;For your information:&#xA;&#xA;-avz Archive mode for preserving metadata, verbosity for detailed feedback, and compression for efficient transmission.&#xA;&#xA;-e Specifies the remote shell to use, in this case, SSH.&#xA;&#xA;-o StrictHostKeyChecking=no Tells SSH not to bother checking if it has connected to the same host before.&#xA;&#xA;-o UserKnownHostsFile=/dev/null This says, &#34;Hey SSH, don&#39;t bother looking for known hosts in the usual place/knownhosts, we already know what&#39;s good&#34;&#xA;&#xA;Now, the remote storage VPS looks for new backups to download, everyday at 01:11&#xA;&#xA;----------------------------&#xA;&#xA;On your YunoHost VPS, you have to add a cronjob, creating backups every night, around midnight.&#xA;Same procedure as last time:&#xA;&#xA;sudo crontab -e&#xA;&#xA;Add this line, save and exit:&#xA;&#xA;11 0    yunohost backup create&#xA;&#xA;----------------------------&#xA;&#xA;With this method, the YunoHost VPS backs up everything, and syncs to remote storage, everyday around midnight. &#xA;&#xA;Rsync will not delete any backups from remote storage, in case they get deleted on the YunoHost VPS.&#xA;(This way, if anything bad happens to the YunoHost VPS, or the yunohost.backups directory, you won&#39;t lose the backup files on the remote storage VPS next time it syncs)&#xA;&#xA;This does mean, that you will have to delete backups, both on the YunoHost VPS and the remote storage VPS, as they become outdated to preserve precious space on your drives.&#xA;&#xA;See the official YunoHost documentation if you want a different solution &#xA;&#xA;-----------------------------------------&#xA;&#xA;How to automatically delete outdated backups.&#xA;&#xA;I made a script that looks for any file older than 7 days, then removes it.&#xA;&#xA;Please change the &#39;backup dir&#39; path, and the &#39;days to keep value&#39; to suit your needs!&#xA;&#xA;https://raw.githubusercontent.com/tr00ls/tr00ls/main/cleanupbackups.sh&#xA;&#xA;One-liner to download the script and make it executable:&#xA;&#xA;wget https://raw.githubusercontent.com/tr00ls/tr00ls/main/cleanupbackups.sh &amp;&amp; sudo chmod +x cleanupbackups.sh&#xA;&#xA;-----------------------------------------&#xA;&#xA;To add a cronjob running this script every night at 02:00 enter:&#xA;&#xA;sudo crontab -e&#xA;&#xA;Then modify and paste in the following line, save and exit:&#xA;&#xA;0 2   * /path/to/cleanup_backups.sh&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>On the remote server, that is to store the backup:</p>

<p>    I started by creating an <strong>ECDSA key pair of 384 bits</strong>, with this command:</p>

<pre><code class="language-bash">ssh-keygen -t ecdsa -b 384
</code></pre>

<p>Then i sent it to the <strong>YunoHost VPS</strong> with this command:</p>

<pre><code class="language-bash">ssh-copy-id -i ~/.ssh/your-key-name.pub &#39;username&#39;@&#39;host-domain&#39;
</code></pre>

<p>Then i created a cronjob that will sync two directories, over SSH, using rsync.</p>



<p>    To do this, you first have to create a cronjob with this command:</p>

<pre><code class="language-bash">sudo crontab -e
</code></pre>

<p>Then modify and paste this line into the crontab, save and exit:</p>

<pre><code class="language-bash">11 1 * * * rsync -avz -e &#34;ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null&#34; &#39;username&#39;@&#39;host-domain&#39;:/home/yunohost.backup/archives/ /home/&#39;username&#39;/archives/
</code></pre>

<hr>

<h2 id="for-your-information">For your information:</h2>

<p><code>-avz</code> Archive mode for preserving metadata, verbosity for detailed feedback, and compression for efficient transmission.</p>

<p><code>-e</code> Specifies the remote shell to use, in this case, SSH.</p>

<p><code>-o StrictHostKeyChecking=no</code> Tells SSH not to bother checking if it has connected to the same host before.</p>

<p><code>-o UserKnownHostsFile=/dev/null</code> This says, “Hey SSH, don&#39;t bother looking for known hosts in the usual place/known_hosts, we already know what&#39;s good”</p>

<p><strong>Now</strong>, the remote storage VPS looks for new backups to download, everyday at 01:11</p>

<hr>

<p>On your YunoHost VPS, you have to add a cronjob, creating backups every night, around midnight.
Same procedure as last time:</p>

<pre><code class="language-bash">sudo crontab -e
</code></pre>

<p>Add this line, save and exit:</p>

<pre><code class="language-bash">11 0 * * * yunohost backup create
</code></pre>

<hr>

<h2 id="with-this-method-the-yunohost-vps-backs-up-everything-and-syncs-to-remote-storage-everyday-around-midnight">With this method, the YunoHost VPS backs up everything, and syncs to remote storage, everyday around midnight.</h2>

<p>Rsync will not delete any backups from remote storage, in case they get deleted on the YunoHost VPS.
(This way, if anything bad happens to the YunoHost VPS, or the yunohost.backups directory, you won&#39;t lose the backup files on the remote storage VPS next time it syncs)</p>

<p>This does mean, that you will have to delete backups, both on the YunoHost VPS and the remote storage VPS, as they become outdated to preserve precious space on your drives.</p>

<p>See the official <a href="https://yunohost.org/en/backup#automatic-or-remote-backup">YunoHost documentation</a> if you want a different solution</p>

<hr>

<h2 id="how-to-automatically-delete-outdated-backups">How to automatically delete outdated backups.</h2>

<p>I made a script that looks for any file older than 7 days, then removes it.</p>

<p>Please change the &#39;backup dir&#39; path, and the &#39;days to keep value&#39; to suit your needs!</p>

<p><a href="https://raw.githubusercontent.com/tr00ls/tr00ls/main/cleanup_backups.sh">https://raw.githubusercontent.com/tr00ls/tr00ls/main/cleanup_backups.sh</a></p>

<p>One-liner to download the script and make it executable:</p>

<pre><code class="language-bash">wget https://raw.githubusercontent.com/tr00ls/tr00ls/main/cleanup_backups.sh &amp;&amp; sudo chmod +x cleanup_backups.sh
</code></pre>

<hr>

<h2 id="to-add-a-cronjob-running-this-script-every-night-at-02-00-enter">To add a cronjob running this script every night at 02:00 enter:</h2>

<pre><code class="language-bash">sudo crontab -e
</code></pre>

<p>Then modify and paste in the following line, save and exit:</p>

<pre><code class="language-bash">0 2 * * * /path/to/cleanup_backups.sh
</code></pre>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/so-you-want-to-backup-your-yunohost-vps-to-a-remote-server</guid>
      <pubDate>Tue, 19 Mar 2024 13:30:49 +0100</pubDate>
    </item>
    <item>
      <title>How to add the Kali Linux repositries, to Debian?</title>
      <link>https://blog.tr00ls.dk/how-to-add-kali-linux-software-repositry-to-you-debian-based-distro</link>
      <description>&lt;![CDATA[Run these commands:&#xA;&#xA;sudo echo &#34;deb http://http.kali.org/kali kali-rolling main non-free contrib&#34;     /etc/apt/sources.list&#xA;sudo echo &#34;deb-src http://http.kali.org/kali kali-rolling main non-free contrib&#34;    /etc/apt/sources.list&#xA;sudo wget https://archive.kali.org/archive-key.asc -O /etc/apt/trusted.gpg.d/kali-archive-keyring.asc&#xA;sudo apt update&#xA;&#xA;!--more--&#xA;&#xA;When you loose track of what t00ls you have installed, use this command:&#xA;&#xA;comm -23 &lt;(apt-mark showmanual | sort -u) &lt;(gzip -dc /var/log/installer/initial-status.gz | sed -n &#39;s/^Package: //p&#39; | sort -u)&#xA;`]]&gt;</description>
      <content:encoded><![CDATA[<p>Run these commands:</p>

<pre><code class="language-bash">sudo echo &#34;deb http://http.kali.org/kali kali-rolling main non-free contrib&#34; &gt;&gt; /etc/apt/sources.list
</code></pre>

<pre><code class="language-bash">sudo echo &#34;deb-src http://http.kali.org/kali kali-rolling main non-free contrib&#34;&gt;&gt; /etc/apt/sources.list
</code></pre>

<pre><code class="language-bash">sudo wget https://archive.kali.org/archive-key.asc -O /etc/apt/trusted.gpg.d/kali-archive-keyring.asc
</code></pre>

<pre><code class="language-bash">sudo apt update
</code></pre>



<h2 id="when-you-loose-track-of-what-t00ls-you-have-installed-use-this-command">When you loose track of what t00ls you have installed, use this command:</h2>

<pre><code class="language-bash">comm -23 &lt;(apt-mark showmanual | sort -u) &lt;(gzip -dc /var/log/installer/initial-status.gz | sed -n &#39;s/^Package: //p&#39; | sort -u)
</code></pre>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/how-to-add-kali-linux-software-repositry-to-you-debian-based-distro</guid>
      <pubDate>Mon, 11 Dec 2023 09:24:04 +0100</pubDate>
    </item>
    <item>
      <title>Automate installing Zsh with Autosuggestions and Syntax highlighting</title>
      <link>https://blog.tr00ls.dk/so-youve-decided-that-manually-installing-zsh-with-autosuggestions-and-syntax</link>
      <description>&lt;![CDATA[I made a script automating the last blog post!&#xA;&#xA;Get it here: https://raw.githubusercontent.com/tr00ls/tr00ls/main/zsh-script.sh&#xA;&#xA;wget https://raw.githubusercontent.com/tr00ls/tr00ls/main/zsh-script.sh &amp;&amp; sudo chmod +x zsh-script.sh&#xA;sudo ./zsh-script.sh&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>I made a script automating the last blog post!</p>

<p>Get it here: <a href="https://raw.githubusercontent.com/tr00ls/tr00ls/main/zsh-script.sh">https://raw.githubusercontent.com/tr00ls/tr00ls/main/zsh-script.sh</a></p>

<pre><code class="language-bash">wget https://raw.githubusercontent.com/tr00ls/tr00ls/main/zsh-script.sh &amp;&amp; sudo chmod +x zsh-script.sh
</code></pre>

<pre><code class="language-bash">sudo ./zsh-script.sh
</code></pre>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/so-youve-decided-that-manually-installing-zsh-with-autosuggestions-and-syntax</guid>
      <pubDate>Fri, 08 Dec 2023 17:43:47 +0100</pubDate>
    </item>
    <item>
      <title>How to manually customize your terminal</title>
      <link>https://blog.tr00ls.dk/so-you-want-a-cool-linux-terminal</link>
      <description>&lt;![CDATA[Let&#39;s use zsh to make our terminal look pretty.&#xA;&#xA;To install zsh, open your terminal and enter:&#xA;&#xA;sudo apt update &amp;&amp; sudo apt install zsh -y&#xA;&#xA;To make zsh your default shell enter:&#xA;&#xA;sudo chshs -s /usr/bin/zsh&#xA;&#xA;We need git for these next steps, so if you haven&#39;t already, please install git by entering:&#xA;&#xA;!--more--&#xA;&#xA;sudo apt install git -y&#xA;&#xA;Now let&#39;s get those Fish-like Autosuggestions:&#xA;&#xA;git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions&#xA;sudo echo &#34;source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh&#34;     ~/.zshrc&#xA;&#xA;Next let&#39;s get Syntax Highlighting&#xA;&#xA;cd ~/.zsh &amp;&amp; git clone https://github.com/zsh-users/zsh-syntax-highlighting.git&#xA;sudo echo &#34;source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh&#34;     ~/.zshrc&#xA;&#xA;--------------------&#xA;&#xA;Now this could be it - you could close your terminal, log out or reboot to finalize - but if you want even more pretty, i suggest you add a custom .zshrc file&#xA;&#xA;You could add the one from Kali Linux&#xA;&#xA;Or the one i use&#xA;&#xA;Before we do anything though we should backup your current .zshrc:&#xA;&#xA;cp ~/.zshrc ~/.zshrc.bak&#xA;&#xA;Whichever .zshrc you choose, simply fill your .zshrc with the new custom content. &#xA;&#xA;To do that open your current .zshrc in a text editor (GUI or CLI) and replace the contents with one of the above choices - or even make/modify one on your own!&#xA;&#xA;--------------------&#xA;&#xA;To finalize all of this enter:&#xA;&#xA;source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh&#xA;source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh&#xA;&#xA;Then close your terminal, log out or reboot and enjoy&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Let&#39;s use <a href="https://en.wikipedia.org/wiki/Z_shell">zsh</a> to make our terminal look pretty.</p>

<p>To install zsh, open your terminal and enter:</p>

<pre><code class="language-bash">sudo apt update &amp;&amp; sudo apt install zsh -y
</code></pre>

<p>To make zsh your default shell enter:</p>

<pre><code class="language-bash">sudo chshs -s /usr/bin/zsh
</code></pre>

<p>We need <strong>git</strong> for these next steps, so if you haven&#39;t already, please install git by entering:</p>



<pre><code class="language-bash">sudo apt install git -y
</code></pre>

<p>Now let&#39;s get those <a href="https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md">Fish-like Autosuggestions</a>:</p>

<pre><code class="language-bash">git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
</code></pre>

<pre><code class="language-bash">sudo echo &#34;source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh&#34; &gt;&gt; ~/.zshrc
</code></pre>

<p>Next let&#39;s get <a href="https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md">Syntax Highlighting</a></p>

<pre><code class="language-bash">cd ~/.zsh &amp;&amp; git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
</code></pre>

<pre><code class="language-bash">sudo echo &#34;source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh&#34; &gt;&gt; ~/.zshrc
</code></pre>

<hr>

<p>Now this could be it – you could close your terminal, log out or reboot to finalize – but if you want even more pretty, i suggest you add a custom <code>.zshrc</code> file</p>

<p>You could add the one from <a href="https://gist.github.com/Anon-Exploiter/4e12193df0099183d18720c6471d571a#file-zshrc">Kali Linux</a></p>

<p>Or the <a href="https://raw.githubusercontent.com/tr00ls/tr00ls/main/.zshrc">one</a> i use</p>

<p>Before we do anything though we should backup your current <code>.zshrc</code>:</p>

<pre><code class="language-bash">cp ~/.zshrc ~/.zshrc.bak
</code></pre>

<p>Whichever <code>.zshrc</code> you choose, simply fill your <code>.zshrc</code> with the new custom content.</p>

<p>To do that open your current <code>.zshrc</code> in a text editor (GUI or CLI) and replace the contents with one of the above choices – or even make/modify one on your own!</p>

<hr>

<p>To finalize all of this enter:</p>

<pre><code class="language-bash">source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
</code></pre>

<pre><code class="language-bash">source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
</code></pre>

<p>Then close your terminal, log out or reboot and enjoy</p>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/so-you-want-a-cool-linux-terminal</guid>
      <pubDate>Fri, 08 Dec 2023 11:31:32 +0100</pubDate>
    </item>
    <item>
      <title>Hello World!</title>
      <link>https://blog.tr00ls.dk/hello-world</link>
      <description>&lt;![CDATA[Hello World!]]&gt;</description>
      <content:encoded><![CDATA[<p>Hello World!</p>
]]></content:encoded>
      <guid>https://blog.tr00ls.dk/hello-world</guid>
      <pubDate>Sat, 07 Oct 2023 16:21:02 +0200</pubDate>
    </item>
  </channel>
</rss>