<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Linux on D. Sébastien Taggart</title>
    <link>https://www.sebastientaggart.com/categories/linux/</link>
    <description>Recent content in Linux on D. Sébastien Taggart</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 04 Oct 2026 23:02:59 -0400</lastBuildDate>
    <atom:link href="https://www.sebastientaggart.com/categories/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Self-Hosting a Minecraft Server for My Son: Privacy, Control, and Fun with Docker</title>
      <link>https://www.sebastientaggart.com/writing/discover-the-fun-of-self-hosting-minecraft-for-your-kids/</link>
      <pubDate>Fri, 02 Sep 2022 21:52:40 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/discover-the-fun-of-self-hosting-minecraft-for-your-kids/</guid>
      <description>&lt;p&gt;Minecraft has transcended its status as merely a game; it’s a vibrant canvas for creativity, collaboration, and connection—especially for my son, Alexander. For him, Minecraft is more than just building elaborate castles or fending off creepers. It&amp;rsquo;s a realm where he can explore, learn, and share experiences with his friends.&lt;/p&gt;
&lt;p&gt;As a parent, however, I’m acutely aware of the risks associated with public or third-party servers. Concerns about online privacy, intrusive ads, and a lack of control over the gaming environment loom large. That’s precisely why I chose to self-host a Minecraft server for Alexander. This decision not only ensures a safe, private space for him to play, but also allows me to manage the server on our own terms.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Minecraft has transcended its status as merely a game; it’s a vibrant canvas for creativity, collaboration, and connection—especially for my son, Alexander. For him, Minecraft is more than just building elaborate castles or fending off creepers. It&rsquo;s a realm where he can explore, learn, and share experiences with his friends.</p>
<p>As a parent, however, I’m acutely aware of the risks associated with public or third-party servers. Concerns about online privacy, intrusive ads, and a lack of control over the gaming environment loom large. That’s precisely why I chose to self-host a Minecraft server for Alexander. This decision not only ensures a safe, private space for him to play, but also allows me to manage the server on our own terms.</p>
<p>And here’s the bonus: using Docker makes the whole process surprisingly straightforward. In this post, I’ll share why self-hosting is a worthy endeavor, how Docker fits into the picture, and provide a step-by-step setup guide to get you started.</p>
<hr>
<h2 id="why-self-host-a-minecraft-server">Why Self-Host a Minecraft Server?</h2>
<h3 id="1-privacy-and-security">1. Privacy and Security</h3>
<p>Public servers often demand accounts on third-party platforms, exposing players to strangers and increasing the risk of inappropriate interactions or data collection. By self-hosting, you gain control over who accesses the server, ensuring a safer environment for your child.</p>
<h3 id="2-full-control">2. Full Control</h3>
<p>With a self-hosted server, you can customize everything—from gameplay rules to mods and plugins. Want a creative-only world? Consider it done. Prefer to whitelist only Alexander’s friends? Easy as pie.</p>
<h3 id="3-no-ads-or-hidden-costs">3. No Ads or Hidden Costs</h3>
<p>Unlike some third-party services that market themselves as “free” while bombarding players with ads or microtransactions, a self-hosted server is distraction-free and fully under your control.</p>
<h3 id="4-a-learning-opportunity">4. A Learning Opportunity</h3>
<p>Setting up a server introduces both Alexander and me to fundamental concepts like hosting, networking, and system administration. It’s a hands-on lesson in how the internet operates.</p>
<hr>
<h2 id="why-use-docker-for-a-minecraft-server">Why Use Docker for a Minecraft Server?</h2>
<p>Docker streamlines the process of running applications such as a Minecraft server by encapsulating them in isolated containers. Here’s why it’s an excellent fit for this purpose:</p>
<ul>
<li><strong>Portability</strong>: Docker containers operate the same way across different systems—be it Linux, macOS, or Windows.</li>
<li><strong>Ease of Updates</strong>: Updating a Docker container is as simple as pulling the latest image.</li>
<li><strong>Resource Efficiency</strong>: Containers are lightweight, consuming fewer resources than traditional virtual machines.</li>
<li><strong>Simplicity</strong>: Docker Compose simplifies managing and configuring the server.</li>
</ul>
<hr>
<h2 id="setting-up-a-minecraft-server-with-docker">Setting Up a Minecraft Server with Docker</h2>
<h3 id="prerequisites">Prerequisites</h3>
<ol>
<li>
<p><strong>Install Docker and Docker Compose</strong></p>
<ul>
<li>Follow the official Docker installation guide for your operating system.</li>
<li>Install Docker Compose by following the provided instructions.</li>
</ul>
</li>
<li>
<p><strong>Have a Basic Understanding of Docker Commands</strong><br>
While this guide will be step-by-step, familiarity with <code>docker</code> and <code>docker-compose</code> commands will be beneficial.</p>
</li>
</ol>
<hr>
<h3 id="step-1-create-a-project-directory">Step 1: Create a Project Directory</h3>
<p>Let’s start by creating a directory for your Minecraft server setup:</p>
<pre tabindex="0"><code>mkdir minecraft-server
cd minecraft-server
</code></pre><hr>
<h3 id="step-2-write-the-docker-compose-file">Step 2: Write the Docker Compose File</h3>
<p>In your <code>minecraft-server</code> directory, create a file named <code>docker-compose.yml</code> with the following content:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;3.8&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">minecraft</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">itzg/minecraft-server:latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="l">minecraft_server</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s2">&#34;25565:25565&#34;</span><span class="w"> </span><span class="c"># Minecraft server port</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">EULA</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;TRUE&#34;</span><span class="w">               </span><span class="c"># Accept Minecraft&#39;s EULA</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">MAX_PLAYERS</span><span class="p">:</span><span class="w"> </span><span class="m">10</span><span class="w">            </span><span class="c"># Maximum players</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">ONLINE_MODE</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;TRUE&#34;</span><span class="w">        </span><span class="c"># Enable Mojang account verification</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">WHITELIST</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;TRUE&#34;</span><span class="w">          </span><span class="c"># Enable whitelist</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">./data:/data            </span><span class="w"> </span><span class="c"># Persist server data</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">unless-stopped</span><span class="w">
</span></span></span></code></pre></div><p><strong>Key Points</strong>:</p>
<ul>
<li><strong>EULA</strong>: Acceptance of the Minecraft End User License Agreement is mandatory to run a server.</li>
<li><strong>ONLINE_MODE</strong>: This setting ensures that only legitimate Mojang accounts can connect.</li>
<li><strong>WHITELIST</strong>: This restricts access to pre-approved players.</li>
</ul>
<hr>
<h3 id="step-3-start-the-server">Step 3: Start the Server</h3>
<p>To start the server, run the following command:</p>
<pre tabindex="0"><code>docker-compose up -d
</code></pre><p>The <code>-d</code> flag runs the container in detached mode, allowing it to operate in the background.</p>
<hr>
<h3 id="step-4-configure-the-server">Step 4: Configure the Server</h3>
<p>Once the server starts for the first time, it will generate configuration files in the <code>data</code> directory. To edit the whitelist or server settings:</p>
<ol>
<li>
<p>Open the <code>data/whitelist.json</code> file to add approved players (e.g., Alexander and his friends).
Example:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">[</span>
</span></span><span class="line"><span class="cl">  <span class="p">{</span> <span class="nt">&#34;uuid&#34;</span><span class="p">:</span> <span class="s2">&#34;player-uuid&#34;</span><span class="p">,</span> <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;PlayerName&#34;</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">]</span>
</span></span></code></pre></div></li>
<li>
<p>Modify <code>data/server.properties</code> to customize game settings like difficulty, game mode, and spawn radius.</p>
</li>
<li>
<p>Restart the server to apply changes:</p>
<pre tabindex="0"><code>docker-compose restart
</code></pre></li>
</ol>
<hr>
<h3 id="step-5-connecting-to-the-server">Step 5: Connecting to the Server</h3>
<ol>
<li>Launch Minecraft on Alexander’s computer.</li>
<li>Select <strong>Multiplayer</strong> &gt; <strong>Add Server</strong>.</li>
<li>Enter the server address: <code>localhost</code> (if hosting locally) or your LAN/External IP (if hosting remotely).</li>
</ol>
<p>For external access, you’ll need to configure port forwarding on your router to allow connections to port <code>25565</code>.</p>
<hr>
<h3 id="step-6-monitor-and-maintain-the-server">Step 6: Monitor and Maintain the Server</h3>
<ul>
<li>
<p><strong>Check Logs</strong>:<br>
To troubleshoot, view server logs using:</p>
<pre tabindex="0"><code>docker-compose logs -f minecraft
</code></pre></li>
<li>
<p><strong>Update the Server</strong>:<br>
To update the Minecraft server image, run:</p>
<pre tabindex="0"><code>docker-compose pull
docker-compose up -d
</code></pre></li>
<li>
<p><strong>Back Up Data</strong>:<br>
Regular backups of the <code>data</code> directory are crucial to preserve worlds and configurations:</p>
<pre tabindex="0"><code>tar -czvf minecraft-backup.tar.gz data/
</code></pre></li>
</ul>
<hr>
<h2 id="extra-features-to-consider">Extra Features to Consider</h2>
<ul>
<li>
<p><strong>Install Mods or Plugins</strong>:<br>
Consider using Forge or PaperMC (available via the same Docker image) to add mods or plugins for a richer gaming experience.</p>
</li>
<li>
<p><strong>Enable Resource Limits</strong>:<br>
Add resource constraints in your <code>docker-compose.yml</code> to prevent the server from consuming excessive CPU or memory:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">deploy</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">resources</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">limits</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">cpus</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;1.0&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;2G&#34;</span><span class="w">
</span></span></span></code></pre></div></li>
</ul>
<hr>
<h2 id="final-thoughts">Final Thoughts</h2>
<p>This setup is about more than just playing Minecraft; it’s about crafting a space for creativity, learning, and collaboration while imparting valuable lessons about technology and privacy.</p>
<p>And perhaps most rewarding of all? I can rest easy knowing that Alexander’s digital playground is safe, ad-free, and entirely under our control.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Exploring Ways to Increase Scroll Back Limit in iTerm2</title>
      <link>https://www.sebastientaggart.com/writing/exploring-ways-to-increase-scroll-back-limit-in-iterm2/</link>
      <pubDate>Fri, 03 Dec 2021 21:36:09 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/exploring-ways-to-increase-scroll-back-limit-in-iterm2/</guid>
      <description>&lt;p&gt;Ever found yourself staring at a terminal output so lengthy that the scrollback buffer limit left you in the dark about where things went awry? It&amp;rsquo;s a common frustration, but fear not! Let’s delve into how you can enhance the scrollback limit in iTerm2, so you can keep your debugging skills sharp and your output history rich.&lt;/p&gt;
&lt;h2 id=&#34;understanding-the-scrollback-limit-in-iterm2&#34;&gt;Understanding the Scrollback Limit in iTerm2&lt;/h2&gt;
&lt;p&gt;Before we get our hands dirty, let&amp;rsquo;s unpack the concept of the &amp;lsquo;Scrollback Limit.&amp;rsquo; Think of it as a safety net for your terminal output. By default, iTerm2 allows you to scroll back through 1,000 lines of output. While this is usually sufficient, there are moments—like when you&amp;rsquo;re running extensive scripts or analyzing logs—when you&amp;rsquo;d prefer a deeper dive into your terminal&amp;rsquo;s past. That’s where increasing the scrollback limit comes into play.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Ever found yourself staring at a terminal output so lengthy that the scrollback buffer limit left you in the dark about where things went awry? It&rsquo;s a common frustration, but fear not! Let’s delve into how you can enhance the scrollback limit in iTerm2, so you can keep your debugging skills sharp and your output history rich.</p>
<h2 id="understanding-the-scrollback-limit-in-iterm2">Understanding the Scrollback Limit in iTerm2</h2>
<p>Before we get our hands dirty, let&rsquo;s unpack the concept of the &lsquo;Scrollback Limit.&rsquo; Think of it as a safety net for your terminal output. By default, iTerm2 allows you to scroll back through 1,000 lines of output. While this is usually sufficient, there are moments—like when you&rsquo;re running extensive scripts or analyzing logs—when you&rsquo;d prefer a deeper dive into your terminal&rsquo;s past. That’s where increasing the scrollback limit comes into play.</p>
<h2 id="increasing-the-scrollback-limit-in-iterm2">Increasing the Scrollback Limit in iTerm2</h2>
<p><img loading="lazy" src="/writing/exploring-ways-to-increase-scroll-back-limit-in-iterm2/assets/imgpaste_22-18-59-12.png"></p>
<p>Ready to expand your horizons? Here’s a straightforward guide to boost the scrollback limit in iTerm2:</p>
<ol>
<li>
<p><strong>Open iTerm2</strong>: Start by launching the iTerm2 terminal on your machine.</p>
</li>
<li>
<p><strong>Access Preferences</strong>: Navigate to <code>iTerm2 &gt; Preferences</code>. This will bring up the preferences dialogue box, your command center for customization.</p>
</li>
<li>
<p><strong>Go to Profiles</strong>: Within the dialogue box, head over to the <code>Profiles</code> tab. This is where the magic happens.</p>
</li>
<li>
<p><strong>Select Terminal Sub-tab</strong>: Click on the <code>Terminal</code> sub-tab within the Profiles section.</p>
</li>
<li>
<p><strong>Adjust Scrollback Buffer</strong>: Here, you&rsquo;ll find the <code>Scrollback Buffer</code> option. To unlock unlimited scrolling, select <code>Unlimited Scrollback</code>. Alternatively, if you prefer a specific limit, deselect <code>Unlimited Scrollback</code> and input your desired number in the <code>Scrollback Lines</code> box.</p>
</li>
<li>
<p><strong>Save and Close</strong>: Once you&rsquo;ve made your adjustments, simply close the dialogue box. Your changes will be saved automatically.</p>
</li>
</ol>
<p>Now, whether you opt for <em>Unlimited Scrollback</em> or set a custom limit, you can confidently scroll back through your terminal output. This means fewer headaches during debugging and an enhanced ability to trace errors back to their source.</p>
<p>Happy coding, and may your scrollback history be ever expansive!</p>
]]></content:encoded>
    </item>
    <item>
      <title>Making Markdown Preview Work From Finder in OSX</title>
      <link>https://www.sebastientaggart.com/writing/making-markdown-preview-work-from-finder-in-osx/</link>
      <pubDate>Fri, 15 Oct 2021 21:48:53 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/making-markdown-preview-work-from-finder-in-osx/</guid>
      <description>&lt;p&gt;The versatility of Markdown lies in its simplicity, making it one of the most effective tools for converting plain text to rich HTML. For those new to the world of Markdown, it’s a lightweight markup language that allows you to create structured documents with ease. However, there’s often a pesky hurdle to overcome: how can we preview Markdown files without the need to open a dedicated text editor or application? Fear not—using OSX’s Finder, you can preview these files as effortlessly as you would an image or PDF. In this guide, I’ll walk you through the steps to enable Markdown previews directly from Finder using a nifty tool called QLMarkdown.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The versatility of Markdown lies in its simplicity, making it one of the most effective tools for converting plain text to rich HTML. For those new to the world of Markdown, it’s a lightweight markup language that allows you to create structured documents with ease. However, there’s often a pesky hurdle to overcome: how can we preview Markdown files without the need to open a dedicated text editor or application? Fear not—using OSX’s Finder, you can preview these files as effortlessly as you would an image or PDF. In this guide, I’ll walk you through the steps to enable Markdown previews directly from Finder using a nifty tool called QLMarkdown.</p>
