diff --git a/tldr/cargo b/tldr/cargo index 8115395c..89de8af6 100644 --- a/tldr/cargo +++ b/tldr/cargo @@ -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}}` diff --git a/tldr/cargo-build b/tldr/cargo-build index a054ad2e..023d9c4b 100644 --- a/tldr/cargo-build +++ b/tldr/cargo-build @@ -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}}` diff --git a/tldr/cargo-check b/tldr/cargo-check index cd319f9d..ce7bfff7 100644 --- a/tldr/cargo-check +++ b/tldr/cargo-check @@ -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` diff --git a/tldr/cargo-doc b/tldr/cargo-doc index ba6b47d0..83e318e9 100644 --- a/tldr/cargo-doc +++ b/tldr/cargo-doc @@ -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}}` diff --git a/tldr/cargo-run b/tldr/cargo-run index 362aed7f..00443ccb 100644 --- a/tldr/cargo-run +++ b/tldr/cargo-run @@ -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}}` diff --git a/tldr/cargo-test b/tldr/cargo-test index 43b1a5c2..6c30e1a0 100644 --- a/tldr/cargo-test +++ b/tldr/cargo-test @@ -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` diff --git a/tldr/getarch.py b/tldr/getarch.py new file mode 100644 index 00000000..9264a33b --- /dev/null +++ b/tldr/getarch.py @@ -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: . + +- 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` diff --git a/tldr/impacket-getarch b/tldr/impacket-getarch new file mode 100644 index 00000000..a6630522 --- /dev/null +++ b/tldr/impacket-getarch @@ -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: . + +- View documentation for the original command: + +`tldr getArch.py` diff --git a/tldr/linux/blkpr b/tldr/linux/blkpr index 87e0f48f..af206de8 100644 --- a/tldr/linux/blkpr +++ b/tldr/linux/blkpr @@ -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}}` diff --git a/tldr/linux/efibootmgr b/tldr/linux/efibootmgr index 016edfc8..0464d2eb 100644 --- a/tldr/linux/efibootmgr +++ b/tldr/linux/efibootmgr @@ -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: diff --git a/tldr/linux/expac b/tldr/linux/expac new file mode 100644 index 00000000..0ffb29b6 --- /dev/null +++ b/tldr/linux/expac @@ -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: . + +- 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)` diff --git a/tldr/linux/fuzzel b/tldr/linux/fuzzel index 2242b64a..daf2528c 100644 --- a/tldr/linux/fuzzel +++ b/tldr/linux/fuzzel @@ -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` diff --git a/tldr/linux/lxc-console b/tldr/linux/lxc-console new file mode 100644 index 00000000..4811eb88 --- /dev/null +++ b/tldr/linux/lxc-console @@ -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: . + +- 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`: + +`` diff --git a/tldr/linux/lxc-create b/tldr/linux/lxc-create index eef16eaf..a960dc5e 100644 --- a/tldr/linux/lxc-create +++ b/tldr/linux/lxc-create @@ -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}}` diff --git a/tldr/linux/lxc-start b/tldr/linux/lxc-start index f6d65eeb..4c78911f 100644 --- a/tldr/linux/lxc-start +++ b/tldr/linux/lxc-start @@ -8,6 +8,18 @@ source: https://github.com/tldr-pages/tldr.git > Start a container. > More information: . +- 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}}` diff --git a/tldr/linux/pw-dot b/tldr/linux/pw-dot index c9711305..158ce7d9 100644 --- a/tldr/linux/pw-dot +++ b/tldr/linux/pw-dot @@ -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]}}` diff --git a/tldr/linux/pw-metadata b/tldr/linux/pw-metadata index 1a7043b8..380cf7cf 100644 --- a/tldr/linux/pw-metadata +++ b/tldr/linux/pw-metadata @@ -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]}}` diff --git a/tldr/linux/semanage-permissive b/tldr/linux/semanage-permissive index 5aabf39e..854a8a87 100644 --- a/tldr/linux/semanage-permissive +++ b/tldr/linux/semanage-permissive @@ -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}}` diff --git a/tldr/osx/herd-list b/tldr/osx/herd-list new file mode 100644 index 00000000..cc66afd6 --- /dev/null +++ b/tldr/osx/herd-list @@ -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: . + +- 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` diff --git a/tldr/osx/osascript b/tldr/osx/osascript index 148e3e46..b90c7c03 100644 --- a/tldr/osx/osascript +++ b/tldr/osx/osascript @@ -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: diff --git a/tldr/phpstan b/tldr/phpstan index 92c07658..b5fcdc70 100644 --- a/tldr/phpstan +++ b/tldr/phpstan @@ -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: . +> More information: . - 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: diff --git a/tldr/tailscale b/tldr/tailscale index c7e34d5a..733f0b0c 100644 --- a/tldr/tailscale +++ b/tldr/tailscale @@ -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: . +> More information: . + +- 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` diff --git a/tldr/tailscale-file b/tldr/tailscale-file index 9a0d3f84..1bbd567f 100644 --- a/tldr/tailscale-file +++ b/tldr/tailscale-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}}` diff --git a/tldr/tailscale-ssh b/tldr/tailscale-ssh index 247eb6df..0706531a 100644 --- a/tldr/tailscale-ssh +++ b/tldr/tailscale-ssh @@ -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: diff --git a/tldr/tailscale-up b/tldr/tailscale-up index c7429214..d6d17e6c 100644 --- a/tldr/tailscale-up +++ b/tldr/tailscale-up @@ -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: . - 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`