<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Gheo's Blog]]></title><description><![CDATA[I write about what i find interesting.]]></description><link>https://blog.sweethuman.tech</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 10:45:25 GMT</lastBuildDate><atom:link href="https://blog.sweethuman.tech/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I do local development CockroachDB Backups]]></title><description><![CDATA[I have this taskfile tasks to make running commands easier:
version: 3
tasks:
  backup:
    desc: Backup the local CockroachDB database
    cmds:
      - task: backup-to
        vars:
          FOLDER: "backup/local-node-backup"
  restore:
    desc: ...]]></description><link>https://blog.sweethuman.tech/how-i-do-local-development-cockroachdb-backups</link><guid isPermaLink="true">https://blog.sweethuman.tech/how-i-do-local-development-cockroachdb-backups</guid><category><![CDATA[Databases]]></category><category><![CDATA[cockroachdb]]></category><category><![CDATA[Backup]]></category><dc:creator><![CDATA[Gheorghe Avram]]></dc:creator><pubDate>Sat, 26 Apr 2025 09:32:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745659872805/ef1af2b3-c02f-4522-ad4f-47dc0e63e043.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have this <a target="_blank" href="https://taskfile.dev/">taskfile</a> tasks to make running commands easier:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">version:</span> <span class="hljs-number">3</span>
<span class="hljs-attr">tasks:</span>
  <span class="hljs-attr">backup:</span>
    <span class="hljs-attr">desc:</span> <span class="hljs-string">Backup</span> <span class="hljs-string">the</span> <span class="hljs-string">local</span> <span class="hljs-string">CockroachDB</span> <span class="hljs-string">database</span>
    <span class="hljs-attr">cmds:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">task:</span> <span class="hljs-string">backup-to</span>
        <span class="hljs-attr">vars:</span>
          <span class="hljs-attr">FOLDER:</span> <span class="hljs-string">"backup/local-node-backup"</span>
  <span class="hljs-attr">restore:</span>
    <span class="hljs-attr">desc:</span> <span class="hljs-string">Restore</span> <span class="hljs-string">the</span> <span class="hljs-string">local</span> <span class="hljs-string">CockroachDB</span> <span class="hljs-string">backup</span> <span class="hljs-string">database</span>
    <span class="hljs-attr">cmds:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">task:</span> <span class="hljs-string">restore-from</span>
        <span class="hljs-attr">vars:</span>
          <span class="hljs-attr">FOLDER:</span> <span class="hljs-string">"backup/local-node-backup"</span>
  <span class="hljs-attr">backup-to:</span>
    <span class="hljs-attr">requires:</span>
      <span class="hljs-attr">vars:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-string">FOLDER</span>
    <span class="hljs-attr">cmds:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">cmd:</span> <span class="hljs-string">mkdir</span> <span class="hljs-string">-p</span> <span class="hljs-string">cockroach-extern</span>
        <span class="hljs-attr">ignore_error:</span> <span class="hljs-literal">true</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">|
        cockroach sql --insecure --host=localhost --port=26257 --execute="BACKUP INTO 'nodelocal://1/{{.FOLDER}}';"
</span>  <span class="hljs-attr">restore-from:</span>
    <span class="hljs-attr">requires:</span>
      <span class="hljs-attr">vars:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-string">FOLDER</span>
    <span class="hljs-attr">cmds:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">|
        cockroach sql --insecure --host=localhost --port=26257 --execute="DROP DATABASE IF EXISTS defaultdb;"
</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">|</span>
        <span class="hljs-string">cockroach</span> <span class="hljs-string">sql</span> <span class="hljs-string">--insecure</span> <span class="hljs-string">--host=localhost</span> <span class="hljs-string">--port=26257</span> <span class="hljs-string">--execute="RESTORE</span> <span class="hljs-string">DATABASE</span> <span class="hljs-string">defaultdb</span> <span class="hljs-string">FROM</span> <span class="hljs-string">LATEST</span> <span class="hljs-string">IN</span> <span class="hljs-string">'nodelocal://1/<span class="hljs-template-variable">{{.FOLDER}}</span>'</span><span class="hljs-string">;"</span>