<h2 id="understanding-homebrew-your-new-best-friend">Understanding Homebrew: Your New Best Friend</h2>
<p>Before we dive into the setup, let’s take a moment to talk about Homebrew. Think of Homebrew as your personal package manager for macOS—an automated assistant that simplifies the installation of software on your system. It handles everything from downloading to unpacking and installing applications. With that context, let’s harness the power of Homebrew to get QLMarkdown up and running.</p>
<p><strong>To install QLMarkdown via Homebrew, follow these straightforward steps:</strong></p>
<ol>
<li>Open your terminal.</li>
<li>Paste the following line and press enter:<br>
<code>brew install --cask qlmarkdown</code></li>
</ol>
<p>This command will pull QLMarkdown directly from Homebrew&rsquo;s official casks. The <code>--cask</code> option signals to Homebrew that you’re installing a binary package rather than a typical one. If you haven’t installed Homebrew yet, don’t worry—it’s easy to get started. Just follow the instructions on their <a href="https://brew.sh">official website</a>.</p>
<h2 id="previewing-markdown-in-finder">Previewing Markdown in Finder</h2>
<p>Once you’ve successfully installed QLMarkdown, it’s time to see it in action. Here’s how to preview Markdown (.md) files directly from Finder:</p>
<ol>
<li>Open Finder and navigate to the directory containing your .md file.</li>
<li>Click on the .md file you wish to preview.</li>
<li>Press <code>Space</code> to bring up the Quick Look preview.</li>
</ol>
<p>Voilà! You should now see a rendered preview of your Markdown file, right there in Finder.</p>
<p><img alt="Markdown Preview Example" loading="lazy" src="/writing/making-markdown-preview-work-from-finder-in-osx/assets/imgpaste_22-18-38-00.png"></p>
<h2 id="wrapping-up">Wrapping Up</h2>
<p>The steps outlined above provide an efficient and straightforward method to preview Markdown on OSX. With just a simple addition via Homebrew, you can eliminate the need for extra applications or text editors. This process exemplifies how understanding and tweaking your tools can enhance your workflow. By combining the strengths of QLMarkdown, Finder, and Homebrew, you can make your Markdown previews more accessible and convenient.</p>
<p>So, go ahead—explore, experiment, and happy coding!</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating from LastPass to Self-Hosted Vaultwarden (Bitwarden)</title>
      <link>https://www.sebastientaggart.com/writing/migrating-from-lastpass-to-self-hosted-vaultwarden-bitwarden/</link>
      <pubDate>Mon, 13 Sep 2021 21:39:43 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/migrating-from-lastpass-to-self-hosted-vaultwarden-bitwarden/</guid>
      <description>&lt;p&gt;If you’ve made the decision to transition from LastPass to a self-hosted password manager like Vaultwarden (a streamlined fork of Bitwarden), you’re likely in search of a reliable guide to facilitate the migration. Whether you’re running it locally through Docker Compose or looking to explore the self-hosted landscape, this post will walk you through the essential steps to ensure a smooth transition.&lt;/p&gt;
