Update cheatsheets

This commit is contained in:
ivuorinen
2026-01-02 00:22:05 +00:00
parent 359cefe811
commit fe5e4dcb31
6 changed files with 157 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Save a video as GIF, scaling the height to 1000px and setting framerate to 15:
`ffmpeg -i {{path/to/video.mp4}} {{[-vf|-filter:v]}} 'scale=-1:{{1000}}' -r {{15}} {{path/to/output.gif}}`
`ffmpeg -i {{path/to/video.mp4}} {{[-vf|-filter:v]}} 'scale=-1:1000' -r 15 {{path/to/output.gif}}`
- Combine numbered images (`frame_1.jpg`, `frame_2.jpg`, etc) into a video or GIF:

42
tldr/linux/apptainer Normal file
View File

@@ -0,0 +1,42 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# apptainer
> Manage containers for HPC and scientific computing.
> Some subcommands such as `build`, `pull`, and `push` have their own usage documentation.
> More information: <https://apptainer.org/docs/user/main/cli.html>.
- Download a container from Docker Hub:
`apptainer pull {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- Download a container from the Container Library:
`apptainer pull {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Build a container from a definition file:
`apptainer build {{path/to/image.sif}} {{path/to/definition.def}}`
- Start an interactive shell inside a container:
`apptainer shell {{path/to/image.sif}}`
- Execute a command inside a container:
`apptainer exec {{path/to/image.sif}} {{command}}`
- Run the default runscript of a container:
`apptainer run {{path/to/image.sif}}`
- Inspect a container's metadata:
`apptainer inspect {{path/to/image.sif}}`
- Display help:
`apptainer {{[-h|--help]}}`

View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# apptainer build
> Build Apptainer container images.
> More information: <https://apptainer.org/docs/user/main/cli/apptainer_build.html>.
- Build a container from a definition file:
`apptainer build {{path/to/image.sif}} {{path/to/definition.def}}`
- Build a container from Docker Hub:
`apptainer build {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- Build a container from the Container Library:
`apptainer build {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Build a writable [s]andbox directory instead of an image file:
`apptainer build {{[-s|--sandbox]}} {{path/to/directory}} docker://{{image}}:{{tag}}`
- Build a container without using the cache:
`apptainer build --disable-cache {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- [F]orce overwrite an existing image file:
`apptainer build {{[-F|--force]}} {{path/to/image.sif}} {{path/to/definition.def}}`
- Build using [f]akeroot for unprivileged builds:
`apptainer build {{[-f|--fakeroot]}} {{path/to/image.sif}} {{path/to/definition.def}}`
- Display help:
`apptainer build {{[-h|--help]}}`

42
tldr/linux/apptainer-pull Normal file
View File

@@ -0,0 +1,42 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# apptainer pull
> Pull container images from remote sources.
> See also: `apptainer-push`.
> More information: <https://apptainer.org/docs/user/main/cli/apptainer_pull.html>.
- Pull a container from Docker Hub:
`apptainer pull {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- Pull a container from the Container Library:
`apptainer pull {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Pull a container from an OCI registry:
`apptainer pull {{path/to/image.sif}} oras://{{registry/namespace/image}}:{{tag}}`
- Pull a container for a specific architecture:
`apptainer pull --arch {{amd64|arm64|ppc64le}} {{path/to/image.sif}} library://{{image}}:{{tag}}`
- [F]orce overwrite an existing image file:
`apptainer pull {{[-F|--force]}} {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- Pull a container as a writable sandbox directory:
`apptainer pull --sandbox {{path/to/directory}} docker://{{image}}:{{tag}}`
- Pull a container without using the cache:
`apptainer pull --disable-cache {{path/to/image.sif}} docker://{{image}}:{{tag}}`
- Display help:
`apptainer pull {{[-h|--help]}}`

30
tldr/linux/apptainer-push Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# apptainer push
> Push container images to remote registries.
> See also: `apptainer-pull`.
> More information: <https://apptainer.org/docs/user/main/cli/apptainer_push.html>.
- Push a container to the Container Library:
`apptainer push {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Push a container to an OCI registry:
`apptainer push {{path/to/image.sif}} oras://{{registry/namespace/image}}:{{tag}}`
- Push an [U]nsigned container (skip signature verification):
`apptainer push {{[-U|--allow-unsigned]}} {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Push a container with a [D]escription (library only):
`apptainer push {{[-D|--description]}} "{{description}}" {{path/to/image.sif}} library://{{user/collection/container}}:{{tag}}`
- Display help:
`apptainer push {{[-h|--help]}}`

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Manipulate complex SQL query with data from multiple CSV files with first line is header (`-ih`):
`trdsql -icsv -ih "SELECT {{column1,column2}} FROM {{path/to/file*.csv}} WHERE column2 != '' ORDER BY column1 GROUP BY column1"`
`trdsql -icsv -ih "SELECT {{column1,column2}} FROM {{path/to/file*.csv}} WHERE column2 != '' ORDER BY {{column1}} GROUP BY {{column1}}"`
- Merge content of 2 CSV files to one CSV file: