<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>TIL on Salar Rahmanian</title><link>https://www.softinio.com/categories/til/</link><description>Recent content in TIL on Salar Rahmanian</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 03 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://www.softinio.com/categories/til/index.xml" rel="self" type="application/rss+xml"/><item><title>Using Stable And Unstable Nix/NixOS Channels Together</title><link>https://www.softinio.com/til/using-stable-and-unstable-nix-channels-together/</link><pubDate>Sat, 03 May 2025 00:00:00 +0000</pubDate><guid>https://www.softinio.com/til/using-stable-and-unstable-nix-channels-together/</guid><description>&lt;p&gt;For one of my servers that is running NixOS I have been using the stable channel for all packages. However I wanted for one package to use the version of the package that the unstable channel had and had to learn how to do it.&lt;/p&gt;
&lt;p&gt;I am using flakes and this is what I originally had as my input:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nix" data-lang="nix"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;github:NixOS/nixpkgs/nixos-24.11&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I added the unstable channel as an input:&lt;/p&gt;</description></item><item><title>PostgreSQL: collation version mismatch</title><link>https://www.softinio.com/til/postgresql-collation-version-mismatch/</link><pubDate>Sun, 28 Jul 2024 00:00:00 +0000</pubDate><guid>https://www.softinio.com/til/postgresql-collation-version-mismatch/</guid><description>&lt;p&gt;I run my own instance of PeerTube which uses PostgreSQL as its database. When I tried to record my latest video, I got an error message that said:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[3397851] WARNING: database &amp;#34;peertube&amp;#34; has a collation version mismatch
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I had never seen this error before, so I did some research to figure out what was going on. It turns out that this error occurs when the collation version of the database does not match the collation version of the server. In my case, the collation version of the database was 2.38, while the collation version of the server was 2.39.&lt;/p&gt;</description></item><item><title>Migrating my markdown notes from Obsidian to Apple Notes</title><link>https://www.softinio.com/til/migrating-my-markdown-notes-from-obsidian-to-apple-notes/</link><pubDate>Sun, 03 Mar 2024 00:00:00 +0000</pubDate><guid>https://www.softinio.com/til/migrating-my-markdown-notes-from-obsidian-to-apple-notes/</guid><description>&lt;p&gt;So I wanted to migrate my markdown notes from Obsidian to Apple Notes. Apple Notes did not support import from markdown. I also wanted to maintain the folder structure.&lt;/p&gt;
&lt;p&gt;For every file I also wanted to maintain the title of the note. I wanted to prepend the title to the HTML file so that when I import the HTML file to Apple Notes, the title is correctly set. I did this by adding the file name (without the extension) as an &lt;code&gt;h1&lt;/code&gt; tag to the HTML file.&lt;/p&gt;</description></item><item><title>Converting HTML to Markdown using Markdownify</title><link>https://www.softinio.com/til/converting-html-to-markdown-using-markdownify/</link><pubDate>Tue, 26 Dec 2023 00:00:00 +0000</pubDate><guid>https://www.softinio.com/til/converting-html-to-markdown-using-markdownify/</guid><description>&lt;p&gt;I had some HTML content that I wanted to convert to markdown.&lt;/p&gt;
&lt;p&gt;The simplest tool I found to do this effectively was a python utility called &lt;a href="https://pypi.org/project/markdownify/"&gt;Markdownify&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I used Nix Shell to install it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nix-shell -p python311Packages.markdownify
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And to do the conversion I just did:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;markdownify myfile.html &amp;gt; myfile.md
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;where &lt;code&gt;myfile.html&lt;/code&gt; is the name of the file I wanted to convert and &lt;code&gt;myfile.md&lt;/code&gt; in the name of the markdown file it got converted to.&lt;/p&gt;</description></item><item><title>Configuring Github Pages With a Custom Domain</title><link>https://www.softinio.com/til/configuring-github-pages-with-a-custom-domain/</link><pubDate>Sat, 14 Jan 2023 16:45:33 -0800</pubDate><guid>https://www.softinio.com/til/configuring-github-pages-with-a-custom-domain/</guid><description>&lt;p&gt;To setup my custom domain I went through the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Verify Domain:&lt;/em&gt; I followed &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages"&gt;these steps&lt;/a&gt; to verify. Note that this was done using my GitHub accounts settings and not the repositories settings.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Configuring my subdomain:&lt;/em&gt; Next I configured my subdomain to be used as my custom domain with GitHub pages by following &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain"&gt;these steps&lt;/a&gt; which involved adding a CNAME record to my DNS settings with my domain registrar. Note that as I was using a subdomain adding a CNAME record was all that was needed (however if I was to use an apex domain, I would have needed to add A and AAAA records too pointing to GitHub&amp;rsquo;s ip addresses).&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Add CNAME file:&lt;/em&gt; You need to add a file called &lt;code&gt;CNAME&lt;/code&gt; to the root of your generated static site that contains your host name only (i.e. for this site &lt;code&gt;til.softinio&lt;/code&gt;). As I use Hugo, I put this in the &lt;code&gt;static&lt;/code&gt; directory as when the site is created it will be put in the root. Here is an &lt;a href="https://github.com/softinio/til/blob/main/static/CNAME"&gt;example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Configuring GitHub Pages:&lt;/em&gt; Go to your repositories settings and select pages. Enter your domain name, save it and click check. Tick the box to enforce &lt;code&gt;https&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="notes"&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This TIL does not cover setting up GitHub actions to build and deploy your code. Here is a &lt;a href="https://github.com/softinio/til/tree/main/.github/workflows"&gt;sample&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You need to have your site deployed at least once so that the &lt;code&gt;gh-pages&lt;/code&gt; branch is created so that you can set the site source branch in your repositories pages settings.&lt;/li&gt;
&lt;li&gt;To make sure your GitHub actions is able to create the &lt;code&gt;gh-pages&lt;/code&gt; branch, go to your repositories settings, then click &lt;code&gt;Actions&lt;/code&gt; then &lt;code&gt;General&lt;/code&gt; and under the &lt;code&gt;workflow permissions&lt;/code&gt; section make sure the &lt;code&gt;read and write permissions&lt;/code&gt; is selected and saved.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="references"&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/"&gt;Hugo Documentation for hosting on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>