Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-07 00:19:24 +00:00
parent 3e6fa5fca1
commit 4102fec4f8
26 changed files with 610 additions and 8 deletions

21
tldr/clusterdb Normal file
View File

@@ -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: <https://www.postgresql.org/docs/current/app-clusterdb.html>.
- 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}}`

View File

@@ -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}}`

29
tldr/dosbox Normal file
View File

@@ -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: <https://www.dosbox.com/wiki/Usage>.
- 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`

41
tldr/gh-variable Normal file
View File

@@ -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: <https://cli.github.com/manual/gh_variable>.
- 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}}`

29
tldr/git-fast-export Normal file
View File

@@ -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: <https://manned.org/git-fast-export>.
- 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 subdirectorys history:
`git fast-export --all -- {{path/to/directory}} > {{path/to/file}}`

13
tldr/kubectl-api-versions Normal file
View File

@@ -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: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_api-versions>.
- Print the supported API versions on the server, in the form of "group/version":
`kubectl api-versions`

25
tldr/kubectl-version Normal file
View File

@@ -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: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_version>.
- 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`

25
tldr/linux/paccapability Normal file
View File

@@ -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: <https://github.com/andrewgregory/pacutils/blob/master/doc/paccapability.pod>.
- List all available capabilities:
`paccapability`
- Check for the specified capability:
`paccapability {{nls|downloader|signatures}}`
- Display help:
`paccapability --help`
- Display version:
`paccapability --version`

33
tldr/linux/paccheck Normal file
View File

@@ -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: <https://github.com/andrewgregory/pacutils/blob/master/doc/paccheck.pod>.
- 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`

33
tldr/linux/pacinfo Normal file
View File

@@ -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: <https://github.com/andrewgregory/pacutils/blob/master/doc/pacinfo.pod>.
- 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`

33
tldr/linux/pacini Normal file
View File

@@ -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: <https://github.com/andrewgregory/pacutils/blob/master/doc/pacini.pod>.
- 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`

View File

@@ -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: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#is-active%20PATTERN%E2%80%A6>.
- 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}}`

View File

@@ -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: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#is-enabled%20UNIT%E2%80%A6>.
- 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`

View File

@@ -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: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#list-units%20PATTERN%E2%80%A6>.
- 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`

15
tldr/osx/contactsd Normal file
View File

@@ -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: <https://keith.github.io/xcode-man-pages/contactsd.8.html>.
- Start the daemon:
`contactsd`

29
tldr/pg_archivecleanup Normal file
View File

@@ -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: <https://www.postgresql.org/docs/current/pgarchivecleanup.html>.
- 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}}`

17
tldr/pg_test_timing Normal file
View File

@@ -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: <https://www.postgresql.org/docs/current/pgtesttiming.html>.
- Run the default timing test (3 seconds):
`pg_test_timing`
- Run for a custom duration:
`pg_test_timing {{[-d|--duration]}} {{seconds}}`

21
tldr/pg_walsummary Normal file
View File

@@ -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: <https://www.postgresql.org/docs/current/app-pgwalsummary.html>.
- 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}}`

25
tldr/pip-hash Normal file
View File

@@ -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: <https://pip.pypa.io/en/stable/cli/pip_hash/>.
- 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}}`

29
tldr/pip-index Normal file
View File

@@ -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: <https://pip.pypa.io/en/stable/cli/pip_index/>.
- 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}}`

33
tldr/pip-inspect Normal file
View File

@@ -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: <https://pip.pypa.io/en/stable/cli/pip_inspect/>.
- 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]}}`

33
tldr/pip-wheel Normal file
View File

@@ -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: <https://pip.pypa.io/en/stable/cli/pip_wheel/>.
- 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}}`

View File

@@ -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:

View File

@@ -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}}`

View File

@@ -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`

37
tldr/vacuumdb Normal file
View File

@@ -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: <https://www.postgresql.org/docs/current/app-vacuumdb.html>.
- 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}}`