Update cheatsheets

This commit is contained in:
ivuorinen
2025-09-18 00:18:12 +00:00
parent bf8338a66c
commit 9cb77296ba
9 changed files with 179 additions and 21 deletions

30
tldr/conda-activate Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda activate
> Activate a conda environment.
> See also: `conda deactivate` to deactivate a conda environment.
> More information: <https://docs.conda.io/projects/conda/en/stable/dev-guide/deep-dives/activation.html>.
- Activate an existing environment named `myenv`:
`conda activate myenv`
- Activate an existing environment located at custom path:
`conda activate {{path/to/myenv}}`
- Stack `myenv` environment on top of a previous environment making libraries/commands/variables from both accessible:
`conda activate --stack myenv`
- Start a clean environment `myenv` without stacking it making previous environment libraries/commands/variables not accessible:
`conda activate --no-stack myenv`
- Display help:
`conda activate {{[-h|--help]}}`

33
tldr/conda-clean Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda clean
> Delete temporary or unused files: index cache, lock files, unused cache packages, tarballs, and log files.
> More information: <https://docs.conda.io/projects/conda/en/stable/commands/clean.html>.
- Delete all temporary or unused files verbosely and say yes to all confirmations:
`conda clean {{[-avy|--all --verbose --yes]}}`
- Delete only index cache, tarballs, and log files:
`conda clean {{[-itl|--index-cache --tarballs --logfiles]}}`
- Delete only temporary [c]ache files that could not be deleted earlier due to being in use:
`conda clean {{[-c|--tempfiles]}} {{path/to/tempfiles}}`
- Delete only unused packages. Might delete packages installed with softlinks:
`conda clean {{[-p|--packages]}}`
- Force delete all writable packages. More broad than the `--all` option. Will delete packages installed with softlinks:
`conda clean {{[-f|--force-pkgs-dirs]}}`
- Display help:
`conda clean {{[-h|--help]}}`

25
tldr/conda-compare Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# conda compare
> Compare packages between conda environments.
> More information: <https://docs.conda.io/projects/conda/en/stable/commands/compare.html>.
- Compare packages in the current directory to packages from the file `file.yml`:
`conda compare file.yml`
- Compare packages in environment named `myenv` to packages from the file `file.yml`:
`conda compare {{[-n|--name]}} myenv {{path/to/file.yml}}`
- Compare packages in environment `myenv` at custom path (i.e. prefix) to packages from the file `file.yml`:
`conda compare {{[-p|--prefix]}} {{path/to/myenv}} {{path/to/file.yml}}`
- Display help:
`conda create {{[-h|--help]}}`

View File

@@ -8,14 +8,22 @@ source: https://github.com/tldr-pages/tldr.git
> Create new conda environments.
> More information: <https://docs.conda.io/projects/conda/en/latest/commands/create.html>.
- Create a new environment named `py39`, and install Python 3.9 and NumPy v1.11 or above in it:
- Create a new environment named `py39`, install Python 3.9, NumPy v1.11 or above in it, and the latest stable version of SciPy. Say yes to all confirmations:
`conda create {{[-y|--yes]}} {{[-n|--name]}} {{py39}} python={{3.9}} "{{numpy>=1.11}}"`
`conda create {{[-ny|--name --yes]}} {{py39}} python={{3.9}} "{{numpy>=1.11 scipy}}"`
- Make exact copy of an environment:
- Create a new environment named `myenv` and install packages listed in files:
`conda create --clone {{py39}} {{[-n|--name]}} {{py39-copy}}`
`conda create {{[-n|--name]}} myenv --file {{file1.yml}} --file {{file2.yml}}`
- Create a new environment with a specified name and install a given package:
- Create a new environment named `myenv` at custom path (i.e. prefix):
`conda create {{[-n|--name]}} {{env_name}} {{package}}`
`conda create {{[-p|--prefix]}} {{path/to/myenv}}`
- Make exact copy of an environment named `py39`:
`conda create --clone py39 {{[-n|--name]}} {{py39-copy}}`
- Display help:
`conda create {{[-h|--help]}}`

