Skip to content

Commit 3a16a26

Browse files
committed
Add commands
1 parent 48810b8 commit 3a16a26

183 files changed

Lines changed: 18636 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/commands/3d-ascii-viewer.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# TLDR
2+
3+
**View a 3D model** as ASCII art in the terminal
4+
5+
```3d-ascii-viewer [path/to/model.obj]```
6+
7+
**View with specific dimensions**
8+
9+
```3d-ascii-viewer -w [80] -h [40] [model.obj]```
10+
11+
**Render with colored output**
12+
13+
```3d-ascii-viewer --color [model.obj]```
14+
15+
**View STL file** with rotation
16+
17+
```3d-ascii-viewer --rotate-x [45] --rotate-y [30] [model.stl]```
18+
19+
**Set custom ASCII characters** for shading
20+
21+
```3d-ascii-viewer --charset " .:-=+*#%@" [model.obj]```
22+
23+
**Enable wireframe mode**
24+
25+
```3d-ascii-viewer --wireframe [model.obj]```
26+
27+
**Output to file** instead of terminal
28+
29+
```3d-ascii-viewer [model.obj] > [output.txt]```
30+
31+
# SYNOPSIS
32+
33+
**3d-ascii-viewer** [_options_] _model_file_
34+
35+
# PARAMETERS
36+
37+
**-w**, **--width** _n_
38+
> Set output width in characters.
39+
40+
**-h**, **--height** _n_
41+
> Set output height in characters.
42+
43+
**--color**
44+
> Enable colored ASCII output using ANSI codes.
45+
46+
**--rotate-x** _degrees_
47+
> Rotate model around the X axis.
48+
49+
**--rotate-y** _degrees_
50+
> Rotate model around the Y axis.
51+
52+
**--rotate-z** _degrees_
53+
> Rotate model around the Z axis.
54+
55+
**--wireframe**
56+
> Render as wireframe instead of solid.
57+
58+
**--charset** _chars_
59+
> Custom characters for brightness levels (dark to light).
60+
61+
**--scale** _factor_
62+
> Scale the model by the specified factor.
63+
64+
**--fps** _n_
65+
> Frames per second for animation mode.
66+
67+
**--animate**
68+
> Continuously rotate the model.
69+
70+
**--help**
71+
> Display help information.
72+
73+
# DESCRIPTION
74+
75+
**3d-ascii-viewer** renders 3D model files as ASCII art in the terminal. It converts 3D geometry into text-based representations using characters of varying density to simulate shading and depth.
76+
77+
The tool supports common 3D formats including OBJ and STL files. Models are rendered using a simple rasterization approach where surface brightness determines which ASCII character is used. Darker areas use sparse characters like dots while brighter areas use dense characters like @ or #.
78+
79+
For interactive exploration, the animate mode continuously rotates the model, creating a spinning effect in the terminal. The color mode adds ANSI color codes for enhanced visual output on terminals that support them.
80+
81+
Output dimensions default to the terminal size but can be overridden for specific use cases like generating ASCII art for text files or documentation. The tool is useful for quick model inspection without launching a full 3D viewer.
82+
83+
# CAVEATS
84+
85+
Complex models with many polygons may render slowly or lose detail. Terminal font and aspect ratio affect the visual output. Color support depends on terminal capabilities. Very small output dimensions may produce unrecognizable results.
86+
87+
# HISTORY
88+
89+
ASCII art renderers for 3D content emerged alongside the demoscene and terminal art communities. Various implementations exist across programming languages, with modern versions supporting standard 3D file formats. The technique builds on decades of ASCII art tradition dating back to early computing.
90+
91+
# SEE ALSO
92+
93+
[meshlab](/man/meshlab)(1), [openscad](/man/openscad)(1), [blender](/man/blender)(1), [figlet](/man/figlet)(1)

