From bf8338a66cc2eefbc62ddf411760664c909dbcac Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Wed, 17 Sep 2025 00:19:01 +0000 Subject: [PATCH] Update cheatsheets --- tldr/asciinema | 18 +++++++---- tldr/linux/lvmpersist | 37 ++++++++++++++++++++++ tldr/linux/systemctl-try-reload-or-restart | 21 ++++++++++++ tldr/linux/systemctl-try-restart | 21 ++++++++++++ tldr/omz | 4 +++ tldr/poetry-env | 22 +++++++++---- 6 files changed, 109 insertions(+), 14 deletions(-) create mode 100644 tldr/linux/lvmpersist create mode 100644 tldr/linux/systemctl-try-reload-or-restart create mode 100644 tldr/linux/systemctl-try-restart diff --git a/tldr/asciinema b/tldr/asciinema index 83468673..e3d8f1a8 100644 --- a/tldr/asciinema +++ b/tldr/asciinema @@ -11,28 +11,32 @@ source: https://github.com/tldr-pages/tldr.git - Associate the local install of `asciinema` with an asciinema.org account: -`asciinema auth` +`asciinema {{[a|auth]}}` - Make a new recording and save it to a local file (finish it with `` or type `exit`): -`asciinema rec {{path/to/recording.cast}}` +`asciinema {{[r|record]}} {{path/to/recording.cast}}` - Replay a terminal recording from a local file: -`asciinema play {{path/to/recording.cast}}` +`asciinema {{[p|play]}} {{path/to/recording.cast}}` - Replay a terminal recording hosted on : -`asciinema play https://asciinema.org/a/{{cast_id}}` +`asciinema {{[p|play]}} https://asciinema.org/a/{{cast_id}}` - Make a new recording, limiting any idle time to at most 2.5 seconds: -`asciinema rec {{[-i|--idle-time-limit]}} 2.5` +`asciinema {{[r|record]}} {{[-i|--idle-time-limit]}} 2.5` - Print the full output of a locally saved recording: -`asciinema cat {{path/to/recording.cast}}` +`asciinema {{[ca|cat]}} {{path/to/recording.cast}}` - Upload a locally saved terminal session to asciinema.org: -`asciinema upload {{path/to/recording.cast}}` +`asciinema {{[u|upload]}} {{path/to/recording.cast}}` + +- Stream the current terminal on a local webpage: + +`asciinema {{[st|stream]}} --local` diff --git a/tldr/linux/lvmpersist b/tldr/linux/lvmpersist new file mode 100644 index 00000000..855698d1 --- /dev/null +++ b/tldr/linux/lvmpersist @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# lvmpersist + +> Manage persistent reservations (PR) on block devices or all PVs in a volume group. +> More information: . + +- Start PR on all PVs in a VG with a local key (exclusive access by default): + +`lvmpersist start --ourkey {{0x1234abcd}} --vg {{vg_name}}` + +- Start PR for a shared VG (allow multiple hosts): + +`lvmpersist start --ourkey {{0x1234abcd}} --access {{sh}} --vg {{vg_name}}` + +- Stop PR on a VG and unregister the local key: + +`lvmpersist stop --ourkey {{0x1234abcd}} --vg {{vg_name}}` + +- Take over a local VG by preempting another host while starting PR: + +`lvmpersist start --ourkey {{0xmy_key}} --removekey {{0xother_key}} --vg {{vg_name}}` + +- Remove another host's key from a shared VG: + +`lvmpersist remove --ourkey {{0xmy_key}} --removekey {{0xother_key}} --vg {{vg_name}}` + +- Show registered keys and reservations for a VG: + +`lvmpersist read --vg {{vg_name}}` + +- Operate on specific devices instead of a VG: + +`lvmpersist start --ourkey {{0x1234abcd}} --device {{/dev/sdX}} --device {{/dev/mapper/mpathY}}` diff --git a/tldr/linux/systemctl-try-reload-or-restart b/tldr/linux/systemctl-try-reload-or-restart new file mode 100644 index 00000000..704a38ea --- /dev/null +++ b/tldr/linux/systemctl-try-reload-or-restart @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl try-reload-or-restart + +> Reload one or more units if they support it; otherwise restart them. +> More information: . + +- Reload or restart a specific unit: + +`systemctl try-reload-or-restart {{unit}}` + +- Reload or restart multiple units: + +`systemctl try-reload-or-restart {{unit1 unit2 ...}}` + +- Reload or restart all units matching a pattern: + +`systemctl try-reload-or-restart '{{pattern}}'` diff --git a/tldr/linux/systemctl-try-restart b/tldr/linux/systemctl-try-restart new file mode 100644 index 00000000..1c8fa270 --- /dev/null +++ b/tldr/linux/systemctl-try-restart @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl try-restart + +> Restart one or more units only if they are currently running. +> More information: . + +- Restart a specific unit if it is running: + +`systemctl try-restart {{unit}}` + +- Restart multiple units if they are running: + +`systemctl try-restart {{unit1 unit2 ...}}` + +- Restart all units matching a pattern if they are running: + +`systemctl try-restart '{{pattern}}'` diff --git a/tldr/omz b/tldr/omz index d3456424..d014b12e 100644 --- a/tldr/omz +++ b/tldr/omz @@ -24,6 +24,10 @@ source: https://github.com/tldr-pages/tldr.git `omz plugin list` +- List all enabled plugins: + +`omz plugin list --enabled` + - Enable/Disable an Oh My Zsh plugin: `omz plugin {{enable|disable}} {{plugin}}` diff --git a/tldr/poetry-env b/tldr/poetry-env index d7a14477..ff8d7089 100644 --- a/tldr/poetry-env +++ b/tldr/poetry-env @@ -5,26 +5,34 @@ source: https://github.com/tldr-pages/tldr.git --- # poetry-env -> Manage virtualenvs associated with a Poetry project. +> Manage virtual environments associated with a Poetry project. > See also: `asdf`. > More information: . -- Print the command to activate a virtualenv: +- Print the command to activate a virtual environment: `poetry env activate` -- Display information about the current environment (-p or -e will display the environment's path or executable): +- Display information about the current environment: -`poetry env info {{[-p|--path]}} {{[-e|--executable]}}` +`poetry env info` -- List all virtualenvs associated with the current project (optionally showing the full path): +- Display the path of the current environment: + +`poetry env info {{[-p|--path]}}` + +- Display the path of the current environment's Python executable: + +`poetry env info {{[-e|--executable]}}` + +- List all virtual environments associated with the current project (optionally showing the full path): `poetry env list --full-path` -- Remove specific or all virtualenvs associated with the current project: +- Remove specific or all virtual environments associated with the current project: `poetry env remove python {{path/to/executable|environment_name}} | poetry env remove --all` -- Activate or create a virtualenv for the project using the specified python executable: +- Activate or create a virtual environment for the project using the specified Python executable: `poetry env use python {{path/to/executable}}`