&lt;h2 id=&#34;why-choose-vaultwarden&#34;&gt;Why Choose Vaultwarden?&lt;/h2&gt;
&lt;p&gt;At its core, Bitwarden is an open-source password manager that not only allows easy imports from LastPass but also offers the flexibility of self-hosting. Vaultwarden, in particular, distills the original Bitwarden server code, making it lighter and easier to manage on personal servers. This means you can take control of your data while enjoying a user-friendly interface.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>If you’ve made the decision to transition from LastPass to a self-hosted password manager like Vaultwarden (a streamlined fork of Bitwarden), you’re likely in search of a reliable guide to facilitate the migration. Whether you’re running it locally through Docker Compose or looking to explore the self-hosted landscape, this post will walk you through the essential steps to ensure a smooth transition.</p>
<h2 id="why-choose-vaultwarden">Why Choose Vaultwarden?</h2>
<p>At its core, Bitwarden is an open-source password manager that not only allows easy imports from LastPass but also offers the flexibility of self-hosting. Vaultwarden, in particular, distills the original Bitwarden server code, making it lighter and easier to manage on personal servers. This means you can take control of your data while enjoying a user-friendly interface.</p>
<h2 id="prerequisites">Prerequisites</h2>
<p>Before we dive into the setup, make sure you have Docker and Docker Compose installed on your machine. These tools will serve as the backbone for running your Vaultwarden instance.</p>
<h2 id="step-1-setting-up-vaultwarden">Step 1: Setting Up Vaultwarden</h2>
<p>Let’s begin by configuring Vaultwarden to run locally using Docker Compose.</p>
<p>Create a <code>docker-compose.yml</code> file with the following content:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;3&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">vaultwarden</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">vaultwarden/server:latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">always</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">bw-data:/data</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">SIGNUPS_ALLOWED=true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="m">8080</span><span class="p">:</span><span class="m">80</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">bw-data</span><span class="p">:</span><span class="w">
</span></span></span></code></pre></div><p>With this configuration, your Vaultwarden server will be accessible on port 8080, and new sign-ups will be enabled. Think of this file as the blueprint for your password management infrastructure.</p>
<h2 id="step-2-deploy-vaultwarden">Step 2: Deploy Vaultwarden</h2>
<p>To deploy your Vaultwarden instance, run the Docker Compose file with the following command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker-compose up -d
</span></span></code></pre></div><p>Once deployed, you can access the Vaultwarden web interface by navigating to <code>http://localhost:8080</code> in your web browser. It’s like opening the door to a secure vault — just make sure you have the right key.</p>
<h2 id="step-3-migrate-data-from-lastpass">Step 3: Migrate Data from LastPass</h2>
<p>Now that your Vaultwarden instance is up and running, it’s time to migrate your data from LastPass:</p>
<ol>
<li>Head to your LastPass vault and navigate to More Options → Advanced → Export.</li>
<li>Save the exported data as a .csv file; this will be the bridge to your new Vaultwarden setup.</li>
<li>Open your Vaultwarden instance, create an account if you haven’t done so already, and go to Tools → Import Data.</li>
<li>Select LastPass (csv) from the dropdown menu and upload your .csv file.</li>
</ol>
<p>A word of caution: once you&rsquo;ve successfully imported your data, ensure you permanently delete the exported LastPass .csv files. These files contain plain-text passwords, and we certainly don’t want them lingering around.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Migrating from LastPass to a self-hosted instance of Vaultwarden not only empowers you with greater control over your sensitive information but also retains the convenience of a password management solution. While the process is straightforward, it’s vital to approach each step with care. By doing so, you safeguard your data and enhance your overall digital security.</p>
<p>So, take a deep breath, follow these steps, and enjoy the peace of mind that comes with managing your passwords on your own terms. Happy migrating!</p>
]]></content:encoded>
    </item>
    <item>
      <title>Unraveling the Intricacies of Popular Open Source Licenses</title>
      <link>https://www.sebastientaggart.com/writing/unraveling-the-intricacies-of-popular-open-source-licenses/</link>
      <pubDate>Sat, 30 Jan 2021 20:25:29 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/unraveling-the-intricacies-of-popular-open-source-licenses/</guid>
      <description>&lt;p&gt;In the dynamic landscape of programming and software development, open source licenses serve as both a roadmap and a compass. They remove barriers, foster collaboration, and catalyze growth, creating a legal framework that empowers developers to freely use, modify, and distribute software source code.&lt;/p&gt;