assets/commands/alembic.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# TLDR
2+
3+
**Initialize Alembic** in a project
4+
5+
```alembic init [alembic]```
6+
7+
**Create a new migration** revision
8+
9+
```alembic revision -m "[Add users table]"```
10+
11+
**Auto-generate a migration** from model changes
12+
13+
```alembic revision --autogenerate -m "[Add email column]"```
14+
15+
**Upgrade to the latest** migration
16+
17+
```alembic upgrade head```
18+
19+
**Upgrade to a specific revision**
20+
21+
```alembic upgrade [revision_id]```
22+
23+
**Downgrade by one revision**
24+
25+
```alembic downgrade -1```
26+
27+
**Show current revision**
28+
29+
```alembic current```
30+
31+
**Display migration history**
32+
33+
```alembic history```
34+
35+
# SYNOPSIS
36+
37+
**alembic** [_options_] _command_ [_command_options_]
38+
39+
# PARAMETERS
40+
41+
**init** _directory_
42+
> Initialize a new Alembic environment in the specified directory.
43+
44+
**revision** [_-m message_] [_--autogenerate_]
45+
> Create a new migration revision file.
46+
47+
**upgrade** _revision_
48+
> Upgrade database to a target revision (use 'head' for latest).
49+
50+
**downgrade** _revision_
51+
> Downgrade database to a target revision (use '-1' for one step back).
52+
53+
**current**
54+
> Show the current revision of the database.
55+
56+
**history**
57+
> List revision history.
58+
59+
**heads**
60+
> Show all current head revisions.
61+
62+
**branches**
63+
> Show all branch points.
64+
65+
**stamp** _revision_
66+
> Set the revision table to a specific version without running migrations.
67+
68+
**show** _revision_
69+
> Display details of a specific revision.
70+
71+
**merge** _revisions_ [_-m message_]
72+
> Merge multiple branch heads into one.
73+
74+
**-c**, **--config** _file_
75+
> Path to alembic.ini configuration file.
76+
77+
**-n**, **--name** _name_
78+
> Name of config section to use.
79+
80+
**-x** _key=value_
81+
> Pass additional arguments to env.py.
82+
83+
**--autogenerate**
84+
> Auto-generate migration by comparing models to database.
85+
86+
**--sql**
87+
> Output SQL instead of applying migrations.
88+
89+
# DESCRIPTION
90+
91+
**Alembic** is a database migration tool for SQLAlchemy, Python's popular ORM. It manages incremental, reversible changes to database schemas through version-controlled migration scripts.
92+
93+
Migrations are Python files stored in a versions directory. Each migration has an upgrade() function to apply changes and a downgrade() function to reverse them. Alembic tracks the current database state in a special table, allowing it to determine which migrations need to run.
94+
95+
The **--autogenerate** feature compares SQLAlchemy model definitions against the current database schema to automatically generate migration scripts. While convenient, generated migrations should be reviewed as autogenerate cannot detect all types of changes.
96+
97+
Configuration is stored in **alembic.ini**, which specifies the database URL, migration script location, and other settings. The **env.py** script in the alembic directory handles migration environment setup and can be customized for complex scenarios.
98+
99+
# CAVEATS
100+
101+
Autogenerate cannot detect all changes (table renames, column type changes on some databases, constraint name changes). Always review generated migrations. Downgrade functions must be manually written or verified for autogenerated migrations. Database URL in alembic.ini may contain credentials that should not be committed.
102+
103+
# HISTORY
104+
105+
**Alembic** was created by Mike Bayer, the author of SQLAlchemy, with the first release in **2011**. It was designed to provide a migration solution that integrates naturally with SQLAlchemy's metadata and model system. The name comes from the alchemical vessel used for distillation, fitting the SQLAlchemy naming theme.
106+
107+
# SEE ALSO
108+
109+
[flask-migrate](/man/flask-migrate)(1), [django-admin](/man/django-admin)(1), [sqlalchemy](/man/sqlalchemy)(1), [psql](/man/psql)(1)

