Update cheatsheets

This commit is contained in:
ivuorinen
2026-01-14 00:22:52 +00:00
parent 7351e2a037
commit 77164ff653
21 changed files with 372 additions and 30 deletions

View File

@@ -8,11 +8,11 @@ source: https://github.com/tldr-pages/tldr.git
> Schedule cron jobs to run on a time interval for the current user.
> More information: <https://manned.org/crontab>.
- Edit the crontab file for the current user:
- [e]dit the crontab file for the current user:
`crontab -e`
- Edit the crontab file for a specific user:
- [e]dit the crontab file for a specific [u]ser:
`sudo crontab -e -u {{user}}`
@@ -20,11 +20,11 @@ source: https://github.com/tldr-pages/tldr.git
`crontab {{path/to/file}}`
- View a list of existing cron jobs for current user:
- [l]ist existing cron jobs for the current user:
`crontab -l`
- Remove all cron jobs for the current user:
- [r]emove all cron jobs for the current user:
`crontab -r`

View File

@@ -6,29 +6,28 @@ source: https://github.com/tldr-pages/tldr.git
# gixy-next
> Analyze NGINX configuration files for security and performance misconfigurations.
> An actively maintained fork of `gixy`.
> More information: <https://gixy.io/usage/>.
- Analyze `nginx` configuration (default path: `/etc/nginx/nginx.conf`):
`gixy {{path/to/nginx.conf}}`
`gixy-next {{path/to/nginx.conf}}`
- Analyze a rendered configuration dump via `stdin` (`-`):
`cat {{path/to/nginx-dump.conf}} | gixy -`
`cat {{path/to/nginx-dump.conf}} | gixy-next -`
- Run only specific checks (comma-separated):
`gixy --tests {{http_splitting,ssrf,version_disclosure}} {{path/to/nginx.conf}}`
`gixy-next --tests {{http_splitting,ssrf,version_disclosure}} {{path/to/nginx.conf}}`
- Skip specific checks (comma-separated):
`gixy --skips {{low_keepalive_requests,worker_rlimit_nofile_vs_connections}} {{path/to/nginx.conf}}`
`gixy-next --skips {{low_keepalive_requests,worker_rlimit_nofile_vs_connections}} {{path/to/nginx.conf}}`
- Only report issues at a given severity or higher:
`gixy {{-l|-ll|-lll}} {{path/to/nginx.conf}}`
`gixy-next {{-l|-ll|-lll}} {{path/to/nginx.conf}}`
- Output as uncolored text or machine-readable JSON:
`gixy {{[-f|--format]}} {{text|json}} {{path/to/nginx.conf}}`
`gixy-next {{[-f|--format]}} {{text|json}} {{path/to/nginx.conf}}`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`hledger {{[areg|aregister]}} assets:bank:checking`
- Show transactions and running balance in the first account named `*savings*`:
- Show transactions and running balance in the first account whose name contains `savings`:
`hledger {{[areg|aregister]}} savings`

View File

@@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git
`hledger {{[bal|balance]}}`
- Show the balance change in accounts named `*expenses*`, as a tree, summarising the top two levels only:
- Show the balance change in accounts whose name contains `expenses`, as a tree, summarising the top two levels only:
`hledger {{[bal|balance]}} {{expenses}} {{[-t|--tree]}} {{[-2|--depth 2]}}`
@@ -25,7 +25,7 @@ source: https://github.com/tldr-pages/tldr.git
`hledger {{[bal|balance]}} type:{{X}} {{[-MTAS|--monthly --row-total --average --sort-amount]}} --budget {{[-t|--tree]}} {{[-2|--depth 2]}} --no-elide`
- Show end balances (including from postings before the start date), quarterly in 2024, in accounts named `*assets*` or `*liabilities*`:
- Show end balances (including from postings before the start date), quarterly in 2024, in accounts whose name contains `assets` or `liabilities`:
`hledger {{[bal|balance]}} {{[-H|--historical]}} {{[-p|--period]}} '{{quarterly in 2024}}' {{assets}} {{liabilities}}`

