Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-23 00:12:47 +00:00
parent b0c7acbdc0
commit 6ad53288ef
10 changed files with 190 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# dalvikvm
> Android Java virtual machine.
> More information: <https://developer.android.com/tools/#art_and_dalvik>.
> More information: <https://source.android.com/docs/core/runtime>.
- Start a specific Java program:

18
tldr/fitstopnm Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# fitstopnm
> Convert a Flexible Image Transport System (FITS) file to a PNM image.
> See also: `pamtofits`.
> More information: <https://netpbm.sourceforge.net/doc/fitstopnm.html>.
- Convert a FITS file to a PNM image:
`fitstopnm {{path/to/file.fits}} > {{path/to/output.pnm}}`
- Convert the image on the specified position of the third axis in the FITS file:
`fitstopnm -image {{z_position}} {{path/to/file.fits}} > {{path/to/output.pnm}}`

22
tldr/pamcut Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamcut
> Cut out a rectangular region from a Netpbm image.
> See also: `pamcrop`, `pamdice`, `pamcomp`.
> More information: <https://netpbm.sourceforge.net/doc/pamcut.html>.
- Discard the specified number of columns/rows on each side of the image:
`pamcut -cropleft {{value}} -cropright {{value}} -croptop {{value}} -cropbottom {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}`
- Keep only the columns between the specified columns (inclusively):
`pamcut -left {{value}} -right {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}`
- Fill missing areas with black pixels if the specified rectangle does not entirely lie within the input image:
`pamcut -top {{value}} -bottom {{value}} -pad {{path/to/image.ppm}} > {{path/to/output.ppm}}`

18
tldr/pamdeinterlace Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamdeinterlace
> Remove every other row in a Netpbm image.
> See also: `pammixinterlace`.
> More information: <https://netpbm.sourceforge.net/doc/pamdeinterlace.html>.
- Produce an image consisting of the input's even-numbered rows:
`pamdeinterlace {{path/to/image.ppm}} > {{path/to/output.ppm}}`
- Produce an image consisting of the input's odd-numbered rows:
`pamdeinterlace -takeodd {{path/to/image.ppm}} > {{path/to/output.ppm}}`

18
tldr/pamdice Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamdice
> Slice a Netpbm image vertically or horizontally.
> See also: `pamundice`.
> More information: <https://netpbm.sourceforge.net/doc/pamdice.html>.
- Slice a Netpbm image such that the resulting tiles have the specified height and width:
`pamdice -outstem {{path/to/filename_stem}} -height {{value}} -width {{value}} {{path/to/input.ppm}}`
- Make the produced pieces overlap by the specified amount horizontally and vertically:
`pamdice -outstem {{path/to/filename_stem}} -height {{value}} -width {{value}} -hoverlap {{value}} -voverlap {{value}} {{path/to/input.ppm}}`

22
tldr/pammixinterlace Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pammixinterlace
> Merge each row in an image with its two neighbours.
> See also: `pamdeinterlace`.
> More information: <https://netpbm.sourceforge.net/doc/pammixinterlace.html>.
- Merge each row in an image with its two neighbours:
`pammixinterlace {{path/to/image.ppm}} > {{path/to/output.ppm}}`
- Use the specified filtering mechanism:
`pammixinterlace -filter {{linear|fir|ffmpeg}} {{path/to/image.ppm}} > {{path/to/output.ppm}}`
- Turn on adaptive filtering mode, i.e., only modify pixels that are obviously part of a comb pattern:
`pammixinterlace -adaptive {{path/to/image.ppm}} > {{path/to/output.ppm}}`

14
tldr/pamtofits Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamtofits
> Convert a Netpbm image to the Flexible Image Transport System (FITS) format.
> See also: `fitstopnm`.
> More information: <https://netpbm.sourceforge.net/doc/pamtofits.html>.
- Convert a Netpbm image to the FITS format:
`pamtofits {{path/to/image.pam}} > {{path/to/output.fits}}`

22
tldr/pamundice Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pamundice
> Combine a grid of Netpbm images into one.
> See also: `pamdice`.
> More information: <https://netpbm.sourceforge.net/doc/pamundice.html>.
- Combine the images whose names match the `printf`-style filename expression. Assume a grid with a specific size:
`pamundice {{filename_%1d_%1a.ppm}} -across {{grid_width}} -down {{grid_height}} > {{path/to/output.ppm}}`
- Assume that the tiles overlap horizontally and vertically by the specified amount:
`pamundice {{filename_%1d_%1a.ppm}} -across {{x_value}} -down {{y_value}} -hoverlap {{value}} -voverlap {{value}} > {{path/to/output.ppm}}`
- Specify the images to be combined through a text file containing one filename per line:
`pamundice -listfile {{path/to/file.txt}} -across {{x_value}} -down {{y_value}} > {{path/to/output.ppm}}`

13
tldr/pnmtofits Normal file
View File

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

42
tldr/tgpt Normal file
View File

@@ -0,0 +1,42 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# tgpt
> Talk to an AI chatbot without the need for API keys.
> Available providers: `openai`, `opengpts`, `koboldai`, `phind`, `llama2`, `blackboxai`.
> More information: <https://github.com/aandrew-me/tgpt>.
- Chat with the default provider (GPT-3.5-turbo):
`tgpt "{{prompt}}"`
- Start [m]ulti-line interactive mode:
`tgpt --multiline`
- Generate [i]mages and save them to the current directory:
`tgpt --image "{{prompt}}"`
- Generate [c]ode with the default provider (GPT-3.5-turbo):
`tgpt --code "{{prompt}}"`
- Chat with a specific provider [q]uietly (without animations):
`tgpt --provider {{openai|opengpts|koboldai|phind|llama2|blackboxai}} --quiet --whole "{{prompt}}"`
- Generate and execute [s]hell commands using a specific provider (with a confirmation prompt):
`tgpt --provider {{llama2}} --shell "{{prompt}}"`
- Prompt with an API key, model, max response length, temperature, and `top_p` (required when using `openai` provider):
`tgpt --provider openai --key "{{api_key}}" --model "{{gpt-3.5-turbo}}" --max-length {{10}} --temperature {{0.7}} --top_p {{0.9}} "{{prompt}}"`
- Feed a file as additional pre-prompt input:
`tgpt --provider {{blackboxai}} "{{prompt}}" < {{path/to/file}}`