Update cheatsheets

This commit is contained in:
ivuorinen
2024-03-03 00:14:15 +00:00
parent 68931b0389
commit d5be0a5308
17 changed files with 212 additions and 4 deletions

22
tldr/checkov Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# checkov
> Checkov is a static code analysis tool for Infrastructure as Code (IaC).
> It is also a software composition analysis (SCA) tool for images and open source packages.
> More information: <https://www.checkov.io/1.Welcome/Quick%20Start.html>.
- Scan a directory containing IaC (Terraform, Cloudformation, ARM, Ansible, Bicep, Dockerfile, etc):
`checkov --directory {{path/to/directory}}`
- Scan an IaC file, omitting code blocks in the output:
`checkov --compact --file {{path/to/file}}`
- List all checks for all IaC types:
`checkov --list`

View File

@@ -23,3 +23,15 @@ source: https://github.com/tldr-pages/tldr.git
- Sort the output by a specified criteria:
`duf --sort {{size|used|avail|usage}}`
- Show or hide specific filesystems:
`duf --{{only-fs|hide-fs}} {{tmpfs|vfat|ext4|xfs}}`
- Sort the output by key:
`duf --sort {{mountpoint|size|used|avail|usage|inodes|inodes_used|inodes_avail|inodes_usage|type|filesystem}}`
- Change the theme (if `duf` fails to use the right theme):
`duf --theme {{dark|light}}`

13
tldr/icontopbm Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# icontopbm
> This command is superseded by `sunicontopbm`.
> More information: <https://netpbm.sourceforge.net/doc/icontopbm.html>.
- View documentation for the current command:
`tldr sunicontopbm`

14
tldr/pamarith Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamarith
> Apply a binary function on two Netpbm images.
> See also: `pamfunc`.
> More information: <https://netpbm.sourceforge.net/doc/pamarith.html>.
- Apply the specified binary function pixel-wise on the two specified images (which must be of the same size):
`pamarith -{{add|subtract|multiply|divide|difference|minimum|maximum|...}} {{path/to/image1.pam|pbm|pgm|ppm}} {{path/to/image2.pam|pbm|pgm|ppm}}`