View File

@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`hledger print {{[-f|--file]}} {{path/to/2023.journal}} {{[-f|--file]}} {{path/to/2024.journal}} {{[-B|--cost]}}`
- Show `$` transactions in `*food*` but not `*groceries*` accounts this month:
- Show `$` transactions this month in accounts whose name contains `food` but not `groceries`:
`hledger print cur:\$ food not:groceries date:thismonth`

34
tldr/jj-config Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config
> Manage config options.
> Some subcommands such as `edit`, `get`, `list`, `path`, `set`, `unset` have their own usage documentation.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config>.
- Start an editor on the user-level config file:
`jj config {{[e|edit]}} --user`
- Get the value of a config option:
`jj config {{[g|get]}} {{name}}`
- List all config variables and their values:
`jj config {{[l|list]}}`
- Print the path to the user-level config file:
`jj config {{[p|path]}} --user`
- Set a config option in the user-level config:
`jj config {{[s|set]}} --user {{name}} {{value}}`
- Unset a config option in the user-level config:
`jj config {{[u|unset]}} --user {{name}}`

22
tldr/jj-config-edit Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config edit
> Start an editor on a config file.
> See also: `jj config path`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-edit>.
- Start an editor on the user-level config file:
`jj config {{[e|edit]}} --user`
- Start an editor on the repo-level config file:
`jj config {{[e|edit]}} --repo`
- Start an editor on the workspace-level config file:
`jj config {{[e|edit]}} --workspace`

27
tldr/jj-config-get Normal file
View File

@@ -0,0 +1,27 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config get
> Get the value of a given config option.
> Unlike `jj config list`, the result is printed without extra formatting for use in scripts.
> See also: `jj config list`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-get>.
- Get the value of a config option:
`jj config {{[g|get]}} {{name}}`
- Get the configured user name:
`jj config {{[g|get]}} user.name`
- Get the configured user email:
`jj config {{[g|get]}} user.email`
- Get the default revset for the log command:
`jj config {{[g|get]}} revsets.log`

38
tldr/jj-config-list Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config list
> List variables set in config files, along with their values.
> See also: `jj config get`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-list>.
- List all config variables and their values:
`jj config {{[l|list]}}`
- List a specific config option:
`jj config {{[l|list]}} {{name}}`
- List user-level config variables:
`jj config {{[l|list]}} --user`
- List repo-level config variables:
`jj config {{[l|list]}} --repo`
- List config variables including built-in default values:
`jj config {{[l|list]}} --include-defaults`
- List config variables including overridden values:
`jj config {{[l|list]}} --include-overridden`
- List config variables with a custom template:
`jj config {{[l|list]}} {{[-T|--template]}} {{template}}`

22
tldr/jj-config-path Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config path
> Print the paths to the config files.
> See also: `jj config edit`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-path>.
- Print the path to the user-level config file:
`jj config {{[p|path]}} --user`
- Print the path to the repo-level config file:
`jj config {{[p|path]}} --repo`
- Print the path to the workspace-level config file:
`jj config {{[p|path]}} --workspace`

31
tldr/jj-config-set Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config set
> Set a config option to a given value.
> The value is specified as a TOML expression.
> See also: `jj config unset`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-set>.
- Set the user name in the user-level config:
`jj config {{[s|set]}} --user user.name "{{name}}"`
- Set the user email in the user-level config:
`jj config {{[s|set]}} --user user.email "{{email}}"`
- Set a config option in the repo-level config:
`jj config {{[s|set]}} --repo {{name}} {{value}}`
- Set a config option in the workspace-level config:
`jj config {{[s|set]}} --workspace {{name}} {{value}}`
- Set a boolean config option:
`jj config {{[s|set]}} --user {{name}} {{true|false}}`

22
tldr/jj-config-unset Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj config unset
> Unset a config option.
> See also: `jj config set`.
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-config-unset>.
- Unset a config option in the user-level config:
`jj config {{[u|unset]}} --user {{name}}`
- Unset a config option in the repo-level config:
`jj config {{[u|unset]}} --repo {{name}}`
- Unset a config option in the workspace-level config:
`jj config {{[u|unset]}} --workspace {{name}}`

View File

@@ -18,19 +18,19 @@ source: https://github.com/tldr-pages/tldr.git
- Duplicate a revision onto a different parent:
`jj duplicate --destination {{dest_revset}} {{revset}}`
`jj duplicate {{[-d|--destination]}} {{dest_revset}} {{revset}}`
- Duplicate a revision and insert it **after** other revision(s):
- Duplicate a revision and insert it after other revision(s):
`jj duplicate --insert-after {{after_revset}} {{revset}}`
`jj duplicate {{[-A|--insert-after]}} {{after_revset}} {{revset}}`
- Duplicate a revision and insert it **before** other revision(s):
- Duplicate a revision and insert it before other revision(s):
`jj duplicate --insert-before {{before_revset}} {{revset}}`
`jj duplicate {{[-B|--insert-before]}} {{before_revset}} {{revset}}`
- Duplicate onto multiple parents (creates a merge commit):
`jj duplicate --destination {{destination1}} --destination {{destination2}} {{revset}}`
`jj duplicate {{[-d|--destination]}} {{destination1}} {{[-d|--destination]}} {{destination2}} {{revset}}`
- Duplicate multiple revisions:

View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# apptainer overlay
> Manage EXT3 writable overlay images for Apptainer containers.
> More information: <https://apptainer.org/docs/user/main/cli/apptainer_overlay.html>.
- Add a writable overlay to an existing SIF image:
`apptainer overlay create {{[-s|--size]}} {{size}} {{path/to/image.sif}}`
- Create a standalone EXT3 writable overlay image:
`apptainer overlay create {{[-s|--size]}} {{size}} {{path/to/overlay.img}}`
- Create a sparse overlay image:
`apptainer overlay create {{[-s|--size]}} {{size}} {{[-S|--sparse]}} {{path/to/overlay.img}}`
- Create an overlay for use with fakeroot:
`apptainer overlay create {{[-f|--fakeroot]}} {{[-s|--size]}} {{size}} {{path/to/overlay.img}}`
- Create an overlay with a specific directory in the layout:
`apptainer overlay create --create-dir {{path/to/directory}} {{path/to/overlay.img}}`
- Display help:
`apptainer overlay {{[-h|--help]}}`

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
---
# slurmrestd
> Interface to Slurm via REST API. It can be used in two modes: *Inetd Mode* & *Listen Mode*.
> Interface to Slurm via REST API. It can be used in two modes: Inetd Mode and Listen Mode.
> More information: <https://slurm.schedmd.com/slurmrestd.html>.
- Change the [g]roup ID (and drop supplemental groups) before processing client requests:

21
tldr/ng-completion Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ng completion
> Generate shell autocompletion scripts for the Angular CLI.
> More information: <https://angular.dev/cli/completion>.
- Set up autocompletion interactively for the current shell:
`ng completion`
- Generate an autocompletion script for `bash` or `zsh`:
`ng completion script`
- Source the autocompletion script in the current session:
`source <(ng completion script)`

View File

@@ -38,6 +38,6 @@ source: https://github.com/tldr-pages/tldr.git
`lls`
- [Interactive] et list of files on remote machine:
- [Interactive] Get a list of files on the remote machine:
`ls`

View File

