<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<atom:link href="https://seanbehan.ca/posts/tag/linux/rss.xml" rel="self" type="application/rss+xml" />
		<title>Sean Behan — Linux</title>
		<link>https://seanbehan.ca/posts/tag/linux</link>
		<description>Posts tagged “Linux”.</description>
		<language>en-CA</language>
		<!-- RSS wants an address here and readers show the name beside it. -->
		<managingEditor>sean@seanbehan.ca (Sean Behan)</managingEditor>
		<webMaster>sean@seanbehan.ca (Sean Behan)</webMaster>
		<lastBuildDate>Sun, 30 Aug 2026 05:19:08 GMT</lastBuildDate>
		<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/usb-cable-testing</guid>
		<title><![CDATA[USB Cable Testing on Linux]]></title>
		<description><![CDATA[usbmon turns Wireshark into a cable tester, and finds retransmissions on cables that supposedly work.]]></description>
		<link>https://seanbehan.ca/posts/usb-cable-testing</link>
		<pubDate>Wed, 15 Apr 2026 07:11:06 GMT</pubDate>
		<category>linux</category><category>test</category><category>usb</category><category>wireshark</category>
		<content:encoded><![CDATA[<p>I was interested in testing my USB cables that I know work, but wanted to see if they had any retransmission going on.</p><p>Then today, I found out Linux has a kernel module that allows you to &quot;monitor&quot; usb interfaces. Like... using wireshark.</p><p>I won&#x27;t explain how to set up wireshark for your distro, that&#x27;s for you to figure out.</p><p>Once you have wireshark set up, you just <code>sudo modprobe usbmon</code> then <code>lsusb</code>.</p><p>Find the USB interface you want to monitor in the list, then select it when starting wireshark (gui).</p><p>That&#x27;s about it... you can filter like this:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>usb.urb_status != 0 &#x26;&#x26; !(usb.urb_status == -115)</span></span></code></pre><p>Short post, but hope this helps you test your own USB cables for any errors that aren&#x27;t shown in dmesg, like failed packets.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/quadlets</guid>
		<title><![CDATA[Podman Quadlets]]></title>
		<description><![CDATA[Quadlets describe a container as a systemd unit, so systemd owns the lifecycle instead of Podman.]]></description>
		<link>https://seanbehan.ca/posts/quadlets</link>
		<pubDate>Fri, 28 Mar 2025 14:39:58 GMT</pubDate>
		<category>containers</category><category>linux</category><category>podman</category><category>quadlet</category><category>systemd</category>
		<content:encoded><![CDATA[<h3>What are Quadlets?</h3><p>In this post I&#x27;ll show you what a quadlet is and how you can use it to manage</p><p>your containers.</p><p>Quadlets are a new way to manage containers using systemd. They are a new</p><p>format for systemd units that allow you to manage containers using systemd.</p><h3>Container Quadlets</h3><p>Here&#x27;s an example of a container quadlet.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/library/alpine:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Exec</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sleep infinity</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span></code></pre><p>If you put this in ~/.config/containers/systemd/alpine.container you can start</p><p>it with <code>systemctl --user start alpine</code> and it will start a new container.</p><p>Just make sure to <code>systemctl --user daemon-reload</code> to reload the systemd daemon</p><p>after you create the quadlet. You have to do this every time, I won&#x27;t repeat</p><p>this throughout the blog post.</p><h3>Pod Quadlets</h3><p>You can also use quadlets to manage pods. Here&#x27;s an example of a pod quadlet.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Pod]</span></span></code></pre><p>Yep, that&#x27;s it. If you put it in <code>~/.config/containers/systemd/mypod.pod</code> you can</p><p>start it with <code>systemctl --user start mypod-pod</code> and it will start a new pod.</p><p>But the best part is this. If you want to add a container to a pod all you have</p><p>to do is this.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/library/alpine:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Exec</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sleep infinity</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Pod</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">mypod.pod</span></span></code></pre><p>Now when you start <code>mypod-pod</code> it will start the container as well.</p><h3>Dependencies</h3><p>You can add dependencies.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Unit]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">After</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">alpine.service</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/library/archlinux:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Exec</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sleep infinity</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Pod</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">mypod.pod</span></span></code></pre><p>Now archlinux will start after alpine.</p><p>There are even more options. You can start .kube, .network, and .build quadlets</p><p>too and they can depend on each other. See the</p><p><a href="https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html">docs</a></p><p>for more info!</p><p>---</p><h3>Example: Nginx and Certbot</h3><p>Okay so now lets run something useful :)</p><p>How about an nginx container and a certbot container to get a certificate for it?</p><h3>Nginx Container</h3><p>First lets create a directory to hold our files.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> ~/.config/containers/systemd/www</span></span></code></pre><p>Next we create a quadlet for our nginx container.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/nginx:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:80</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">443</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:443</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">./www:/usr/share/nginx/html</span></span></code></pre><p>This will run a web server for us. If you aren&#x27;t root, you&#x27;ll need to enable unprivleged ports.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> sysctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> net.ipv4.ip_unprivileged_port_start=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span></span></code></pre><p>Now we can start it with <code>systemctl --user start nginx</code> and it will start a new container.</p><p>If you browse to <code>http://localhost</code> you should see the nginx welcome page.</p><h3>Certbot Container</h3><p>Now we need to get a certificate for it. We can use certbot for this.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/certbot/certbot:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">letsencrypt:/etc/letsencrypt</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">./www:/mnt</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Exec</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">certonly --webroot --webroot-path /mnt --agree-tos --email your@email.com -d your.domain.com</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span></code></pre><p>Make sure to replace your@email.com and your.domain.com with your own email and domain.</p><p>Then start the container with <code>systemctl --user start certbot</code> and it will get a certificate for you.</p><h3>Nginx with SSL</h3><p>Now you can use the certificate in your nginx container.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/nginx:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:80</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">443</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:443</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">letsencrypt:/etc/letsencrypt</span></span></code></pre><p>That&#x27;s great, but now we need to configure nginx to use the certificate. We can</p><p>do this by adding a volume for the configuration file.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/nginx:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:80</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">PublishPort</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">443</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:443</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">letsencrypt:/etc/nginx/certs</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">./nginx.conf:/etc/nginx/conf.d</span></span></code></pre><p>Along with a configuration file for nginx.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">server</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    listen </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">443</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ssl;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    server_name </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">your.domain.com;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    ssl_certificate </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">/etc/nginx/certs/live/your.domain.com/fullchain.pem;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    ssl_certificate_key </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">/etc/nginx/certs/live/your.domain.com/privkey.pem;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    location</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> / </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        root </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">/usr/share/nginx/html;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        index </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">index.html;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre><p>Again, make sure to replace your.domain.com with your own domain.</p><p>Now you can start the container with <code>systemctl --user start nginx</code> and it will</p><p>start a new container with the certificate. You can verify this by going to</p><p><code>https://your.domain.com</code>.</p><p>Now you have a web server with HTTPS.</p><h3>Automatic Certificate Renewal</h3><p>If you want to renew your certificate automatically it&#x27;s as simple as this.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Container]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Image</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">docker.io/certbot/certbot:latest</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Exec</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">renew</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">AutoUpdate</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">registry</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Volume</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">letsencrypt:/etc/letsencrypt</span></span></code></pre><p>Now you can create a timer for it in <code>~/.config/systemd/user/certbot.timer</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Unit]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">Renew Certbot certificates</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Timer]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">OnCalendar</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">Sun </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">00</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">:00:00</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Persistent</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">Unit</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">certbot.service</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">[Install]</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">WantedBy</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">timers.target</span></span></code></pre><p>Now you enable the timer.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">systemctl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --user</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> enable</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --now</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> certbot.timer</span></span></code></pre><p>Now your certificate will be renewed every Sunday at midnight.</p><p>That&#x27;s it! Now you have a web server with HTTPS and a certificate that will be</p><p>renewed automatically.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/ostree</guid>
		<title><![CDATA[Using Ostree for file snapshots]]></title>
		<description><![CDATA[Ostree is not just for Silverblue. Using it as a content-addressed snapshot store for your own files.]]></description>
		<link>https://seanbehan.ca/posts/ostree</link>
		<pubDate>Sat, 27 May 2023 11:47:26 GMT</pubDate>
		<category>backup</category><category>linux</category><category>ostree</category>
		<content:encoded><![CDATA[<h3>Introduction</h3><p>Ostree is the software that allows rpm-ostree in Fedora Silverblue to keep snapshots of previous deployments and do incremental updates, but did you know it can also be used to keep snapshots of your own files? It&#x27;s actually quite easy once it&#x27;s all set up.</p><p>For this I would strongly suggest you use root for your ostree. Although you can use it without, you will be able to use files that regular users can&#x27;t use such as hardlinks if you&#x27;re root, which will speed up incremental snapshots very much.</p><h3>Initializing the Ostree Repository</h3><p>First you&#x27;ll want to create your inital ostree. Do this in a new folder, on a drive with lots of free space for the files you want to snapshot. You&#x27;ll need as much free space as all the files you want to snapshot.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">mkdir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> tree</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> ostree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> init</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repo=tree</span></span></code></pre><h3>Committing and Restoring Files</h3><p>Next you can start committing files to your new tree. Be sure to check the man pages for <code>ostree-commit</code> and <code>ostree-init</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> ostree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> commit</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repo=tree</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --branch=master</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $PWD</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/dir</span></span></code></pre><p>Keep in mind you cannot commit individual files, only entire directories at a time. Now when you change something inside <code>/dir</code> you can commit again with the exact same command and you will have both copies in your ostree. To restore the original copy you can then use <code>ostree-checkout</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">ostree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> refs</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repo=tree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> master</span></span></code></pre><p>This will show you a list of all your commits. Now choose the one you want to restore.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">ostree</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> checkout</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repo=tree</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --union</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> your-commit-sha</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> dir</span></span></code></pre><h3>Important Considerations</h3><p>Make sure you check <code>ostree -h</code> for a list of ostree commands and read each of their man pages if you want to use them fully.</p><p>I use this on a filesystem that is already a RAID1. Make sure you keep proper backups, ostree can create snapshots but it won&#x27;t help you if your entire drive fails.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/flatpak-mesa</guid>
		<title><![CDATA[Flatpak Mesa Git]]></title>
		<description><![CDATA[Swapping the Flatpak Mesa runtime for mesa-git so a new AMD card stops falling back to software OpenGL.]]></description>
		<link>https://seanbehan.ca/posts/flatpak-mesa</link>
		<pubDate>Thu, 25 May 2023 17:48:28 GMT</pubDate>
		<category>graphics</category><category>linux</category>
		<content:encoded><![CDATA[<h3>The Problem</h3><p>If you&#x27;ve switched to Flatpak for gaming you may notice that Mesa is sometimes a little bit old. The issue I had myself was that my 6000 series AMD graphics card didn&#x27;t have up to date graphics drivers, resulting in OpenGL games not running on the graphics card, but rather the CPUs OpenGL implementation, which made games such as CS:GO and Minecraft run at 5 or 10 FPS.</p><h3>The Solution</h3><p>To get the latest Mesa git on Flatpak you can install it like this:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> org.freedesktop.Platform.GL.mesa-git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> org.freedesktop.Platform.GL32.mesa-git</span></span></code></pre><p>This will allow you to install the latest Mesa graphics drivers to allow applications to detect hardware properly and run better. Make sure when you are prompted for a version of Mesa to install you choose the latest version number that doesn&#x27;t have &quot;beta&quot; at the end.</p><h3>Usage</h3><p>Once you&#x27;ve done this you can run your Flatpak like this to use Mesa git.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">FLATPAK_GL_DRIVERS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">mesa-git</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> com.valvesoftware.Steam</span></span></code></pre><p>You can also export <code>FLATPAK_GL_DRIVERS=mesa-git</code> in your <code>.bashrc</code> or <code>.profile</code> to use Mesa git for all Flatpak applications. This may cause issues though, and I&#x27;d personally advise you only use it when it&#x27;s needed.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/btrfs</guid>
		<title><![CDATA[BTRFS RAID1 and how to fix it]]></title>
		<description><![CDATA[Setting up a two-disk BTRFS RAID1 for a Steam library, and repairing it when a drive starts throwing errors.]]></description>
		<link>https://seanbehan.ca/posts/btrfs</link>
		<pubDate>Tue, 23 May 2023 14:39:58 GMT</pubDate>
		<category>backup</category><category>linux</category><category>raid</category>
		<content:encoded><![CDATA[<h3>BTRFS RAID1 Setup</h3><p>I mentioned in my previous post that I use an external drive to keep my Steam</p><p>games on. In an attempt to not have to re-download hundreds of gigabytes of</p><p>games I keep them on a RAID1 with 2x5TB drives that I use BTRFS to manage. In</p><p>this post I&#x27;m going to outline how I set it all up, and how I manage it when</p><p>issues arise.</p><h3>Formatting Drives</h3><p>First of all I had to format the drives, so I made sure they were empty and</p><p>everything was backed up. Don&#x27;t do this unless you know for sure that all the</p><p>data on all your drives is backed up somewhere else, or you want to delete it</p><p>permanently.</p><p>Okay so the commands are easy, you just have to make sure you&#x27;re using the</p><p>right ones as not to lose your data. Don&#x27;t run these commands without</p><p>understanding what they do. Replace \_ with your drive letter. A lot of these</p><p>commands need to be run with root, make sure to either elevate to root (<code>sudo -s</code>)</p><p>or prepend the commands with <code>sudo</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">lsblk</span></span></code></pre><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">mkfs.btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">mkfs.btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span></span></code></pre><h3>Creating the RAID1 Array</h3><p>Now you can mount the newly formatted drives to a single RAID1.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">mount</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /mnt</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> device</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /mnt</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> balance</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> start</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -dconvert=raid1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -mconvert=raid1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /mnt</span></span></code></pre><p>The last command might take a little bit of time, but once it&#x27;s finished your</p><p>drives will be all ready to be used.</p><h3>Managing the Array</h3><p>Now if you need to swap out a drive, add another, or you unplug one when it&#x27;s</p><p>writing you can simply balance again and btrfs should be able to balance back</p><p>onto the drive.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> balance</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> start</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -dconvert=raid1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -mconvert=raid1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /mnt</span></span></code></pre><p>You can view the status of the balance using:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> balance</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> status</span></span></code></pre><p>You can remove a drive or add another using:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> device</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> device</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/sd_1</span></span></code></pre><p>Just make sure you balance right afterwards (which will take a VERY long time</p><p>if you have lots of data, beware)</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">btrfs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> balance</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> start</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -dconvert=raid1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -mconvert=raid1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /mnt</span></span></code></pre>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/flatpak</guid>
		<title><![CDATA[Using any Linux Distribution with Flatpak]]></title>
		<description><![CDATA[Flatpak makes the host distribution almost irrelevant, down to proprietary codecs and games on musl Alpine.]]></description>
		<link>https://seanbehan.ca/posts/flatpak</link>
		<pubDate>Tue, 23 May 2023 13:49:32 GMT</pubDate>
		<category>graphics</category><category>linux</category>
		<content:encoded><![CDATA[<h3>Introduction</h3><p>I was using Fedora Silverblue for nearly a year before I realized I had been using Flatpak&#x27;s for nearly all my software, which mind you isn&#x27;t much, but I can use Firefox, Chrome, and play any video game I want using Flatpak alone so it makes sense for me.</p><p>To get this working all you need is a distribution where you can install Flatpak. I&#x27;m using Alpine Linux edge with musl and even that works. Using Flatpak allows me to use proprietary video and audio codecs in Firefox and Chrome since musl doesn&#x27;t support those codecs as of right now.</p><h3>Setting up Flatpak</h3><p>If your distribution doesn&#x27;t already come with FlatHub like Alpine, you&#x27;ll need to <a href="https://flatpak.org/setup/">add it</a>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> remote-add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --if-not-exists</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> flathub</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://flathub.org/repo/flathub.flatpakrepo</span></span></code></pre><h3>Installing Applications</h3><p>This will allow you access to the entire Flatpak library. You can search for software using:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> search</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> steam</span></span></code></pre><p>Then install using:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> com.valvesoftware.Steam</span></span></code></pre><p>Make sure you periodically update your Flatpak&#x27;s as well using:</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> update</span></span></code></pre><h3>Steam and Gaming</h3><p>For Steam to work you&#x27;ll likely need to install some other Flatpak&#x27;s as well, but once they&#x27;re installed all your other gaming Flatpak&#x27;s should &quot;just work&quot;.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> com.valvesoftware.Steam.CompatibilityTool.Proton</span></span></code></pre><p>You might also want to install your distribution&#x27;s <code>steam-devices</code> package if you want to use a game controller.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> apt-get</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> steam-devices</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> # ubuntu / debian</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">doas</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> apk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> steam-devices</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">         # alpine</span></span></code></pre><h3>Managing Permissions with Flatseal</h3><p>I like to give the Steam Flatpak access to my external drives so I can keep games there instead of on my hard drive. To do this I simply install Flatseal and use Flatseal to give rw (read+write) access to the directory where my drives mount to.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> com.github.tchx84.Flatseal</span></span></code></pre><h3>Google Chrome</h3><p>Next if you want to install Google Chrome.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">flatpak</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> com.google.Chrome</span></span></code></pre><h3>Conclusion</h3><p>That&#x27;s all you have to do, then you would have Google Chrome installed.</p><p>Flatpak uses it&#x27;s own runtime, remember to update all your Flatpak&#x27;s periodically with <code>flatpak update</code> to avoid security vulnerabilities and other issues.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/8814au</guid>
		<title><![CDATA[Fedora 8814au Kernel Module Compilation]]></title>
		<description><![CDATA[Compiling the out-of-tree 8814au driver for an Alfa AC1900 on Fedora, kernel headers and all.]]></description>
		<link>https://seanbehan.ca/posts/8814au</link>
		<pubDate>Thu, 12 May 2022 19:21:37 GMT</pubDate>
		<category>development</category><category>kernel</category><category>linux</category>
		<content:encoded><![CDATA[<p>For my wireless card, the Alfa AC1900, I had to compile the module to get it to</p><p>work on Linux since it wasn&#x27;t already part of the kernel.</p><h3>Prerequisites</h3><p>To do this you will need:</p><ol><li><code>make</code> and <code>gcc</code> or <code>clang</code></li><li><code>kernel-debug-devel</code> package</li><li>sudo permission to <code>insmod</code> the compiled module</li></ol><p>This[^1] is the only one I found that worked for me on the latest stable linux</p><p>kernel, which as of today on Fedora is 5.17.6.</p><h3>Kernel Header Installation</h3><p>First you need to install the kernel development header package.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span># Fedora</span></span>
<span class="line"><span>sudo dnf install kernel-debug-devel</span></span>
<span class="line"><span></span></span>
<span class="line"><span># Ubuntu</span></span>
<span class="line"><span>sudo apt install linux-headers-$(uname -r)</span></span></code></pre><p>[^2]</p><h3>Building and Loading the Module</h3><p>Next you need to make the module.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>git clone https://github.com/morrownr/8814au.git</span></span>
<span class="line"><span>cd 8814au</span></span></code></pre><p>Now simply <code>make</code> the module using the <code>make</code> command and use <code>insmod</code> to load</p><p>it.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>make -j16</span></span>
<span class="line"><span>sudo sh -c "modprobe cfg80211; insmod /home/codebam/8814au/8814au.ko"</span></span></code></pre><p>If everything worked successfully, you should now have a loaded 8814au module</p><p>that you can use along with your wireless card to connect to WiFi.</p><p>[^1]: https://github.com/morrownr/8814au</p><p>[^2]: https://www.tecmint.com/install-kernel-headers-in-ubuntu-and-debian</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/podman-systemd</guid>
		<title><![CDATA[Podman Auto Updating Systemd Services]]></title>
		<description><![CDATA[podman generate systemd plus an autoupdate label: containers that start on boot and update themselves.]]></description>
		<link>https://seanbehan.ca/posts/podman-systemd</link>
		<pubDate>Thu, 23 Sep 2021 14:34:43 GMT</pubDate>
		<category>docker</category><category>linux</category><category>podman</category>
		<content:encoded><![CDATA[<h3>Introduction</h3><p>Podman[^1] has a nice feature called <code>generate</code> that lets you generate</p><p>different kinds of configuration files for starting pods. One that I use often</p><p>is <code>podman generate systemd</code> which generates a new user service that can be</p><p>started with <code>systemctl --user start container-yourcontainer.service</code> or</p><p>enabled.</p><h3>Auto-Updating Containers</h3><p>If you want your container to auto update you can simply pass it the flag</p><p><code>--label &quot;io.containers.autoupdate=registry&quot;</code> when you&#x27;re creating it. The</p><p>systemd service will automatically pull the latest versions of containers</p><p>before starting them. You can manually update your container images now using</p><p><code>podman auto-update</code>.</p><p>If you want to update your images on a schedule you can enable the</p><p><code>podman-auto-update.timer</code> using `systemctl --user enable --now</p><p>podman-auto-update.timer` which will auto update your containers every Monday</p><p>morning.[^2]</p><h3>Kubernetes YAML Generation</h3><p>You can also generate a Kubernetes YAML configurations using `podman generate</p><p>kube`. This can then be loaded in Kubernetes to run your containers.</p><p>[^1]: https://podman.io</p><p>[^2]: https://fedoramagazine.org/auto-updating-podman-containers-with-systemd/</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/podman-crun</guid>
		<title><![CDATA[Podman crun and cgroups v2]]></title>
		<description><![CDATA[Getting Podman onto cgroups v2 and crun on distributions that still default to cgroups v1 and runc.]]></description>
		<link>https://seanbehan.ca/posts/podman-crun</link>
		<pubDate>Sun, 19 Sep 2021 03:09:02 GMT</pubDate>
		<category>docker</category><category>linux</category><category>podman</category>
		<content:encoded><![CDATA[<h3>Introduction</h3><p>Podman[^1] is a container management software similar to Docker that can run</p><p>OCI containers as regular users (not root) by using container management</p><p>libraries such as crun or runc, and cgroups v1 or v2. It can be used as a</p><p>drop-in replacement for Docker and supports docker-compose using</p><p>podman-compose.</p><p>Unfortunately for some distributions after installing podman the operating</p><p>system defaults to cgroups v1 and runc, not cgroups v2 and crun. As was the</p><p>case on Rocky Linux for me.</p><h3>Switching to crun</h3><p>First we can switch to crun instead of runc by installing crun with our package</p><p>manager. It was already installed for me, but on Fedora you would use `sudo dnf</p><p>install crun`</p><p>Then you can edit the file <code>/usr/share/containers/containers.conf</code> and change</p><p>the line <code>runtime = &quot;runc&quot;</code> to <code>runtime = &quot;crun&quot;</code>. Now you can verify that</p><p>you&#x27;re using crun with <code>podman info | grep crun</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>name: crun</span></span>
<span class="line"><span>package: crun-0.20.1-1.module+el8.4.0+643+525e162a.x86_64</span></span>
<span class="line"><span>path: /usr/bin/crun</span></span>
<span class="line"><span>  crun version 0.20.1</span></span></code></pre><h3>Enabling cgroups v2</h3><p>Now the harder part was enabling cgroups v2. Luckily I found a</p><p><a href="https://github.com/containers/podman/issues/9410#issuecomment-785840320">comment</a></p><p>on a GitHub issue outlining the steps you need to complete to get cgroups v2 to</p><p>work.</p><p>First we can enable it in the kernel with</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1"</span></span></code></pre><p>Then we can enable linger. This will also allow our containers to remain</p><p>running after logging out.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>sudo loginctl enable-linger codebam</span></span></code></pre><p>Then the last step which made everything work for me is to set the</p><p><code>pid_limit=0</code>. For me it was in <code>/usr/share/containers/containers.conf</code> instead</p><p>of <code>/etc/containers/</code>.</p><h3>Verification</h3><p>Now you can reboot. <code>podman info | grep cgroup</code> should say</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>cgroupControllers: []</span></span>
<span class="line"><span>cgroupManager: systemd</span></span>
<span class="line"><span>cgroupVersion: v2</span></span></code></pre><p>Now we&#x27;re using cgroups v2 and crun.</p><p>[^1]: https://podman.io</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/silverblue</guid>
		<title><![CDATA[Fedora Silverblue]]></title>
		<description><![CDATA[Why an atomic rpm-ostree desktop stuck: updates that check out like git, and roll back the same way.]]></description>
		<link>https://seanbehan.ca/posts/silverblue</link>
		<pubDate>Sat, 13 Feb 2021 20:21:43 GMT</pubDate>
		<category>linux</category>
		<content:encoded><![CDATA[<h3>Introduction</h3><p>Over the past few months I experimented with some new Linux distributions. Here</p><p>I&#x27;ll show you the one I&#x27;m currently using and why I think it&#x27;s great.</p><h3>Atomic Updates and Rollbacks</h3><p>Fedora Silverblue is what&#x27;s known as an Atomic operating system. On Fedora</p><p>Silverblue every update is checked out similar to how git checks out a new</p><p>reference. If you want to install packages into the base image you can use</p><p>rpm-ostree install like you usually would, the only difference is that you need</p><p>to reboot to boot into your new base system reference.</p><h3>Toolbox for Development</h3><p>If you don&#x27;t want to reboot there is a better way though. Instead of layering</p><p>packages into your base image you can use a tool called toolbox which is simply</p><p>a wrapper around podman for creating containers with the current Fedora image.</p><p>You can use toolbox enter and install and run any software as well as access</p><p>files inside your home directory.</p><h3>Rebasing and Customization</h3><p>If at some point you do updates and your system doesn&#x27;t boot, you don&#x27;t have to</p><p>worry. You can simply reboot and choose the last working base image and your</p><p>system will boot up as normal, allowing you to fix any breakage.</p><p>Silverblue is so much more powerful than that though. You can rebase your</p><p>entire system on different base images or Fedora versions. Now instead of</p><p>installing your new desktop environment and risk breaking your operating system</p><p>you can do an <code>rpm-ostree rebase</code> and rebase on another desktop environment. I</p><p>used this to rebase on an image from</p><p><a href="https://fedoraproject.org/atomic-desktops/kinoite/">Kinoite</a> called</p><p>base which just includes all the base packages and no desktop environment. Then</p><p>I installed my window manager of choice and it&#x27;s dependencies. Now I have a</p><p>fully modular Fedora installation along with <a href="https://swaywm.org/">Sway</a> and</p><p>all the dependencies I need to use it.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/alpine-lbu</guid>
		<title><![CDATA[Alpine Linux LBU]]></title>
		<description><![CDATA[Alpine can commit changes back onto its own live ISO. Using LBU to build a persistent maintenance drive.]]></description>
		<link>https://seanbehan.ca/posts/alpine-lbu</link>
		<pubDate>Fri, 04 Dec 2020 03:09:46 GMT</pubDate>
		<category>alpine</category><category>linux</category>
		<content:encoded><![CDATA[<h3>What is LBU?</h3><p>Alpine Linux has a cool feature called LBU that lets you create a backup on top</p><p>of the Live ISO. These backups are called local backups.</p><p>I plan on using LBU as a system maintenance drive. It allows you to save</p><p>changes you make to the Live ISO and restore them automatically when you boot</p><p>the next time.</p><h3>Setup and Committing</h3><p>To set up LBU I booted the Alpine Linux ISO, ran <code>setup-alpine</code>, mounted my</p><p>drive to <code>/media/alpine_usb</code> and when I got to the disk selection I selected no</p><p>disk, and <code>alpine_usb</code> as where to store the configs, and the default for</p><p>cache.</p><p>Now when I make changes in the Alpine Linux Live ISO I can commit them.</p><p>To see what is being committed I first check <code>lbu status</code> which lists all the</p><p>files being added or removed, then <code>lbu commit</code> to commit the changes.</p><p>When I was rebooting I had an issue where the drive would automount itself to</p><p>/media/sdb and then wouldn&#x27;t work with lbu when I wanted to commit or check the</p><p>status because it was already mounted. To fix this I just had to `umount</p><p>/dev/sdb` on boot and then lbu worked as expected.</p><h3>Caching and Configuration</h3><p>To use cache you have to mount it to <code>/media/alpine_usb</code> so that it can write</p><p>the cache files when you&#x27;re installing packages. I want this because it makes</p><p>reinstalling my packages on reboot a lot faster, they can just be loaded from</p><p>cache instead of from online repositories.</p><p>Upon reboot I had to reinstall all the packages I had installed using `apk</p><p>upgrade` but since the cache is there it just installs everything really</p><p>quickly.</p><p>I uncommented and changed the number of backups in <code>/etc/lbu/lbu.conf</code> to 20 so</p><p>that I would be able to revert up to 20 commits in case I broke my configs.</p><p>I see Alpine LBU as a good way to keep a backup of changes to the ISO so it</p><p>could be used as a system recovery disk with the tools that are needed.</p>]]></content:encoded>
	</item>
<item>
		<guid isPermaLink="true">https://seanbehan.ca/posts/2fa-everything</guid>
		<title><![CDATA[2FA Everything]]></title>
		<description><![CDATA[Moving a password store between pass and KeePass, and getting two YubiKeys to guard all of it.]]></description>
		<link>https://seanbehan.ca/posts/2fa-everything</link>
		<pubDate>Fri, 04 Dec 2020 01:38:10 GMT</pubDate>
		<category>linux</category><category>security</category>
		<content:encoded><![CDATA[<h3>Password Management</h3><p>I&#x27;ll start this post by saying one thing. Are you SURE you want to wipe that</p><p>yubikey? I spent the last 2 weeks redoing my entire password manager. Silly me</p><p>forgot that I had my passwords encrypted using the yubikey I wiped to create</p><p>new PGP keys.</p><p>Anyways over the past week or two I moved all my passwords from</p><p><a href="https://www.passwordstore.org/">pass</a> into <a href="https://keepass.info/">keepass</a></p><p>and then back into pass when keepass didn&#x27;t meet all my needs for a password</p><p>manager. KeePass supported using yubikeys for decryption, but not more than one</p><p>at a time. If I were to lose the key I would get permanently locked out.</p><p>Features I want in my password manager:</p><ul><li>2FA for password manager decryption</li><li>Mobile and desktop apps</li><li>Secure encryption</li></ul><p>What I settled on was this. I bought myself a [Yubikey 5C</p><p>NFC](https://www.yubico.com/ca/product/yubikey-5c-nfc/) to go alongside my</p><p>previous <a href="https://www.yubico.com/ca/product/yubikey-5c/">Yubikey 5C</a>. There</p><p>might be better alternatives, but this is the one I purchased. This one had NFC</p><p>and was convenient for accessing passwords on my phone and laptop.</p><h3>Yubikey PGP Key Generation</h3><p>To generate my PGP keys I actually generated them on the Yubikey itself, this</p><p>way the private key never touches the laptop I used to generate the key.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>$ gpg --card-edit</span></span>
<span class="line"><span>gpg/card> admin</span></span>
<span class="line"><span>gpg/card> key-attr</span></span>
<span class="line"><span>gpg/card> generate</span></span></code></pre><p>The <code>key-attr</code> command lets you choose the type and size of key you&#x27;re</p><p>generating on the device. I used RSA 4096 for my Yubikey 5C and ed25519 for the</p><p>Yubikey 5C NFC. I can&#x27;t use RSA or larger keys if I want to be able to use it</p><p>with NFC.</p><p>I backed up my revokal certificates that were put in the <code>~/.gnupg/</code> directory</p><p>as indicated after they were generated, and I exported and backed up the public</p><p>keys, then I uploaded the keys to a keyserver.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>gpg --export --armor 0F6D5021A87F92BA > 0F6D5021A87F92BA.asc</span></span>
<span class="line"><span>gpg --send-keys 0F6D5021A87F92BA</span></span>
<span class="line"><span></span></span>
<span class="line"><span>gpg --export --armor F9BC985B3BF972C7 > F9BC985B3BF972C7.asc</span></span>
<span class="line"><span>gpg --send-keys F9BC985B3BF972C7</span></span></code></pre><p>I started putting passwords into pass using `pass init 0F6D5021A87F92BA</p><p>F9BC985B3BF972C7`. That lets me encrypt to both Yubikeys at once. Now if I lose</p><p>or accidentally wipe one of the Yubikeys again the other will be able to</p><p>decrypt my passwords. I also signed the keys with each other, just to show that</p><p>both are valid if one were to be lost.</p><p>While I did all this I thought I might as well enable 2FA using both the</p><p>Yubikeys on every account that supported it. Google actually has something</p><p>cool called Advanced Protection which allows you to set up your account with 2</p><p>yubikeys to login with, so I enabled that for my Google account.</p><p>I downloaded the [password</p><p>store](https://play.google.com/store/apps/details?id=dev.msfjarvis.aps) Android</p><p>app for my phone, along with <a href="https://www.openkeychain.org/">Openkeychain</a>.</p><p>This part wasn&#x27;t too hard to set up, I just searched for my key on the</p><p>keyserver that I just uploaded it to, then imported it. I went through the</p><p>setup to add a security token and imported it so that it was recognized as one</p><p>of my keys.</p><h3>Git and Password Store Sync</h3><p>At this point I set up my password store with git to use for syncing. I set it</p><p>up on some mirrors just in case one went down, and I backed it up to Nextcloud.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>git remote add all git@seanbehan.dev:pass</span></span>
<span class="line"><span>git remote set-url --add --push all git@seanbehan.dev:pass</span></span>
<span class="line"><span>git remote set-url --add --push all git@git.sr.ht:~codebam/pass</span></span>
<span class="line"><span>git remote set-url --add --push all git@git.maych.in:codebam/password-store</span></span>
<span class="line"><span>git push --set-upstream all master</span></span></code></pre><p>I actually set up git on my own server here too. To do this I added a new user</p><p>named <code>git</code> and added my ssh keys to it, then inside it&#x27;s home directory I made</p><p>git repositories to push to using.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>mkdir pass</span></span>
<span class="line"><span>cd pass</span></span>
<span class="line"><span>git init --bare</span></span></code></pre><h3>Yubikey for SSH</h3><p>I generated a new SSH key from within the password store app and used that for</p><p>authentication from my phone. On my laptop I set up gpg-agent with ssh support</p><p>so that I could use my yubikey as an SSH key as well as a PGP key.</p><h3><code>~/.bashrc</code></h3><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> GPG_TTY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tty</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">)"</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> SSH_AUTH_SOCK</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/run/user/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$UID</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/gnupg/S.gpg-agent.ssh"</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">gpg-connect-agent</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> updatestartuptty</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /bye</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /dev/null</span></span></code></pre><h3><code>~/.gnupg/gpg.conf</code></h3><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">use-agent</span></span></code></pre><p>Then I used <code>ssh-add -L</code> to show my public SSH key for each yubikey to put on</p><p>the server.</p><p>I used pass for 2FA as well because the password store app supports that. I</p><p>just scanned the code and installed <code>pass-otp</code> on Fedora to get support for</p><p>OTPs.</p><p>I installed the <a href="https://github.com/passff/passff">PassFF</a> Firefox extention to</p><p>get support for pass in my browser, and turned on autofill on my phone so that</p><p>it can autofill everywhere.</p><p>I set up git to sign all my commits so that it shows that my commits are signed</p><p>and valid.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>git config --global user.signingkey 0F6D5021A87F92BA</span></span>
<span class="line"><span>git config --global commit.gpgsign true</span></span></code></pre><h3>System-level U2F Authentication</h3><p>As an extra layer of security on Fedora I installed the <code>pam-u2f</code> package on</p><p>and generated U2F logins.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>sudo pamu2fcfg -uroot >> /etc/u2f_mappings</span></span></code></pre><p>I ran it once for each key, then opened the file and edit it so it looked like</p><p>this.</p><h3>Before</h3><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>root:key1root:key2</span></span></code></pre><h3>After</h3><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>root:key1:key2</span></span>
<span class="line"><span>codebam:key1:key2</span></span></code></pre><p>In <code>/etc/pam.d/system-auth</code> I added a line to the very top above all the other</p><p><code>auth</code>.</p><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span>auth	    required              pam_u2f.so authfile=/etc/u2f_mappings</span></span></code></pre><p>I added the same line to <code>/etc/pam.d/su</code> as well so that my user and root</p><p>requires a yubikey to <code>su</code>.</p><p>This makes it so that <code>sudo</code>, <code>su</code>, and logging in through a <code>getty</code> (not in</p><p>GDM for some reason, but I haven&#x27;t fixed it) require you to tap the yubikey</p><p>before typing the password. Two factors of authentication for my computer, and</p><p>every online service that supports it, backed by hardware.</p><p>Once I was done all this I committed my changes to my dotfiles pushed them to</p><p>git so that I could easily set the same thing up on my desktop which is also</p><p>running Fedora.</p>]]></content:encoded>
	</item>
	</channel>
</rss>