Dynamically add programs to PATH on Windows

On Windows, I always prefer to use Portable Apps. I store them in a different drive on my computer. That way, if I have to reinstall my OS, I still have all my apps available.

There’s one catch though. If I want to use the apps directly from the command line or access them programmatically, I have to give the full path to the executable. The only way around it is to update the PATH` environment variable with the directory where the portable app exists.

This gets a little painful and when restoring the system, it takes a whole bunch of time adding these to the PATH environment variable again.

It would be ideal if I had a single folder, which is added to the PATH, and I have some sorts of links or shortcuts there to launch the apps.

However, many apps require that they be run from the directory where they exist, rather than by using a shortcut or link.

To overcome this issue, we need to do things a bit differently.

Continue reading

Enable vi mode in Powershell

How did I not know about this capability?

This is the one thing that I used to miss in Powershell all this while. And just recently I got to know that this can be enabled very simply.

vi mode can be enabled in the profile by adding this –

# Enable Vi editing mode
Set-PSReadLineOption -EditMode Vi

VS Code – disable inline MDN suggestions

VS Code has this setting on by default – as I start typing it tries to suggest some MDN references. It took me forever to figure out how to set this off.

Every time I’m setting up VS Code on a new machine, I forget what this setting is!

"editor.parameterHints.enabled": false,

comment line and duplicate snippet for VS Code with keyboard shortcut

Multiple times during the day, I comment a line and then duplicate it with some minor changes. This whole action does not take much time individually but over the course of days and years, I think I’ve wasted a lot of time on this!

This has been overdue for a long time, and I should have created a snippet for this earlier, but never got around to it.

So, I’ll create a snippet which does exactly that and map it to keyboard shortcuts so that the same shortcut works across multiple programming languages.

Continue reading

Run caddy as a non-root user on Ubuntu

Any process can be run as a non-root user service.

The first criteria to have a service as a non-root user is to have the service be kept running even when the user is not logged in.

However, having a web server places an additional challenge – port 80 and port 443 which are basically the http and the https ports need to be bound by a user with administrative privileges because they are lower ports.

Continue reading

Fossil Activity Graph

I’ve been a bit envious of the activity graph that Github creates for the checkins happening across all repositories by a developer.

Since I’ve always been using fossil across projects, I thought I could do the same with fossil as well.

Fossil repositories being SQLite databases themselves made things a bit easier.

Continue reading

Restrict access to part of path in Nginx

So, I have a site, let’s call it example.com. But I have multiple levels of directories under it. I have directories like /example.com/repositories and the actual repositories at the next level like so example.com/repositories/abcd or example.com/repositories/efgh.

Now, I only want access to example.com/repositories restricted. Everyone should be able to access the root level i.e. example.com and the nested subdirectories i.e. example.com/repositories/*.

Continue reading

Add a confirmation on a rake task

Many times on a rake task it’s better to have a confirmation before continuing the task. This is especially required before important tasks like a deployment or a database migration in production.

Adding a gets doesn’t work at all. To overcome this, we can add a confirm task which is run before the actual task is run.

Continue reading

Copyright © 2026 the möbius trip

Theme by Anders NorenUp ↑