@@ -5,14 +5,18 @@ source: https://github.com/tldr-pages/tldr.git
---
# xdelta
> Delta encoding utility.
> Often used for applying patches to binary files.
> More information: <https://github.com/jmacd/xdelta>.
> A delta encoding utility to generate and apply patches to binary files.
> For the modern version (v3), see `xdelta3`.
> More information: <https://manned.org/xdelta>.
- Apply a patch:
- Generate a patch (delta) between two files:
`xdelta -d -s {{path/to/input_file}} {{path/to/delta_file.xdelta}} {{path/to/output_file}}`
`xdelta delta {{path/to/old_file}} {{path/to/new_file}} {{path/to/patch_file}}`
- Create a patch:
- Apply a patch to an old file to reconstruct the new file:
`xdelta -e -s {{path/to/old_file}} {{path/to/new_file}} {{path/to/output_file.xdelta}}`
`xdelta patch {{path/to/patch_file}} {{path/to/old_file}} {{path/to/new_file}}`
- Generate a patch with a specific compression level:
`xdelta delta -{{0..9}} {{path/to/old_file}} {{path/to/new_file}} {{path/to/patch_file}}`

21
tldr/xdelta3 Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# xdelta3
> A delta compression tool for binary files.
> More information: <https://github.com/jmacd/xdelta/blob/wiki/CommandLineSyntax.md>.
- Create a patch ([e]ncode) based on a [s]ource file:
`xdelta3 -e -s {{path/to/old_file}} {{path/to/new_file}} {{path/to/patch_file}}`
- Apply a patch ([d]ecompress) to a [s]ource file:
`xdelta3 -d -s {{path/to/old_file}} {{path/to/patch_file}} {{path/to/new_file}}`
- Create a patch with a specific compression level:
`xdelta3 -{{0..9}} -s {{path/to/old_file}} {{path/to/new_file}} {{path/to/patch_file}}`

38
tldr/yara Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# yara
> Pattern matching tool for identifying and classifying malware.
> See also: `yarac`.
> More information: <https://yara.readthedocs.io/en/stable/commandline.html>.
- Scan a specific file with a rule file:
`yara {{path/to/rule.yar}} {{path/to/file}}`
- Recursively scan a directory and subdirectories containing possible threats:
`yara {{path/to/rule.yar}} {{[-r|--recursive]}} {{path/to/directory}}`
- Scan a running process by its PID using multiple rules:
`yara {{path/to/rule1.yar path/to/rule2.yar ...}} {{PID}}`
- Print metadata associated with the matching rules:
`yara {{[-m|--print-meta]}} {{path/to/rule.yar}} {{path/to/file}}`
- Print the strings that caused the rule to match:
`yara {{[-s|--print-strings]}} {{path/to/rule.yar}} {{path/to/file}}`
- Use a specific number of threads for parallel scanning:
`yara {{[-p|--threads]}} {{number_of_threads}} {{path/to/rule.yar}} {{path/to/directory}}`
- Use compiled YARA rules file to scan a directory recursively:
`yara {{[-C|--compiled-rules]}} {{path/to/rules.bin}} {{[-r|--recursive]}} {{path/to/directory}}`

30
tldr/yarac Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# yarac
> Compile YARA rule source files into a binary format for faster loading.
> See also: `yara`.
> More information: <https://manned.org/yarac>.
- Compile a specific rule file:
`yarac {{path/to/rule.yar}} {{path/to/rule.bin}}`
- Compile multiple rule files into a single binary:
`yarac {{path/to/rule1.yar path/to/rule2.yar ...}} {{path/to/rules.bin}}`
- Define an external variable during compilation:
`yarac -d {{identifier}}={{value}} {{path/to/rule.yar}} {{path/to/rule.bin}}`
- Disable warnings during compilation:
`yarac {{[-w|--no-warnings]}} {{path/to/rule.yar}} {{path/to/rule.bin}}`
- Fail compilation on any warnings (do not use along with `--no-warnings`):
`yarac --fail-on-warnings {{path/to/rule.yar}} {{path/to/rule.bin}}`