Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-22 00:20:27 +00:00
parent 8d00ec1c41
commit 0cc7cfe867
23 changed files with 180 additions and 20 deletions

41
tldr/adb-shell-pm Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# adb shell pm
> Android Package Manager tool.
> More information: <https://developer.android.com/tools/adb>.
- Print the path to the APK of a package:
`adb shell pm path {{package}}`
- Install an app package from a given path:
`adb shell pm install /{{path/to/app.apk}}`
- Uninstall a package from the device:
`adb shell pm uninstall {{package}}`
- Clear all app data for a package:
`adb shell pm clear {{package}}`
- Enable a package or component:
`adb shell pm enable {{package_or_class}}`
- Disable a package or component:
`adb shell pm disable {{package_or_class}}`
- Grant a permission for an app:
`adb shell pm grant {{package}} {{android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...}}`
- Revoke a permission for an app:
`adb shell pm revoke {{package}} {{android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...}}`

37
tldr/adb-shell-pm-list Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# adb shell pm list
> List users, packages, permissions, instrumentation, permission groups, features and libraries managed by the package manager.
> More information: <https://developer.android.com/tools/adb>.
- List all installed packages:
`adb shell pm list packages`
- Print all users on the system:
`adb shell pm list users`
- Print all known permission groups:
`adb shell pm list permission-groups`
- Print all known permissions:
`adb shell pm list permissions`
- List all test packages:
`adb shell pm list instrumentation`
- Print all features of the system:
`adb shell pm list features`
- Print all the libraries supported by the current device:
`adb shell pm list libraries`

View File

@@ -21,7 +21,7 @@ source: https://github.com/tldr-pages/tldr.git
`atool {{[-X|--extract-to]}} {{path/to/output_directory}} {{archive.rar}}`
- Display a specific file's content from an archive to standard output (like `cat`):
- Display a specific file's content from an archive to `stdout` (like `cat`):
`atool {{[-c|--cat]}} {{archive.tar}} {{path/to/file_in_archive.txt}}`

View File

@@ -11,11 +11,11 @@ source: https://github.com/tldr-pages/tldr.git
- Update restart policy to apply when a specific container exits:
`docker update --restart={{always|no|on-failure|unless-stopped}} {{container_name}}`
`docker update --restart {{always|no|on-failure|unless-stopped}} {{container_name}}`
- Update the policy to restart up to three times a specific container when it exits with non-zero exit status:
`docker update --restart=on-failure:3 {{container_name}}`
`docker update --restart on-failure:3 {{container_name}}`
- Update the number of CPUs available to a specific container:

View File

@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`elasticsearch-keystore add {{setting_name}}`
- Add a setting from standard input:
- Add a setting from `stdin`:
`echo "{{setting_value}}" | elasticsearch-keystore add --stdin {{setting_name}}`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`kubectl cluster-info`
- Dump current cluster state to standard output (for debugging):
- Dump current cluster state to `stdout` (for debugging):
`kubectl cluster-info dump`

View File

