diff --git a/users/wpcarro/website/blog/posts.nix b/users/wpcarro/website/blog/posts.nix index b791f0365..1dd6930a1 100644 --- a/users/wpcarro/website/blog/posts.nix +++ b/users/wpcarro/website/blog/posts.nix @@ -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; + } ] diff --git a/users/wpcarro/website/blog/posts/tee-time.md b/users/wpcarro/website/blog/posts/tee-time.md new file mode 100644 index 000000000..c8107fcde --- /dev/null +++ b/users/wpcarro/website/blog/posts/tee-time.md @@ -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 +```