From 821daeffe6491ad990582aa8a0f63634a2c978fc Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Sat, 11 Jun 2022 13:23:05 +0200 Subject: [PATCH] Add first snippet --- content/posts/my-first-post.md | 6 ------ content/snippets/seconds-since-last-pacman-sync.md | 11 +++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 content/posts/my-first-post.md create mode 100644 content/snippets/seconds-since-last-pacman-sync.md diff --git a/content/posts/my-first-post.md b/content/posts/my-first-post.md deleted file mode 100644 index a7210b0..0000000 --- a/content/posts/my-first-post.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "My First Post" -date: 2022-06-11T11:00:47Z -draft: true ---- - diff --git a/content/snippets/seconds-since-last-pacman-sync.md b/content/snippets/seconds-since-last-pacman-sync.md new file mode 100644 index 0000000..4b9d7c3 --- /dev/null +++ b/content/snippets/seconds-since-last-pacman-sync.md @@ -0,0 +1,11 @@ +--- +title: "Seconds since last pacman sync" +date: 2022-05-19T08:45:13Z +draft: false +--- + +We can echo the result of the current timestamp subtracted from the last edit timestamp in `/var/lib/pacman/local/*/desc`. + +``` +echo $(expr $(date +%s) - $(grep -rn -A 1 %INSTALLDATE% /var/lib/pacman/local/*/desc | grep -oP '\d{10,}$' | sort | tail -1)) +``` \ No newline at end of file