</code></pre>
<p>And I have my <code>docker-compose.yml</code> setup like this:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">services:</span>
    <span class="hljs-attr">crdb:</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">cockroachdb/cockroach:latest-v25.1</span>
        <span class="hljs-attr">ports:</span>
            <span class="hljs-bullet">-</span> <span class="hljs-string">'26257:26257'</span>
            <span class="hljs-bullet">-</span> <span class="hljs-string">'8080:8080'</span>
        <span class="hljs-attr">command:</span> <span class="hljs-string">start-single-node</span> <span class="hljs-string">--insecure</span>
        <span class="hljs-attr">volumes:</span>
            <span class="hljs-bullet">-</span> <span class="hljs-string">crdb:/cockroach/cockroach-data</span>
            <span class="hljs-bullet">-</span> <span class="hljs-attr">type:</span> <span class="hljs-string">bind</span>
              <span class="hljs-attr">source:</span> <span class="hljs-string">./cockroach-extern</span>
              <span class="hljs-attr">target:</span> <span class="hljs-string">/cockroach/cockroach-data/extern</span>
<span class="hljs-attr">volumes:</span>
    <span class="hljs-attr">crdb:</span>
</code></pre>
<p>And from my own project docs:</p>
<h2 id="heading-database-backup-and-restore">Database Backup and Restore</h2>
<p>You will notice in <code>docker-compose.yaml</code> these few lines of code at the database declaration. Let me explain what's going on.</p>
<pre><code class="lang-yaml">    <span class="hljs-bullet">-</span> <span class="hljs-attr">type:</span> <span class="hljs-string">bind</span>
      <span class="hljs-attr">source:</span> <span class="hljs-string">./cockroach-extern</span>
      <span class="hljs-attr">target:</span> <span class="hljs-string">/cockroach/cockroach-data/extern</span>
