Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-16 00:20:08 +00:00
parent 367b1e4cb2
commit 07c7ca9e90
25 changed files with 227 additions and 85 deletions

View File

@@ -31,12 +31,12 @@ source: https://github.com/tldr-pages/tldr.git
- Build the Rust project in the current directory using the release profile:
`cargo build --release`
`cargo {{[b|build]}} {{[-r|--release]}}`
- Build the Rust project in the current directory using the nightly compiler (requires `rustup`):
`cargo +nightly build`
`cargo +nightly {{[b|build]}}`
- Build using a specific number of threads (default is the number of logical CPUs):
`cargo build --jobs {{number_of_threads}}`
`cargo {{[b|build]}} --jobs {{number_of_threads}}`

View File

@@ -10,28 +10,28 @@ source: https://github.com/tldr-pages/tldr.git
- Build the package or packages defined by the `Cargo.toml` manifest file in the local path:
`cargo build`
`cargo {{[b|build]}}`
- Build artifacts in release mode, with optimizations:
`cargo build --release`
`cargo {{[b|build]}} {{[-r|--release]}}`
- Require that `Cargo.lock` is up to date:
`cargo build --locked`
`cargo {{[b|build]}} --locked`
- Build all packages in the workspace:
`cargo build --workspace`
`cargo {{[b|build]}} --workspace`
- Build a specific package:
`cargo build --package {{package}}`
`cargo {{[b|build]}} {{[-p|--package]}} {{package}}`
- Build only the specified binary:
`cargo build --bin {{name}}`
`cargo {{[b|build]}} --bin {{name}}`
- Build only the specified test target:
`cargo build --test {{testname}}`
`cargo {{[b|build]}} --test {{test_name}}`

View File

@@ -10,20 +10,20 @@ source: https://github.com/tldr-pages/tldr.git
- Check the current package:
`cargo check`
`cargo {{[c|check]}}`
- Check all tests:
`cargo check --tests`
`cargo {{[c|check]}} --tests`
- Check the integration tests in `tests/integration_test1.rs`:
`cargo check --test {{integration_test1}}`
`cargo {{[c|check]}} --test {{integration_test1}}`
- Check the current package with the features `feature1` and `feature2`:
`cargo check --features {{feature1,feature2}}`
`cargo {{[c|check]}} {{[-F|--features]}} {{feature1,feature2}}`
- Check the current package with default features disabled:
`cargo check --no-default-features`
`cargo {{[c|check]}} --no-default-features`

View File

@@ -10,16 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
- Build the documentation for the current project and all dependencies:
`cargo doc`
`cargo {{[d|doc]}}`
- Do not build documentation for dependencies:
`cargo doc --no-deps`
`cargo {{[d|doc]}} --no-deps`
- Build and open the documentation in a browser:
`cargo doc --open`
`cargo {{[d|doc]}} --open`
- Build and view the documentation of a particular package:
`cargo doc --open --package {{package}}`
`cargo {{[d|doc]}} --open {{[-p|--package]}} {{package}}`

View File

@@ -11,28 +11,28 @@ source: https://github.com/tldr-pages/tldr.git
- Run the default binary target:
`cargo run`
`cargo {{[r|run]}}`
- Run the specified binary:
`cargo run --bin {{name}}`
`cargo {{[r|run]}} --bin {{name}}`
- Run the specified example:
`cargo run --example {{name}}`
`cargo {{[r|run]}} --example {{name}}`
- Activate a space or comma separated list of features:
`cargo run --features {{feature1 feature2 ...}}`
`cargo {{[r|run]}} {{[-F|--features]}} "{{feature1 feature2 ...}}"`
- Disable the default features:
`cargo run --no-default-features`
`cargo {{[r|run]}} --no-default-features`
- Activate all available features:
`cargo run --all-features`
`cargo {{[r|run]}} --all-features`
- Run with the given profile:
`cargo run --profile {{name}}`
`cargo {{[r|run]}} --profile {{name}}`

View File

