From 4102fec4f8fbec4ca1e85361c74f3bb874456b83 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Tue, 7 Oct 2025 00:19:24 +0000 Subject: [PATCH] Update cheatsheets --- tldr/clusterdb | 21 +++++++++++++++++ tldr/curl | 2 +- tldr/dosbox | 29 +++++++++++++++++++++++ tldr/gh-variable | 41 +++++++++++++++++++++++++++++++++ tldr/git-fast-export | 29 +++++++++++++++++++++++ tldr/kubectl-api-versions | 13 +++++++++++ tldr/kubectl-version | 25 ++++++++++++++++++++ tldr/linux/paccapability | 25 ++++++++++++++++++++ tldr/linux/paccheck | 33 ++++++++++++++++++++++++++ tldr/linux/pacinfo | 33 ++++++++++++++++++++++++++ tldr/linux/pacini | 33 ++++++++++++++++++++++++++ tldr/linux/systemctl-is-active | 25 ++++++++++++++++++++ tldr/linux/systemctl-is-enabled | 22 ++++++++++++++++++ tldr/linux/systemctl-list-units | 38 ++++++++++++++++++++++++++++++ tldr/osx/contactsd | 15 ++++++++++++ tldr/pg_archivecleanup | 29 +++++++++++++++++++++++ tldr/pg_test_timing | 17 ++++++++++++++ tldr/pg_walsummary | 21 +++++++++++++++++ tldr/pip-hash | 25 ++++++++++++++++++++ tldr/pip-index | 29 +++++++++++++++++++++++ tldr/pip-inspect | 33 ++++++++++++++++++++++++++ tldr/pip-wheel | 33 ++++++++++++++++++++++++++ tldr/st-flash | 4 ++-- tldr/stat | 2 +- tldr/uname | 4 ---- tldr/vacuumdb | 37 +++++++++++++++++++++++++++++ 26 files changed, 610 insertions(+), 8 deletions(-) create mode 100644 tldr/clusterdb create mode 100644 tldr/dosbox create mode 100644 tldr/gh-variable create mode 100644 tldr/git-fast-export create mode 100644 tldr/kubectl-api-versions create mode 100644 tldr/kubectl-version create mode 100644 tldr/linux/paccapability create mode 100644 tldr/linux/paccheck create mode 100644 tldr/linux/pacinfo create mode 100644 tldr/linux/pacini create mode 100644 tldr/linux/systemctl-is-active create mode 100644 tldr/linux/systemctl-is-enabled create mode 100644 tldr/linux/systemctl-list-units create mode 100644 tldr/osx/contactsd create mode 100644 tldr/pg_archivecleanup create mode 100644 tldr/pg_test_timing create mode 100644 tldr/pg_walsummary create mode 100644 tldr/pip-hash create mode 100644 tldr/pip-index create mode 100644 tldr/pip-inspect create mode 100644 tldr/pip-wheel create mode 100644 tldr/vacuumdb diff --git a/tldr/clusterdb b/tldr/clusterdb new file mode 100644 index 00000000..376bb91d --- /dev/null +++ b/tldr/clusterdb @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# clusterdb + +> Cluster (reorganize) a PostgreSQL database. +> More information: . + +- Cluster a specific database: + +`clusterdb {{database_name}}` + +- Cluster all databases: + +`clusterdb {{[-a|--all]}}` + +- Cluster a specific table in a database: + +`clusterdb {{[-t|--table]}} {{table_name}} {{database_name}}` diff --git a/tldr/curl b/tldr/curl index fd3870cc..78fc8d65 100644 --- a/tldr/curl +++ b/tldr/curl @@ -34,7 +34,7 @@ source: https://github.com/tldr-pages/tldr.git `curl {{[-d|--data]}} {{'{"name":"bob"}'}} {{[-H|--header]}} {{'Content-Type: application/json'}} {{http://example.com/users/1234}}` -- Pass client certificate and key for a resource, skipping certificate validation: +- Pass client certificate and private key for the request, skipping certificate validation: `curl {{[-E|--cert]}} {{client.pem}} --key {{key.pem}} {{[-k|--insecure]}} {{https://example.com}}` diff --git a/tldr/dosbox b/tldr/dosbox new file mode 100644 index 00000000..ee381d7f --- /dev/null +++ b/tldr/dosbox @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# dosbox + +> MS-DOS emulator to run legacy DOS applications and games. +> More information: . + +- Start DOSBox with default settings: + +`dosbox` + +- Run a DOS executable located at a specific path: + +`dosbox {{path/to/executable.exe}}` + +- Mount a folder as C: and run an executable: + +`dosbox {{path/to/executable.exe}} -c "MOUNT C {{path/to/folder}}"` + +- Start DOSBox in fullscreen mode: + +`dosbox -fullscreen` + +- Exit DOSBox automatically after running a program: + +`dosbox {{path/to/executable.exe}} -exit` diff --git a/tldr/gh-variable b/tldr/gh-variable new file mode 100644 index 00000000..234625a7 --- /dev/null +++ b/tldr/gh-variable @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# gh variable + +> Manage GitHub Actions and Dependabot variables. +> More information: . + +- List variables for the current repository: + +`gh variable {{[ls|list]}}` + +- List variables for a specific organization: + +`gh variable {{[ls|list]}} {{[-o|--org]}} {{organization}}` + +- Get a variable for the current repository: + +`gh variable get {{name}}` + +- Set a variable for the current repository (user will be prompted for the value): + +`gh variable set {{name}}` + +- Set a variable for a deployment environment in the current repository: + +`gh variable set {{name}} {{[-e|--env]}} {{environment_name}}` + +- Set an organization variable visible to all repositories: + +`gh variable set {{name}} {{[-o|--org]}} {{organization}} {{[-v|--visibility]}} all` + +- Set multiple variables from a dotenv file: + +`gh variable set {{[-f|--env-file]}} {{path/to/file.env}}` + +- Delete a variable for the current repository: + +`gh variable delete {{name}}` diff --git a/tldr/git-fast-export b/tldr/git-fast-export new file mode 100644 index 00000000..75e937bc --- /dev/null +++ b/tldr/git-fast-export @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# git fast-export + +> Exports the contents and history of a Git repository in a streamable, plain-text format. +> More information: . + +- Export the entire Git repository history to `stdout`: + +`git fast-export --all` + +- Export the entire repository to a file: + +`git fast-export --all > {{path/to/file}}` + +- Export a specific branch only: + +`git fast-export {{main}}` + +- Export with `progress` statements every `n` objects (for showing progress during `git fast-import`): + +`git fast-export --progress {{n}} --all > {{path/to/file}}` + +- Export only a specific subdirectory’s history: + +`git fast-export --all -- {{path/to/directory}} > {{path/to/file}}` diff --git a/tldr/kubectl-api-versions b/tldr/kubectl-api-versions new file mode 100644 index 00000000..24d898f6 --- /dev/null +++ b/tldr/kubectl-api-versions @@ -0,0 +1,13 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kubectl api-versions + +> Print the supported API versions on the server, in the form of "group/version". +> More information: . + +- Print the supported API versions on the server, in the form of "group/version": + +`kubectl api-versions` diff --git a/tldr/kubectl-version b/tldr/kubectl-version new file mode 100644 index 00000000..58c77370 --- /dev/null +++ b/tldr/kubectl-version @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# kubectl version + +> Print the client and server version information for the current context. +> More information: . + +- Print the client and server version information for the current context: + +`kubectl version` + +- Print the client version only for the current context: + +`kubectl version --client` + +- Output the client and server version information for the current context in JSON: + +`kubectl version {{[-o|--output]}} json` + +- Output the client and server version information for the current context in YAML: + +`kubectl version {{[-o|--output]}} yaml` diff --git a/tldr/linux/paccapability b/tldr/linux/paccapability new file mode 100644 index 00000000..1d162fc2 --- /dev/null +++ b/tldr/linux/paccapability @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# paccapability + +> Query and display the capabilities supported by libalpm. +> More information: . + +- List all available capabilities: + +`paccapability` + +- Check for the specified capability: + +`paccapability {{nls|downloader|signatures}}` + +- Display help: + +`paccapability --help` + +- Display version: + +`paccapability --version` diff --git a/tldr/linux/paccheck b/tldr/linux/paccheck new file mode 100644 index 00000000..6f1c222e --- /dev/null +++ b/tldr/linux/paccheck @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# paccheck + +> Check installed packages on an Arch-based system to verify dependencies, integrity, and consistency. +> More information: . + +- List and check all installed packages: + +`paccheck` + +- Check the specified packages: + +`paccheck {{package1 package2 ...}}` + +- Only display messages if a problem is found: + +`paccheck --quiet` + +- Check that all package dependencies are satisfied: + +`paccheck --depends` + +- Display help: + +`paccheck --help` + +- Display version: + +`paccheck --version` diff --git a/tldr/linux/pacinfo b/tldr/linux/pacinfo new file mode 100644 index 00000000..a085965f --- /dev/null +++ b/tldr/linux/pacinfo @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# pacinfo + +> Display information about installed packages. +> More information: . + +- Display information about a specific package: + +`pacinfo {{package_name}}` + +- Disable low-speed timeouts for downloads: + +`pacinfo --no-timeout {{package_name}}` + +- Display sizes in bytes and date values as Unix timestamps: + +`pacinfo --raw {{package_name}}` + +- Display additional package information: + +`pacinfo --verbose {{package_name}}` + +- Display help: + +`pacinfo --help` + +- Display version: + +`pacinfo --version` diff --git a/tldr/linux/pacini b/tldr/linux/pacini new file mode 100644 index 00000000..508be418 --- /dev/null +++ b/tldr/linux/pacini @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# pacini + +> Query pacman-style configuration files. +> More information: . + +- Show the full parsed configuration file (default: `stdin`): + +`pacini {{path/to/file}}` + +- List configured sections: + +`pacini --section-list` + +- Always show directive names even if only one directive is provided: + +`pacini --verbose {{directive}}` + +- Display directives listed in a specific section: + +`pacini --section {{section_name}}` + +- Display help: + +`pacini --help` + +- Display version: + +`pacini --version` diff --git a/tldr/linux/systemctl-is-active b/tldr/linux/systemctl-is-active new file mode 100644 index 00000000..2ccb177c --- /dev/null +++ b/tldr/linux/systemctl-is-active @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl is-active + +> Check if one or more systemd units are active. +> More information: . + +- Check whether a unit is active: + +`systemctl is-active {{unit}}` + +- Check whether multiple units are active: + +`systemctl is-active {{unit1 unit2 ...}}` + +- Check whether a unit is active without printing the state to `stdout`: + +`systemctl is-active {{[-q|--quiet]}} {{unit}}` + +- Check whether a user unit is active: + +`systemctl is-active --user {{unit}}` diff --git a/tldr/linux/systemctl-is-enabled b/tldr/linux/systemctl-is-enabled new file mode 100644 index 00000000..3b21a7bc --- /dev/null +++ b/tldr/linux/systemctl-is-enabled @@ -0,0 +1,22 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl is-enabled + +> Check whether unit files are enabled. +> See also: `systemctl enable`, `systemctl disable`. +> More information: . + +- Show the enablement state: + +`systemctl is-enabled {{unit1 unit2 ...}}` + +- Suppress output and return only the exit code: + +`systemctl is-enabled {{unit}} --quiet` + +- Show installation targets and symlink paths: + +`systemctl is-enabled {{unit}} --full` diff --git a/tldr/linux/systemctl-list-units b/tldr/linux/systemctl-list-units new file mode 100644 index 00000000..a8f237b2 --- /dev/null +++ b/tldr/linux/systemctl-list-units @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl list-units + +> List units that systemd currently has in memory. +> See also: `systemctl list-unit-files` for listing installed unit files. +> More information: . + +- List units which are active, have pending jobs, or have failed: + +`systemctl list-units` + +- List all units, including inactive ones: + +`systemctl list-units {{[-a|--all]}}` + +- Filter by unit type: + +`systemctl list-units {{[-t|--type]}} {{service|socket|timer|...}}` + +- Filter by state: + +`systemctl list-units --state {{running|listening|dead|...}}` + +- Filter by a name pattern: + +`systemctl list-units 'systemd*'` + +- Print output directly to `stdout`: + +`systemctl list-units --no-pager` + +- Print output without headers or footers (for scripts): + +`systemctl list-units --no-legend` diff --git a/tldr/osx/contactsd b/tldr/osx/contactsd new file mode 100644 index 00000000..c9edeb7e --- /dev/null +++ b/tldr/osx/contactsd @@ -0,0 +1,15 @@ +--- +syntax: markdown +tags: [tldr, osx] +source: https://github.com/tldr-pages/tldr.git +--- +# contactsd + +> Manages the information in your contacts database. +> It provides functionality to apps using the Contacts API and performs various background maintenance tasks. +> It should not be invoked manually. +> More information: . + +- Start the daemon: + +`contactsd` diff --git a/tldr/pg_archivecleanup b/tldr/pg_archivecleanup new file mode 100644 index 00000000..4e8926d7 --- /dev/null +++ b/tldr/pg_archivecleanup @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pg_archivecleanup + +> Remove old WAL archive files in PostgreSQL. +> More information: . + +- Clean an archive directory up to a given WAL file: + +`pg_archivecleanup {{path/to/archive}} {{path/to/walfile}}` + +- Perform a dry run (list files that would be removed without actually doing it): + +`pg_archivecleanup {{[-n|--dry-run]}} {{path/to/archive}} {{path/to/walfile}}` + +- Strip a file extension before deciding deletion: + +`pg_archivecleanup {{[-x|--strip-extension]}} {{extension}} {{path/to/archive}} {{path/to/walfile}}` + +- Remove backup history files too: + +`pg_archivecleanup {{[-b|--clean-backup-history]}} {{path/to/archive}} {{path/to/walfile}}` + +- Enable debug logging output: + +`pg_archivecleanup {{[-d|--debug]}} {{path/to/archive}} {{path/to/walfile}}` diff --git a/tldr/pg_test_timing b/tldr/pg_test_timing new file mode 100644 index 00000000..65cf09c7 --- /dev/null +++ b/tldr/pg_test_timing @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pg_test_timing + +> Measure timing overhead on your system (ensure clock monotonicity). +> More information: . + +- Run the default timing test (3 seconds): + +`pg_test_timing` + +- Run for a custom duration: + +`pg_test_timing {{[-d|--duration]}} {{seconds}}` diff --git a/tldr/pg_walsummary b/tldr/pg_walsummary new file mode 100644 index 00000000..60b2c903 --- /dev/null +++ b/tldr/pg_walsummary @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pg_walsummary + +> Print contents of WAL summary files. +> More information: . + +- Convert a WAL summary file to text: + +`pg_walsummary {{path/to/file}}` + +- Print one line per individual modified block (rather than ranges): + +`pg_walsummary {{[-i|--individual]}} {{path/to/file}}` + +- Suppress normal output (only errors): + +`pg_walsummary {{[-q|--quiet]}} {{path/to/file}}` diff --git a/tldr/pip-hash b/tldr/pip-hash new file mode 100644 index 00000000..914ef410 --- /dev/null +++ b/tldr/pip-hash @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pip hash + +> Compute hashes of package archives for verification. +> More information: . + +- Generate hash for a package file: + +`pip hash {{path/to/package.whl}}` + +- Generate hash using a specific algorithm: + +`pip hash {{[-a|--algorithm]}} {{sha256|sha384|sha512|...}} {{path/to/package.whl}}` + +- Generate hashes for multiple files: + +`pip hash {{path/to/package1.whl path/to/package2.whl ...}}` + +- Generate hash for downloaded archive: + +`pip hash {{path/to/package.tar.gz}}` diff --git a/tldr/pip-index b/tldr/pip-index new file mode 100644 index 00000000..b42f640e --- /dev/null +++ b/tldr/pip-index @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pip index + +> Inspect information available from package indexes. +> More information: . + +- List all available versions of a package: + +`pip index versions {{package}}` + +- List versions from a specific index: + +`pip index versions {{package}} --index-url {{https://test.pypi.org/simple/}}` + +- Include pre-release versions: + +`pip index versions {{package}} --pre` + +- Include an additional index: + +`pip index versions {{package}} --extra-index-url {{https://example.com/simple/}}` + +- List versions for a specific platform: + +`pip index versions {{package}} --platform {{linux_x86_64}}` diff --git a/tldr/pip-inspect b/tldr/pip-inspect new file mode 100644 index 00000000..1226f861 --- /dev/null +++ b/tldr/pip-inspect @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pip inspect + +> Inspect the Python environment and produce a report in JSON format. +> More information: . + +- Inspect the current environment: + +`pip inspect` + +- Inspect and save output to a file: + +`pip inspect > {{environment_report.json}}` + +- Inspect only locally installed packages (not global): + +`pip inspect --local` + +- Inspect only user-installed packages: + +`pip inspect --user` + +- Inspect packages in a specific path: + +`pip inspect --path {{path/to/environment}}` + +- Inspect with verbose output (Note: the `-v` flag can be repeated to increase verbosity): + +`pip inspect {{[-v|--verbose]}}` diff --git a/tldr/pip-wheel b/tldr/pip-wheel new file mode 100644 index 00000000..0c1cc03f --- /dev/null +++ b/tldr/pip-wheel @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pip wheel + +> Build wheel archives for packages and dependencies. +> More information: . + +- Build a wheel for a package: + +`pip wheel {{package}}` + +- Build wheels for packages in requirements file: + +`pip wheel {{[-r|--requirement]}} {{path/to/requirements.txt}}` + +- Build wheel to a specific directory: + +`pip wheel {{package}} {{[-w|--wheel-dir]}} {{path/to/directory}}` + +- Build wheel without dependencies: + +`pip wheel {{package}} --no-deps` + +- Build wheel from local project: + +`pip wheel {{path/to/project}}` + +- Build wheel from Git repository: + +`pip wheel git+{{https://github.com/user/repo.git}}` diff --git a/tldr/st-flash b/tldr/st-flash index f89ca1e8..86425f2a 100644 --- a/tldr/st-flash +++ b/tldr/st-flash @@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git - Read 4096 bytes from the device starting from 0x8000000: -`st-flash read {{firmware}}.bin {{0x8000000}} {{4096}}` +`st-flash read {{firmware}}.bin 0x8000000 4096` - Write firmware to device starting from 0x8000000: -`st-flash write {{firmware}}.bin {{0x8000000}}` +`st-flash write {{firmware}}.bin 0x8000000` - Erase firmware from device: diff --git a/tldr/stat b/tldr/stat index 4cffbfd0..ce1472a4 100644 --- a/tldr/stat +++ b/tldr/stat @@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git `stat {{path/to/file}}` -- Display properties about a specific file such as size, permissions, creation and access dates among others without labels: +- Display properties about a specific file, only showing the raw result data without labels: `stat {{[-t|--terse]}} {{path/to/file}}` diff --git a/tldr/uname b/tldr/uname index c02a15c0..092d11b6 100644 --- a/tldr/uname +++ b/tldr/uname @@ -33,10 +33,6 @@ source: https://github.com/tldr-pages/tldr.git `uname {{[-o|--operating-system]}}` -- Print the current network node host name: - -`uname {{[-n|--nodename]}}` - - Display help: `uname --help` diff --git a/tldr/vacuumdb b/tldr/vacuumdb new file mode 100644 index 00000000..2c094d89 --- /dev/null +++ b/tldr/vacuumdb @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# vacuumdb + +> Garbage-collect and analyze a PostgreSQL database. +> More information: . + +- Vacuum a specific database: + +`vacuumdb {{database_name}}` + +- Vacuum all databases: + +`vacuumdb {{[-a|--all]}}` + +- Vacuum a specific table in a database: + +`vacuumdb {{[-t|--table]}} {{table_name}} {{database_name}}` + +- Vacuum and update statistics for the query planner: + +`vacuumdb {{[-z|--analyze]}} {{database_name}}` + +- Perform a full vacuum (more aggressive, locks tables, rewrites the whole table): + +`vacuumdb {{[-f|--full]}} {{database_name}}` + +- Vacuum with verbose output: + +`vacuumdb {{[-v|--verbose]}} {{database_name}}` + +- Vacuum a database using multiple parallel jobs: + +`vacuumdb --jobs {{number_of_jobs}} {{database_name}}`