Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-21 00:19:51 +00:00
parent c3f5e8d7ab
commit 8d00ec1c41
29 changed files with 728 additions and 15 deletions

View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# adb shell pm list packages
> List installed, known, or filtered packages on an Android device.
> More information: <https://developer.android.com/tools/adb>.
- List all installed packages:
`adb shell pm list packages`
- List all packages and their associated APK file paths:
`adb shell pm list packages -f`
- Only list disabled packages:
`adb shell pm list packages -d`
- Only list enabled packages:
`adb shell pm list packages -e`
- Only list system packages:
`adb shell pm list packages -s`
- Only list third-party (non-system) packages:
`adb shell pm list packages -3`
- Show the installer for each package:
`adb shell pm list packages -i`

37
tldr/cli4 Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# cli4
> Python command-line interface for Cloudflare API.
> More information: <https://github.com/cloudflare/python-cloudflare>.
- Display account information:
`cli4 {{/user}}`
- List all zones:
`cli4 {{/zones}}`
- List DNS records for a specific zone:
`cli4 {{/zones/:example.com/dns_records}}`
- Create a new DNS record:
`cli4 --post {{name=example.com}} {{type=A}} {{content=192.0.2.1}} {{/zones/:example.com/dns_records}}`
- Update an existing DNS record:
`cli4 --put {{name=sub.example.com}} {{type=A}} {{content=192.0.2.2}} {{/zones/:example.com/dns_records/:record_id}}`
- Delete a DNS record:
`cli4 --delete {{/zones/:example.com/dns_records/:record_id}}`
- Purge all cache for a zone:
`cli4 --post {{purge_everything=true}} {{/zones/:example.com/purge_cache}}`

33
tldr/conda-export Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda export
> Export environment details.
> More information: <https://docs.conda.io/projects/conda/en/latest/commands/export.html>.
- Export the current environment details to `stdout`:
`conda export`
- Export the current environment details to a `YAML` file:
`conda export {{[-f|--file]}} {{path/to/environment.yaml}}`
- Export details in a specific format:
`conda export --format {{environment-json|environment-yaml|explicit|json|reqs|requirements|txt|yaml|yml}}`
- Target an environment by name:
`conda export {{[-n|--name]}} {{environment_name}}`
- Target an environment by its path:
`conda export {{[-p|--prefix]}} {{path/to/environment}}`
- Include a specific channel:
`conda export {{[-c|--channel]}} {{channel_name}}`

34
tldr/conda-init Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda init
> Initialize conda for shell interaction.
> Most shells need to be closed and restarted for changes to take effect.
> More information: <https://docs.conda.io/projects/conda/en/latest/commands/init.html>.
- Initialize a specific shell (if none is specified, defaults to `bash` for UNIX and `powershell` for Windows):
`conda init {{zsh|bash|powershell|fish|tcsh|xonsh}}`
- Initialize all available shells:
`conda init --all`
- Initialize conda for all users on the system:
`conda init --system`
- Don't initialize conda for the current user:
`conda init --no-user`
- Add `condabin/` directory to PATH:
`conda init --condabin`
- Undo effects of the last `conda init`:
`conda init --reverse`

21
tldr/conda-notices Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda notices
> Retrieve latest channel notifications.
> More information: <https://docs.conda.io/projects/conda/en/latest/commands/notices.html>.
- Show notices for the default channel and all `.condarc` channels:
`conda notices`
- Include a specific channel:
`conda notices {{[-c|--channel]}} {{channel_name}}`
- Ignore default and `.condarc` channels:
`conda notices {{[-c|--channel]}} {{channel_name}} --override-channels`

37
tldr/ecpg Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ecpg
> Embedded SQL preprocessor for C programs.
> More information: <https://www.postgresql.org/docs/current/app-ecpg.html>.
- Preprocess a specific file:
`ecpg {{input.pgc}}`
- Preprocess from `stdin` and output to `stdout`:
`ecpg -o - -`
- Preprocess from `stdin` and write to a file:
`cat input.pgc | ecpg -o output.c -`
- Preprocess and specify an output file:
`ecpg -o {{output.c}} {{input.pgc}}`
- Preprocess a header file (`.pgh` extension):
`ecpg {{input.pgh}}`
- Preprocess in a specific compatibility mode:
`ecpg -C {{INFORMIX|INFORMIX_SE|ORACLE}} {{input.pgc}}`
- Preprocess with autocommit enabled:
`ecpg -t {{input.pgc}}`

21
tldr/git-filter-branch Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git filter-branch
> Change branch history, like removing files.
> More information: <https://git-scm.com/docs/git-filter-branch>.
- Remove a file from all commits:
`git filter-branch --tree-filter 'rm {{[-f|--force]}} {{file}}' HEAD`
- Update author email:
`git filter-branch --env-filter 'GIT_AUTHOR_EMAIL={{new_email}}' HEAD`
- Delete a folder from history:
`git filter-branch --tree-filter 'rm {{[-rf|--recursive --force]}} {{folder}}' HEAD`