@@ -10,24 +10,24 @@ source: https://github.com/tldr-pages/tldr.git
- Only run tests containing a specific string in their names:
`cargo test {{testname}}`
`cargo {{[t|test]}} {{test_name}}`
- Set the number of simultaneous running test cases:
`cargo test -- --test-threads {{count}}`
`cargo {{[t|test]}} -- --test-threads {{count}}`
- Test artifacts in release mode, with optimizations:
`cargo test --release`
`cargo {{[t|test]}} {{[-r|--release]}}`
- Test all packages in the workspace:
`cargo test --workspace`
`cargo {{[t|test]}} --workspace`
- Run tests for a specific package:
`cargo test --package {{package}}`
`cargo {{[t|test]}} {{[-p|--package]}} {{package}}`
- Run tests without hiding output from test executions:
`cargo test -- --nocapture`
`cargo {{[t|test]}} -- --nocapture`

26
tldr/getarch.py Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# getArch.py
> Determine the OS architecture (x86 or x64) of a remote Windows system.
> Part of the Impacket suite.
> More information: <https://github.com/fortra/impacket>.
- Check the architecture of a single target system:
`getArch.py -target {{target}}`
- Check the architecture of multiple targets from a file (one per line):
`getArch.py -targets {{path/to/targets_file}}`
- Set a custom socket timeout (default is 2 seconds):
`getArch.py -target {{target}} -timeout {{seconds}}`
- Enable debug mode for detailed output:
`getArch.py -target {{target}} -debug`

14
tldr/impacket-getarch Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# impacket-getArch
> This command is an alias of `getArch.py`.
> Part of the Impacket suite.
> More information: <https://github.com/fortra/impacket>.
- View documentation for the original command:
`tldr getArch.py`

View File

@@ -14,16 +14,16 @@ source: https://github.com/tldr-pages/tldr.git
- Set the type of an existing reservation to exclusive access:
`blkpr -c reserve {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} exclusive-access {{path/to/device}}`
`blkpr {{[-c|--command]}} reserve {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} exclusive-access {{path/to/device}}`
- Preempt the existing reservation with a given key and replace it with a new reservation:
`blkpr -c preempt {{[-K|--oldkey]}} {{old_key}} {{[-k|--key]}} {{new_key}} {{[-t|--type]}} write-exclusive {{path/to/device}}`
`blkpr {{[-c|--command]}} preempt {{[-K|--oldkey]}} {{old_key}} {{[-k|--key]}} {{new_key}} {{[-t|--type]}} write-exclusive {{path/to/device}}`
- Release a reservation with a given key and type on a given device:
`blkpr -c release {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} {{reservation_type}} {{path/to/device}}`
`blkpr {{[-c|--command]}} release {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} {{reservation_type}} {{path/to/device}}`
- Clear all reservations from a given device:
`blkpr -c clear {{[-k|--key]}} {{key}} {{path/to/device}}`
`blkpr {{[-c|--command]}} clear {{[-k|--key]}} {{key}} {{path/to/device}}`

View File

@@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git
- Add UEFI Shell v2 as a boot option:
`sudo efibootmgr -c -d {{/dev/sda}} -p {{1}} -l "{{\path o\shell.efi}}" -L "{{UEFI Shell}}"`
`sudo efibootmgr {{[-c|--create]}} {{[-d|--disk]}} {{/dev/sda}} {{[-p|--part]}} {{1}} {{[-l|--loader]}} "{{\path o\shell.efi}}" {{[-L|--label]}} "{{UEFI Shell}}"`
- Add Linux as a boot option:
`sudo efibootmgr --create --disk {{/dev/sda}} --part {{1}} --loader "{{ mlinuz}}" --unicode "{{kernel_cmdline}}" --label "{{Linux}}"`
`sudo efibootmgr {{[-c|--create]}} {{[-d|--disk]}} {{/dev/sda}} {{[-p|--part]}} {{1}} {{[-l|--loader]}} "{{ mlinuz}}" {{[-u|--unicode]}} "{{kernel_cmdline}}" {{[-L|--label]}} "{{Linux}}"`
- Change the current boot order:

