Update cheatsheets

This commit is contained in:
ivuorinen
2024-06-04 00:14:12 +00:00
parent cdeb1d6bc9
commit c4f575222c
33 changed files with 232 additions and 151 deletions

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# age
> A simple, modern and secure file encryption tool.
> See `age-keygen` for how to generate key pairs.
> See also: `age-keygen` for generating key pairs.
> More information: <https://github.com/FiloSottile/age>.
- Generate an encrypted file that can be decrypted with a passphrase:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# age-keygen
> Generate `age` key pairs.
> See `age` for how to encrypt/decrypt files.
> See also: `age` for encrypting/decrypting files.
> More information: <https://manned.org/age-keygen>.
- Generate a key pair, save it to an unencrypted file, and print the public key to `stdout`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# apm
> Atom editor Package Manager.
> See `atom`.
> See also: `atom`.
> More information: <https://github.com/atom/apm>.
- Install a package from <http://atom.io/packages> or a theme from <http://atom.io/themes>:

View File

@@ -5,14 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# compare
> Create a comparison image to visually annotate the difference between two images.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/compare.php>.
> This command is an alias of `magick compare`.
- Compare two images:
- View documentation for the original command:
`compare {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
- Compare two images using the specified metric:
`compare -verbose -metric {{PSNR}} {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
`tldr magick compare`

View File

@@ -5,38 +5,10 @@ source: https://github.com/tldr-pages/tldr.git
---
# convert
> Convert between image formats, scale, join, and create images, and much more.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/convert.php>.
> This command is an alias of `magick convert`.
> Note: this alias is deprecated since ImageMagick 7. It has been replaced by `magick`.
> Use `magick convert` if you need to use the old tool in versions 7+.
- Convert an image from JPEG to PNG:
- View documentation for the original command:
`convert {{path/to/input_image.jpg}} {{path/to/output_image.png}}`
- Scale an image to 50% of its original size:
`convert {{path/to/input_image.png}} -resize 50% {{path/to/output_image.png}}`
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
`convert {{path/to/input_image.png}} -resize 640x480 {{path/to/output_image.png}}`
- Scale an image to have a specified file size:
`convert {{path/to/input_image.png}} -define jpeg:extent=512kb {{path/to/output_image.jpg}}`
- Vertically/Horizontally append images:
`convert {{path/to/image1.png path/to/image2.png ...}} {{-append|+append}} {{path/to/output_image.png}}`
- Create a GIF from a series of images with 100ms delay between them:
`convert {{path/to/image1.png path/to/image2.png ...}} -delay {{10}} {{path/to/animation.gif}}`
- Create an image with nothing but a solid red background:
`convert -size {{800x600}} "xc:{{#ff0000}}" {{path/to/image.png}}`
- Create a favicon from several images of different sizes:
`convert {{path/to/image1.png path/to/image2.png ...}} {{path/to/favicon.ico}}`
`tldr magick convert`

View File

@@ -6,7 +6,8 @@ source: https://github.com/tldr-pages/tldr.git
# git fsck
> Verify the validity and connectivity of nodes in a Git repository index.
> Does not make any modifications. See `git gc` for cleaning up dangling blobs.
> Does not make any modifications.
> See also: `git gc` for cleaning up dangling blobs.
> More information: <https://git-scm.com/docs/git-fsck>.
- Check the current repository:

View File

@@ -5,19 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# identify
> Describe the format and characteristics of image files.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/identify.php>.
> This command is an alias of `magick identify`.
- Describe the format and basic characteristics of an image:
- View documentation for the original command:
`identify {{path/to/image}}`
- Describe the format and verbose characteristics of an image:
`identify -verbose {{path/to/image}}`
- Collect dimensions of all JPEG files in the current directory and save them into a CSV file:
`identify -format "{{%f,%w,%h
}}" {{*.jpg}} > {{path/to/filelist.csv}}`
`tldr magick identify`

View File

@@ -5,18 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# import
> Capture some or all of an X server screen, and save the image to a file.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/import.php>.
> This command is an alias of `magick import`.
- Capture the entire X server screen into a PostScript file:
- View documentation for the original command:
`import -window root {{path/to/output.ps}}`
- Capture contents of a remote X server screen into a PNG image:
`import -window root -display {{remote_host}}:{{screen}}.{{display}} {{path/to/output.png}}`
- Capture a specific window given its ID as displayed by `xwininfo` into a JPEG image:
`import -window {{window_id}} {{path/to/output.jpg}}`
`tldr magick import`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# mount.ddi
> Mount Discoverable Disk Images.
> See `tldr systemd-dissect` for other commands relevant to DDIs.
> See also: `systemd-dissect` for other commands relevant to DDIs.
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemd-dissect.html>.
- Mount an OS image:

View File

@@ -13,22 +13,30 @@ source: https://github.com/tldr-pages/tldr.git
`pw-dot`
- Specify an output file, showing all object types:
- Read objects from `pw-dump` JSON file:
`pw-dot --output {{path/to/file.dot}} --all`
`pw-dot {{-j|--json}} {{path/to/file.json}}`
- Specify an [o]utput file, showing [a]ll object types:
`pw-dot --output {{path/to/file.dot}} {{-a|--all}}`
- Print `.dot` graph to `stdout`, showing all object properties:
`pw-dot --output - --detail`
`pw-dot --output - {{-d|--detail}}`
- Generate a graph from a remote instance, showing only linked objects:
- Generate a graph from a [r]emote instance, showing only linked objects:
`pw-dot --remote {{remote_name}} --smart`
`pw-dot --remote {{remote_name}} {{-s|--smart}}`
- Lay the graph from left to right, instead of dot's default top to bottom:
- Lay the graph from [l]eft to [r]ight, instead of dot's default top to bottom:
`pw-dot --lr`
`pw-dot {{-L|--lr}}`
- Lay the graph using 90-degree angles in edges:
`pw-dot --90`
`pw-dot {{-9|--90}}`
- Display help:
`pw-dot --help`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# setcap
> Set capabilities of specified file.
> See also: `tldr getcap`.
> See also: `getcap`.
> More information: <https://manned.org/setcap>.
- Set capability `cap_net_raw` (to use RAW and PACKET sockets) for a given file:

View File

@@ -6,8 +6,9 @@ source: https://github.com/tldr-pages/tldr.git
# magick
> Create, edit, compose, or convert between image formats.
> ImageMagick version 7+. See `convert` for versions 6 and below.
> More information: <https://imagemagick.org/>.
> This tool replaces `convert` in ImageMagick 7+. See `magick convert` to use the old tool in versions 7+.
> Some subcommands, such as `mogrify` have their own usage documentation.
> More information: <https://imagemagick.org>.
- Convert between image formats:

18
tldr/magick-compare Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick compare
> Create a comparison image to visually annotate the difference between two images.
> See also: `magick`.
> More information: <https://imagemagick.org/script/compare.php>.
- Compare two images:
`magick compare {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
- Compare two images using the specified metric:
`magick compare -verbose -metric {{PSNR}} {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`

42
tldr/magick-convert Normal file
View File

@@ -0,0 +1,42 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick convert
> Convert between image formats, scale, join, and create images, and much more.
> Note: this tool (previously `convert`) has been replaced by `magick` in ImageMagick 7+.
> More information: <https://imagemagick.org/script/convert.php>.
- Convert an image from JPEG to PNG:
`magick convert {{path/to/input_image.jpg}} {{path/to/output_image.png}}`
- Scale an image to 50% of its original size:
`magick convert {{path/to/input_image.png}} -resize 50% {{path/to/output_image.png}}`
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
`magick convert {{path/to/input_image.png}} -resize 640x480 {{path/to/output_image.png}}`
- Scale an image to have a specified file size:
`magick convert {{path/to/input_image.png}} -define jpeg:extent=512kb {{path/to/output_image.jpg}}`
- Vertically/Horizontally append images:
`magick convert {{path/to/image1.png path/to/image2.png ...}} {{-append|+append}} {{path/to/output_image.png}}`
- Create a GIF from a series of images with 100ms delay between them:
`magick convert {{path/to/image1.png path/to/image2.png ...}} -delay {{10}} {{path/to/animation.gif}}`
- Create an image with nothing but a solid red background:
`magick convert -size {{800x600}} "xc:{{#ff0000}}" {{path/to/image.png}}`
- Create a favicon from several images of different sizes:
`magick convert {{path/to/image1.png path/to/image2.png ...}} {{path/to/favicon.ico}}`

23
tldr/magick-identify Normal file
View File

@@ -0,0 +1,23 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick identify
> Describe the format and characteristics of image files.
> See also: `magick`.
> More information: <https://imagemagick.org/script/identify.php>.
- Describe the format and basic characteristics of an image:
`magick identify {{path/to/image}}`
- Describe the format and verbose characteristics of an image:
`magick identify -verbose {{path/to/image}}`
- Collect dimensions of all JPEG files in the current directory and save them into a CSV file:
`magick identify -format "{{%f,%w,%h
}}" {{*.jpg}} > {{path/to/filelist.csv}}`