</code></pre>
<p>CockroachDB saves all backups, exports etc. to folder <code>/cockroach/cockroach-data/extern</code> so we will bind this folder to a local folder in the project directory so we can have access to this data and manipulate it.</p>
<h2 id="heading-backups">Backups</h2>
<p>Info about backups <a target="_blank" href="https://www.cockroachlabs.com/docs/stable/take-full-and-incremental-backups">https://www.cockroachlabs.com/docs/stable/take-full-and-incremental-backups</a></p>
<p>To run a full backup we will run the following command</p>
<pre><code class="lang-sql"><span class="hljs-keyword">BACKUP</span> <span class="hljs-keyword">TO</span> <span class="hljs-string">'nodelocal://1/cockroach-backup'</span>;
</code></pre>
<p>This will backup all the data into the cluster to the local directory of nodeID <code>1</code> and into the <code>cockroach-backup</code> folder in the <code>extern</code> root directory of the respective node.</p>
<p>Now if you look into the local folder you will notice <code>./cockroach-extern/cockroach-backup</code> contains some data.</p>
<h2 id="heading-restores">Restores</h2>
<p>To run a restore of <code>defaultdb</code>, the database the app uses locally we have to run the following command</p>
<pre><code class="lang-sql"><span class="hljs-keyword">RESTORE</span> <span class="hljs-keyword">DATABASE</span> defaultdb <span class="hljs-keyword">FROM</span> LATEST <span class="hljs-keyword">IN</span> <span class="hljs-string">'nodelocal://1/cockroach-backup'</span> <span class="hljs-keyword">WITH</span> new_db_name = <span class="hljs-string">'new_defaultdb'</span>;
</code></pre>
<p>This command will look at the LATEST backup in the <code>cockroach-backup</code> folder and will restore database <code>defaultdb</code> and assign it a new name called <code>new_defaultdb</code>. Now you can access the restored version of the database by changing the connection string to point to <code>new_defaultdb</code>.</p>
]]></content:encoded></item><item><title><![CDATA[How to install OBS Plugins on MacOS]]></title><description><![CDATA[There are two ways to install OBS Plugins on MacOS.
We will be installing OBS Virtual Background Plugin in both examples. Download the zip file and extract it. Normally it should contain a bin and data folder.
Example for OBS Virtual Background Plugi...]]></description><link>https://blog.sweethuman.tech/how-to-install-obs-plugins-on-macos</link><guid isPermaLink="true">https://blog.sweethuman.tech/how-to-install-obs-plugins-on-macos</guid><category><![CDATA[macOS]]></category><category><![CDATA[mac]]></category><category><![CDATA[macbook]]></category><category><![CDATA[obs]]></category><dc:creator><![CDATA[Gheorghe Avram]]></dc:creator><pubDate>Sun, 26 Jun 2022 12:34:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/8zsBofKrhP8/upload/v1656243066145/TxtZ3vFU0.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are two ways to install OBS Plugins on MacOS.
We will be installing <a target="_blank" href="https://obsproject.com/forum/resources/obs-virtual-background-plugin.1371/">OBS Virtual Background Plugin</a> in both examples. Download the zip file and extract it. Normally it should contain a <code>bin</code> and <code>data</code> folder.</p>
<p>Example for OBS Virtual Background Plugin:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656243820684/SBVHt8Tqt.png" alt="CleanShot 2022-06-26 at 14.43.07.png" /></p>
<h1 id="heading-first-method">First Method</h1>
<p>This method is simpler but you may encounter issues when running the plugin.</p>
<p>Go to the folder <code>~/Library/Application Support/obs-studio</code>.<br />If you navigate to it manually through Finder go to your user directory, right click and select <code>Show View Options</code> and then check the <code>Show Library Folder</code> checkbox as pictured below.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656244190277/0zPd1evjK.png" alt="CleanShot 2022-06-26 at 14.48.53.png" /></p>
<p>Once you are in the <code>obs-studio</code> folder you will find a <code>plugins</code> folder. If you don't find it, create it yourself. After that copy the entire folder into <code>plugins</code> (in my case would be <code>obs-virtualbg</code> which contains both the <code>bin</code> and <code>data</code> folder).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656244983939/r5RtKfnd6.png" alt="CleanShot 2022-06-26 at 15.02.01.png" /></p>
<p>Start OBS.</p>
<p>Now you might notice you get an error message as pictured below, if this happens try the second method and make sure to delete the folder you just copied from the <code>plugins</code> folder.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656245189221/Fczx69qkV.png" alt="CleanShot 2022-06-26 at 15.03.59.png" /></p>
<h1 id="heading-second-method">Second Method</h1>
<p>Go to the <code>Applications</code> folder and find your .app file. Either <code>OBS.app</code> or another name for a modified version, I am using Stream Elements OBS so for me it is <code>SE.Live.app</code>. Right Click and select <code>Show Package Contents</code>, after that enter the <code>Contents</code> folder.</p>
<h2 id="heading-add-the-binary">Add the binary</h2>
<p>In the folder of the extension, you have extracted previously, you will find a .so file in the <code>bin</code> folder. Copy that file to the <code>Plugins</code> folder. In my case I copy <code>obs-virtualbg.so</code> to the <code>Plugins</code> folder. If it asks you for a password or elevated permissions provide it so it can copy the file.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656246727129/T7SgvANpy.png" alt="CleanShot 2022-06-26 at 15.16.29.png" /></p>
<h2 id="heading-add-the-data">Add the data</h2>
<p>To add the data we have to go to <code>Resources</code> -&gt; <code>data</code> -&gt; <code>obs-plugins</code>.<br />In here create a folder with the same name as the .so file. I will create a folder with the name <code>obs-virtualbg</code> and copy inside it the contents of the <code>data</code> folder from the original plugin folder.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656246222769/H4nfwPSbx.png" alt="CleanShot 2022-06-26 at 15.23.16.png" /></p>
<p>Now close the window and start OBS. You should find that obs started with no warning and the plugin runs as it should.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656246331704/Lm_vXh-k8.png" alt="CleanShot 2022-06-26 at 15.24.21@2x.png" /></p>
]]></content:encoded></item><item><title><![CDATA[How to set up a Smashing dashboard on your Raspberry Pi]]></title><description><![CDATA[As an OS we are going to use DietPi because it automates most of the setups. There is a 64Bit version available but at the time of writing this, I can't install Chromium on it.
To install DietPi you can follow their Guide. For flashing I used RPi Ima...]]></description><link>https://blog.sweethuman.tech/raspberry-pi-smashing-dashboard</link><guid isPermaLink="true">https://blog.sweethuman.tech/raspberry-pi-smashing-dashboard</guid><category><![CDATA[Raspberry Pi]]></category><category><![CDATA[dashboard]]></category><category><![CDATA[Ruby]]></category><dc:creator><![CDATA[Gheorghe Avram]]></dc:creator><pubDate>Thu, 17 Dec 2020 00:23:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1608164614776/KoQ7JcPWZ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As an OS we are going to use <a target="_blank" href="https://dietpi.com/">DietPi</a> because it automates most of the setups. There is a 64Bit version available but at the time of writing this, I can't install Chromium on it.</p>
<p>To install DietPi you can follow their <a target="_blank" href="https://dietpi.com/docs/user-guide_install/">Guide</a>. For flashing I used <a target="_blank" href="https://www.raspberrypi.org/downloads/">RPi Imager</a>.</p>
<p>Now you should be here: 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1608164396429/qPvqt9iU9.png" alt="alt" /></p>
<h2 id="first-run">First Run</h2>
<p>Enter  <code>Software Optimised</code>, select <code>Chromium</code> (using the arrows and spacebar), and then press Enter.<br />After that go to <code>DietPi-Config</code> -&gt; <code>Display Options</code> -&gt; <code>Display Resolution</code> and select the current screen resolution.<br />After that go back until you see <code>AutoStart Options</code>, select <code>Chromium</code> with Enter, you can leave the URL as it is and make sure the user is set to <code>root</code>. Go all the way back by selecting <code>Exit</code>.<br />Then go to <code>Software Additional</code> and select <code>Build-Essentials</code>, <code>Git</code>, <code>Node.JS</code>, and your editor of choice. Exit by pressing Enter. (Pressing Esc will clear your Settings)<br />And finally, select <code>Install</code> and reboot at the end.</p>
<h2 id="setting-up-chromium">Setting up Chromium</h2>
<p>In some cases, the window size of Chromium might be smaller than the resolution. Looking like this:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1608164441011/fWug15XkD.png" alt="Small Chromium Window" /></p>
<p>To fix this we have to edit these variables in the file at <code>/boot/dietpi.txt</code> and set them to your appropriate resolution:</p>
<pre><code class="lang-bash">SOFTWARE_CHROMIUM_RES_X=1280
SOFTWARE_CHROMIUM_RES_Y=720
</code></pre>
<p>After that, we have to modify the chromium autostart script to fix some glaring issues. It can be found here <code>/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh</code></p>
<pre><code class="lang-bash">CHROMIUM_OPTS=<span class="hljs-string">"--kiosk --test-type --window-size=<span class="hljs-variable">$RES_X</span>,<span class="hljs-variable">$RES_Y</span> --start-fullscreen --start-maximized --window-position=0,0"</span>
</code></pre>
<p>To this variable add these options:</p>
<ul>
<li><code>--no-default-browser-check</code> Disables the default browser check. Useful for UI/browser tests where we want to avoid having the default browser info-bar displayed.</li>
<li><code>--disable-component-update</code> Disable the popup for updating chromium or saying it can't update chromium.</li>
<li><code>--no-first-run</code> Skip First Run tasks, whether or not it's actually the First Run.</li>
</ul>
<p>More info on command line switches <a target="_blank" href="https://peter.sh/experiments/chromium-command-line-switches/">here</a></p>
<p>Right before:</p>
<pre><code class="lang-bash">xinit <span class="hljs-variable">$FP_CHROMIUM</span> <span class="hljs-variable">$CHROMIUM_OPTS</span>
</code></pre>
<p>add these commands:</p>
<pre><code class="lang-bash">sed -i <span class="hljs-string">'s/"exited_cleanly":false/"exited_cleanly":true/'</span> ~/.config/chromium/<span class="hljs-string">'Local State'</span>
sed -i <span class="hljs-string">'s/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/'</span> ~/.config/chromium/Default/Preferences
</code></pre>
<p>These set in the local chromium settings the <code>exited_cleanly</code> value, it tells chromium it always exited as it should. This being a RaspberryPi, Chromium might close directly and we don't want to see the "Restore Previous Session" pop-up.</p>
<p>In the end, you should have a file that looks like this</p>
<pre><code class="lang-bash"><span class="hljs-meta">#!/bin/bash</span>
<span class="hljs-comment"># Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621</span>
<span class="hljs-comment"># - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options</span>

