Update cheatsheets

This commit is contained in:
ivuorinen
2024-08-28 00:15:37 +00:00
parent 4f0d9efa90
commit 498596c46b
6 changed files with 119 additions and 9 deletions

41
tldr/bfs Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# bfs
> Breadth-first search for your files.
> More information: <https://manned.org/bfs>.
- Find files by extension:
`bfs {{root_path}} -name '{{*.ext}}'`
- Find files matching multiple path/name patterns:
`bfs {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'`
- Find directories matching a given name, in case-insensitive mode:
`bfs {{root_path}} -type d -iname '{{*lib*}}'`
- Find files matching a given pattern, excluding specific paths:
`bfs {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'`
- Find files matching a given size range, limiting the recursive depth to "1":
`bfs {{root_path}} -maxdepth 1 -size {{+500k}} -size {{-10M}}`
- Run a command for each file (use `{}` within the command to access the filename):
`bfs {{root_path}} -name '{{*.ext}}' -exec {{wc -l}} {} \;`
- Find all files modified today and pass the results to a single command as arguments:
`bfs {{root_path}} -daystart -mtime {{-1}} -exec {{tar -cvf archive.tar}} {} \+`
- Find empty files (0 byte) or directories and delete them verbosely:
`bfs {{root_path}} -type {{f|d}} -empty -delete -print`

22
tldr/linux/cjxl Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# cjxl
> Compress images to JPEG XL.
> Accepted input extensions are PNG, APNG, GIF, JPEG, EXR, PPM, PFM, PAM, PGX, and JXL.
> More information: <https://github.com/libjxl/libjxl>.
- Convert an image to JPEG XL:
`cjxl {{path/to/image.ext}} {{path/to/output.jxl}}`
- Set quality to lossless and maximize compression of the resulting image:
`cjxl --distance 0 --effort 9 {{path/to/image.ext}} {{path/to/output.jxl}}`
- Display an extremely detailed help page:
`cjxl --help --verbose --verbose --verbose --verbose`

18
tldr/linux/djxl Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# djxl
> Decompress JPEG XL images.
> Accepted output extensions are PNG, APNG, JPEG, EXR, PGM, PPM, PNM, PFM, PAM, EXIF, XMP and JUMBF.
> More information: <https://github.com/libjxl/libjxl>.
- Decompress a JPEG XL image to another format:
`djxl {{path/to/image.jxl}} {{path/to/output.ext}}`
- Display an extremely detailed help page:
`djxl --help --verbose --verbose --verbose --verbose`

View File

@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
- Run an installed application:
`flatpak run {{name}}`
`flatpak run {{com.example.app}}`
- Install an application from a remote source:
`flatpak install {{remote}} {{name}}`
`flatpak install {{remote_name}} {{com.example.app}}`
- List installed applications, ignoring runtimes:
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Remove an installed application:
`flatpak remove {{name}}`
`flatpak remove {{com.example.app}}`
- Remove all unused applications:
@@ -38,4 +38,4 @@ source: https://github.com/tldr-pages/tldr.git
- Show information about an installed application:
`flatpak info {{name}}`
`flatpak info {{com.example.app}}`

21
tldr/linux/flatpak-run Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# flatpak run
> Run flatpak applications and runtimes.
> More information: <https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-run>.
- Run an installed application:
`flatpak run {{com.example.app}}`
- Run an installed application from a specific branch e.g. stable, beta, master:
`flatpak run --branch={{stable|beta|master|...}} {{com.example.app}}`
- Run an interactive shell inside a flatpak:
`flatpak run --command={{sh}} {{com.example.app}}`

View File

@@ -6,21 +6,29 @@ source: https://github.com/tldr-pages/tldr.git
# mitmproxy
> An interactive man-in-the-middle HTTP proxy.
> See also: `mitmweb`.
> More information: <https://docs.mitmproxy.org/stable/concepts-options>.
> See also: `mitmweb` and `mitmdump`.
> More information: <https://docs.mitmproxy.org/stable/>.
- Start `mitmproxy` with default settings:
- Start `mitmproxy` with default settings (will listen on port `8080`):
`mitmproxy`
- Start `mitmproxy` bound to a custom address and port:
`mitmproxy --listen-host {{ip_address}} --listen-port {{port}}`
`mitmproxy --listen-host {{ip_address}} {{--listen-port|-p}} {{port}}`
- Start `mitmproxy` using a script to process traffic:
`mitmproxy --scripts {{path/to/script.py}}`
`mitmproxy {{--scripts|-s}} {{path/to/script.py}}`
- Export the logs with SSL/TLS master keys to external programs (wireshark, etc.):
`SSLKEYLOGFILE="{{path/to/file}}" mitmproxy`
- Specify mode of operation of the proxy server (`regular` is the default):
`mitmproxy {{--mode|-m}} {{regular|transparent|socks5|...}}`
- Set the console layout:
`mitmproxy --console-layout {{horizontal|single|vertical}}`