22
tldr/magick-import Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick import
> Capture some or all of an X server screen and save the image to a file.
> See also: `magick`.
> More information: <https://imagemagick.org/script/import.php>.
- Capture the entire X server screen into a PostScript file:
`magick import -window root {{path/to/output.ps}}`
- Capture contents of a remote X server screen into a PNG image:
`magick import -window root -display {{remote_host}}:{{screen}}.{{display}} {{path/to/output.png}}`
- Capture a specific window given its ID as displayed by `xwininfo` into a JPEG image:
`magick import -window {{window_id}} {{path/to/output.jpg}}`

31
tldr/magick-mogrify Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick mogrify
> Perform operations on multiple images, such as resizing, cropping, flipping, and adding effects.
> Changes are applied directly to the original file.
> See also: `magick`.
> More information: <https://imagemagick.org/script/mogrify.php>.
- Resize all JPEG images in the directory to 50% of their initial size:
`magick mogrify -resize {{50%}} {{*.jpg}}`
- Resize all images starting with `DSC` to 800x600:
`magick mogrify -resize {{800x600}} {{DSC*}}`
- Convert all PNGs in the directory to JPEG:
`magick mogrify -format {{jpg}} {{*.png}}`
- Halve the saturation of all image files in the current directory:
`magick mogrify -modulate {{100,50}} {{*}}`
- Double the brightness of all image files in the current directory:
`magick mogrify -modulate {{200}} {{*}}`