34
tldr/linux/expac Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# expac
> A data extraction tool for alpm databases, offering printf-like flexibility for pacman-based utilities.
> See also: `pacman`.
> More information: <https://github.com/falconindy/expac>.
- List the dependencies of a package:
`expac -S '%D' {{package}}`
- List the optional dependencies of a package:
`expac -S "%o" {{package}}`
- List the download size of packages in MiB:
`expac -S -H M '%k %n' {{package1 package2 ...}}`
- List packages marked for upgrade with their download size:
`expac -S -H M '%k %n' $(pacman -Qqu) | sort -sh`
- List explicitly-installed packages with their optional dependencies:
`expac -d '
' -l '
' -Q '%n
%O' $(pacman -Qeq)`

View File

@@ -18,20 +18,20 @@ source: https://github.com/tldr-pages/tldr.git
- Display a menu of the output of the `ls` command:
`{{ls}} | fuzzel -d`
`{{ls}} | fuzzel {{[-d|--dmenu]}}`
- Display a menu with custom items separated by a new line (`
`):
`echo -e "{{red}}
{{green}}
{{blue}}" | fuzzel -d`
{{blue}}" | fuzzel {{[-d|--dmenu]}}`
- Let the user choose between multiple items and save the selected one to a file:
`echo -e "{{red}}
{{green}}
{{blue}}" | fuzzel -d > {{color.txt}}`
{{blue}}" | fuzzel {{[-d|--dmenu]}} > {{color.txt}}`
- Reset apps usage count (default cache directory: `$XDG_CACHE_HOME/fuzzel`):
@@ -39,8 +39,8 @@ source: https://github.com/tldr-pages/tldr.git
- Launch `fuzzel` on a specific monitor, see `wlr-randr` or `swaymsg -t get_outputs`:
`fuzzel -o "{{DP-1}}"`
`fuzzel {{[-o|--output]}} "{{DP-1}}"`
- Use `fuzzel` to do an online search:
`fuzzel -d -l 0 --placeholder "{{Type your search}}" | sed 's/^/\"/g;s/$/\"/g' | xargs firefox --search`
`fuzzel {{[-d|--dmenu]}} {{[-l|--lines]}} 0 --placeholder "{{Type your search}}" | sed 's/^/\"/g;s/$/\"/g' | xargs firefox --search`

21
tldr/linux/lxc-console Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# lxc-console
> Attach to a container.
> More information: <https://linuxcontainers.org/lxc/manpages//man1/lxc-console.1.html>.
- Start a console in a container:
`agetty {{[-L|--local-line]}} {{38400}} tty1`
- Connect to an lxc console:
`sudo lxc-console {{container_name}}`
- Exit `lxc-console`:
`<Ctrl a><q>`

View File

@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
- Create a container interactively in `/var/lib/lxc/`:
`sudo lxc-create {{[-n|--name]}} {{container}} {{[-t|--template]}} download`
`sudo lxc-create {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download`
- Create a container in a target directory:
`sudo lxc-create {{[-P|--lxcpath]}} {{/path/to/directory/}} {{[-n|--name]}} {{container}} {{[-t|--template]}} download`
`sudo lxc-create {{[-P|--lxcpath]}} {{/path/to/directory/}} {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download`
- Create a container passing options to a template:
`sudo lxc-create {{[-n|--name]}} {{name}} {{[-t|--template]}} download -- {{[-d|--dist]}} {{distro-name}} {{[-r|--release]}} {{release-version}} {{[-a|--arch]}} {{arch}}`
`sudo lxc-create {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download -- {{[-d|--dist]}} {{distro-name}} {{[-r|--release]}} {{release-version}} {{[-a|--arch]}} {{arch}}`

View File

