Category: system admin

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

change default sudo editor in visudo

For whatever reason, the default editor to change sudo permissions, which pops up when visudo is entered, is set to nano. I don’t have a clue why an option can’t be given on first use to change the editor.

The way to change it is to run the update-alternatives command

$> sudo update-alternatives --config editor

Which gives us these options.

visudo options

Select 3 for vim.basic and we’re back to sanity.

Copyright © 2024 the möbius trip

Theme by Anders NorenUp ↑