Live data from Hacker News

Server Setup Basics for Self Hosting

becomesovran.com

61–70 of 75 posts

Re: Server Setup Basics for Self Hosting

#62
post #21

I recommend checking out Caddy https://caddyserver.com/ >, which replaces both Nginx and Certbot in this setup. Tailscale https://tailscale.com/ > can remove the need to open port 22 to the world, but I wouldn't rely on it unless your VPS provider has a way to access the server console in case of configuration mistakes.

Regarding tailscale, be sure to remove the expiration flag on your server. That's how I lost mine.

Re: Server Setup Basics for Self Hosting

#63
post #50
post #30

Especially when writing a tutorial for beginners - please use the long-form flags (e.g. sudo usermod --append --groups sudo newuser) instead of short-form flags (e.g. sudo usermod -aG sudo newuser). Short-form flags make commands look like arcane voodoo magic. They make sense only to help you save time entering commands if you know them by heart already. Tutorials are read by beginners who are not necessarily familia…

"Acronyms seriously suck" ~Elon

At least it would be funny if signed by RMS.[0]

[0] He wouldn't as he was a fan of recursive ones.

Re: Server Setup Basics for Self Hosting

#64
post #30

Especially when writing a tutorial for beginners - please use the long-form flags (e.g. sudo usermod --append --groups sudo newuser) instead of short-form flags (e.g. sudo usermod -aG sudo newuser). Short-form flags make commands look like arcane voodoo magic. They make sense only to help you save time entering commands if you know them by heart already. Tutorials are read by beginners who are not necessarily familia…

I would go as far as to say short flags should never be shared or saved (besides man pages or similar). Long flags help anyone who needs to review something in the future, even the author. Perfect for scripts of all sorts, tutorials, anything checked into git, etc.

Re: Server Setup Basics for Self Hosting

#65
post #5

> Differential backups back up all the changes since the last full backup (...) An incremental backup backs up data that was changed since the last backup I'm not sure I understand the distinction?

They both do delta backups, but incremental bases it's delta on previous backup, while differential between the last full backup. To restore from an incremental you need the last full backup and all the incrementals inbetween. If you do say a full backup every month, you'd need up to 30 good incremental backup sets to be able to restore. For the differential you just need the last full backup in addition. Obviously t…

I see, thanks. I only use Restic so this is not relevant to me, but I think I understand the trade-off.

Re: Server Setup Basics for Self Hosting

#66
post #64
post #30

Especially when writing a tutorial for beginners - please use the long-form flags (e.g. sudo usermod --append --groups sudo newuser) instead of short-form flags (e.g. sudo usermod -aG sudo newuser). Short-form flags make commands look like arcane voodoo magic. They make sense only to help you save time entering commands if you know them by heart already. Tutorials are read by beginners who are not necessarily familia…

I would go as far as to say short flags should never be shared or saved (besides man pages or similar). Long flags help anyone who needs to review something in the future, even the author. Perfect for scripts of all sorts, tutorials, anything checked into git, etc.

Powershell recommendations, for instance, are that you keep aliases and short-form for yourself, and long-form for scripts and tutorials.

    Remove-Item -Path X:\test\ -Recurse -Force

    del X:\test -rec -for

Re: Server Setup Basics for Self Hosting

#67
post #32

At the end of the article, there's a link to a script[1] that does the steps covered in the article. That got me thinking: how do other self-hosters/homelabbers here go about automating their server setups? None/purely manual? One big shell script? Multiple scripts wrapped in a Makefile (or justfile, or other command runner)? More enterprisey provisioning/automation tools like Ansible, Puppet, etc.? [1] https://git.s…

I’m using PyInfra [1] these days (no affiliation, just think it’s cool).

It’s like Ansible, but you write Python directly instead of a YAML DSL. Code reuse is as simple as writing modules, importing them, and calling whatever functions you’ve written in normal Python.

I find it almost as easy as writing a shell script, but with most of the advantages of Ansible like idempotency and a post-run status output.

1: https://github.com/pyinfra-dev/pyinfra

Re: Server Setup Basics for Self Hosting

#68
post #2

Love seeing devops post on HN. Wish it included server monitoring as a section.

Server monitoring for self-hosting is kind of hard because it basically necessitates either buying another server to monitor the first, or paying for SaaS.

From personal experience, I would just pay someone else for a SaaS monitoring solution. It will almost universally be cheaper and more reliable.

If you really wanted to run your own, Prometheus is probably the way to go. Local storage should be fine as a data store for self-hosted. Grafana can be used for dashboarding, and either Grafana or AlertManager can do the alerting component.

It’s really not all that worth it for self-hosted scale, though. Running all that in the cloud is going to cost basically the same as buying a DataDog license unless you’re at 3-ish hosts, and more than that if you’re doing clustered monitoring so you aren’t blind if your monitoring host is down.

Re: Server Setup Basics for Self Hosting

#69
post #30

Especially when writing a tutorial for beginners - please use the long-form flags (e.g. sudo usermod --append --groups sudo newuser) instead of short-form flags (e.g. sudo usermod -aG sudo newuser). Short-form flags make commands look like arcane voodoo magic. They make sense only to help you save time entering commands if you know them by heart already. Tutorials are read by beginners who are not necessarily familia…

Yes please! This came up enough for us we standardized on this for all documentation and CI scripts.

https://architecture.lullabot.com/adr/20211006-avoid-command...

Re: Server Setup Basics for Self Hosting

#70

Earlier quoted context omitted.

I've just been doing ssh -v localhost echo 2>&1 | grep continue (obviously replacing "localhost" with whatever server you want, and you can put anything you want where "echo" is but that's the best no-op I've come up with)

The best no-op, if there is such a thing, is probably `:` or `true`.

Oh nice, `:` does work:) I thought that wouldn't work because it was a shell built-in. Thanks!
Post reply on HN