<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>avijya</title><description>Personal blog and website of Avijya Shrestha. Projects and articles on web and game development!</description><link>https://avijya.sh/</link><item><title>dotfiles</title><description>A quick post for anyone interested in my dotfiles: how I&apos;ve set it up for git, workflow, tools, etc.</description><content:encoded>&lt;p&gt;Finally got around to setting up my dotfiles properly. After trying a custom written bash script with symlinks, stow, and looking up home-manager, I’ve settled on a bare git repository. It’s simple, has no dependencies besides git, and just works. For a guide to set it up, use the &lt;a href=&quot;https://www.atlassian.com/git/tutorials/dotfiles&quot;&gt;Atlassian Dotfiles Tutorial - Bare Git Repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;workflow&quot;&gt;Workflow&lt;/h2&gt;
&lt;p&gt;I use neovim as my primary editor with tmux as a terminal multiplexer to manage my workspaces. The Primagen’s &lt;a href=&quot;https://github.com/ThePrimeagen/.dotfiles&quot;&gt;tmux-sessionizer&lt;/a&gt; is the best tool I’ve found for my tmux workflow. Make sure to add double quotes around the variables that store folder names to make the script work for folders with spaces. See &lt;a href=&quot;https://github.com/up-the-hill/dotfiles&quot;&gt;my dotfiles&lt;/a&gt; for the fixed script.&lt;/p&gt;
&lt;p&gt;I’ve also started to use KDE’S virtual desktops for quickly switching between workspaces, and I’m enjoying flitting between windows.&lt;/p&gt;
&lt;p&gt;In the end, though, I don’t think any of this is for any productivity boosts. Instead I’m just simplifying things that have annoyed me when I’m working on my projects. And it’s fun.&lt;/p&gt;
&lt;h2 id=&quot;links&quot;&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/up-the-hill/dotfiles&quot;&gt;My dotfiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ThePrimeagen/.dotfiles&quot;&gt;The Primagen’s Dotfiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.atlassian.com/git/tutorials/dotfiles&quot;&gt;Atlassian Dotfiles Tutorial - Bare Git Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title>Old-school Web Apps using CGI</title><description>A quick overview and showcase on making CGI apps.</description><content:encoded>&lt;p&gt;I know I’m late to the party, but I’ve been exploring the old web movement and loving it lately. While going through endless &lt;a href=&quot;https://tilde.club/wiki/cgi.html&quot;&gt;wiki links&lt;/a&gt;, I discovered a little thing called CGI scripting for building websites. And as an avid shitty website-builder myself, of course I had to try it out.&lt;/p&gt;
&lt;p&gt;This project is built and hosted on &lt;a href=&quot;https://tilde.club&quot;&gt;tilde.club&lt;/a&gt;. I will not touch on the server-side configuration for building CGI websites as it is managed fully by the website admins, which I am thankful for.&lt;/p&gt;
&lt;h2 id=&quot;picking-a-language&quot;&gt;Picking a language&lt;/h2&gt;
&lt;p&gt;After years of programming and getting stuck on deciding frameworks and languages, I’ve grown to hate the whole process of deciding on every single minute detail before I even start. So I chose Perl for the sole reason that the wiki says that “Perl was the main language of choice back in the heyday of CGI programming.”, despite never having used Perl before. And being an xkcd fan, I’ve always felt left out on the Perl jokes.&lt;/p&gt;
&lt;h2 id=&quot;basics&quot;&gt;Basics&lt;/h2&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;perl&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;#!/usr/bin/perl&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;Status: 200&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;Content-Type: text/plain&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;Hello World!&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just look at it. It looks almost stupidly simple, but after copying it to my &lt;code&gt;public_html&lt;/code&gt; folder, it works &lt;em&gt;flawlessly&lt;/em&gt;. Well, after forgetting to and then changing the executable permissions, it works &lt;em&gt;flawlessly&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;silly-features&quot;&gt;Silly features&lt;/h2&gt;
&lt;p&gt;The first thing I made was the quintessential counter.&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;perl&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;# functions to read and update the counter file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;sub&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; read_counter&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;-e&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $counter_file) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;        open&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;my&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $fh, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&amp;#x3C;&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, $counter_file) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; die&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;Cannot open file &lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$counter_file&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$!&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        my&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $visits = &amp;#x3C;$fh&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;        close&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;($fh);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $visits;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; 0;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;sub&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; update_counter&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    my&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; ($visits) = @_;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;    open&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;my&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $fh, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, $counter_file) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; die&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;Cannot open file &lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$counter_file&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$!&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; $fh $visits;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;    close&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;($fh);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Calling these functions on page load every time, I save the counter values to &lt;code&gt;$counter_file&lt;/code&gt;
As of 2025-07-02, the website’s been loaded 6414 times!&lt;/p&gt;
&lt;h2 id=&quot;etc&quot;&gt;Etc&lt;/h2&gt;
&lt;p&gt;There’s also a bunch of other features I added, including a message board and a like system. Feel free to look at my mess of a codebase to see how they work.
Have fun making your own CGI app!&lt;/p&gt;
&lt;h2 id=&quot;links&quot;&gt;Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tilde.club/~troubadour/&quot;&gt;CGI webpage - tilde.club/troubadour&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/BadLoaf/tilde_cgi&quot;&gt;Github repo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tilde.club/wiki/cgi.html&quot;&gt;CGI - Making web applications like it’s 90s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item></channel></rss>