17
tldr/git-merge-tree Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git merge-tree
> Merge branches without changing files.
> More information: <https://git-scm.com/docs/git-merge-tree>.
- Show the result of a merge between two branches:
`git merge-tree {{branch1}} {{branch2}}`
- Perform a merge and write the resulting tree:
`git merge-tree --write-tree {{branch1}} {{branch2}}`

21
tldr/git-rerere Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git rerere
> Reuse fixes for merge conflicts.
> More information: <https://git-scm.com/docs/git-rerere>.
- Enable rerere globally:
`git config --global rerere.enabled true`
- Forget a file's recorded resolution:
`git rerere forget {{path/to/file}}`
- Check the status of recorded resolutions:
`git rerere status`

View File

@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
- Use fullscreen mode and a custom background color:
`gource {{[-f|--fullscreen ]}} {{[-b|--background-colour]}} {{hex_color_code}}`
`gource {{[-f|--fullscreen]}} {{[-b|--background-colour]}} {{hex_color_code}}`
- Specify the animation title:

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud
> A tool for managing IBM Cloud apps and services.
> Manage IBM Cloud apps and services.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli>.
- Update `ibmcloud` to the latest version:

29
tldr/kubectl-kustomize Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# kubectl kustomize
> Build a set of Kubernetes resources using a `kustomization.yaml` file.
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_kustomize/>.
- Build resources from the current directory:
`kubectl kustomize`
- Build resources from a specific directory:
`kubectl kustomize {{path/to/directory}}`
- Build resources from a remote URL:
`kubectl kustomize {{https://github.com/user/repo/path}}`
- Build resources and save to a file:
`kubectl kustomize {{path/to/directory}} > {{output.yaml}}`
- Build resources with load restrictor disabled:
`kubectl kustomize --load-restrictor {{LoadRestrictionsNone}} {{path/to/directory}}`

37
tldr/linux/grub-probe Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# grub-probe
> Probe device information for a particular path or device.
> More information: <https://www.gnu.org/software/grub/manual/grub/html_node/Invoking-grub_002dprobe.html>.
- Get GRUB filesystem module for a path:
`sudo grub-probe {{[-t|--target]}} fs {{/boot/grub}}`
- Get the system device containing a path:
`sudo grub-probe {{[-t|--target]}} device {{/boot/grub}}`
- Get GRUB disk name for a system device:
`sudo grub-probe {{[-t|--target]}} drive {{/dev/sdX}} {{[-d|--device]}}`
- Get filesystem UUID:
`sudo grub-probe {{[-t|--target]}} fs_uuid {{/boot/grub}}`
- Get filesystem label:
`sudo grub-probe {{[-t|--target]}} fs_label {{/boot/grub}}`
- Get MBR partition type code(two hexadecimal digits):
`sudo grub-probe {{[-t|--target]}} msdos_parttype {{/dev/sdX}}`
- Probe using a custom device map:
`sudo grub-probe {{[-t|--target]}} drive {{/boot/grub}} {{[-m|--device-map]}} {{path/to/custom_device.map}}`

25
tldr/linux/installpkg Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# installpkg
> Install a Slackware package.
> More information: <http://www.slackware.com/config/packages.php>.
- Install a package:
`sudo installpkg {{path/to/package.tgz}}`
- Generate a report of a simulated installation to `stdout`:
`installpkg -warn {{path/to/package.tgz}}`
- Create a package from current directory and its subdirectories:
`installpkg -m {{package_name.tgz}}`
- Install the contents of the current directory and subdirectories as a package with a specified name:
`sudo installpkg -r {{package_name.tgz}}`

25
tldr/linux/ip-netconf Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# ip netconf
> Display configuration parameters.
> More information: <https://manned.org/ip-netconf>.
- Show network configuration for all interfaces:
`ip {{[netc|netconf]}}`
- Show network configuration for a specific interface:
`ip {{[netc|netconf]}} {{[s|show]}} dev {{network_interface}}`
- Show only IPv4 network configuration:
`ip -4 {{[netc|netconf]}}`
- Show only IPv6 network configuration:
`ip -6 {{[netc|netconf]}}`

