RSSAmplifier

Blog

The Perpetual Amateur

Recent content on The Perpetual Amateur

/RSS feed ↗29 posts

Latest posts

Run Gemini CLI Safely with Firejail

I have always had a strict policy against running JS applications. But gemini-cli looked promising, and I wanted to use it outside of a throwaway VM. A friend introduced me to firejail , which runs programs in a (configurable) restricted environment. This meant I could safely use tools like gemini-cli and reduce my exposure to the ever-present supply chain attacks in the JavaScript world. §…

Self Hosting Gitlab using Quadlets

§ What are Quadlets? I self-host most of my services important to me personally. Lately, I have been using Quadlets for this. I came across the concept of Quadlets from Immich. For git repositories, I have been just using git init --bare in a server and plain SSH to work them: git clone git@<user>:sources/<repo> . Having used Quadlets with Immich, I thought of trying using them with Gitlab. And…

Bootstrapping pipx for the obsessed

Managing Python based applications is made easy with pipx . But I dislike installing pipx via a pip user install, as it results in two python utilities managing packages. So, instead I let pipx manage it&rsquo;s own updates. Here&rsquo;s how we can do it on a Debian system: Install python3-pip , with: $ sudo apt install python3-pip Install pipx: $ pip install --user pipx Didn&rsquo;t we want avoid…

Cross Compiling Rust Binaries with Github Actions

Compiling rust is slow, specially on low power devices such as a Raspberry Pi . I build all my rust utilities with my RPi 4 and sync to the rest with syncthing . That was true for my project, sysit , as well. I use sysit on all my systems to keep tabs on the resource usage. Inspired from how skim utilizes cross compilation to build binaries directly using Github workflows, I incorporated a similar…

Encrypting a home in a Raspberry Pi

;tldr Use fscrypt to encrypt your home partition, with a few simple steps. § Why encryption? I prefer to encrypt all my (and my family&rsquo;s) storage at rest. Encryption is useful in scenarios where someone gains physical access to your device. This may save you from any losses other than the material cost of the device. Specially with a Raspberry Pi, it is more of a worry as how tiny the device…

Hopping across the country with WireGuard

I need to be able to access all the computers over the internet as they are spread across the country: descartes : My dad&rsquo;s Debian desktop (1800 km away). kant : RPi 3 running Arch (a NAS, printer, a wormhole). camus : RPi 4 running Manjaro (my personal work machine). nietzsche : My wife&rsquo;s Manjaro notebook. Phones: newton , feyman , einstine and sagan . kepler : a tiny Debian on Google…

Cooling the Raspberry Pi 4 with Argon Neo

The Raspberry Pi 4 runs hot, specially when overclocked. As I use it as my programming machine for my personal projects, I wanted to get the most out of its CPU. The first case I ordered for my Pi came with a fan which worked on 3.3V and 5V (too noisy). I setup a circuit which would allow me to turn it on/off via a GPIO pin controlled by this python based service , which turns the fan on/off based…

Some Light in the Background

§ tl;dr Dark backgrounds are the best. But when one accidentally land somewhere with a light background with eyes trained for dark, it can hurt. So, one may as well just make everything light for consistency. We love dark backgrounds. They are easier on the eyes, comfortable to work with in the night/dark rooms. So, we&rsquo;d like everything that we see on the screen to be dark. And that&rsquo;s…

Window Management in OSX with Spark

