From 18aa2714fc758de0472d762c1d78cfba80e37492 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Tue, 20 May 2025 00:20:40 +0000 Subject: [PATCH] Update cheatsheets --- tldr/biff | 41 +++++++++++++++++++++++++++++++++++++++++ tldr/dunstctl | 33 +++++++++++++++++++++++++++++++++ tldr/dunstify | 26 ++++++++++++++++++++++++++ tldr/espeak | 2 +- tldr/git-for-each-ref | 41 +++++++++++++++++++++++++++++++++++++++++ tldr/notify-send | 29 +++++++++++++++++++++++++++++ tldr/ntp-ctl | 21 +++++++++++++++++++++ 7 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 tldr/biff create mode 100644 tldr/dunstctl create mode 100644 tldr/dunstify create mode 100644 tldr/git-for-each-ref create mode 100644 tldr/notify-send create mode 100644 tldr/ntp-ctl diff --git a/tldr/biff b/tldr/biff new file mode 100644 index 00000000..c7a21e96 --- /dev/null +++ b/tldr/biff @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# biff + +> A simple utility for doing datetime arithmetic, parsing and formatting. +> More information: . + +- Print the current time in a format of your choosing: + +`biff time fmt {{[-f|--format]}} rfc3339 now` + +- Print multiple relative times in one command: + +`biff time fmt {{[-f|--format]}} '%c' now -1d 'next sat' 'last monday' '9pm last mon'` + +- Print the current time in another time zone, and round it the nearest 15 minute increment: + +`biff time in Asia/Bangkok now | biff time round {{[-i|--increment]}} 15 {{[-s|--smallest]}} minute` + +- Convert a time between two different time zone: + +`TZ='Japan' biff time in America/New_York 02:30` + +- Print a past or future time relative to current time: + +`biff time add {{-1d|1d|1w|-1m|1y|...}} now` + +- Add a complex duration to the current time: + +`biff time add '1 week, 12 hours ago' now` + +- Find the duration since a date in the past and round it to the desired precision: + +`biff span since 2025-01-20T12:00 {{[-l|--largest]}} year` + +- Find timestamps in a log file and reformat them into your local time in place: + +`biff tag lines /tmp/access.log | biff time in system | biff time fmt {{[-f|--format]}} '%c' | head {{[-n|--lines]}} 3 | biff untag {{[-s|--substitute]}}` diff --git a/tldr/dunstctl b/tldr/dunstctl new file mode 100644 index 00000000..de5dbabc --- /dev/null +++ b/tldr/dunstctl @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# dunstctl + +> Control the `dunst` notification daemon. +> More information: . + +- Pause/Unpause/Toggle desktop notifications: + +`dunstctl set-paused {{true|false|toggle}}` + +- Close all notifications: + +`dunstctl close-all` + +- Delete all notifications from history: + +`dunstctl history-clear` + +- Display the latest notification from history: + +`dunstctl history-pop` + +- Reload the configuration file: + +`dunstctl reload` + +- Display help: + +`dunstctl {{[-h|--help]}}` diff --git a/tldr/dunstify b/tldr/dunstify new file mode 100644 index 00000000..8ac1588f --- /dev/null +++ b/tldr/dunstify @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# dunstify + +> A notification tool that is an extension of `notify-send`, but has more features based around `dunst`. +> Accepts all options of `notify-send`. +> More information: . + +- Show a notification with a given title and message: + +`dunstify "{{Title}}" "{{Message}}"` + +- Show a notification with the specified urgency: + +`dunstify "{{Title}}" "{{Message}}" {{[-u|--urgency]}} {{low|normal|critical}}` + +- Specify a message ID (overwrites any previous messages with the same ID): + +`dunstify "{{Title}}" "{{Message}}" {{[-r|--replace]}} {{123}}` + +- Display help: + +`dunstify {{[-?|--help]}}` diff --git a/tldr/espeak b/tldr/espeak index 75826aa2..32fc2405 100644 --- a/tldr/espeak +++ b/tldr/espeak @@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git --- # espeak -> Uses text-to-speech to speak through the default sound device. +> Use text-to-speech to speak through the default sound device. > More information: . - Speak a phrase aloud: diff --git a/tldr/git-for-each-ref b/tldr/git-for-each-ref new file mode 100644 index 00000000..6efe851c --- /dev/null +++ b/tldr/git-for-each-ref @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# git for-each-ref + +> List and optionally format references (branches, tags) in a Git repository. +> More information: . + +- List all refs (branches and tags): + +`git for-each-ref` + +- List only branches: + +`git for-each-ref refs/heads/` + +- List only tags: + +`git for-each-ref refs/tags/` + +- Show branches merged into HEAD: + +`git for-each-ref --merged HEAD refs/heads/` + +- List short names of all refs: + +`git for-each-ref --format "%(refname:short)"` + +- Sort refs by committer date (most recent first): + +`git for-each-ref --sort -committerdate` + +- Sort refs by committer date (oldest first): + +`git for-each-ref --sort committerdate` + +- Limit output to a specified number of refs: + +`git for-each-ref --count {{count}}` diff --git a/tldr/notify-send b/tldr/notify-send new file mode 100644 index 00000000..2266e918 --- /dev/null +++ b/tldr/notify-send @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# notify-send + +> Use the current desktop environment's notification system to create a notification. +> More information: . + +- Show a notification with the title "Test" and the content "This is a test": + +`notify-send "{{Test}}" "{{This is a test}}"` + +- Show a notification with a custom icon: + +`notify-send {{[-i|--icon]}} {{icon.png}} "{{Test}}" "{{This is a test}}"` + +- Show a notification for 5 seconds: + +`notify-send {{[-t|--expire-time]}} 5000 "{{Test}}" "{{This is a test}}"` + +- Show a notification with the specified urgency level (default: normal): + +`notify-send {{[-u|--urgency]}} {{low|normal|critical}} "{{Test}}" "{{This is a test}}"` + +- Show a notification with an app's icon and name: + +`notify-send "{{Test}}" {{[-i|--icon]}} {{google-chrome}} {{[-a|--app-name]}} "{{Google Chrome}}"` diff --git a/tldr/ntp-ctl b/tldr/ntp-ctl new file mode 100644 index 00000000..7ab435ec --- /dev/null +++ b/tldr/ntp-ctl @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# ntp-ctl + +> Management client for the `ntpd-rs` daemon. +> More information: . + +- Display information about the current state of the NTP daemon: + +`ntp-ctl status` + +- Check if the specified configuration file (default: `/etc/ntpd-rs/ntp.toml`) is valid: + +`ntp-ctl {{[-c|--config]}} {{path/to/config}} validate` + +- Interactively run a single synchronization of the clock: + +`sudo ntp-ctl force-sync`