@@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git
`kubectl proxy {{[-p|--port]}} {{port}} {{[-w|--www]}} {{path/to/static_dir}}`
- Run a proxy on a random local port, printing the chosen port to stdout:
- Run a proxy on a random local port, printing the chosen port to `stdout`:
`kubectl proxy {{[-p|--port]}} 0`

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo aa-decode {{logfile}}`
- Decode logs from standard input (e.g., redirected file):
- Decode logs from `stdin` (e.g., redirected file):
`sudo aa-decode - < {{logfile}}`

View File

@@ -26,7 +26,7 @@ source: https://github.com/tldr-pages/tldr.git
`dnf reposync --repoid {{repo_name}} {{[-n|--newest-only]}}`
- Just print URLs of what would be downloaded, dont download:
- Just print URLs of what would be downloaded, don't download:
`dnf reposync --repoid {{repo_name}} {{[-u|--urls]}}`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Load a ZFS encryption key from a file:
`grub-mount {{[-K|--zfs-key]}} {{/path/to/zfs.key}} {{/dev/sdX}} {{/mnt}}`
`grub-mount {{[-K|--zfs-key]}} /{{path/to/zfs.key}} {{/dev/sdX}} {{/mnt}}`
- Show debugging output for a matching category:

41
tldr/linux/ip-stats Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# ip stats
> Manage and show interface statistics.
> More information: <https://manned.org/ip-stats>.
- Show all interface statistics across all network devices:
`ip {{[st|stats]}}`
- Show statistics for a specific network interface:
`ip {{[st|stats]}} show dev {{network_interface}}`
- Show link-layer statistics (same as `ip -statistics link show`):
`ip {{[st|stats]}} show group link`
- Show hardware offload statistics for all devices:
`ip {{[st|stats]}} show group offload`
- Show offload statistics for a specific interface:
`ip {{[st|stats]}} show dev {{network_interface}} group offload`
- Show a specific offload subgroup:
`ip {{[st|stats]}} show dev {{network_interface}} group offload subgroup {{l3_stats|cpu_hit|hw_stats_info}}`
- Show address-family specific statistics (e.g. MPLS):
`ip {{[st|stats]}} show group afstats subgroup {{mpls}}`
- Enable Layer 3 hardware statistics collection on a device:
`ip {{[st|stats]}} set dev {{network_interface}} l3_stats on`

41
tldr/linux/oma Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# oma
> A package management frontend for dpkg-based Linux distributions.
> More information: <https://github.com/AOSC-Dev/oma#usage>.
- Enter the interactive package management interface:
`sudo oma`
- Install a package:
`sudo oma install {{package_name}}`
- Remove a package:
`sudo oma remove {{package_name}}`
- Search for a package:
`oma search {{keyword}}`
- Show detailed information for a package:
`oma show`
- Upgrade all installed packages to their latest versions:
`sudo oma upgrade`
- Update the list of available packages and versions (done automatically before `oma install` and `oma upgrade`):
`sudo oma refresh`
- Display help:
`oma help`

View File

@@ -21,7 +21,7 @@ source: https://github.com/tldr-pages/tldr.git
`patool list {{path/to/archive}}`
- Compare the contents of two archives and display the differences in the standard output:
- Compare the contents of two archives and display the differences in `stdout`:
`patool diff {{path/to/archive1}} {{path/to/archive2}}`

View File

@@ -21,10 +21,10 @@ source: https://github.com/tldr-pages/tldr.git
`llvm-mc -o {{path/to/output.s}} {{path/to/input.bc}}`
- Assemble assembly code from standard input stream and show encoding to standard output stream:
- Assemble assembly code from `stdin` and show encoding to `stdout`:
`echo "{{addl %eax, %ebx}}" | llvm-mc -show-encoding -show-inst`
- Disassemble machine code from standard input stream for specified triple:
- Disassemble machine code from `stdin` for specified triple:
`echo "{{0xCD 0x21}}" | llvm-mc --disassemble -triple={{target_name}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# multipass
> Manage Ubuntu virtual machines using native hypervisors.
> More information: <https://documentation.ubuntu.com/multipass/en/latest/reference/command-line-interface/#>.
> More information: <https://documentation.ubuntu.com/multipass/en/latest/reference/command-line-interface/>.
- List the aliases that can be used to launch an instance:

Binary file not shown.

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pinta
> A free, open source program for drawing and image editing.
> More information: <https://www.pinta-project.com/user-guide/overview/#>.
> More information: <https://www.pinta-project.com/user-guide/overview/>.
- Start Pinta:

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`pkl eval {{module.pkl}}`
- Run as a server that communicates over standard input/output:
- Run as a server that communicates over `stdin` and `stdout`:
`pkl server`

View File

@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`poetry config {{config_key}}`
- Change or add a new configuration setting by passing a value after the settings name:
- Change or add a new configuration setting by passing a value after the setting's name:
`poetry config {{config_key}} {{config_value}}`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Syncs your project's environment with the `poetry.lock` file.
> More information: <https://python-poetry.org/docs/cli/#sync>.
- Sync your projects environment with the `poetry.lock` file:
- Sync your project's environment with the `poetry.lock` file:
`poetry sync`

View File

@@ -13,6 +13,6 @@ source: https://github.com/tldr-pages/tldr.git
`python -m json.tool {{path/to/file.json}}`
- Validate and pretty-print JSON from standard input:
- Validate and pretty-print JSON from `stdin`:
`echo '{{{"key": "value"}}}' | python -m json.tool`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo socat - TCP-LISTEN:8080,fork`
- Listen on a port using SSL and print to STDOUT:
- Listen on a port using SSL and print to `stdout`:
`sudo socat OPENSSL-LISTEN:4433,reuseaddr,cert=./cert.pem,cafile=./ca.cert.pem,key=./key.pem,verify=0 STDOUT`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`st {{path/to/file}}`
- Print statistics from standard input:
- Print statistics from `stdin`:
`cat {{path/to/file}} | st`