&lt;p&gt;However, for software producers, the task of selecting the right open source license can feel daunting. With a myriad of options at their disposal—each presenting its own set of advantages and challenges—it’s crucial to navigate this terrain with clarity. Consumers, too, must approach the terms of these licenses with care.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>In the dynamic landscape of programming and software development, open source licenses serve as both a roadmap and a compass. They remove barriers, foster collaboration, and catalyze growth, creating a legal framework that empowers developers to freely use, modify, and distribute software source code.</p>
<p>However, for software producers, the task of selecting the right open source license can feel daunting. With a myriad of options at their disposal—each presenting its own set of advantages and challenges—it’s crucial to navigate this terrain with clarity. Consumers, too, must approach the terms of these licenses with care.</p>
<h2 id="an-overview-of-popular-open-source-licenses">An Overview of Popular Open Source Licenses</h2>
<h3 id="mit-license">MIT License</h3>
<p>The MIT License stands out as one of the most permissive open source licenses. In essence, it communicates: “Feel free to do whatever you like with this, as long as you give me credit and refrain from suing me.” This flexibility is appealing to developers, allowing for a broad range of applications. However, it comes with a caveat: minimal protection if a larger project decides to incorporate your work without acknowledgment.</p>
<h3 id="gnu-general-public-license-gpl">GNU General Public License (GPL)</h3>
<p>The GPL, on the other hand, is a copyleft license. This means that any software derived from a GPL component must also be released as open source. While this fosters an expansive and free user environment, it can complicate commercial use. Many proprietary developers shy away from GPL because it requires them to disclose their source code, which can be a dealbreaker in competitive markets.</p>
<h3 id="apache-license-20">Apache License 2.0</h3>
<p>Similar to the MIT License, the Apache License 2.0 offers permissiveness but adds an important layer of protection: an express grant of patent rights from contributors to users. This provision safeguards users from potential legal disputes over patent claims, making it a robust choice for those concerned about legal entanglements. Conversely, this may be viewed as a limitation by developers who prefer greater control over their contributions.</p>
<h3 id="bsd-licenses">BSD Licenses</h3>
<p>The BSD licenses represent a family of permissive free software licenses, imposing minimal restrictions on software use and distribution. This flexibility is attractive for users, allowing them to exploit the software without significant constraints. However, akin to the MIT License, the lack of protective measures could deter developers, who may find it disheartening when larger projects incorporate their work without proper credit.</p>
<h2 id="key-takeaways">Key Takeaways</h2>
<p>Choosing an open source license is not merely a bureaucratic step; it’s a strategic decision that reflects your goals for your project and your desired level of control. Understanding the implications of your chosen license is vital for safeguarding your rights.</p>
<p>If you, as a software producer, prioritize maximum exposure and usage of your software, consider leaning towards the MIT or Apache Licenses. Conversely, if your aim is to ensure that all derivatives of your work remain open, the GPL may be more aligned with your objectives.</p>
<p>For users, a permissive license such as the MIT, BSD, or Apache License allows for greater freedom and reduces the risk of legal complications.</p>
<p>Ultimately, beyond the realm of code and technical specifications, it’s essential to comprehend the frameworks within which you operate. In this intricate dance of technology and rights, knowledge is not just power—it’s protection.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Read a Filtered List of Files from a Directory and Ask the User to Choose One (Bash)</title>
      <link>https://www.sebastientaggart.com/writing/read-a-filtered-list-of-files-from-a-directory-and-ask-the-user-to-choose-one-bash/</link>
      <pubDate>Mon, 30 Sep 2019 14:40:05 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/read-a-filtered-list-of-files-from-a-directory-and-ask-the-user-to-choose-one-bash/</guid>
      <description>&lt;p&gt;One of the standout features of Docksal is its extensibility through Bash scripting, making it a valuable tool for automating various tasks. A common scenario is the need to import databases when initializing projects. The snippet below serves this purpose by scanning a directory for database files and allowing the user to select which one to import.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Get a list of *.mysql | *.sql.gz | *.sql in /db/ and let the user choose which to import&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;unset&lt;/span&gt; options i
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;IFS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;read&lt;/span&gt; -r -d &lt;span class=&#34;s1&#34;&gt;$&amp;#39;\0&amp;#39;&lt;/span&gt; f&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  options&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;i++&lt;span class=&#34;o&#34;&gt;]=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$f&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt; &amp;lt; &amp;lt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;find &lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PROJECT_ROOT&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;/db/ -maxdepth &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; -type f &lt;span class=&#34;se&#34;&gt;\(&lt;/span&gt; -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;*.mysql&amp;#34;&lt;/span&gt; -o -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;*.sql.gz&amp;#34;&lt;/span&gt; -o -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;*.sql&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\)&lt;/span&gt; -print0&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Press [Enter] to choose a DB to import&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;read&lt;/span&gt; -t5 -p &lt;span class=&#34;s2&#34;&gt;&amp;#34;(times out in 5 seconds) &amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$?&lt;/span&gt; -gt &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Timed out waiting for response. Skipping DB import...&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;select&lt;/span&gt; opt in &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[@]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Skip DB Import&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$opt&lt;/span&gt; in
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      *.mysql &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; *.sql.gz &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; *.sql&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Importing &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$opt&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; ...&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        fin db import &lt;span class=&#34;nv&#34;&gt;$opt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s2&#34;&gt;&amp;#34;Skip DB Import&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Skipping DB Import...&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;break&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      *&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Invalid choice, please enter the number of your choice above.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This script effectively searches a specified directory for files that match certain extensions and prompts the user to make a selection. The inclusion of a timeout is a thoughtful touch, especially for scripts designed to run unattended or as part of a larger automation workflow.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>One of the standout features of Docksal is its extensibility through Bash scripting, making it a valuable tool for automating various tasks. A common scenario is the need to import databases when initializing projects. The snippet below serves this purpose by scanning a directory for database files and allowing the user to select which one to import.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Get a list of *.mysql | *.sql.gz | *.sql in /db/ and let the user choose which to import</span>
</span></span><span class="line"><span class="cl"><span class="nb">unset</span> options i
</span></span><span class="line"><span class="cl"><span class="k">while</span> <span class="nv">IFS</span><span class="o">=</span> <span class="nb">read</span> -r -d <span class="s1">$&#39;\0&#39;</span> f<span class="p">;</span> <span class="k">do</span>
</span></span><span class="line"><span class="cl">  options<span class="o">[</span>i++<span class="o">]=</span><span class="s2">&#34;</span><span class="nv">$f</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">done</span> &lt; &lt;<span class="o">(</span>find <span class="si">${</span><span class="nv">PROJECT_ROOT</span><span class="si">}</span>/db/ -maxdepth <span class="m">1</span> -type f <span class="se">\(</span> -name <span class="s2">&#34;*.mysql&#34;</span> -o -name <span class="s2">&#34;*.sql.gz&#34;</span> -o -name <span class="s2">&#34;*.sql&#34;</span> <span class="se">\)</span> -print0<span class="o">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;Press [Enter] to choose a DB to import&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nb">read</span> -t5 -p <span class="s2">&#34;(times out in 5 seconds) &#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="o">[</span> <span class="nv">$?</span> -gt <span class="m">0</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">  <span class="nb">echo</span> <span class="s2">&#34;&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="nb">echo</span> <span class="s2">&#34;Timed out waiting for response. Skipping DB import...&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">else</span>
</span></span><span class="line"><span class="cl">  <span class="k">select</span> opt in <span class="s2">&#34;</span><span class="si">${</span><span class="nv">options</span><span class="p">[@]</span><span class="si">}</span><span class="s2">&#34;</span> <span class="s2">&#34;Skip DB Import&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="k">do</span>
</span></span><span class="line"><span class="cl">    <span class="k">case</span> <span class="nv">$opt</span> in
</span></span><span class="line"><span class="cl">      *.mysql <span class="p">|</span> *.sql.gz <span class="p">|</span> *.sql<span class="o">)</span>
</span></span><span class="line"><span class="cl">        <span class="nb">echo</span> <span class="s2">&#34;Importing </span><span class="nv">$opt</span><span class="s2"> ...&#34;</span>
</span></span><span class="line"><span class="cl">        fin db import <span class="nv">$opt</span>
</span></span><span class="line"><span class="cl">        <span class="nb">break</span>
</span></span><span class="line"><span class="cl">        <span class="p">;;</span>
</span></span><span class="line"><span class="cl">      <span class="s2">&#34;Skip DB Import&#34;</span><span class="o">)</span>
</span></span><span class="line"><span class="cl">        <span class="nb">echo</span> <span class="s2">&#34;Skipping DB Import...&#34;</span>
</span></span><span class="line"><span class="cl">        <span class="nb">break</span>
</span></span><span class="line"><span class="cl">        <span class="p">;;</span>
</span></span><span class="line"><span class="cl">      *<span class="o">)</span>
</span></span><span class="line"><span class="cl">        <span class="nb">echo</span> <span class="s2">&#34;Invalid choice, please enter the number of your choice above.&#34;</span>
</span></span><span class="line"><span class="cl">        <span class="p">;;</span>
</span></span><span class="line"><span class="cl">    <span class="k">esac</span>
</span></span><span class="line"><span class="cl">  <span class="k">done</span>
</span></span><span class="line"><span class="cl"><span class="k">fi</span>
</span></span></code></pre></div><p>This script effectively searches a specified directory for files that match certain extensions and prompts the user to make a selection. The inclusion of a timeout is a thoughtful touch, especially for scripts designed to run unattended or as part of a larger automation workflow.</p>
<h3 id="why-it-matters">Why It Matters</h3>
<p>Understanding how to leverage Bash for such tasks not only enhances your efficiency but also empowers you to create more dynamic and responsive scripts. This approach illustrates the blend of technical skill and strategic foresight that is crucial in today&rsquo;s digital landscape.</p>
<h3 id="insights-to-consider">Insights to Consider</h3>
<p>Bash scripting, while often seen as a technical skill, is inherently about problem-solving. By framing your scripts to engage users, you add a layer of interaction that can significantly improve the user experience.</p>
<h3 id="moving-forward">Moving Forward</h3>
<p>Consider how you can implement similar patterns in your own scripts. Whether it’s adding user interactivity or building in safeguards like timeouts, these small enhancements can lead to more robust and user-friendly automation solutions. Embrace the iterative process—after all, improvement comes from curiosity and experimentation.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to Downgrade PostgreSQL from 11 to 9 to Fix &#34;pg_dump: Aborting Because of Server Version Mismatch&#34; Error</title>
      <link>https://www.sebastientaggart.com/writing/downgrade-postgresql-11-to-9-to-fix-pg_dump-server-version-mismatch/</link>
      <pubDate>Sun, 21 Apr 2019 13:46:16 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/downgrade-postgresql-11-to-9-to-fix-pg_dump-server-version-mismatch/</guid>
      <description>&lt;p&gt;In the world of GitLab and PostgreSQL, compatibility is crucial. When using GitLab Omnibus, you&amp;rsquo;ll find it ships with PostgreSQL 9.6. However, if you&amp;rsquo;re leveraging an external PostgreSQL database container, it&amp;rsquo;s essential to adhere to a key requirement: GitLab only supports the exact version of PostgreSQL internally and externally. This subtlety often gets lost in the shuffle, especially for those new to the ecosystem. To put it plainly, if you&amp;rsquo;re running a Docker installation of GitLab, you must use PostgreSQL 9.6—no more, no less.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>In the world of GitLab and PostgreSQL, compatibility is crucial. When using GitLab Omnibus, you&rsquo;ll find it ships with PostgreSQL 9.6. However, if you&rsquo;re leveraging an external PostgreSQL database container, it&rsquo;s essential to adhere to a key requirement: GitLab only supports the exact version of PostgreSQL internally and externally. This subtlety often gets lost in the shuffle, especially for those new to the ecosystem. To put it plainly, if you&rsquo;re running a Docker installation of GitLab, you must use PostgreSQL 9.6—no more, no less.</p>