30
tldr/magick-montage Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# magick montage
> Tile images into a customizable grid.
> See also: `magick`.
> More information: <https://imagemagick.org/script/montage.php>.
- Tile images into a grid, automatically resizing images larger than the grid cell size:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} {{path/to/montage.jpg}}`
- Tile images into a grid, automatically calculating the grid cell size from the largest image:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} {{path/to/montage.jpg}}`
- Specify the grid cell size and resize images to fit it before tiling:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{640x480+0+0}} {{path/to/montage.jpg}}`
- Limit the number of rows and columns in the grid, causing input images to overflow into multiple output montages:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -tile {{2x3}} {{montage_%d.jpg}}`
- Resize and crop images to fill their grid cells before tiling:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -resize {{640x480^}} -gravity {{center}} -crop {{640x480+0+0}} {{path/to/montage.jpg}}`

View File

@@ -5,26 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# mogrify
> Perform operations on multiple images, such as resizing, cropping, flipping, and adding effects.
> Changes are applied directly to the original file. Part of ImageMagick.
> More information: <https://imagemagick.org/script/mogrify.php>.
> This command is an alias of `magick mogrify`.
- Resize all JPEG images in the directory to 50% of their initial size:
- View documentation for the original command:
`mogrify -resize {{50%}} {{*.jpg}}`
- Resize all images starting with `DSC` to 800x600:
`mogrify -resize {{800x600}} {{DSC*}}`
- Convert all PNGs in the directory to JPEG:
`mogrify -format {{jpg}} {{*.png}}`
- Halve the saturation of all image files in the current directory:
`mogrify -modulate {{100,50}} {{*}}`
- Double the brightness of all image files in the current directory:
`mogrify -modulate {{200}} {{*}}`
`tldr magick mogrify`

View File

@@ -5,26 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# montage
> Tiles images into a customizable grid.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/montage.php>.
> This command is an alias of `magick montage`.
- Tile images into a grid, automatically resizing images larger than the grid cell size:
- View documentation for the original command:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} {{path/to/montage.jpg}}`
- Tile images into a grid, automatically calculating the grid cell size from the largest image:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} {{path/to/montage.jpg}}`
- Specify the grid cell size and resize images to fit it before tiling:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{640x480+0+0}} {{path/to/montage.jpg}}`
- Limit the number of rows and columns in the grid, causing input images to overflow into multiple output montages:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -tile {{2x3}} {{montage_%d.jpg}}`
- Resize and crop images to fill their grid cells before tiling:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -resize {{640x480^}} -gravity {{center}} -crop {{640x480+0+0}} {{path/to/montage.jpg}}`
`tldr magick montage`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix-build
> Build a Nix expression.
> See also: `tldr nix3 build`.
> See also: `nix3 build`.
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-build.html>.
- Build a Nix expression:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix-shell
> Start an interactive shell based on a Nix expression.
> See also: `tldr nix3 shell`.
> See also: `nix3 shell`.
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-shell.html>.
- Start with nix expression in `shell.nix` or `default.nix` in the current directory:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix-store
> Manipulate or query the Nix store.
> See also: `tldr nix3 store`.
> See also: `nix3 store`.
> More information: <https://nixos.org/manual/nix/stable/command-ref/nix-store.html>.
- Collect garbage, such as removing unused paths:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix build
> Build a Nix expression (downloading from the cache when possible).
> See also: `tldr nix-build`. See `tldr nix3 flake` for information about flakes.
> See also: `nix-build` for information about traditional Nix builds from expressions, `nix3 flake` for information about flakes.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-build.html>.
- Build a package from nixpkgs, symlinking the result to `./result`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix registry
> Manage a Nix flake registry.
> See `tldr nix3 flake` for information about flakes.
> See also: `nix3 flake` for information about flakes.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-registry.html>.
- Pin the `nixpkgs` revision to the current version of the upstream repository:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix run
> Run an application from a Nix flake.
> See `tldr nix3 flake` for information about flakes.
> See also: `nix3 flake` for information about flakes.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-run.html>.
- Run the default application in the flake in the current directory:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix search
> Search for packages in a Nix flake.
> See `tldr nix3 flake` for information about flakes.
> See also: `nix3 flake` for information about flakes.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-search.html>.
- Search `nixpkgs` for a package based on its name or description:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix shell
> Start a shell in which the specified packages are available.
> See also: `tldr nix-shell`. See `tldr nix3 flake` for information about flakes.
> See also: `nix-shell` for setting up development environments, `nix3 flake` for information about flakes.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-shell.html>.
- Start an interactive shell with some packages from `nixpkgs`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nix store
> Manipulate the Nix store.
> See also: `tldr nix-store`.
> See also: `nix-store`.
> More information: <https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-store.html>.
- Collect garbage, i.e. remove unused paths to reduce space usage:

