From 7bb915f683c58ec7946a91c8b676f7305d5aba73 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 4 Sep 2025 00:18:21 +0000 Subject: [PATCH] Update cheatsheets --- tldr/choose | 8 ++++---- tldr/linux/gksu | 32 ++++++++++++++++++++++++++++++++ tldr/linux/gksudo | 32 ++++++++++++++++++++++++++++++++ tldr/linux/lvchange | 33 +++++++++++++++++++++++++++++++++ tldr/linux/lvconvert | 29 +++++++++++++++++++++++++++++ tldr/linux/pacman-sync | 2 +- tldr/npm-ls | 16 ++++++++++------ tldr/pbzip2 | 4 ++++ tldr/pngcheck | 2 +- tldr/rbw | 41 +++++++++++++++++++++++++++++++++++++++++ tldr/ts-node | 10 +++++----- 11 files changed, 192 insertions(+), 17 deletions(-) create mode 100644 tldr/linux/gksu create mode 100644 tldr/linux/gksudo create mode 100644 tldr/linux/lvchange create mode 100644 tldr/linux/lvconvert create mode 100644 tldr/rbw diff --git a/tldr/choose b/tldr/choose index c5fa3acb..eb5fc36c 100644 --- a/tldr/choose +++ b/tldr/choose @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # choose > A human-friendly and fast alternative to cut and (sometimes) awk. -> More information: . +> More information: . - Print the 5th item from a line (starting from 0): @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - Print the first, 3rd, and 5th item from a line, where items are separated by ':' instead of whitespace: -`choose --field-separator '{{:}}' {{0}} {{2}} {{4}}` +`choose {{[-f|--field-separator]}} '{{:}}' {{0}} {{2}} {{4}}` - Print everything from the 2nd to 5th item on the line, including the 5th: @@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git - Print everything from the 2nd to 5th item on the line, excluding the 5th: -`choose --exclusive {{1}}:{{4}}` +`choose {{[-x|--exclusive]}} {{1}}:{{4}}` - Print the beginning of the line to the 3rd item: @@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git - Print all items from the beginning of the line until the 3rd item (exclusive): -`choose --exclusive :{{2}}` +`choose {{[-x|--exclusive]}} :{{2}}` - Print all items from the 3rd to the end of the line: diff --git a/tldr/linux/gksu b/tldr/linux/gksu new file mode 100644 index 00000000..370043f5 --- /dev/null +++ b/tldr/linux/gksu @@ -0,0 +1,32 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# gksu + +> Frontend for `su`. +> Allows you to run graphical commands which need root access without having to run an X terminal emulator. +> Note: This command is deprecated in favor of commands like `pkexec`, and is no longer maintained. +> See also: `gksudo`. +> More information: . + +- Run a command as a specific user: + +`gksu {{[-u|--user]}} {{userid}} {{command}}` + +- Run the command while preserving the current environments: + +`gksu {{[-u|--user]}} {{userid}} {{[-k|--preserve-env]}} {{command}}` + +- Force `gksu` to use `su` to run the command: + +`gksu {{[-u|--user]}} {{userid}} {{[-w|--su-mode]}} {{command}}` + +- Force `gksu` to use `sudo` to run the command: + +`gksu {{[-u|--user]}} {{userid}} {{[-S|--sudo-mode]}} {{command}}` + +- Output debug info for the given command: + +`gksu {{[-u|--user]}} {{userid}} {{[-d|--debug]}} {{command}}` diff --git a/tldr/linux/gksudo b/tldr/linux/gksudo new file mode 100644 index 00000000..02c8d610 --- /dev/null +++ b/tldr/linux/gksudo @@ -0,0 +1,32 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# gksudo + +> Frontend for `sudo`. +> Allows you to run graphical commands which need root access without having to run an X terminal emulator. +> Note: This command is deprecated in favor of commands like `pkexec`, and is no longer maintained. +> See also: `gksu`. +> More information: . + +- Run a command as a specific user: + +`gksudo {{[-u|--user]}} {{userid}} {{command}}` + +- Run the command while preserving the current environments: + +`gksudo {{[-u|--user]}} {{userid}} {{[-k|--preserve-env]}} {{command}}` + +- Force `gksudo` to use `su` to run the command: + +`gksu {{[-u|--user]}} {{userid}} {{[-w|--su-mode]}} {{command}}` + +- Force `gksudo` to use `sudo` to run the command: + +`gksudo {{[-u|--user]}} {{userid}} {{[-S|--sudo-mode]}} {{command}}` + +- Output debug info for the given command: + +`gksudo {{[-u|--user]}} {{userid}} {{[-d|--debug]}} {{command}}` diff --git a/tldr/linux/lvchange b/tldr/linux/lvchange new file mode 100644 index 00000000..a74393fb --- /dev/null +++ b/tldr/linux/lvchange @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# lvchange + +> Change attributes or the activation state of logical volumes. +> More information: . + +- Activate a logical volume: + +`lvchange {{[-a|--activate]}} y {{/dev/vg_name/lv_name}}` + +- Deactivate a logical volume: + +`lvchange {{[-a|--activate]}} n {{/dev/vg_name/lv_name}}` + +- Enable autoactivation for a logical volume: + +`lvchange {{[-a|--activate]}} ay {{/dev/vg_name/lv_name}}` + +- Set a logical volume to read-only (use `rw` for read-write): + +`lvchange {{[-p|--permission]}} r {{/dev/vg_name/lv_name}}` + +- Skip activation for a logical volume: + +`lvchange {{[-k|--setactivationskip]}} y {{/dev/vg_name/lv_name}}` + +- Refresh a logical volume using the latest metadata: + +`lvchange --refresh {{/dev/vg_name/lv_name}}` diff --git a/tldr/linux/lvconvert b/tldr/linux/lvconvert new file mode 100644 index 00000000..b414e236 --- /dev/null +++ b/tldr/linux/lvconvert @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# lvconvert + +> Convert or modify the type, redundancy, or state of logical volumes. +> More information: . + +- Convert a linear logical volume to RAID1 (add one mirror: two copies total): + +`lvconvert --type raid1 {{[-m|--mirrors]}} 1 {{/dev/vg_name/lv_name}}` + +- Remove mirroring and convert back to a linear logical volume: + +`lvconvert {{[-m|--mirrors]}} 0 {{/dev/vg_name/lv_name}}` + +- Merge a snapshot back into its origin logical volume (applies on next activation): + +`lvconvert --merge {{/dev/vg_name/snapshot_lv}}` + +- Repair a degraded RAID logical volume: + +`lvconvert --repair {{/dev/vg_name/lv_name}}` + +- Convert an existing logical volume into a thin pool with a separate metadata LV: + +`lvconvert --type thin-pool --poolmetadata {{/dev/vg_name/pool_metadata_lv}} {{/dev/vg_name/pool_lv}}` diff --git a/tldr/linux/pacman-sync b/tldr/linux/pacman-sync index 2bfa3a6c..49219672 100644 --- a/tldr/linux/pacman-sync +++ b/tldr/linux/pacman-sync @@ -33,7 +33,7 @@ source: https://github.com/tldr-pages/tldr.git `sudo pacman -Syu --overwrite {{path/to/file}}` -- Remove not installed packages and unused repositories from the cache (use the flags `Sc` to [c]lean all packages): +- Remove not installed packages and unused repositories from the cache (use the flags `Scc` to [c]lean all packages): `sudo pacman -Sc` diff --git a/tldr/npm-ls b/tldr/npm-ls index 6ca85dc9..99ad0db1 100644 --- a/tldr/npm-ls +++ b/tldr/npm-ls @@ -8,22 +8,26 @@ source: https://github.com/tldr-pages/tldr.git > Print installed packages to `stdout`. > More information: . -- Print all versions of direct dependencies to `stdout`: +- Print all versions of direct dependencies in the current project to `stdout`: -`npm ls` +`npm {{[ls|list]}}` - Print all installed packages including peer dependencies: -`npm ls {{[-a|--all]}}` +`npm {{[ls|list]}} {{[-a|--all]}}` + +- Print all globally installed packages: + +`npm {{[ls|list]}} {{[-g|--global]}}` - Print dependencies with extended information: -`npm ls {{[-l|--long]}}` +`npm {{[ls|list]}} {{[-l|--long]}}` - Print dependencies in parseable format: -`npm ls {{[-p|--parseable]}}` +`npm {{[ls|list]}} {{[-p|--parseable]}}` - Print dependencies in JSON format: -`npm ls --json` +`npm {{[ls|list]}} --json` diff --git a/tldr/pbzip2 b/tldr/pbzip2 index 15116f57..e8c205d4 100644 --- a/tldr/pbzip2 +++ b/tldr/pbzip2 @@ -17,6 +17,10 @@ source: https://github.com/tldr-pages/tldr.git `pbzip2 -p{{4}} {{path/to/file}}` +- Compress in combination with tar (options can be passed to `pbzip2`): + +`tar -cf {{path/to/compressed_file}}.tar.bz2 {{[-I|--use-compress-program]}} "pbzip2 {{-option1 -option2 ...}}" {{path/to/file}}` + - Decompress a file: `pbzip2 {{[-d|--decompress]}} {{path/to/compressed_file.bz2}}` diff --git a/tldr/pngcheck b/tldr/pngcheck index 9e08bfc7..70deca26 100644 --- a/tldr/pngcheck +++ b/tldr/pngcheck @@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git > Forensics tool for validating the integrity of PNG based (PNG, JNG, MNG) image files. > Can also extract embedded images and text from a file. -> More information: . +> More information: . - Verify the integrity of an image file (width, height, and color depth): diff --git a/tldr/rbw b/tldr/rbw new file mode 100644 index 00000000..d2fc2985 --- /dev/null +++ b/tldr/rbw @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# rbw + +> Unofficial Bitwarden-compatible password manager. +> More information: . + +- Log in to the vault: + +`rbw login` + +- Unlock the vault: + +`rbw unlock` + +- List all items in the vault: + +`rbw list` + +- Get a password for an entry: + +`rbw get "{{entry_name}}"` + +- Get a username for an entry: + +`rbw get {{[-f|--field]}} username "{{entry_name}}"` + +- Copy a password to the clipboard: + +`rbw get {{[-c|--clipboard]}} "{{entry_name}}"` + +- Generate a new password with the specified number of characters: + +`rbw generate {{password_length}}` + +- Lock the vault: + +`rbw lock` diff --git a/tldr/ts-node b/tldr/ts-node index da978b7d..a45951b7 100644 --- a/tldr/ts-node +++ b/tldr/ts-node @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # ts-node > Run TypeScript code directly, without any compiling. -> More information: . +> More information: . - Execute a TypeScript file without compiling (`node` + `tsc`): @@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git - Execute a TypeScript file without loading `tsconfig.json`: -`ts-node --skip-project {{path/to/file.ts}}` +`ts-node --skipProject {{path/to/file.ts}}` - Evaluate TypeScript code passed as a literal: -`ts-node --eval '{{console.log("Hello World")}}'` +`ts-node {{[-e|--eval]}} '{{console.log("Hello World")}}'` - Execute a TypeScript file in script mode: @@ -26,8 +26,8 @@ source: https://github.com/tldr-pages/tldr.git - Transpile a TypeScript file to JavaScript without executing it: -`ts-node --transpile-only {{path/to/file.ts}}` +`ts-node {{[-T|--transpileOnly]}} {{path/to/file.ts}}` - Display help: -`ts-node --help` +`ts-node {{[-h|--help]}}`