<span class="hljs-comment"># Command line switches https://peter.sh/experiments/chromium-command-line-switches/</span>
<span class="hljs-comment"># --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN</span>
<span class="hljs-comment"># --pull-to-refresh=1</span>
<span class="hljs-comment"># --ash-host-window-bounds="400,300"</span>

<span class="hljs-comment"># Resolution to use for kiosk mode should ideally match current system resolution</span>
RES_X=$(sed -n <span class="hljs-string">'/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}'</span> /boot/dietpi.txt)
RES_Y=$(sed -n <span class="hljs-string">'/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}'</span> /boot/dietpi.txt)

CHROMIUM_OPTS=<span class="hljs-string">"--kiosk --test-type --no-default-browser-check --no-first-run --disable-component-update --window-size=<span class="hljs-variable">$RES_X</span>,<span class="hljs-variable">$RES_Y</span> --start-fullscreen --start-maximized --window-position=0,0"</span>
<span class="hljs-comment"># If you want tablet mode, uncomment the next line.</span>
<span class="hljs-comment">#CHROMIUM_OPTS+=' --force-tablet-mode --tablet-ui'</span>

<span class="hljs-comment"># Add URL for the first run:</span>
URL=$(sed -n <span class="hljs-string">'/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}'</span> /boot/dietpi.txt)
CHROMIUM_OPTS+=<span class="hljs-string">" --homepage <span class="hljs-variable">$URL</span>"</span>