View File

@@ -11,12 +11,12 @@ source: https://github.com/tldr-pages/tldr.git
- Fix a Netpbm file that is missing its last part:
`pamfix -truncate {{path/to/corrupted.ext} > {{path/to/output.ext}}`
`pamfix -truncate {{path/to/corrupted.ext}} > {{path/to/output.ext}}`
- Fix a Netpbm file where pixel values exceed the image's `maxval` by lowering the offending pixels' values:
`pamfix -clip {{path/to/corrupted.ext}} > {{path/to/output.ext}}`
- Fix a Netpbm file where pixel values exceed the image's maxval by increasing it:
- Fix a Netpbm file where pixel values exceed the image's `maxval` by increasing it:
`pamfix -changemaxval {{path/to/corrupted.pam|pbm|pgm|ppm}} > {{path/to/output.pam|pbm|pgm|ppm}}`

View File

@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
- Use the specified [f]ont for annotations and paint the background [w]hite:
`pcdovtoppm -a {{number}} -w {{path/to/file.pcd}} > {{path/to/output.ppm}}`
`pcdovtoppm -f {{font}} -w {{path/to/file.pcd}} > {{path/to/output.ppm}}`

View File

@@ -15,28 +15,28 @@ source: https://github.com/tldr-pages/tldr.git
- Use archive mode (recursively copy directories, copy symlinks without resolving, and preserve permissions, ownership and modification times):
`rsync --archive {{path/to/source}} {{path/to/destination}}`
`rsync {{-a|--archive}} {{path/to/source}} {{path/to/destination}}`
- Compress the data as it is sent to the destination, display verbose and human-readable progress, and keep partially transferred files if interrupted:
`rsync --compress --verbose --human-readable --partial --progress {{path/to/source}} {{path/to/destination}}`
`rsync {{-zvhP|--compress --verbose --human-readable --partial --progress}} {{path/to/source}} {{path/to/destination}}`
- Recursively copy directories:
`rsync --recursive {{path/to/source}} {{path/to/destination}}`
`rsync {{-r|--recursive}} {{path/to/source}} {{path/to/destination}}`
- Transfer directory contents, but not the directory itself:
`rsync --recursive {{path/to/source}}/ {{path/to/destination}}`
`rsync {{-r|--recursive}} {{path/to/source}}/ {{path/to/destination}}`
- Use archive mode, resolve symlinks and skip files that are newer on the destination:
- Use archive mode, resolve symlinks, and skip files that are newer on the destination:
`rsync --archive --update --copy-links {{path/to/source}} {{path/to/destination}}`
`rsync {{-auL|--archive --update --copy-links}} {{path/to/source}} {{path/to/destination}}`
- Transfer a directory from a remote host running `rsyncd` and delete files on the destination that do not exist on the source:
`rsync --recursive --delete rsync://{{host}}:{{path/to/source}} {{path/to/destination}}`
`rsync {{-r|--recursive}} --delete rsync://{{host}}:{{path/to/source}} {{path/to/destination}}`
- Transfer a file over SSH using a different port than the default (22) and show global progress:
`rsync --rsh 'ssh -p {{port}}' --info=progress2 {{host}}:{{path/to/source}} {{path/to/destination}}`
`rsync {{-e|--rsh}} 'ssh -p {{port}}' --info=progress2 {{host}}:{{path/to/source}} {{path/to/destination}}`

View File

@@ -20,10 +20,6 @@ source: https://github.com/tldr-pages/tldr.git
`usql --command="{{sql_command}}"`
- List databases available on the server:
`usql --list-databases`
- Run an SQL command in the `usql` prompt:
`{{prompt}}=> {{command}}`