<h2 id="tldr">TL;DR:</h2>
<p>To address the version mismatch error, run a Python script against your PostgreSQL 11 dump to remove <code>AS integer</code> from <code>CREATE SEQUENCE</code> statements, then proceed with the import as usual.</p>
<h2 id="setting-the-scene">Setting the Scene</h2>
<p>Consider a <code>docker-compose.yml</code> file that resembles the following (note that some details are intentionally obfuscated for clarity):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;3.5&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">services</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">gitlab</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;gitlab/gitlab-ce:latest&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;gitlab&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">always</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;git.sebastientaggart.com&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">GITLAB_OMNIBUS_CONFIG</span><span class="p">:</span><span class="w"> </span><span class="p">|</span><span class="sd">
</span></span></span><span class="line"><span class="cl"><span class="sd">        external_url &#39;https://git.sebastientaggart.com&#39;
</span></span></span><span class="line"><span class="cl"><span class="sd">        # Other configurations...</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s1">&#39;3000:3000&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s1">&#39;10022:22&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s1">&#39;./data/gitlab/config:/etc/gitlab&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s1">&#39;./data/gitlab/logs:/var/log/gitlab&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s1">&#39;./data/gitlab/data:/var/opt/gitlab&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">postgresql-gitlab</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;postgres:11.1-alpine&#39;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">container_name</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;gitlab_postgresql&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">restart</span><span class="p">:</span><span class="w"> </span><span class="l">always</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">environment</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">POSTGRES_USER=gitlab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">POSTGRES_PASSWORD={PASSWORD}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">POSTGRES_DB=gitlab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">volumes</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="l">./data/postgresql-gitlab:/var/lib/postgresql/data</span><span class="w">
</span></span></span></code></pre></div><p>If you attempt to back up the database using the typical command, such as:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker <span class="nb">exec</span> -t gitlab gitlab-rake gitlab:backup:create
</span></span></code></pre></div><p>You might encounter the following error:</p>
<pre tabindex="0"><code>Dumping PostgreSQL database gitlab ... pg_dump: server version: 11.1; pg_dump version: 9.6.11
pg_dump: aborting because of server version mismatch
</code></pre><h2 id="extracting-the-database-dump">Extracting the Database Dump</h2>
<p>To resolve this issue, you&rsquo;ll need to access the PostgreSQL container and upgrade the PostgreSQL client to version 11. Here’s how:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main&#34;</span> &gt;&gt; /etc/apt/sources.list.d/pgdg.list
</span></span><span class="line"><span class="cl">sh -c <span class="s1">&#39;echo &#34;deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main&#34; &gt; /etc/apt/sources.list.d/pgdg.list&#39;</span>
</span></span><span class="line"><span class="cl">apt install wget ca-certificates
</span></span><span class="line"><span class="cl">wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc <span class="p">|</span> apt-key add -
</span></span><span class="line"><span class="cl">apt update
</span></span><span class="line"><span class="cl">apt install postgresql-client
</span></span><span class="line"><span class="cl">ln -s /usr/bin/psql /usr/bin/pg_dump /opt/gitlab/bin/
</span></span></code></pre></div><p>With the client upgraded, you can now carry out the export with the following command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">docker <span class="nb">exec</span> -t gitlab_postgresql pg_dumpall -c -U gitlab &gt; dump_11_<span class="k">$(</span>date +%d-%m-%Y<span class="s2">&#34;_&#34;</span>%H_%M_%S<span class="k">)</span>.sql
</span></span></code></pre></div><p>Remember, this command is executed directly against the PostgreSQL container, not through the usual rake command, as we are preparing to downgrade PostgreSQL back to 9.6.</p>
<h2 id="managing-data-between-operations">Managing Data Between Operations</h2>
<p>In my scenario, I&rsquo;ve been using a volume for the PostgreSQL data directory to keep the database intact between container resets. Before switching to an older PostgreSQL version in your <code>docker-compose.yml</code>, you&rsquo;ll need to clean out the data directory:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo rm -rf /opt/docker/gitlab/data/postgresql-gitlab/*
</span></span></code></pre></div><h2 id="downgrading-from-10-to-9">Downgrading from 10 to 9</h2>
<p>Exporting from PostgreSQL 11 and importing into 10 usually goes smoothly. However, moving from 10 to 9 can lead to database errors. Fortunately, a simple Python script can help us navigate this issue, as referenced in <a href="https://stackoverflow.com/questions/49547602/cant-import-postgresql10-dump-into-9-6-database">this Stack Overflow discussion</a>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="ch">#!/usr/bin/env python3</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">sys</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Downgrades pg_dump 10 script to 9.x</span>
</span></span><span class="line"><span class="cl"><span class="c1"># removing &#39;AS integer&#39; from &#39;CREATE SEQUENCE&#39; statement</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">inside_create_sequence</span> <span class="o">=</span> <span class="kc">False</span>
</span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">readlines</span><span class="p">():</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">inside_create_sequence</span> <span class="ow">and</span> <span class="n">row</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;as integer&#39;</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="k">pass</span>
</span></span><span class="line"><span class="cl">    <span class="k">else</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="nb">print</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">flush</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">inside_create_sequence</span> <span class="o">=</span> <span class="n">row</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;CREATE SEQUENCE &#39;</span><span class="p">)</span>
</span></span></code></pre></div><p>Save this script as <code>pgdump_10_to_9.py</code>, make it executable, and run it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cat dump_10_12-04-2019_15_09_16.sql <span class="p">|</span> ./pgdump_10_to_9.py &gt; dump_9_compatible.sql
</span></span></code></pre></div><p>After that, update your <code>docker-compose.yml</code> to leverage a PostgreSQL 9.6 image and import your cleaned-up dump:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cat dump_9_compatible.sql <span class="p">|</span> docker <span class="nb">exec</span> -i gitlab_postgresql psql -U gitlab
</span></span></code></pre></div><p>And just like that, you’ve successfully downgraded to a version of PostgreSQL that’s more compatible with GitLab.</p>
<p>By approaching the downgrade methodically, you can navigate the complexities of version compatibility with confidence. Remember, clarity in your setup can save you from numerous headaches down the line.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to Recursively Fix File Permissions in Mac OSX and Linux</title>
      <link>https://www.sebastientaggart.com/writing/how-to-recursively-fix-file-permissions-in-mac-osx-and-linux/</link>
      <pubDate>Thu, 20 Sep 2018 12:27:22 -0500</pubDate>
      <guid>https://www.sebastientaggart.com/writing/how-to-recursively-fix-file-permissions-in-mac-osx-and-linux/</guid>
      <description>&lt;p&gt;When navigating the intricacies of a GIT repository, one common challenge often feels like a hidden trap: file permissions that shift unpredictably, triggering GIT to flag a barrage of changes. This scenario is especially prevalent when files transition from Windows systems, but it can crop up in various contexts. Fortunately, there’s a simple remedy: recursively updating file permissions.&lt;/p&gt;
&lt;h3 id=&#34;why-this-matters&#34;&gt;Why This Matters&lt;/h3&gt;
&lt;p&gt;Think of file permissions as the gatekeepers of your digital realm. They dictate who can read, write, or execute a file. Misconfigured permissions can sow confusion and frustration, leading to unnecessary roadblocks in your workflow. Ensuring the correct permissions is essential for smooth code execution and effective collaboration within your team.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>When navigating the intricacies of a GIT repository, one common challenge often feels like a hidden trap: file permissions that shift unpredictably, triggering GIT to flag a barrage of changes. This scenario is especially prevalent when files transition from Windows systems, but it can crop up in various contexts. Fortunately, there’s a simple remedy: recursively updating file permissions.</p>
<h3 id="why-this-matters">Why This Matters</h3>
<p>Think of file permissions as the gatekeepers of your digital realm. They dictate who can read, write, or execute a file. Misconfigured permissions can sow confusion and frustration, leading to unnecessary roadblocks in your workflow. Ensuring the correct permissions is essential for smooth code execution and effective collaboration within your team.</p>
<h3 id="the-solution">The Solution</h3>
<p>To rectify permissions for all directories starting from your current position, deploy the following command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">find . -type d -exec chmod <span class="m">775</span> <span class="o">{}</span> <span class="se">\;</span>  
</span></span></code></pre></div><p>This command performs a dual role: it identifies all directories (thanks to <code>-type d</code>) and then applies the <code>chmod 775</code> command, granting the necessary access levels.</p>
<p>For files, you’ll want to execute a similar command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">find . -type f -exec chmod <span class="m">644</span> <span class="o">{}</span> <span class="se">\;</span>  
</span></span></code></pre></div><p>Here, <code>-type f</code> targets files specifically, while <code>chmod 644</code> sets the appropriate permissions. This distinction is vital, as files and directories each require tailored access levels to function optimally.</p>
<h3 id="targeting-specific-directories">Targeting Specific Directories</h3>
<p>If your focus is on a specific directory, modifying your command is straightforward. For instance:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">find ~/Documents/localdev/test/* -type d -exec chmod <span class="m">755</span> <span class="o">{}</span> <span class="se">\;</span>  
</span></span></code></pre></div><p>In this case, the <code>find</code> command begins its search from <code>~/Documents/localdev/test/*</code>, applying the <code>chmod</code> command to all directories within that path.</p>
<h3 id="final-thoughts">Final Thoughts</h3>
<p>While navigating file permissions might seem like a necessary chore, these commands empower you to reclaim control over your environment. Clarity in permissions not only streamlines development workflows but also minimizes the time spent troubleshooting.</p>
<p>So, the next time you’re confronted with those pesky permission warnings, you’ll be ready to address them confidently. Happy coding!</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