14
tldr/pbmto4425 Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pbmto4425
> Display a PBM image on an AT&T 4425 terminal.
> See also: `ppmtoterm`, `pbmtoascii`.
> More information: <https://netpbm.sourceforge.net/doc/pbmto4425.html>.
- Display a PBM image on an AT&T 4425 terminal using the terminal's mosaic graphics character set:
`pbmto4425 {{path/to/image.pbm}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pbmtoascii
> Convert a PBM image to ASCII graphics.
> See also: `ppmtoascii`, `asciitopgm`, `ppmtoterm`.
> More information: <https://netpbm.sourceforge.net/doc/pbmtoascii.html>.
- Read a PBM file as input and produce an ASCII output:

13
tldr/pbmtoicon Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pbmtoicon
> This command is superseded by `pbmtosunicon`.
> More information: <https://netpbm.sourceforge.net/doc/pbmtoicon.html>.
- View documentation for the current command:
`tldr pbmtosunicon`

13
tldr/pbmtosunicon Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pbmtosunicon
> Convert a PBM image into a Sun icon.
> More information: <https://netpbm.sourceforge.net/doc/pbmtosunicon.html>.
- Convert a PBM image into a Sun icon:
`pbmtosunicon {{path/to/input.pbm}} > {{path/to/output.ico}}`

13
tldr/pnmarith Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pnmarith
> This command is superseded by `pamarith`.
> More information: <https://netpbm.sourceforge.net/doc/pnmarith.html>.
- View documentation for the current command:
`tldr pamarith`

View File

@@ -7,6 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Quantize the colors in a PNM image into a smaller set.
> This command is a combination of `pnmcolormap` and `pnmremap` and accepts the union of their options, except `-mapfile`.
> See also: `pnmquantall`.
> More information: <https://netpbm.sourceforge.net/doc/pnmquant.html>.
- Generate an image using only `n_colors` or less colors as close as possible to the input image:

18
tldr/pnmquantall Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pnmquantall
> Run `pnmquant` on multiple files at once such that they share a common colormap.
> See also: `pnmquant`.
> More information: <https://netpbm.sourceforge.net/doc/pnmquantall.html>.
- Run `pnmquant` on multiple files with the specified parameters, overwriting the original files:
`pnmquantall {{n_colors}} {{path/to/input1.pnm path/to/input2.pnm ...}}`
- Save the quantised images to files named the same as the input files, but with the specified extension appended:
`pnmquantall -ext {{extension}} {{n_colors}} {{path/to/input1.pnm path/to/input2.pnm ...}}`

13
tldr/ppmquantall Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ppmquantall
> This command is superseded by `pnmquantall`.
> More information: <https://netpbm.sourceforge.net/doc/ppmquantall.html>.
- View documentation for the current command:
`tldr pnmquantall`

18
tldr/ppmtoascii Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ppmtoascii
> Convert a PPM image to an ASCII image using ANSI terminal color codes.
> See also: `ppmtoterm`, `pbmtoascii`, `pbmto4425`.
> More information: <https://netpbm.sourceforge.net/doc/ppmtoascii.html>.
- Convert a PPM image to an ASCII image, combining an area of 1x2 pixels into a character:
`ppmtoascii {{path/to/input.ppm}} > {{path/to/output.txt}}`
- Convert a PPM image to an ASCII image, combining an area of 2x4 pixels into a character:
`ppmtoascii -2x4 {{path/to/input.ppm}} > {{path/to/output.txt}}`

14
tldr/ppmtoterm Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ppmtoterm
> Convert a PPM image to an ANSI ISO 6429 ASCII image.
> See also: `ppmtoascii`, `pbmtoascii`, `pbmto4425`.
> More information: <https://netpbm.sourceforge.net/doc/ppmtoterm.html>.
- Convert a PPM image to an ANSI ISO 6429 ASCII image, mapping each pixel to an individual character:
`ppmtoterm {{path/to/input.ppm}} > {{path/to/output.txt}}`

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Trim an audio file to the specified times:
`sox {{path/to/input_audio}} {{path/to/output_audio}} trim {{start}} {{end}}`
`sox {{path/to/input_audio}} {{path/to/output_audio}} trim {{start}} {{duration}}`
- Normalize an audio file (adjust volume to the maximum peak level, without clipping):

13
tldr/sunicontopbm Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# sunicontopnm
> Convert a Sun icon into a Netpbm image.
> More information: <https://netpbm.sourceforge.net/doc/sunicontopnm.html>.
- Convert a Sun icon into a Netpbm image:
`sunicontopnm {{path/to/input.ico}} > {{path/to/output.pbm}}`

View File

@@ -6,20 +6,36 @@ source: https://github.com/tldr-pages/tldr.git
# trivy
> Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues.
> More information: <https://github.com/aquasecurity/trivy>.
> More information: <https://aquasecurity.github.io/trivy>.
- Scan an image:
- Scan a Docker image for vulnerabilities and exposed secrets:
`trivy image {{image:tag}}`
- Scan a Docker image filtering the output by severity:
`trivy image --severity {{HIGH,CRITICAL}} {{alpine:3.15}}`
- Scan a Docker image ignoring any unfixed/unpatched vulnerabilities:
`trivy image --ignore-unfixed {{alpine:3.15}}`
- Scan the filesystem for vulnerabilities and misconfigurations:
`trivy fs --security-checks {{vuln,config}} {{path/to/project_directory}}`
- Scan a directory for misconfigurations:
- Scan a IaC (Terraform, CloudFormation, ARM, Helm and Dockerfile) directory for misconfigurations:
`trivy config {{path/to/iac_directory}}`
- Scan a local or remote Git repository for vulnerabilities:
`trivy repo {{path/to/local_repository_directory|remote_repository_URL}}`
- Scan a Git repository up to a specific commit hash:
`trivy repo --commit {{commit_hash}} {{repository}}`
- Generate output with a SARIF template:
`trivy image --format {{template}} --template {{"@sarif.tpl"}} -o {{path/to/report.sarif}} {{image:tag}}`