Update cheatsheets

This commit is contained in:
ivuorinen
2025-04-13 00:44:09 +00:00
parent abc22a98ef
commit 37f3913313
33 changed files with 117 additions and 70 deletions

View File

@@ -15,27 +15,27 @@ source: https://github.com/tldr-pages/tldr.git
- Search for a case-insensitive pattern:
`ack --ignore-case "{{search_pattern}}"`
`ack {{[-i|--ignore-case]}} "{{search_pattern}}"`
- Search for lines matching a pattern, printing [o]nly the matched text and not the rest of the line:
`ack -o "{{search_pattern}}"`
`ack {{[-o|--output='$&']}} "{{search_pattern}}"`
- Limit search to files of a specific type:
`ack --type {{ruby}} "{{search_pattern}}"`
`ack {{[-t|--type]}} {{ruby}} "{{search_pattern}}"`
- Do not search in files of a specific type:
`ack --type no{{ruby}} "{{search_pattern}}"`
`ack {{[-t|--type]}} no{{ruby}} "{{search_pattern}}"`
- Count the total number of matches found:
`ack --count --no-filename "{{search_pattern}}"`
`ack {{[-c|--count]}} {{[-h|--no-filename]}} "{{search_pattern}}"`
- Print the file names and the number of matches for each file only:
`ack --count --files-with-matches "{{search_pattern}}"`
`ack {{[-c|--count]}} {{[-l|--files-with-matches]}} "{{search_pattern}}"`
- List all the values that can be used with `--type`:

View File

@@ -17,7 +17,7 @@ source: https://github.com/tldr-pages/tldr.git
`ansible {{group}} {{[-m|--module-name]}} ping`
- Display facts about a group of hosts by invoking the setup [m]odule:
- Display facts about a group of hosts by invoking the setup module:
`ansible {{group}} {{[-m|--module-name]}} setup`

View File

@@ -29,6 +29,6 @@ source: https://github.com/tldr-pages/tldr.git
`az lock list`
- Show a subscription level lock with a specific [n]ame:
- Show a subscription level lock with a specific name:
`az lock show {{[-n|--name]}} {{lock_name}}`

View File

@@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git
`az storage blob download --account-name {{storage_account_name}} --account-key {{storage_account_key}} {{[-c|--container-name]}} {{container_name}} {{[-n|--name]}} {{path/to/blob}} {{[-f|--file]}} {{path/to/local_file}}`
- [d]ownload blobs from a blob container recursively:
- Download blobs from a blob container recursively:
`az storage blob download-batch --account-name {{storage_account_name}} --account-key {{storage_account_key}} {{[-s|--source]}} {{container_name}} {{[-d|--destination]}} {{path/to/remote}} --pattern {{filename_regex}} {{[-d|--destination]}} {{path/to/destination}}`

View File

@@ -12,9 +12,9 @@ source: https://github.com/tldr-pages/tldr.git
`box compile`
- Compile a new Phar file using a specific [c]onfiguration file:
- Compile a new Phar file using a specific configuration file:
`box compile -c {{path/to/config}}`
`box compile {{[-c|--config]}} {{path/to/config}}`
- Display information about the PHAR PHP extension:

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`bzip3 {{[-d|--decode]}} {{path/to/compressed_file.bz3}}`
- Decompress a file to `stdout` ([c]):
- Decompress a file to `stdout`:
`bzip3 {{[-dc|--decode --stdout]}} {{path/to/compressed_file.bz3}}`

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- List all containers (Running and Exited):
`crictl ps --all`
`crictl ps {{[-a|--all]}}`
- List all images:
@@ -26,15 +26,15 @@ source: https://github.com/tldr-pages/tldr.git
- Open a specific shell inside a running container:
`crictl exec -it {{container_id}} {{sh}}`
`crictl exec {{[-it|--interactive --tty]}} {{container_id}} {{sh}}`
- Pull a specific image from a registry:
`crictl pull {{image:tag}}`
- Print and [f]ollow logs of a specific container:
- Print and follow logs of a specific container:
`crictl logs -f {{container_id}}`
`crictl logs {{[-f|--follow]}} {{container_id}}`
- Remove one or more images:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Build a specific [P]roject file:
`gprbuild -P{{project_name}}`
`gprbuild -P {{project_name}}`
- Clean up the build workspace:

View File