I am a big fan of deterministic access to applications windows. That is, to be able to open them without needing any visual feedback from the screen. Tiling window managers do this well. On OSX, this can be tricky. For a long time, I used a two windows workflow i.e. all the applications I need should run in just two windows (applications): the browser (mail, slack etc.) or the terminal (emacs,…

The Purpose Of It All

If you have some time, I&rsquo;d recommend reading The Myth of Sysiphus instead. The mind is free, with not much to worry about and starts to wander. It lands on the question: &ldquo;What is the meaning of it all?&rdquo;. Its not difficult to arrive at the answer: &ldquo;There isn&rsquo;t a meaning, really&rdquo;, and sets in an existential crisis. But, I&rsquo;d argue that there is a flaw in the…

Dynamic DNS with Cloudflare

It is hard to maintain a regular internet uptime with home connections. 1/2 router re-connections per week can be fairly common. When that happens, the public IP changes with most ISPs. This can be annoying if you want access your computer remotely (possibly to SSH home). Dynamic DNS is a solution that exists to solve just that. I maintain DNS entries for my domain at Clouflare . The latest…

The two windows workflow

I was introduced to OSX for the first time in September, 2015. Coming from a XMonad/Linux based setup, I was accustomed to powerful and fast window management. Most available solutions for OSX did not have these qualities. I tried: Amethyst , a window manager with basic XMonad bindings. Just type the application name in Alfred . Initially this was slow, but quickly became habitual. Mjolinr , which…

Decentralized Twitter

As a social network, twitter has a few fairly unique characteristics: It forces people to be more creative in trying to express the idea within 140 characters. Ability to control the content that you receive. Stricter filtering is possible based on one&rsquo;s interests. On platforms such as Quora/Facebook, the feed is not deterministic. That&rsquo;s not the case with twitter. You see tweets in…

Find my code at Github

You can find most of the public code I have written at Github .

Navigating with the first telescope

In my previous post , I wrote about my initial experiences with stargazing - primarily to demonstrate that it can be fascinating without fancy equipment. After those initial sessions, I bought a telescope which magnified my experience significantly. Stars. Stars everywhere! § The Telescope The primary purpose of an (astronomical) telescope, unlike popular belief, is not actually magnification.…

Gazing in the night sky

About 6 months ago, I picked up a new hobby: Stargazing. Starting off with just naked eyes, I quickly realized that there is actually quite a lot to see without any optical equipment. Sky Map and Stellarium are incredibly useful applications for a dilettante like me. § Dark adjustment Before any stargazing session, dark adjustment i.e. dilating the pupils completely to improve night vision, is…

You have infinite email addresses

tl;dr You can add arbitrary tags to your email address. Any email sent to your-email+tag@your-provider.ext will land in the inbox for your-email@your-provider.ext . Emails are important. They are your identity on the web. Just like on phone, you&rsquo;d want to control who can contact you via email. This warrants caution in signing up at places on the internet. It can be unsafe to register with…

About Me

Hi, I am Rohan. I read and write code. I frequently read about physics, energy and climate change. After getting depressed enough of the latter, I read fiction or annoy my friends with my ideas or just code. I like to play table tennis, cricket and chess. I also bought a harmonica. Keep your hands on ears if you see me holding it. And yeah, I maintain a blog, which is so devoid of activity that it…

Categorizing archives by year with Hakyll

Recently, I decided to categorize my posts under directories named by the year they were created in. For example, this post is placed at: posts/2015/hakyll-years.mkd . I decided to utilize this structure to also group how archives are listed. Inspired from Hakyll&rsquo;s tag functionality I wrote my own group by years functionality. This post tries to explain that. Also, I don&rsquo;t see why a…

Clean URLs with Hakyll

The URLs generated by Hakyll , by default also include a .html extension. I have never been a fan of this. When things in reality are driven by the Content-Type header, it is absolutely redundant. Hakyll provides all the utilities with which we can get cleaner URLs, like this page&rsquo;s . For this, I rely on the fact that most of the web servers automatically serve /foo/index.html for the URL…

Sitemap with Hakyll

Its fairly trivial to configure Hakyll to generate sitemaps. Sitemaps helps search engines websites. Similar to any typical html page, create a template - templates/sitemap.xml : <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> $for(entries)$ <url> <loc>$host$$url$</loc> <changefreq>weekly</changefreq>…

Testing tornado websockets without third party clients

Recently, I built an encrypted chat service , which was based on tornado and ember.js . The project itself had grave security issues, so I shut it down, but while working on it I learned a few new things and testing websockets with tornado is one of them. Most of the material out there for this suggests developing separate client based tests, which I didn&rsquo;t want to do. Eventually, I figured…

Using pulseaudio to play system beeps

Recently, I built a new desktop. After receiving everything, I realized that I was missing the onboard speaker (which creates the annoying beep sound). Ideally, the computer case should have had it, but they don&rsquo;t come with a buzzer anymore. My various applications rely on the system beep, hence I needed to find a software alternative. Turns out it is fairly trivial to configure it to…

Switch between networks based on availability

Having been blessed with an unreliable internet, I always have had the need to change the default route when one goes down. ip provides you the required tooling to do that. I had been doing it so often, that I ended up writing a function to do this: route_to () { interface=$1 route=$(ip route | grep $interface | sed -r 's/\.0\/[[:digit:]]{2,3} /.1 /' | cut -d ' ' -f -4) if [ -n "$route" ]; then…

VNC over reverse SSH

Note: My recent article , talking about WireGuard is a better and more ergonomic approach to achive this, compared to using reverse SSH. About a year ago, I switched my parents computer (lets call it P ) from the pre-installed OS (Windows) to Ubuntu. The primary reason for this switch was it hard for me to debug and fix issues. Things have been smooth after the switch with no issues which I found…

The ubiquitous shell

Nothing makes a terminal feel more like home as one&rsquo;s own shell configuration. My shell is bash, configured through a .bashrc and .profile . Bash is likely to be present in any Unix machine one uses. Bash is also my primary IDE. This allows for keeping a relatively simple set of utilities and tools to internalize. Coupled with a reliable window manager, workflows can be quickly scripted in…

Emacs: Flymake with virtualenvs in python-mode

Lately, I have been writing some python with emacs. So, I have been trying to get the popular checkers ( pylint / pyflakes ) to work with flymake and virtualenvs. The issues with existing solutions to get flymake working with the checkers is that most of them assume a global version of executable (which would be fine if it weren&rsquo;t for the whole python 2 and 3 incompatibility). The…

A productive workflow with vim sessions and servers

You can find lot of posts on the internet which try to tell you how to improve the ways in which Vim is used. Well, here is another one. § Vim Server, ZSH and Tiles A Vim instance behaves as a server in which files can be opened through remote applications. Read :help client-server of Vim to know more about this. I generally keep multiple Vim sessions running, described by task they are related…

Configure ssh to handle proxies and tunnels seamlessly

Recently I opened up on the port 443 over my EC2 instance (more or less like a VPS), so that I can access it through any firewalled proxy too. Apart from getting SSH running to a machine from outside world, I did some cool configuration to have ssh deal with with various remote hosts automatically. It uses the right proxy settings according the host being accessed. All the stuff which runs over…