@@ -8,6 +8,18 @@ source: https://github.com/tldr-pages/tldr.git
> Start a container.
> More information: <https://linuxcontainers.org/lxc/getting-started/>.
- Start the lxc service:
`systemctl start lxc-net`
- Start a container:
`sudo lxc-start {{container_name}}`
- Start a container in the foreground:
`sudo lxc-start {{container_name}} {{[-F|--foreground]]}`
- Exit out of a foreground container (run this in a separate terminal):
`sudo lxc-stop {{container_name}}`

View File

@@ -17,17 +17,17 @@ source: https://github.com/tldr-pages/tldr.git
`pw-dot {{[-j|--json]}} {{path/to/file.json}}`
- Specify an [o]utput file, showing all object types:
- Specify an output file, showing all object types:
`pw-dot --output {{path/to/file.dot}} {{[-a|--all]}}`
`pw-dot {{[-o|--output]}} {{path/to/file.dot}} {{[-a|--all]}}`
- Print `.dot` graph to `stdout`, showing all object properties:
`pw-dot --output - {{[-d|--detail]}}`
`pw-dot {{[-o|--output]}} - {{[-d|--detail]}}`
- Generate a graph from a [r]emote instance, showing only linked objects:
- Generate a graph from a remote instance, showing only linked objects:
`pw-dot --remote {{remote_name}} {{[-s|--smart]}}`
`pw-dot {{[-r|--remote]}} {{remote_name}} {{[-s|--smart]}}`
- Lay the graph from left to right, instead of dot's default top to bottom:
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
- Display help:
`pw-dot --help`
`pw-dot {{[-h|--help]}}`

View File

@@ -31,8 +31,8 @@ source: https://github.com/tldr-pages/tldr.git
- Set `log.level` to 1 in `settings`:
`pw-metadata --name {{settings}} {{0}} {{log.level}} {{1}}`
`pw-metadata {{[-n|--name]}} {{settings}} {{0}} {{log.level}} {{1}}`
- Display help:
`pw-metadata --help`
`pw-metadata {{[-h|--help]}}`

View File

@@ -14,6 +14,10 @@ source: https://github.com/tldr-pages/tldr.git
`sudo semanage permissive {{[-l|--list]}}`
- Set or unset permissive mode for a domain:
- Set permissive mode for a domain:
`sudo semanage permissive {{-a|--add|-d|--delete}} {{httpd_t}}`
`sudo semanage permissive {{[-a|--add]}} {{httpd_t}}`
- Unset permissive mode for a domain:
`sudo semanage permissive {{[-d|--delete]}} {{httpd_t}}`

30
tldr/osx/herd-list Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, osx]
source: https://github.com/tldr-pages/tldr.git
---
# herd list
> List available commands in the Herd PHP platform.
> See also: `herd`.
> More information: <https://herd.laravel.com>.
- List all available commands:
`herd list`
- List all available commands in a specific namespace:
`herd list {{namespace}}`
- List all commands in raw format (useful for embedding a command runner):
`herd list --raw`
- Display the list in a specific output format:
`herd list --format={{txt|xml|json|md}}`
- List all commands without describing their arguments:
`herd list --short`

View File

@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
- Run an AppleScript command:
`osascript -e "{{say 'Hello world'}}"`
`osascript -e '{{say "Hello world"}}'`
- Run multiple AppleScript commands:
`osascript -e "{{say 'Hello'}}" -e "{{say 'world'}}"`
`osascript -e '{{say "Hello"}}' -e '{{say "world"}}'`
- Run a compiled (`*.scpt`), bundled (`*.scptd`), or plaintext (`*.applescript`) AppleScript file:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# phpstan
> A PHP static analysis tool to discover bugs in code.
> More information: <https://github.com/phpstan/phpstan>.
> More information: <https://phpstan.org/user-guide/command-line-usage>.
- Analyze one or more directories:
@@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git
- Analyze a directory using a configuration file:
`phpstan analyse {{path/to/directory}} --configuration {{path/to/config}}`
`phpstan analyse {{path/to/directory}} {{[-c|--configuration]}} {{path/to/config}}`
- Analyze using a specific rule level (0-7, higher is stricter):
- Analyze using a specific rule level (0-10, higher is stricter):
`phpstan analyse {{path/to/directory}} --level {{level}}`
`phpstan analyse {{path/to/directory}} {{[-l|--level]}} {{level}}`
- Specify an autoload file to load before analyzing:
`phpstan analyse {{path/to/directory}} --autoload-file {{path/to/autoload_file}}`
`phpstan analyse {{path/to/directory}} {{[-a|--autoload-file]}} {{path/to/autoload_file}}`
- Specify a memory limit during analysis:

View File

@@ -7,19 +7,23 @@ source: https://github.com/tldr-pages/tldr.git
> A private WireGuard network service.
> Some subcommands such as `up` have their own usage documentation.
> More information: <https://tailscale.com>.
> More information: <https://tailscale.com/kb/1080/cli>.
- Allow the current user to operate on the Tailscale daemon:
`sudo tailscale set --operator $USER`
- Connect to Tailscale:
`sudo tailscale up`
`tailscale up`
- Disconnect from Tailscale:
`sudo tailscale down`
`tailscale down`
- Display the current Tailscale IP addresses:
- Display all devices connected to Tailscale (with their IP addresses):
`tailscale ip`
`tailscale status`
- Ping a peer node at the Tailscale layer and display which route it took for each response:
@@ -29,14 +33,10 @@ source: https://github.com/tldr-pages/tldr.git
`tailscale netcheck`
- Start a web server for controlling Tailscale:
- Start a web server for controlling the Tailscale daemon:
`tailscale web`
- Display a shareable identifier to help diagnose issues:
`tailscale bugreport`
- Display help for a subcommand:
`tailscale {{subcommand}} --help`

View File

@@ -11,8 +11,8 @@ source: https://github.com/tldr-pages/tldr.git
- Send a file to a specific node:
`sudo tailscale file cp {{path/to/file}} {{hostname|ip}}:`
`tailscale file cp {{path/to/file}} {{hostname|ip}}:`
- Store files that were sent to the current node into a specific directory:
`sudo tailscale file get {{path/to/directory}}`
`tailscale file get {{path/to/directory}}`

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Advertise/Disable SSH on the host:
`sudo tailscale up --ssh={{true|false}}`
`tailscale up --ssh={{true|false}}`
- SSH to a specific host which has Tailscale-SSH enabled:

View File

@@ -6,37 +6,38 @@ source: https://github.com/tldr-pages/tldr.git
# tailscale up
> Connect the client to the Tailscale network.
> In version 1.8 and above, command-line arguments are stored and reused until they're overwritten or `--reset` is called.
> Note: run `sudo tailscale set --operator $USER` to allow the current user to run these commands.
> All options described here can be changed later using `tailscale set --option argument`. Use `--option=false` to disable options that don't require arguments.
> More information: <https://tailscale.com/kb/1080/cli/#up>.
- Connect to Tailscale:
`sudo tailscale up`
`tailscale up`
- Connect and offer the current machine to be an exit node for internet traffic:
`sudo tailscale up --advertise-exit-node`
`tailscale up --advertise-exit-node`
- Connect using a specific node for internet traffic:
`sudo tailscale up --exit-node={{exit_node_ip}}`
`tailscale up --exit-node {{exit_node_ip}}`
- Connect and block incoming connections to the current node:
`sudo tailscale up --shields-up`
`tailscale up --shields-up`
- Connect and don't accept DNS configuration from the admin panel (defaults to `true`):
`sudo tailscale up --accept-dns=false`
`tailscale up --accept-dns=false`
- Connect and configure Tailscale as a subnet router:
`sudo tailscale up --advertise-routes={{10.0.0.0/24,10.0.1.0/24,...}}`
`tailscale up --advertise-routes {{10.0.0.0/24,10.0.1.0/24,...}}`
- Connect and accept subnet routes from Tailscale:
`sudo tailscale up --accept-routes`
`tailscale up --accept-routes`
- Reset unspecified settings to their default values and connect:
`sudo tailscale up --reset`
`tailscale up --reset`