@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo btrfs restore --path-regex {{regex}} -c {{path/to/btrfs_device}} {{path/to/target_directory}}`
- Restore files from a btrfs filesystem using a specific root tree `bytenr` (see `btrfs-find-root`):
- Restore files from a btrfs filesystem using a specific root [t]ree `bytenr` (see `btrfs-find-root`):
`sudo btrfs restore -t {{bytenr}} {{path/to/btrfs_device}} {{path/to/target_directory}}`

17
tldr/linux/caligula Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# caligula
> A user-friendly, lightweight TUI for disk imaging.
> More information: <https://github.com/ifd3f/caligula>.
- Flash an ISO to a drive:
`caligula burn {{path/to/image.iso}}`
- Flash an ISO to a drive without entering the hash interactively:
`caligula burn {{path/to/image.iso}} {{[s|--hash]}} {{hash}}`

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- List password information for the user:
`chage {{[-l|--list]]} {{username}}`
`chage {{[-l|--list]}} {{username}}`
- Enable password expiration in 10 days:

View File

@@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git
- List partitions:
`sudo fdisk -l`
`sudo fdisk {{[-l|--list]}}`
- Start the partition manipulator:

View File

@@ -13,9 +13,9 @@ source: https://github.com/tldr-pages/tldr.git
`swww img {{path/to/image}}`
- Set wallpaper to specified [o]utputs:
- Set wallpaper to specified outputs:
`swww img -o {{output1,output2,...}} {{path/to/image}}`
`swww img {{[-o|--outputs]}} {{output1,output2,...}} {{path/to/image}}`
- Restore last wallpaper:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo urpmi.removemedia {{medium}}`
- Remove all media:
- Remove [a]ll media:
`sudo urpmi.removemedia -a`

25
tldr/linux/znc Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# znc
> IRC bouncer.
> More information: <https://manned.org/znc>.
- Run the initial setup:
`znc {{[-c|--makeconf]}}`
- Start the IRC bouncer daemon:
`znc`
- Setup `znc` for systemd:
`sudo {{[-u|--user]}} znc znc {{[-c|--makeconf]}} {{[-d|--datadir]}} /var/lib/znc`
- Enable `znc` to start on boot and start it now:
`systemctl enable znc --now`

View File

@@ -25,6 +25,10 @@ source: https://github.com/tldr-pages/tldr.git
`{{<[>|<]>}}`
- Add subtitles from a file:
`mpv --sub-file={{path/to/file}}`
- Take a screenshot of the current frame (saved to `./mpv-shotNNNN.jpg` by default):
`<s>`
@@ -36,7 +40,3 @@ source: https://github.com/tldr-pages/tldr.git
- Play a file using a profile defined in the `mpv.conf` file:
`mpv --profile {{profile_name}} {{path/to/file}}`
- Display the output of webcam or other video input device:
`mpv {{/dev/video0}}`

View File

@@ -21,7 +21,7 @@ source: https://github.com/tldr-pages/tldr.git
`poetry install`
- Interactively initialize the current directory as a new Poetry project:
- Interactively (append `-n` for non-interactively) initialize the current directory as a new Poetry project:
`poetry init`

View File

@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
- Start an HTTP server with CORS enabled by including the `Access-Control-Allow-Origin: *` header in all responses:
`serve --cors`
`serve {{[-C|--cors]}}`
- Start an HTTP server on the default port rewriting all not-found requests to the `index.html` file:
`serve --single`
`serve {{[-s|--single]}}`
- Start an HTTPS server on the default port using the specified certificate:
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Start an HTTP server on the default port using a specific configuration file:
`serve --config {{path/to/serve.json}}`
`serve {{[-c|--config]}} {{path/to/serve.json}}`
- Display help:

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Display help:
`sfdk --help`
`sfdk {{[-h|--help]}}`
- Display help for specific topic (`building`, `testing`, `maintaining`, `ide`, `all`):

View File

@@ -18,16 +18,16 @@ source: https://github.com/tldr-pages/tldr.git
- Add testing level to the check:
`sfdk check -l +{{level}}`
`sfdk check {{[-l|--levels]}} +{{level}}`
- Remove testing level from the check:
`sfdk check -l -{{level}}`
`sfdk check {{[-l|--levels]}} -{{level}}`
- Add testing suite to the check:
`sfdk check -s +{{suite}}`
`sfdk check {{[-s|--suites]}} +{{suite}}`
- Remove testing suite from the check:
`sfdk check -s -{{suite}}`
`sfdk check {{[-s|--suites]}} -{{suite}}`

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Preview deploy without applying the changes:
`sfdk deploy --{{method}} --dry-run`
`sfdk deploy --{{method}} {{[-n|--dry-run]}}`
- Deploy files in glob pattern `package*`:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sfdk emulator device-model-show
> Show emulated device model's properties.
> More information: <https://github.com/sailfishos/sailfish-qtcreator/tree/master/src/tools/sfdk>.
- Show a model properties:

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Display the available emulators:
`sfdk emulator list -a`
`sfdk emulator list {{[-a|--available]}}`
- Display the installed emulators:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sfdk emulator start
> Starts an emulator.
> More information: <https://github.com/sailfishos/sailfish-qtcreator/tree/master/src/tools/sfdk>.
- Start an emulator:

View File

@@ -10,16 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
- Initialize a new project of the given type:
`sfdk init -t {{type}}`
`sfdk init {{[-t|--type]}} {{type}}`
- Initialize a new project with a specified builder:
`sfdk init -t {{type}} -b {{builder}}`
`sfdk init {{[-t|--type]}} {{type}} {{[-b|--builder]}} {{builder}}`
- Initialize a new project ignoring non-empty directory:
`sfdk init -t {{type}} --force`
`sfdk init {{[-t|--type]}} {{type}} --force`
- List available project types:
`sfdk init -l`
`sfdk init {{[-l|--list-types]}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sfdk maintain
> Launches the interactive SDK Maintenance tool.
> More information: <https://github.com/sailfishos/sailfish-qtcreator/tree/master/src/tools/sfdk>.
- Launch SDK Maintenance tool:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sfdk qmltypes
> Generates qmltypes files.
> More information: <https://github.com/sailfishos/sailfish-qtcreator/tree/master/src/tools/sfdk>.
- Generate qmltypes files:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sfdk scrape
> Converts source code modifications to patches.
> More information: <https://github.com/sailfishos/sailfish-qtcreator/tree/master/src/tools/sfdk>.
- Save source modifications as patches:
@@ -13,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Preview the list of commits to be scrapped:
`sfdk scrape --dry-run`
`sfdk scrape {{[-n|--dry-run]}}`
- Scrape while preserving the original patches file names:
@@ -21,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Scrape while saving patches to a specified [o]utput directory:
`sfdk scrape -o {{directory}}`
`sfdk scrape {{[-o|--output-dir]}} {{directory}}`
- Scrape without removing commits from submodules after creating patches:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Preview undeploy without applying the changes:
`sfdk undeploy --{{method}} --dry-run`
`sfdk undeploy --{{method}} {{[-n|--dry-run]}}`
- Undeploy files in glob pattern `package*`:

View File

@@ -12,30 +12,30 @@ source: https://github.com/tldr-pages/tldr.git
`shellcheck {{path/to/script.sh}}`
- Check a shell script interpreting it as the specified [s]hell dialect (overrides the shebang at the top of the script):
- Check a shell script interpreting it as the specified shell dialect (overrides the shebang at the top of the script):
`shellcheck --shell {{sh|bash|dash|ksh}} {{path/to/script.sh}}`
`shellcheck {{[-s|--shell]}} {{sh|bash|dash|ksh}} {{path/to/script.sh}}`
- Ignor[e] one or more error types:
- Ignore one or more error types:
`shellcheck --exclude {{SC1009,SC1073,...}} {{path/to/script.sh}}`
`shellcheck {{[-e|--exclude]}} {{SC1009,SC1073,...}} {{path/to/script.sh}}`
- Also check any sourced shell scripts:
`shellcheck --check-sourced {{path/to/script.sh}}`
`shellcheck {{[-a|--check-sourced]}} {{path/to/script.sh}}`
- Display output in the specified [f]ormat (defaults to `tty`):
- Display output in the specified format (defaults to `tty`):
`shellcheck --format {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}`
`shellcheck {{[-f|--format]}} {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}`
- Enable one or more [o]ptional checks:
`shellcheck --enable {{add-default-case,avoid-nullary-conditions,...}} {{path/to/script.sh}}`
`shellcheck {{[-o|--enable]}} {{add-default-case,avoid-nullary-conditions,...}} {{path/to/script.sh}}`
- List all available optional checks that are disabled by default:
`shellcheck --list-optional`
- Adjust the level of [S]everity to consider (defaults to `style`):
- Adjust the level of severity to consider (defaults to `style`):
`shellcheck --severity {{error|warning|info|style}} {{path/to/script.sh}}`
`shellcheck {{[-S|--severity]}} {{error|warning|info|style}} {{path/to/script.sh}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sops
> SOPS (Secrets OPerationS): a simple and flexible tool for managing secrets.
> More information: <https://github.com/mozilla/sops>.
> More information: <https://github.com/getsops/sops>.
- Encrypt a file:

View File

@@ -10,32 +10,32 @@ source: https://github.com/tldr-pages/tldr.git
- Print all URLs found by a Google search:
`xidel {{https://www.google.com/search?q=test}} --extract "//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']"`
`xidel {{https://www.google.com/search?q=test}} {{[-e|--extract]}} "//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']"`
- Print the title of all pages found by a Google search and download them:
`xidel {{https://www.google.com/search?q=test}} --follow "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" --extract {{//title}} --download {{'{$host}/'}}`
`xidel {{https://www.google.com/search?q=test}} {{[-f|--follow]}} "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" {{[-e|--extract]}} {{//title}} --download {{'{$host}/'}}`
- Follow all links on a page and print the titles, with XPath:
`xidel {{https://example.org}} --follow {{//a}} --extract {{//title}}`
`xidel {{https://example.org}} {{[-f|--follow]}} {{//a}} {{[-e|--extract]}} {{//title}}`
- Follow all links on a page and print the titles, with CSS selectors:
`xidel {{https://example.org}} --follow "{{css('a')}}" --css {{title}}`
`xidel {{https://example.org}} {{[-f|--follow]}} "{{css('a')}}" --css {{title}}`
- Follow all links on a page and print the titles, with pattern matching:
`xidel {{https://example.org}} --follow "{{<a>{.}</a>*}}" --extract "{{<title>{.}</title>}}"`
`xidel {{https://example.org}} {{[-f|--follow]}} "{{<a>{.}</a>*}}" {{[-e|--extract]}} "{{<title>{.}</title>}}"`
- Read the pattern from example.xml (which will also check if the element containing "ood" is there, and fail otherwise):
`xidel {{path/to/example.xml}} --extract "{{<x><foo>ood</foo><bar>{.}</bar></x>}}"`
`xidel {{path/to/example.xml}} {{[-e|--extract]}} "{{<x><foo>ood</foo><bar>{.}</bar></x>}}"`
- Print all newest Stack Overflow questions with title and URL using pattern matching on their RSS feed:
`xidel {{http://stackoverflow.com/feeds}} --extract "{{<entry><title>{title:=.}</title><link>{uri:=@href}</link></entry>+}}"`
`xidel {{http://stackoverflow.com/feeds}} {{[-e|--extract]}} "{{<entry><title>{title:=.}</title><link>{uri:=@href}</link></entry>+}}"`
- Check for unread Reddit mail, Webscraping, combining CSS, XPath, JSONiq, and automatically form evaluation:
`xidel {{https://reddit.com}} --follow "{{form(css('form.login-form')[1], {'user': '$your_username', 'passwd': '$your_password'})}}" --extract "{{css('#mail')/@title}}"`
`xidel {{https://reddit.com}} {{[-f|--follow]}} "{{form(css('form.login-form')[1], {'user': '$your_username', 'passwd': '$your_password'})}}" {{[-e|--extract]}} "{{css('#mail')/@title}}"`

View File

@@ -14,24 +14,24 @@ source: https://github.com/tldr-pages/tldr.git
- Grep a pattern in a compressed file (case-insensitive):
`zgrep -i {{pattern}} {{path/to/compressed/file}}`
`zgrep {{[-i|--ignore-case]}} {{pattern}} {{path/to/compressed/file}}`
- Output count of lines containing matched pattern in a compressed file:
`zgrep -c {{pattern}} {{path/to/compressed/file}}`
`zgrep {{[-c|--count]}} {{pattern}} {{path/to/compressed/file}}`
- Display the lines which dont have the pattern present (Invert the search function):
`zgrep -v {{pattern}} {{path/to/compressed/file}}`
`zgrep {{[-v|--invert-match]}} {{pattern}} {{path/to/compressed/file}}`
- Grep a compressed file for multiple patterns:
`zgrep -e "{{pattern_1}}" -e "{{pattern_2}}" {{path/to/compressed/file}}`
`zgrep {{[-e|--regexp]}} "{{pattern_1}}" {{[-e|--regexp]}} "{{pattern_2}}" {{path/to/compressed/file}}`
- Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`):
`zgrep -E {{regular_expression}} {{path/to/file}}`
`zgrep {{[-E|--extended-regexp]}} {{regular_expression}} {{path/to/file}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`zgrep -{{C|B|A}} {{3}} {{pattern}} {{path/to/compressed/file}}`
`zgrep --{{context|before-context|after-context}} {{3}} {{pattern}} {{path/to/compressed/file}}`