29
tldr/createuser Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# createuser
> Create a PostgreSQL user (role).
> More information: <https://www.postgresql.org/docs/current/app-createuser.html>.
- Create a user interactively:
`createuser --interactive {{username}}`
- Create a user with no special rights:
`createuser {{username}}`
- Create a superuser:
`createuser {{[-s|--superuser]}} {{username}}`
- Create a user allowed to create databases, manage roles, and prompt for a password:
`createuser {{[-d|--createdb]}} {{[-r|--createrole]}} {{[-P|--pwprompt]}} {{username}}`
- Create a user without the ability to create databases or manage roles:
`createuser {{[-D|--no-createdb]}} {{[-R|--no-createrole]}} {{username}}`

View File

@@ -16,6 +16,10 @@ source: https://github.com/tldr-pages/tldr.git
`git show {{commit|tag|branch}}`
- Show only the list of added, renamed or deleted files:
`git show --summary {{commit}}`
- Show information about the 3rd commit from the HEAD of a branch:
`git show {{branch}}~{{3}}`
@@ -32,10 +36,6 @@ source: https://github.com/tldr-pages/tldr.git
`git show --name-only {{commit}}`
- Show only the list of added, renamed or deleted files:
`git show --summary {{commit}}`
- Show the contents of a file as it was at a given revision (e.g. branch, tag or commit):
`git show {{revision}}:{{path/to/file}}`

View File

@@ -5,25 +5,25 @@ source: https://github.com/tldr-pages/tldr.git
---
# git subtree
> Manage project dependencies as subprojects.
> Merge subtrees together or split repository into subtrees.
> More information: <https://manned.org/git-subtree>.
- Add a Git repository as a subtree:
- Add a Git repository as a subtree and squash the commits together:
`git subtree add {{[-P|--prefix]}} {{path/to/directory}}/ --squash {{repository_url}} {{branch_name}}`
`git subtree add {{[-P|--prefix]}} {{path/to/directory}} --squash {{repository_url}} {{branch_name}}`
- Update subtree repository to its latest commit:
`git subtree pull {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{branch_name}}`
`git subtree pull {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{branch_name}}`
- Merge recent changes up to the latest subtree commit into the subtree:
`git subtree merge {{[-P|--prefix]}} {{path/to/directory}}/ --squash {{repository_url}} {{branch_name}}`
`git subtree merge {{[-P|--prefix]}} {{path/to/directory}} --squash {{repository_url}} {{branch_name}}`
- Push commits to a subtree repository:
`git subtree push {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{branch_name}}`
`git subtree push {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{branch_name}}`
- Extract a new project history from the history of a subtree:
`git subtree split {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{[-b|--branch]}} {{branch_name}}`
`git subtree split {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{[-b|--branch]}} {{branch_name}}`

33
tldr/linux/lvmpolld Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# lvmpolld
> LVM poll daemon that supervises long-running LVM operations.
> More information: <https://manned.org/lvmpolld>.
- Start the daemon in the foreground:
`lvmpolld {{[-f|--foreground]}}`
- Start in the foreground with debug logging:
`lvmpolld {{[-f|--foreground]}} {{[-l|--log]}} debug`
- Set the idle shutdown timeout (seconds):
`lvmpolld {{[-t|--timeout]}} {{300}}`
- Use a custom socket path:
`lvmpolld {{[-s|--socket]}} {{/tmp/lvmpolld.socket}}`
- Use a custom PID file:
`lvmpolld {{[-p|--pidfile]}} {{/tmp/lvmpolld.pid}}`
- Dump the current state:
`lvmpolld --dump`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# nodemon
> Watch files and automatically restart a node application when changes are detected.
> More information: <https://nodemon.io>.
> More information: <https://github.com/remy/nodemon/tree/main/doc/cli>.
- Execute the specified file and watch a specific file for changes:
@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Ignore specific files:
`nodemon --ignore {{path/to/file_or_directory}}`
`nodemon {{[-i|--ignore]}} {{path/to/file_or_directory}}`
- Pass arguments to the node application:
@@ -30,8 +30,8 @@ source: https://github.com/tldr-pages/tldr.git
- Run an arbitrary non-node script:
`nodemon --exec "{{command_to_run_script}} {{options}}" {{path/to/script}}`
`nodemon {{[-x|--exec]}} "{{command_to_run_script}} {{options}}" {{path/to/script}}`
- Run a Python script:
`nodemon --exec "python {{options}}" {{path/to/file.py}}`
`nodemon {{[-x|--exec]}} "python {{options}}" {{path/to/file.py}}`