mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-21 00:50:50 +00:00
Update cheatsheets
This commit is contained in:
33
tldr/linux/ip-route-get
Normal file
33
tldr/linux/ip-route-get
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ip route get
|
||||
|
||||
> Get a single route to a destination and print its contents exactly as the kernel sees it.
|
||||
> More information: <https://manned.org/ip-route>.
|
||||
|
||||
- Print route to a destination:
|
||||
|
||||
`ip route get {{1.1.1.1}}`
|
||||
|
||||
- Print route to a destination from a specific source address:
|
||||
|
||||
`ip route get {{destination}} from {{source}}`
|
||||
|
||||
- Print route to a destination for packets arriving on a specific interface:
|
||||
|
||||
`ip route get {{destination}} iif {{eth0}}`
|
||||
|
||||
- Print route to a destination, forcing output through a specific interface:
|
||||
|
||||
`ip route get {{destination}} oif {{eth1}}`
|
||||
|
||||
- Print route to a destination with a specified Type of Service (ToS):
|
||||
|
||||
`ip route get {{destination}} tos {{0x10}}`
|
||||
|
||||
- Print route to a destination using a specific VRF (Virtual Routing and Forwarding) instance:
|
||||
|
||||
`ip route get {{destination}} vrf {{myvrf}}`
|
||||
38
tldr/npm-audit
Normal file
38
tldr/npm-audit
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# npm audit
|
||||
|
||||
> Scan for known vulnerabilities in project dependencies.
|
||||
> Reports vulnerabilities and suggests remediation.
|
||||
> More information: <https://docs.npmjs.com/cli/npm-audit>.
|
||||
|
||||
- Scan the project’s dependencies for known vulnerabilities:
|
||||
|
||||
`npm audit`
|
||||
|
||||
- Automatically fix vulnerabilities in the project's dependencies:
|
||||
|
||||
`npm audit fix`
|
||||
|
||||
- Force an automatic fix to dependencies with vulnerabilities:
|
||||
|
||||
`npm audit fix {{-f|--force}}`
|
||||
|
||||
- Update the lock file without modifying the `node_modules` directory:
|
||||
|
||||
`npm audit fix --package-lock-only`
|
||||
|
||||
- Perform a dry run. Simulate the fix process without making any changes:
|
||||
|
||||
`npm audit fix --dry-run`
|
||||
|
||||
- Output audit results in JSON format:
|
||||
|
||||
`npm audit --json`
|
||||
|
||||
- Configure the audit to only fail on vulnerabilities above a specified severity:
|
||||
|
||||
`npm audit --audit-level={{info|low|moderate|high|critical}}`
|
||||
41
tldr/npm-find-dupes
Normal file
41
tldr/npm-find-dupes
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# npm find-dupes
|
||||
|
||||
> Identify duplicate dependencies in `node_modules`.
|
||||
> More information: <https://docs.npmjs.com/cli/commands/npm-find-dupes>.
|
||||
|
||||
- List all duplicate packages within `node_modules`:
|
||||
|
||||
`npm find-dupes`
|
||||
|
||||
- Include `devDependencies` in duplicate detection:
|
||||
|
||||
`npm find-dupes --include=dev`
|
||||
|
||||
- List all duplicate instances of a specific package in `node-modules`:
|
||||
|
||||
`npm find-dupes {{package_name}}`
|
||||
|
||||
- Exclude optional dependencies from duplicate detection:
|
||||
|
||||
`npm find-dupes --omit=optional`
|
||||
|
||||
- Set the logging level for output:
|
||||
|
||||
`npm find-dupes --loglevel={{silent|error|warn|info|verbose}}`
|
||||
|
||||
- Output duplicate information in JSON format:
|
||||
|
||||
`npm find-dupes --json`
|
||||
|
||||
- Limit duplicate search to specific scopes:
|
||||
|
||||
`npm find-dupes --scope={{@scope1,@scope2}}`
|
||||
|
||||
- Exclude specific scopes from duplicate detection:
|
||||
|
||||
`npm find-dupes --omit-scope={{@scope1,@scope2}}`
|
||||
21
tldr/npm-init
Normal file
21
tldr/npm-init
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# npm init
|
||||
|
||||
> Create a `package.json` file.
|
||||
> More information: <https://docs.npmjs.com/cli/commands/npm-init>.
|
||||
|
||||
- Initialize a new package with prompts:
|
||||
|
||||
`npm init`
|
||||
|
||||
- Initialize a new package with default values:
|
||||
|
||||
`npm init -y`
|
||||
|
||||
- Initialize a new package using a specific initializer:
|
||||
|
||||
`npm init {{create-react-app}} {{my-app}}`
|
||||
25
tldr/nxc-wmi
Normal file
25
tldr/nxc-wmi
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# nxc wmi
|
||||
|
||||
> Pentest and exploit the Windows Management Instrumentation (WMI).
|
||||
> More information: <https://www.netexec.wiki/wmi-protocol>.
|
||||
|
||||
- Search for valid credentials by trying out every combination in the specified lists of [u]sernames and [p]asswords:
|
||||
|
||||
`nxc wmi {{192.168.178.2}} -u {{path/to/usernames.txt}} -p {{path/to/passwords.txt}}`
|
||||
|
||||
- Authenticate via local authentication (as opposed to authenticating to the domain):
|
||||
|
||||
`nxc wmi {{192.168.178.2}} -u {{username}} -p {{password}} --local-auth`
|
||||
|
||||
- Issue the specified WMI query:
|
||||
|
||||
`nxc wmi {{192.168.178.2}} -u {{username}} -p {{password}} --wmi {{wmi_query}}`
|
||||
|
||||
- Execute the specified command on the targeted host:
|
||||
|
||||
`nxc wmi {{192.168.178.2}} -u {{username}} -p {{password}} --x {{command}}`
|
||||
@@ -16,10 +16,14 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`pulumi stack`
|
||||
|
||||
- List known stacks:
|
||||
- List stacks in the current project:
|
||||
|
||||
`pulumi stack ls`
|
||||
|
||||
- List stacks across all projects:
|
||||
|
||||
`pulumi stack ls --all`
|
||||
|
||||
- Select an active stack:
|
||||
|
||||
`pulumi stack select {{stack_name}}`
|
||||
|
||||
29
tldr/sui
Normal file
29
tldr/sui
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sui
|
||||
|
||||
> Interact with the Sui network.
|
||||
> More information: <https://docs.sui.io/references/cli/cheatsheet>.
|
||||
|
||||
- Execute a Sui subcommand:
|
||||
|
||||
`sui {{subcommand}}`
|
||||
|
||||
- Build tools for a smart contract:
|
||||
|
||||
`sui move {{subcommand}}`
|
||||
|
||||
- Publish smart contracts, get object information, execute transactions and more:
|
||||
|
||||
`sui client {{subcommand}}`
|
||||
|
||||
- Start a local network:
|
||||
|
||||
`sui start`
|
||||
|
||||
- Update from source:
|
||||
|
||||
`cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui`
|
||||
41
tldr/sui-client
Normal file
41
tldr/sui-client
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sui client
|
||||
|
||||
> Publish smart contracts, get object information, execute transactions, and more.
|
||||
> More information: <https://docs.sui.io/references/cli/client>.
|
||||
|
||||
- Create a new address with the ED25519 scheme:
|
||||
|
||||
`sui client new-address ed25519 {{address-alias}}`
|
||||
|
||||
- Create a new testnet environment with an RPC URL and alias:
|
||||
|
||||
`sui client new-env --rpc https://fullnode.testnet.sui.io:443 --alias testnet`
|
||||
|
||||
- Switch to the address of your choice (accepts also an alias):
|
||||
|
||||
`sui client switch --address {{address-alias}}`
|
||||
|
||||
- Switch to the given environment:
|
||||
|
||||
`sui client switch --env {{env-alias}}`
|
||||
|
||||
- Publish a smart contract:
|
||||
|
||||
`sui client publish {{package-path}}`
|
||||
|
||||
- Interact with the Sui faucet:
|
||||
|
||||
`sui client faucet {{subcommand}}`
|
||||
|
||||
- List the gas coins for the given address (accepts also an alias):
|
||||
|
||||
`sui client gas {{address}}`
|
||||
|
||||
- Create, sign, and execute programmable transaction blocks:
|
||||
|
||||
`sui client ptb {{options}} {{subcommand}}`
|
||||
21
tldr/sui-client-faucet
Normal file
21
tldr/sui-client-faucet
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sui client faucet
|
||||
|
||||
> Interact with the Sui faucet.
|
||||
> More information: <https://docs.sui.io/references/cli/client#request-a-sui-coin-from-faucet>.
|
||||
|
||||
- Get a SUI coin from the faucet associated with the active network:
|
||||
|
||||
`sui client faucet`
|
||||
|
||||
- Get a SUI coin for the address (accepts also an alias):
|
||||
|
||||
`sui client faucet --address {{address}}`
|
||||
|
||||
- Get a SUI coin from custom faucet:
|
||||
|
||||
`sui client faucet --url {{custom-faucet-url}}`
|
||||
29
tldr/sui-client-ptb
Normal file
29
tldr/sui-client-ptb
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sui client ptb
|
||||
|
||||
> Create, sign and execute programmable transaction blocks.
|
||||
> More information: <https://docs.sui.io/references/cli/ptb>.
|
||||
|
||||
- Call a Move function from a package and module:
|
||||
|
||||
`sui client ptb --move-call p::m::f "<{{type}}>" args`
|
||||
|
||||
- Make a Move vector with two elements of type u64:
|
||||
|
||||
`sui client ptb --make-move-vec "<u64>" "[1000,2000]"`
|
||||
|
||||
- Split a gas coin and transfer it to address:
|
||||
|
||||
`sui client ptb --split-coins gas "[1000]" --assign new_coins --transfer-objects "[new_coins]" @{{address}}`
|
||||
|
||||
- Transfer an object to an address:
|
||||
|
||||
`sui client ptb --transfer-objects "[{{object_id}}]" @{{address}}`
|
||||
|
||||
- Publish a Move package, and transfer the upgrade capability to sender:
|
||||
|
||||
`sui client ptb --move-call sui::tx_context::sender --assign sender --publish "." --assign upgrade_cap --transfer-objects "[upgrade_cap]" sender`
|
||||
37
tldr/sui-move
Normal file
37
tldr/sui-move
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sui move
|
||||
|
||||
> Work with Move source code.
|
||||
> More information: <https://docs.sui.io/references/cli/move>.
|
||||
|
||||
- Create a new Move project in the given folder:
|
||||
|
||||
`sui move new {{project_name}}`
|
||||
|
||||
- Test the Move project in the current directory:
|
||||
|
||||
`sui move test`
|
||||
|
||||
- Test with coverage and get a summary:
|
||||
|
||||
`sui move test --coverage; sui move coverage summary`
|
||||
|
||||
- Find which parts of your code are covered from tests (i.e. explain coverage results):
|
||||
|
||||
`sui move coverage source --module {{module_name}}`
|
||||
|
||||
- Build the Move project in the current directory:
|
||||
|
||||
`sui move build`
|
||||
|
||||
- Build the Move project from the given path:
|
||||
|
||||
`sui move build --path {{path}}`
|
||||
|
||||
- Migrate to Move 2024 for the package at the provided path:
|
||||
|
||||
`sui move migrate {{path}}`
|
||||
Reference in New Issue
Block a user