Update cheatsheets

This commit is contained in:
ivuorinen
2024-09-09 00:17:25 +00:00
parent 70eb9d3aae
commit 63176c5eb3
9 changed files with 51 additions and 36 deletions

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# docker ps
> List Docker containers.
> More information: <https://docs.docker.com/engine/reference/commandline/ps/>.
> More information: <https://docs.docker.com/reference/cli/docker/container/ls/>.
- List currently running Docker containers:

View File

@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Commit only specific (already staged) files:
`git commit {{path/to/file1}} {{path/to/file2}}`
`git commit {{path/to/file1 path/to/file2 ...}}`
- Create a commit, even if there are no staged files:

26
tldr/linux/audit2allow Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# audit2allow
> Create an SELinux local policy module to allow rules based on denied operations found in logs.
> Note: Use audit2allow with caution—always review the generated policy before applying it, as it may allow excessive access.
> More information: <https://manned.org/audit2allow>.
- Generate a local policy to allow access for all denied services:
`sudo audit2allow --all -M {{local_policy_name}}`
- Generate a local policy module to grant access to a specific process/service/command from the audit logs:
`sudo grep {{apache2}} /var/log/audit/audit.log | sudo audit2allow -M {{local_policy_name}}`
- Inspect and review the Type Enforcement (.te) file for a local policy:
`vim {{local_policy_name}}.te`
- Install a local policy module:
`sudo semodule -i {{local_policy_name}}.pp`

View File

@@ -24,16 +24,20 @@ source: https://github.com/tldr-pages/tldr.git
- Download a macOS recovery image and creates a virtual machine configuration:
`quickget macos {{high-sierra|mojave|catalina|big-sur|monterey|ventura}}`
`quickget macos {{mojave|catalina|big-sur|monterey|ventura|sonoma}}`
- Show an ISO URL for an operating system (Note: it does not work for Windows):
- Show an ISO URL for an operating system:
`quickget --show-iso-url fedora {{release}} {{edition}}`
`quickget --url fedora {{release}} {{edition}}`
- Test if an ISO file is available for an operating system:
`quickget --test-iso-url nixos {{edition}} {{plasma5}}`
`quickget --check nixos {{release}} {{edition}}`
- Open an operating system distribution's homepage in a browser (Note: it does not work for Windows):
- Download an image without building any VM configuration:
`quickget --open-distro-homepage {{os}}`
`quickget --download {{os}} {{release}} {{edition}}`
- Create a VM configuration for an OS image:
`quickget --create-config {{os}} {{path/to/iso}}`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Manage the trashcan/recycling bin.
> More information: <https://github.com/andreafrancia/trash-cli>.
- Delete a file and send it to the trash:
- Send a file to the trash:
`trash {{path/to/file}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# netcat
> This command is an alias of `nc`.
> More information: <https://manned.org/nc>.
- View documentation for the original command:

View File

@@ -9,9 +9,9 @@ source: https://github.com/tldr-pages/tldr.git
> Manage Node.js projects and their module dependencies.
> More information: <https://www.npmjs.com>.
- Interactively create a `package.json` file:
- Create a `package.json` file with default values (omit --yes to do it interactively):
`npm init`
`npm init {{-y|--yes}}`
- Download all the packages listed as dependencies in `package.json`:
@@ -23,11 +23,11 @@ source: https://github.com/tldr-pages/tldr.git
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
`npm install {{package_name}} --save-dev`
`npm install {{package_name}} {{-D|--save-dev}}`
- Download the latest version of a package and install it globally:
`npm install --global {{package_name}}`
`npm install {{-g|--global}} {{package_name}}0`
- Uninstall a package and remove it from the list of dependencies in `package.json`:
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
- List top-level globally installed packages:
`npm list --global --depth={{0}}`
`npm list {{-g|--global}} --depth {{0}}`

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Check one or more specific files or directories:
`rubocop {{path/to/file}} {{path/to/directory}}`
`rubocop {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
- Write output to file:
@@ -26,11 +26,11 @@ source: https://github.com/tldr-pages/tldr.git
- Exclude a cop:
`rubocop --except {{cop_1}} {{cop_2}}`
`rubocop --except {{cop1 cop2 ...}}`
- Run only specified cops:
`rubocop --only {{cop_1}} {{cop_2}}`
`rubocop --only {{cop1 cop2 ...}}`
- Auto-correct files (experimental):

View File

@@ -5,25 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# trash-cli
> A command-line interface to the trashcan APIs.
> This command is an alias of `trash`.
> More information: <https://github.com/andreafrancia/trash-cli>.
- Trash specific files and directories into the current trashcan:
- View documentation for the original command:
`trash-put {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
- Remove specific files from the current trashcan:
`trash-rm {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
- Empty the current trashcan:
`trash-empty`
- List trashed files and directories in the current trashcan:
`trash-list`
- Restore a specific file or directory by a number from the displayed list from the current trashcan:
`trash-restore`
`tldr trash`