Category: system admin

Setup up READ_ONLY users on Postgres

To grant access to users for only viewing a database (i.e. no INESRTs or CREATE or UPDATE access) there are certain conditions.

First, access should be only allowed through ssh.

Second, the ssh user should not be able to get into a shell directly.

And finally, the database should restrict access to that particular user with relevant permissions.

Continue reading

PM2 – the best process manager

In the past, on my server I’ve installed Fossil, Syncthing, Bitwarden, Inlets. All these require some form of Process Management. These programs / processes / services need to be always running, so they are restarted in case they get terminated. Also, on a system restart these need to start up automatically.

I’ve mostly used Systemd or Supervisor to all these things.

However, I recently came across PM2 and I was really blown out of my mind as to how simple it was to set it up.

Continue reading

moving from LastPass to bitwarden using vaultwarden (bitwarden_rs)

I have been using LastPass for password management since like forever.

I became a paid customer in 2014. It was initially $1/month. Then it got hiked to $2/month and currently it stands at $3/month. That’s $36/year which was working out too much for me.

Furthermore, the free option is limited to a single type of device. Since I wanted to use it across desktops and mobiles, there was no option except for the $3/month plan.

I had been looking at bitwarden for quite some time now but read that it’s too resource heavy. I then came to know of biwarden_rs which is a rewrite of bitwarden in Rust and compatible with upstream Bitwarden clients. I had then forgotten about this for some time until I head the news of it being renamed to vaultwarden via a Reddit thread.

Continue reading

incomplete list of linux mail commands

As mentioned in the previous post, if you need to run cron jobs in linux, knowing how to debug them via mail is really important.

By the way, mail is the older program, the link above is to the man page of mailx which is the newer program created relatively recently, in 1986!

Navigating through messages in the mailbox is quite a challenge as I found.

So I decided to create a list of the commands which I used most frequently and found useful.

Continue reading

Use Wake-On-LAN to wake up another computer when your PC resumes

Starting up another computer on a network itself is such a fascinating idea! For me, it literally feels like magic!

There are so many things involved. The computer which needs to be started (or woken up) has to have the capability, both at the hardware and the software level.

Also the computer doing the waking needs to send a magic packet!

When I initially heard this, I honestly thought this was a joke of some kind. A magic packet? Really?

Continue reading

pipe localhost to the internet using inlets over Nginx

Many times during developing some application it becomes important to show the progress to someone over the internet.

Most of the time we end up using some screen sharing software. That, however, can only show my screen to the other person. They cannot really interact with the application.

We can use some software for remote desktop sharing but then I cannot work while the other person is using my screen.

One very nice solution is ngrok, which essentially creates a tunnel from the local system to ngrok’s servers and gives a nice URL.

ngrok

However, I was a bit concerned since all my traffic was getting redirected via ngrok’s servers.

I was looking around for something which would do the same thing but via my servers and finally came across inlets. This is an open source project, written in Go, which can be easily self hosted.

Continue reading

nginx auto-index styling

modified nginx index list

I’ve always been envious of the directory listing that Caddy has for serving files. Nginx also has the capability to list directories and files.

This is extremely useful to serve a directory out quickly over LAN or even where it is required to serve a directory listing instead of a web page.

However, the default Nginx styling leaves a lot to be desired!

Continue reading

different ways to run program as root

I discovered that there are many different ways to run a program as root.

The most well known way is to use the sudo command

$> sudo run_as_root_program.sh

This, of course, prompts for the password which you need to then enter.

But what if we need to run the program itself from another program so that the password prompt doesn’t appear?

I came across this requirement recently and it took quite a few iterations before I got it right.

Continue reading

Copyright © 2024 the möbius trip

Theme by Anders NorenUp ↑