Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-04 00:17:43 +00:00
parent a03cd9f584
commit 54fbdb75a0
14 changed files with 193 additions and 44 deletions

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> JavaScript runtime and toolkit.
> Includes a bundler, a test runner, and a package manager.
> More information: <https://bun.sh>.
> More information: <https://bun.com/docs>.
- Run a JavaScript file or a `package.json` script:

View File

@@ -9,26 +9,34 @@ source: https://github.com/tldr-pages/tldr.git
> Some subcommands such as `pull`, `push`, `copy`, etc. have their own usage documentation.
> More information: <https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md/>.
- Execute a `crane` subcommand:
- Log in to a registry:
`crane {{subcommand}}`
`crane auth login {{registry}} {{[-u|--username]}} {{user}} {{[-p|--password]}} {{password}}`
- Allow pushing non-distributable (foreign) layers:
- List the repos in a registry:
`crane --allow-nondistributable-artifacts {{subcommand}}`
`crane catalog {{registry}} --full-ref`
- Allow image references to be fetched without TLS:
- List the tags in a repository:
`crane --insecure {{subcommand}}`
`crane ls {{repository}} {{[-o|--omit-digest-tags]}}`
- Specify the platform in the form `os/arch/variant:osversion` (e.g. `linux/amd64`). (default all):
- Pull remote images by reference and store their contents locally:
`crane --platform {{platform}} {{subcommand}}`
`crane pull {{image}} {{tarball}}`
- Enable debug logs for a subcommand:
- Push local image contents to a remote registry:
`crane {{[-v|--verbose]}} {{subcommand}}`
`crane push {{path/to/directory_or_tarball}} {{image}}`
- Display help for a subcommand:
- Efficiently tag a remote image:
`crane {{[-h|--help]}} {{subcommand}}`
`crane tag {{image}} {{tag}}`
- Efficiently copy a remote image from src to dst while retaining the digest value:
`crane copy {{src}} {{dst}} {{[-a|--all-tags]}}`
- Delete an image reference from its registry:
`crane delete {{image}}`

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> A collection of tools for indexing, inspecting, and visualizing disk usage.
> Duc maintains a database of accumulated sizes of directories of the file system, allowing queries in this database, or creating fancy graphs to show where data is.
> More information: <http://duc.zevv.nl>.
> More information: <https://duc.zevv.nl/>.
- Index the `/usr` directory, writing to the default database location `~/.duc.db`:

View File

@@ -6,31 +6,35 @@ source: https://github.com/tldr-pages/tldr.git
# gcrane
> Container images managing tool.
> This tool implements a superset of the `crane` commands, with additional commands that are specific to `gcr.io`.
> This tool implements a superset of the `crane` commands, with additional commands that are specific to Google Container Registry (`gcr.io`).
> Some subcommands such as `append`, `auth`, `copy`, etc. have their own usage documentation which can be found under `crane`.
> Some subcommands such as `completion`, `gc`, `help` are specific to gcrane and have their own usage documentation.
> More information: <https://github.com/google/go-containerregistry/blob/main/cmd/gcrane/README.md>.
- Execute a `gcrane` subcommand:
- Login to a registry:
`gcrane {{subcommand}}`
`gcrane auth login {{registry}} {{[-u|--username]}} {{user}} {{[-p|--password]}} {{password}}`
- Allow pushing non-distributable (foreign) layers:
- List tags, manifests, and sub-repostiories:
`gcrane --allow-nondistributable-artifacts {{subcommand}}`
`gcrane ls {{registry}}/{{project_id}}`
- Allow image references to be fetched without TLS:
- Copy images from one registry to another:
`gcrane --insecure {{subcommand}}`
`gcrane cp {{[-r|--recursive]}} {{source_registry}}/{{project_id}}/{{repository}} {{target_registry}}/{{project_id}}/{{repository}}`
- Specify the platform in the form `os/arch/variant:osversion` (e.g. `linux/amd64`). (default all):
- Print images that can be garbage collected:
`gcrane --platform {{platform}} {{subcommand}}`
`gcrane gc {{registry}}/{{project_id}}/{{repository}}`
- Enable debug logs:
- Delete images that can be garbage collected:
`gcrane {{[-v|--verbose]}} {{subcommand}}`
`gcrane gc {{registry}}/{{project_id}}/{{repository}} | xargs {{[-n|--max-args]}} 1 gcrane delete`
- Display help:
- List a specific registry with specific ID:
`gcrane {{[-h|--help]}}`
`gcrane ls {{gcr.io}}/{{my-project-id}}`
- Migrate all images from US registry to EU registry:
`gcrane cp {{[-r|--recursive]}} {{gcr.io}}/{{my-project-id}}/{{repository}} {{eu.gcr.io}}/{{my-project-id}}/{{repository}}`