assets/commands/apptainer-exec.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# TLDR
2+
3+
**Execute a command** inside a container
4+
5+
```apptainer exec [container.sif] [command]```
6+
7+
**Run with bound directory** from host to container
8+
9+
```apptainer exec --bind [/host/path]:[/container/path] [container.sif] [command]```
10+
11+
**Execute with writable overlay**
12+
13+
```apptainer exec --overlay [overlay.img] [container.sif] [command]```
14+
15+
**Run with GPU support** (NVIDIA)
16+
17+
```apptainer exec --nv [container.sif] [command]```
18+
19+
**Execute from Docker Hub** image
20+
21+
```apptainer exec docker://[ubuntu:latest] [cat /etc/os-release]```
22+
23+
**Run with isolated network**
24+
25+
```apptainer exec --net --network none [container.sif] [command]```
26+
27+
**Execute with custom environment variable**
28+
29+
```apptainer exec --env [VAR=value] [container.sif] [command]```
30+
31+
**Run with all host filesystems bound**
32+
33+
```apptainer exec --bind /:/host:ro [container.sif] [command]```
34+
35+
# SYNOPSIS
36+
37+
**apptainer exec** [_options_] _container_ _command_ [_args_]
38+
39+
# PARAMETERS
40+
41+
**--bind**, **-B** _src[:dest[:opts]]_
42+
> Bind mount a path from the host into the container.
43+
44+
**--overlay** _image_
45+
> Use an overlay filesystem for writable layer.
46+
47+
**--nv**
48+
> Enable NVIDIA GPU support inside the container.
49+
50+
**--rocm**
51+
> Enable AMD ROCm GPU support.
52+
53+
**--contain**, **-c**
54+
> Use minimal /dev and empty other directories.
55+
56+
**--containall**, **-C**
57+
> Full isolation: contain plus clean environment and no PID namespace.
58+
59+
**--cleanenv**, **-e**
60+
> Clean environment before running container.
61+
62+
**--env** _VAR=value_
63+
> Set environment variable in container.
64+
65+
**--env-file** _file_
66+
> Load environment variables from file.
67+
68+
**--home** _path_
69+
> Set custom home directory.
70+
71+
**--pwd** _path_
72+
> Set initial working directory in container.
73+
74+
**--net**
75+
> Enable network namespace.
76+
77+
**--network** _type_
78+
> Specify network type (none, bridge, etc.).
79+
80+
**--fakeroot**
81+
> Run container with fake root privileges.
82+
83+
**--writable-tmpfs**
84+
> Add writable tmpfs overlay.
85+
86+
**--no-mount** _type_
87+
> Disable specific mount (proc, sys, dev, devpts, home, tmp, cwd).
88+
89+
# DESCRIPTION
90+
91+
**apptainer exec** runs a specified command inside an Apptainer container. Unlike **apptainer shell** which provides an interactive session, exec runs a single command and returns its exit status, making it ideal for batch processing and scripts.
92+
93+
The container can be specified as a local SIF file, a library URI (library://), a Docker URI (docker://), or an OCI archive. The command and any arguments are executed within the container environment with the current user's identity preserved.
94+
95+
By default, Apptainer mounts the current directory, home directory, and standard system paths into the container. Additional paths can be bound using **--bind**. For HPC workloads, the **--nv** or **--rocm** flags enable GPU passthrough.
96+
97+
The command inherits the host's environment by default. Use **--cleanenv** for reproducibility or **--contain** for isolation. Exit status reflects the executed command's return code.
98+
99+
# CAVEATS
100+
101+
User namespaces must be enabled in the kernel for rootless operation. Some containers may require **--writable-tmpfs** or **--overlay** to function properly. NVIDIA GPU support requires the nvidia-container-cli and compatible drivers. Network namespace requires root or appropriate privileges unless user namespaces are configured.
102+
103+
# HISTORY
104+
105+
Apptainer is the continuation of the **Singularity** project after it joined the Linux Foundation in **2021**. The exec subcommand has been a core feature since Singularity's inception at Lawrence Berkeley National Laboratory in **2015**. Apptainer 1.0 was released in **2022**, maintaining full compatibility with Singularity container formats while adding new features.
106+
107+
# SEE ALSO
108+
109+
[apptainer](/man/apptainer)(1), [apptainer-shell](/man/apptainer-shell)(1), [apptainer-run](/man/apptainer-run)(1), [apptainer-build](/man/apptainer-build)(1), [docker](/man/docker)(1)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# TLDR
2+
3+
**Display the run-help** for a container
4+
5+
```apptainer run-help [container.sif]```
6+
7+
**Show help for a Docker Hub image**
8+
9+
```apptainer run-help docker://[image:tag]```
10+
11+
**Display help from a library image**
12+
13+
```apptainer run-help library://[user/collection/image:tag]```
14+
15+
**Get run-help for an OCI archive**
16+
17+
```apptainer run-help oci-archive://[path/to/archive.tar]```
18+
19+
# SYNOPSIS
20+
21+
**apptainer run-help** [_options_] _container_
22+
23+
# PARAMETERS
24+
25+
_container_
26+
> Path to a SIF file or URI to a container image (docker://, library://, oci-archive://).
27+
28+
**--help**, **-h**
29+
> Display help for the run-help command.
30+
31+
# DESCRIPTION
32+
33+
**apptainer run-help** displays help text embedded within an Apptainer/Singularity container. This help information is defined during container build time using the **%help** section in a definition file.
34+
35+
Container authors use the %help section to document how to use their container, including expected arguments, required bind mounts, environment variables, and example commands. This provides users with container-specific usage information without needing external documentation.
36+
37+
When called on a container without a help section, the command returns with no output. The help text is stored in the container's metadata and does not affect the container's runtime size significantly.
38+
39+
This command is particularly useful in HPC environments where users may encounter unfamiliar containers and need quick usage guidance. It complements **apptainer inspect** which shows technical metadata rather than user-facing documentation.
40+
41+
# CAVEATS
42+
43+
Only displays help if the container author included a %help section during build. Returns nothing (not an error) if no help is defined. Cannot add help to an existing container without rebuilding it.
44+
45+
# HISTORY
46+
47+
The run-help feature has been part of Singularity/Apptainer since early versions, providing a standardized way for container authors to document container usage. The command was retained when Singularity became Apptainer under the Linux Foundation in **2021**.
48+
49+
# SEE ALSO
50+
51+
[apptainer](/man/apptainer)(1), [apptainer-run](/man/apptainer-run)(1), [apptainer-inspect](/man/apptainer-inspect)(1), [apptainer-build](/man/apptainer-build)(1)

0 commit comments

Comments
 (0)