feat(wpcarro/blog): Short notes post on sudo tee

See post for more information :)

Change-Id: I1e2c1e3997d895fd64f225b5f0bc91f5b26d3e96
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5940
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
This commit is contained in:
William Carroll 2022-07-11 20:58:23 -07:00 committed by clbot
parent 7885fe99dc
commit 5188c689bf
2 changed files with 23 additions and 0 deletions

View file

@ -43,4 +43,11 @@
content = ./posts/restic.md;
draft = false;
}
{
key = "tee-time";
title = "tee time";
date = 1657597870;
content = ./posts/tee-time.md;
draft = false;
}
]

View file

@ -0,0 +1,16 @@
I encountered this fun TIL while troubleshooting Linux write permissions
issues...
## TL;DR
Don't do this (unless you want misleading test results):
```shell
λ sudo -u node-exporter echo 'Hello, world' >/var/lib/textfile-exporter/test.prom
```
Do this:
```shell
λ echo 'Hello, world' | sudo -u node-exporter tee /var/lib/textfile-exporter/test.prom
```