Hi there 馃憢

Welcome to my blog.

Rust & Iced: Let's draw some arrows!

I have been working on a chess desktop application using the iced GUI library. This is my first big project using rust, so it has been a fun endeavor learning iced as well as rust at the same time. The iced documentation is almost non-existent, so hopefully i can document some of my learnings here for future reference. The iced API is also evolving rapidly, so its possible this gets obsolete pretty quickly, but the general ideas here will still be valid. One of the features I am implementing is the ability to show the contents of a chess pgn file on a chessboard, which means building out a full fledged chessboard in iced. Visual annotations, like arrows, are incredibly useful for highlighting key moves and strategic ideas in chess analysis. In this post, I'll guide you through the process of drawing these arrows using the Iced Rust GUI library's canvas feature. ...

May 11, 2025 路 4 min

Using Claude Code with Gemini/OpenAI models

I've been wanting to try Anthropic's Claude Code for a while now, and tried this out today. While exploring options, I came across Claude Code Proxy which is a neat way to use Gemini or OpenAI models with Claude code, instead of just relying on the (expensive) Anthropic models. It works by proxying prompts from claude models to Gemini/OpenAI models that you can configure. To save cost, it uses a BIG_MODEL for complex queries, and SMALL_MODEL for simpler queries. Sonnet and Haiku are the default models for Anthropic, but I tried with gemini-2.5-pro-preview-03-25 for the BIG_MODEL, and gemini-2.0-flash for the SMALL_MODEL. Use the Gemini models page for up-to-date names of these models. ...

April 18, 2025 路 2 min

Quickly subscribing to RSS feeds in FreshRSS

I use a selfhosted FreshRSS instance to manage my rss feeds. I wanted a quick way to add a web page's rss feed into FreshRSS without copy pasting the URLs. So i created a bookmarklet with the following code to open the freshRSS add-feed page with the URL filled in. javascript:(function(){ var freshRssUrl = 'https://[FreshRSS_Domain_URL]/i/?c=feed&a=add&url_rss='; window.open(freshRssUrl + encodeURIComponent(window.location.href)); })() Of course, update the URL to your FreshRSS domain accordingly in that snippet! Another quick tip: Did you know that all Youtube channels have a rss feed? I use these rss feeds to get notifications for any new youtube videos on my favorite channels.

April 13, 2025 路 1 min

Getting reliable WiFi on Thinkpad T440s with Linux

While looking around at my old devices, noticed my trusty old Thinkpad 440s (bought in 2014) which had been gathering dust for a while. Hoping to get some more use out of it, I installed Pop_OS!, but noticed that wifi would get cut-off on a regular basis, and it consistently needed a reboot to get wifi working again. Here is a fun story on how I got it working. The Thinkpad T440s from 2014 came in two flavors, one with an Intel wifi card, and the other a Realtek RTL8192EE card. Mine came with the Realtek adapter, and there are enough stories on the internet around its questionable reliability on both Windows and Linux. Further digging showed there is an alternate driver which had been maintained by Larry Finger, atleast since 2019. Larry Finger passed away in 2024, which means we no longer have someone maintaining it. A quick build on the project showed it no longer builds with the latest kernels, as function signatures have changed in the newer kernels. Luckily, it was a fairly trivial fix, and the resulting code now builds fine for kernel 6.12, which is what Iam currently running. The documentation on how to install it still works well enough. There is an alternate method to install via DKMS, which I did not try. ...

April 9, 2025 路 2 min

Streamline Org-Mode Capture: Disable Browser Prompts for Org-Protocol

I use emacs org-mode to capture links from the browser for later reading, or for archiving. For this purpose, I use a simple bookmarklet to capture the link, title and any selected text, and then use an org-capture template to store the information. However, when i click on the bookmarklet, most browsers throw a pop-up asking for permission to open org-protocol:// links. This security check, while well-intentioned, adds friction every time I try to capture a link. Here's how we can disable this confirmation prompt on Chromium based browsers. ...

April 7, 2025 路 1 min

Trade deficits aren't necessarily bad!

Noah Smith challenges the common perception of trade deficits, using the credit card analogy to illustrate that they represent acquiring more goods in exchange for future financial obligations. This perspective helps us understand how South Korea, for example, leveraged trade deficits to fuel rapid industrial growth, particularly in its manufacturing sector, by importing necessary capital goods. However, the US experience with China demonstrates the potential for trade deficits to contribute to deindustrialization, as seen in the decline of American steel and textile industries. Therefore, while addressing deindustrialization is crucial, tariffs offer a simplistic and potentially harmful solution.

April 6, 2025 路 1 min

Mounting Synology folder share on linux

Accessing files stored on your Synology NAS directly from your Linux machine can be very convenient, whether it's for managing media libraries, accessing shared documents, or performing backups. This guide provides quick steps to mount a Synology share on Ubuntu or its derivatives (like Pop!_OS) using the CIFS protocol, ensuring it's available even after a reboot. Prerequisites On your Synology, go to Control Panel -> File Services -> SMB and check the 'Enable SMB service' option. On your linux machine, install CIFS Utilities sudo apt update sudo apt install cifs-utils Create a mount point where the Synology share will be accessible. Let's use /mnt/nas_media as an example. sudo mkdir /mnt/nas_media ...

April 5, 2025 路 2 min