<span class="hljs-comment"># Find absolute file path location of Chromium binary.</span>
FP_CHROMIUM=$(<span class="hljs-built_in">command</span> -v chromium)
<span class="hljs-keyword">if</span> [[ ! <span class="hljs-variable">$FP_CHROMIUM</span> ]]; <span class="hljs-keyword">then</span>

        <span class="hljs-comment"># Assume RPi</span>
        FP_CHROMIUM=<span class="hljs-string">"<span class="hljs-subst">$(command -v chromium-browser)</span>"</span>

<span class="hljs-keyword">fi</span>

sed -i <span class="hljs-string">'s/"exited_cleanly":false/"exited_cleanly":true/'</span> ~/.config/chromium/<span class="hljs-string">'Local State'</span>
sed -i <span class="hljs-string">'s/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/'</span> ~/.config/chromium/Default/Preferences

xinit <span class="hljs-variable">$FP_CHROMIUM</span> <span class="hljs-variable">$CHROMIUM_OPTS</span>
</code></pre>
<h2 id="setting-up-smashing">Setting up Smashing</h2>
<p><a target="_blank" href="https://smashing.github.io/">Smashing</a> is a Sinatra based framework that lets you build beautiful dashboards. (from their docs)</p>
<p>Log in as the user <code>dietpi</code>(it's the default user) and run these steps:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Install ruby</span>
sudo apt install ruby-dev
<span class="hljs-comment"># Install gems</span>
sudo gem install smashing bundler
<span class="hljs-comment"># Generate sample project</span>
smashing new sample_dashboard
<span class="hljs-built_in">cd</span> sample_dashboard
<span class="hljs-comment"># Install dependencies</span>
bundle install
<span class="hljs-comment"># Run</span>
smashing start
</code></pre>
<p>Now you should be able to connect to it on localhost, or using the LAN address of the Raspberry Pi on port 3030 and it should look something like this:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1608164500542/vBygn6f19.png" alt="Smashing Dashboard" /></p>
<p>Now that we know it works we need to set up the service that autostarts the dashboard and tell chromium to load our link on boot.</p>
<p>Create a file called <code>smashing.service</code> in path <code>/etc/systemd/system</code> containing:</p>
<pre><code class="lang-ini"><span class="hljs-section">[Unit]</span>
<span class="hljs-attr">Description</span>=Start Smashing Dashboard
<span class="hljs-attr">Before</span>=graphical.target
<span class="hljs-attr">After</span>=network.target remote-fs.target

<span class="hljs-section">[Service]</span>
<span class="hljs-attr">Type</span>=exec
<span class="hljs-attr">Restart</span>=always
<span class="hljs-attr">RestartSec</span>=<span class="hljs-number">60</span>
<span class="hljs-attr">TimeoutSec</span>=<span class="hljs-number">5</span>min
<span class="hljs-attr">KillMode</span>=control-group
<span class="hljs-attr">GuessMainPID</span>=<span class="hljs-literal">no</span>
<span class="hljs-attr">User</span>=dietpi
<span class="hljs-attr">Group</span>=dietpi
<span class="hljs-attr">WorkingDirectory</span>=/home/dietpi/sample_dashboard
<span class="hljs-attr">ExecStart</span>=/usr/local/bin/smashing start
<span class="hljs-comment">#ExecStop=/usr/local/bin/smashing stop</span>
<span class="hljs-attr">PrivateTmp</span>=<span class="hljs-literal">true</span>
<span class="hljs-attr">PrivateDevices</span>=<span class="hljs-literal">true</span>
<span class="hljs-attr">ProtectSystem</span>=full
<span class="hljs-attr">MountFlags</span>=private
<span class="hljs-attr">NoNewPrivileges</span>=<span class="hljs-literal">true</span>

<span class="hljs-section">[Install]</span>
<span class="hljs-attr">WantedBy</span>=multi-user.target
</code></pre>
<p>Make sure to change the <code>WorkingDirectory</code> to the path where your dashboard is at.<br />More info about the service options <a target="_blank" href="https://www.freedesktop.org/software/systemd/man/systemd.service.html">here</a></p>
<p>After that do:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Reload the Daemon to see our changes</span>
sudo systemctl daemon-reload
<span class="hljs-comment"># Start smashing on boot</span>
sudo systemctl <span class="hljs-built_in">enable</span> smashing
</code></pre>
<p>And to modify the link that Chromium loads we can either modify from the TUI using the app <code>dietpi-config</code> or modify the variable <code>SOFTWARE_CHROMIUM_AUTOSTART_URL</code> in <code>/boot/dietpi.txt</code> and set it to <code>http://localhost:3030</code></p>
<p>Now reboot and it should automagically load the dashboard full-screen on boot having this as a final result:<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1608164541277/E1pyvtucd.jpeg" alt="alt" /></p>
<p>More info on Smashing <a target="_blank" href="https://github.com/Smashing/smashing/wiki">here</a><br />If you want to have more control over the performance of the smashing service you can use <code>dietpi-services</code>.<br />DietPi has a lot of tooling that makes your life with a RaspberryPi much much better and I recommend looking more into it.</p>
]]></content:encoded></item></channel></rss>