33
tldr/linux/ip-tuntap Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# ip tuntap
> Manage TUN/TAP virtual network interfaces.
> More information: <https://baturin.org/docs/iproute2/#ip-tuntap>.
- Show all existing TUN/TAP devices:
`ip {{[tunt|tuntap]}}`
- Create a TUN device with a specific name:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0}} {{[m|mode]}} {{[t|tun]}}`
- Create a TAP device with a specific name:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tap0}} {{[m|mode]}} {{[ta|tap]}}`
- Delete a TUN or TAP device:
`sudo ip {{[tunt|tuntap]}} {{[d|delete]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}}`
- Set the owner (UID) of a TUN/TAP device:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}} {{[u|user]}} {{username}}`
- Set both owner (UID) and group (GID) for a TUN/TAP device:
`sudo ip {{[tunt|tuntap]}} {{[a|add]}} {{[d|dev]}} {{tun0|tap0}} {{[m|mode]}} {{tun|tap}} {{[u|user]}} {{username}} {{[g|group]}} {{group_name}}`

29
tldr/linux/removepkg Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# removepkg
> Remove a specified Slackware package.
> More information: <http://www.slackware.com/config/packages.php>.
- Remove a package:
`sudo removepkg {{package_name}}`
- Generate a report of a simulated removal to `stdout`:
`removepkg -warn {{package_name}}`
- Reconstruct the package subtree in `/tmp/preserved_packages/package_name` and remove the package:
`sudo removepkg -preserve {{package_name}}`
- Copy package under `/tmp/preserved_packages/package_name` without removing:
`removepkg -copy {{package_name}}`
- Save temporary files created by `removepkg` for debugging:
`sudo removepkg -keep {{package_name}}`

View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl list-dependencies
> Show a unit's dependency tree in systemd.
> See also: `systemctl list-units` to list loaded units.
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#%0A%20%20%20%20%20%20%20%20%20%20%20%20list-dependencies%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT...%0A%20%20%20%20%20%20%20%20%20%20>.
- Show the dependency tree of `default.target`:
`systemctl list-dependencies`
- Show the dependency tree of a specific unit:
`systemctl list-dependencies {{unit}}`
- Include all dependency types (not only `Requires=` and `Wants=`):
`systemctl list-dependencies {{unit}} {{[-a|--all]}}`
- Limit the tree to a specific unit type:
`systemctl list-dependencies {{unit}} {{[-t|--type]}} {{service|socket|target|mount|...}}`
- Reverse the direction to show units that depend on the specified unit:
`systemctl list-dependencies {{unit}} --reverse`
- Print output without headers or footers (for scripts):
`systemctl list-dependencies {{unit}} --no-legend`

View File

@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
- List one VG metadata backup file:
`vgcfgrestore {{[-l|--list ]}} {{[ -f|--file]}} {{path/to/file}} {{vg_name}}`
`vgcfgrestore {{[-l|--list]}} {{[-f|--file]}} {{path/to/file}} {{vg_name}}`

41
tldr/oh-my-posh Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# oh-my-posh
> Cross platform prompt engine for any shell.
> More information: <https://ohmyposh.dev/docs/installation/customize>.
- Display current shell name:
`oh-my-posh get shell`
- Initialize for Bash:
`eval "$(oh-my-posh init bash --config {{path/to/theme}})"`
- Initialize for Powershell:
`oh-my-posh init pwsh --config {{path/to/theme}} | Invoke-Expression`
- Initialize for Zsh:
`eval "$(oh-my-posh init zsh --config {{path/to/theme}})"`
- Enable live reloading:
`oh-my-posh enable reload`
- Disable live reloading:
`oh-my-posh disable reload`
- Print debug information for troubleshooting:
`oh-my-posh debug`
- Update to latest version:
`oh-my-posh upgrade`

33
tldr/oneliner Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# oneliner
> Turn plain English into shell commands using OpenAI, Claude, or local LLMs, designed to teach, not replace your knowledge.
> More information: <https://github.com/dorochadev/oneliner#-usage-flags>.
- Generate a shell command from plain English:
`oneliner "{{find all jpg files larger than 10MB}}"`
- Explain what a command does:
`oneliner {{[-e|--explain]}} "{{delete node_modules recursively}}"`
- Copy a generated command to the clipboard:
`oneliner {{[-c|--clipboard]}} "{{compress all pdfs}}"`
- Show a detailed, educational breakdown of a command:
`oneliner {{[-b|--breakdown]}} "{{list all active network connections}}"`
- Execute a generated command (use with caution):
`oneliner {{[-r|--run]}} "{{list files larger than 1GB}}"`
- Interactively confirm before executing a generated command:
`oneliner {{[-i|--interactive]}} "{{delete temporary files in /tmp}}"`

29
tldr/pg_recvlogical Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pg_recvlogical
> Control PostgreSQL logical decoding streams.
> More information: <https://www.postgresql.org/docs/current/app-pgrecvlogical.html>.
- Create a new logical replication slot:
`pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot`
- Start streaming changes from a logical replication slot to a file:
`pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --start {{[-f|--file]}} {{filename}}`
- Drop a logical replication slot:
`pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --drop-slot`
- Create a slot with two-phase commit enabled:
`pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot {{[-t|--enable-two-phase]}}`
- Display help:
`pg_recvlogical {{[-?|--help]}}`

29
tldr/pg_resetwal Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pg_resetwal
> Reset the write-ahead log and other control information of a PostgreSQL database cluster.
> More information: <https://www.postgresql.org/docs/current/app-pgresetwal.html>.
- Reset the WAL and control information for a specific data directory:
`pg_resetwal {{[-D|--pgdata]}} {{path/to/data}}`
- Perform a dry run:
`pg_resetwal {{[-D|--pgdata]}} {{path/to/data}} {{[-n|--dry-run]}}`
- Force the WAL and control information reset:
`pg_resetwal {{[-D|--pgdata]}} {{path/to/data}} {{[-f|--force]}}`
- Display help:
`pg_resetwal {{[-?|--help]}}`
- Display version:
`pg_resetwal {{[-V|--version]}}`

View File

@@ -5,10 +5,14 @@ source: https://github.com/tldr-pages/tldr.git
---
# pg_waldump
> Display a human-readable rendering of the write-ahead log (WAL).
> Display a human-readable rendering of the write-ahead log (WAL) of a PostgreSQL database cluster.
> More information: <https://www.postgresql.org/docs/current/pgwaldump.html>.
- Basic invocation reading a WAL segment (or range):
- Display WAL records from a specific segment:
`pg_waldump {{start_segment}}`
- Display WAL records between two segments:
`pg_waldump {{start_segment}} {{end_segment}}`
@@ -16,14 +20,6 @@ source: https://github.com/tldr-pages/tldr.git
`pg_waldump {{start_segment}} {{end_segment}} {{[-p|--path]}} {{path}}`
- Start from a particular WAL location (LSN):
`pg_waldump {{start_segment}} {{end_segment}} {{[-s|--start]}} {{lsn}}`
- Stop at a particular WAL location (LSN):
`pg_waldump {{start_segment}} {{end_segment}} {{[-e|--end]}} {{lsn}}`
- Follow new WAL entries as they arrive:
`pg_waldump {{start_segment}} {{end_segment}} {{[-f|--follow]}}`
@@ -32,10 +28,14 @@ source: https://github.com/tldr-pages/tldr.git
`pg_waldump {{start_segment}} {{end_segment}} {{[-n|--limit]}} {{count}}`
- Quiet mode (suppress output except errors):
- Display summary statistics instead of individual records:
`pg_waldump {{start_segment}} {{end_segment}} {{[-q|--quiet]}}`
`pg_waldump {{start_segment}} {{end_segment}} {{[-z|--stats]}}`
- Filter by resource manager:
`pg_waldump {{start_segment}} {{end_segment}} {{[-r|--rmgr]}} {{rmgr_name}}`
- Display help:
`pg_waldump {{[-?|--help]}}`

25
tldr/postgres Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# postgres
> Run the PostgreSQL database server.
> More information: <https://www.postgresql.org/docs/current/app-postgres.html>.
- Start the server on a specific port (defaults to 5432):
`postgres -p {{5433}}`
- Set a runtime parameter (short form):
`postgres -c {{shared_buffers=128MB}}`
- Set a runtime parameter (long form):
`postgres --{{shared-buffers}}={{128MB}}`
- Start in single-user mode for a specific database (defaults to the user name):
`postgres --single -D {{path/to/datadir}} {{my_database}}`

27
tldr/vagrant-destroy Normal file
View File

@@ -0,0 +1,27 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant destroy
> Stop a guest machine and destroy all its resources.
> Any boxes installed are kept intact.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/destroy>.
- Destroy the currently running machine:
`vagrant destroy`
- Target a machine by name or ID:
`vagrant destroy {{name|id}}`
- Do not ask for confirmation before destroying:
`vagrant destroy {{[-f|--force]}}`
- Shut down the machine gracefully:
`vagrant destroy {{[-g|--graceful]}}`

23
tldr/vagrant-reload Normal file
View File

@@ -0,0 +1,23 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant reload
> Equivalent of running `halt` followed by `up`.
> A reload is usually required for changes in a Vagrantfile to take effect.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/reload>.
- Reload the currently running machine:
`vagrant reload`
- Target a machine by name or ID:
`vagrant reload {{name|id}}`
- Force the provisioners to run:
`vagrant reload --provision`

18
tldr/vagrant-status Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant status
> Display the state of the machines Vagrant is managing.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/status>.
- View status of the currently running machine/s:
`vagrant status`
- Target a machine by name or ID:
`vagrant status {{name|id}}`

18
tldr/vagrant-suspend Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant suspend
> Save the state of the guest machine rather than fully shutting it down.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/suspend>.
- Suspend the currently running machine:
`vagrant suspend`
- Target a machine by name or ID:
`vagrant suspend {{name|id}}`