37
tldr/gh-project Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# gh project
> Work with GitHub Projects.
> More information: <https://cli.github.com/manual/gh_project>.
- List projects owned by the currently authenticated user:
`gh project {{[ls|list]}}`
- List projects owned by a specific user or organization:
`gh project {{[ls|list]}} --owner {{owner}}`
- View a project by number:
`gh project view {{number}} --owner {{owner}}`
- Create a new project:
`gh project create --owner {{owner}} --title {{project_title}}`
- Add an item (issue or pull request) to a project:
`gh project item-add {{number}} --owner {{owner}} --url {{issue_or_pr_url}}`
- List items in a project:
`gh project item-list {{number}} --owner {{owner}}`
- Close a project:
`gh project close {{number}} --owner {{owner}}`

View File

@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
- Update every submodule to its latest commit:
`git submodule foreach git pull`
`git submodule update --init --recursive --remote`

32
tldr/hg
View File

@@ -9,18 +9,34 @@ source: https://github.com/tldr-pages/tldr.git
> Some subcommands such as `commit` have their own usage documentation.
> More information: <https://www.mercurial-scm.org/help/commands>.
- Execute a Mercurial command:
- Create an empty Mercurial repository:
`hg {{command}}`
`hg init`
- Display help:
- Clone a remote Mercurial repository from the internet:
`hg help`
`hg clone {{https://example.com/repo}}`
- Display help for a specific command:
- View the status of a local repository:
`hg help {{command}}`
`hg status`
- Display version:
- Add all new files to the next commit:
`hg --version`
`hg add`
- Commit changes to version history:
`hg commit {{[-m|--message]}} {{message_text}}`
- Push local changes to a remote repository:
`hg push`
- Pull any changes made to a remote:
`hg pull`
- Reset everything the way it was in the latest commit:
`hg update {{[-C|--clean]}}; hg purge`

View File

@@ -28,14 +28,14 @@ source: https://github.com/tldr-pages/tldr.git
`htop {{[-d|--delay]}} {{50}}`
- Disable all system and process changing features:
`htop --readonly`
- See interactive commands while running htop:
`<?>`
`{{<F1>|<?>}}`
- Switch to a different tab:
`<Tab>`
- Display help:
`htop {{[-h|--help]}}`

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Command-line text-only web browser.
> See also: `links2'.
> More information: <http://links.twibright.com/user_en.html#subch-browser_calibration>.
> More information: <https://links.twibright.com/user_en.html#subch-browser_calibration>.
- Visit a website:

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Command-line web browser with optional graphics support.
> See also: `links`.
> More information: <http://links.twibright.com/user_en.html#subch-browser_calibration>.
> More information: <https://links.twibright.com/user_en.html#subch-browser_calibration>.
- Visit a website in graphics mode:

View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl reload
> Reload a service's configuration without restarting it.
> This reloads the service itself (like Apache or Nginx configs), not the systemd unit file.
> To reload unit files, use `systemctl daemon-reload`.
- Reload a service:
`systemctl reload {{nginx}}`
- Reload multiple services:
`systemctl reload {{networking apache2 ...}}`
- Reload a service for the current user:
`systemctl --user reload {{pipewire}}`

33
tldr/linux/systemctl-show Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl show
> Show properties of units or systemd itself.
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#show%20PATTERN%E2%80%A6%7CJOB%E2%80%A6>.
- Show properties of the system service manager:
`systemctl show`
- Show properties of the user service manager:
`systemctl show --user`
- Show properties of a specific unit:
`systemctl show {{unit}}`
- Show properties of a specific user unit:
`systemctl show --user {{unit}}`
- Include empty properties in the list:
`systemctl show {{[-a|--all]}}`
- Only show the specified properties:
`systemctl show {{[-p|--property]}} {{Wants,Conflicts,...}} {{unit}}`

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Python package manager.
> Some subcommands such as `install` have their own usage documentation.
> More information: <https://pip.pypa.io>.
> More information: <https://pip.pypa.io/en/stable/cli/pip/>.
- Install a package (see `pip install` for more install examples):

29
tldr/srun Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# srun
> Run a command under the Slurm workload manager.
> More information: <https://slurm.schedmd.com/srun.html>.
- Run a simple command interactively:
`srun hostname`
- Run a job with 4 tasks (CPUs):
`srun {{[-n|--ntasks]}} 4 {{path/to/program}}`
- Allocate 8 GB of memory:
`srun --mem 8G {{path/to/program}}`
- Run a job on a specific partition:
`srun {{[-p|--partition]}} gpu {{path/to/program}}`
- Run a job and save the output to a file:
`srun {{path/to/program}} > {{path/to/output}}`