Update cheatsheets

This commit is contained in:
ivuorinen
2026-01-16 00:22:46 +00:00
parent 494fa25437
commit c2565bdd4e
11 changed files with 37 additions and 25 deletions

View File

@@ -10,24 +10,28 @@ source: https://github.com/tldr-pages/tldr.git
- Create a new encrypted vault file with a prompt for a password:
`ansible-vault create {{vault_file}}`
`ansible-vault create {{path/to/vault_file}}`
- Create a new encrypted vault file using a vault key file to encrypt it:
- Edit, view or re-key (re-encrypt) an existing encrypted vault file with a prompt for the password:
`ansible-vault create --vault-password-file {{password_file}} {{vault_file}}`
`ansible-vault {{edit|view|rekey}} {{path/to/vault_file}}`
- Encrypt an existing file using an optional password file:
- Create a new encrypted vault file using a password file to encrypt it:
`ansible-vault encrypt --vault-password-file {{password_file}} {{vault_file}}`
`ansible-vault create --vault-password-file {{path/to/password_file}} {{path/to/vault_file}}`
- Encrypt an existing plaintext file in-place using a password file:
`ansible-vault encrypt --vault-password-file {{path/to/password_file}} {{path/to/file}}`
- Encrypt a string using Ansible's encrypted string format, displaying interactive prompts:
`ansible-vault encrypt_string`
- View an encrypted file, using a password file to decrypt:
- View an encrypted vault file by using a password file to decrypt:
`ansible-vault view --vault-password-file {{password_file}} {{vault_file}}`
`ansible-vault view --vault-password-file {{path/to/password_file}} {{path/to/vault_file}}`
- Re-key already encrypted vault file with a new password file:
- Re-key (re-encrypt) an already encrypted vault file with a new password file:
`ansible-vault rekey --vault-password-file {{old_password_file}} --new-vault-password-file {{new_password_file}} {{vault_file}}`
`ansible-vault rekey --vault-password-file {{path/to/old_password_file}} --new-vault-password-file {{path/to/new_password_file}} {{path/to/vault_file}}`

View File

@@ -10,13 +10,13 @@ source: https://github.com/tldr-pages/tldr.git
- 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 {{[-ny|--name --yes]}} {{py39}} python={{3.9}} "{{numpy>=1.11 scipy}}"`
`conda create {{[-ny|--name --yes]}} py39 python=3.9 "numpy>=1.11 scipy"`
- Create a new environment named `myenv` and install packages listed in files:
`conda create {{[-n|--name]}} myenv --file {{file1.yml}} --file {{file2.yml}}`
- Create a new environment named `myenv` at custom path (i.e. prefix):
- Create a new environment at a custom path (i.e. prefix):
`conda create {{[-p|--prefix]}} {{path/to/myenv}}`

View File

@@ -36,6 +36,6 @@ source: https://github.com/tldr-pages/tldr.git
`git commit {{[-m|--message]}} "{{message}}" --allow-empty`
- Add a description in addition to the commit message:
- Create a commit with a message and a description:
`git commit {{[-m|--message]}} "{{message}}" {{[-m|--message]}} "{{description}}"`

View File

@@ -23,3 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
- Remove a user, and all files owned by them:
`sudo deluser --remove-all-files {{username}}`
- Remove a user from a group, without deleting the user:
`sudo deluser {{username}} {{group}}`

View File

@@ -27,7 +27,7 @@ source: https://github.com/tldr-pages/tldr.git
- [d]elete lines 1 to 5 of a file and back up the original file with a `.orig` extension:
`sed {{[-i|--in-place=]}}{{.orig}} '1,5d' {{path/to/file}}`
`sed {{[-i|--in-place=]}}.orig '1,5d' {{path/to/file}}`
- [p]rint only the first line to `stdout`:

View File

@@ -11,8 +11,12 @@ source: https://github.com/tldr-pages/tldr.git
- Create a sparsified compressed image without snapshots from an unsparsified one:
`virt-sparsify --compress {{path/to/image.qcow2}} {{path/to/image_new.qcow2}}`
`virt-sparsify --compress {{path/to/image.qcow2}} {{path/to/new_image.qcow2}}`
- Sparsify an image in-place:
`virt-sparsify --in-place {{path/to/image.img}}`
- Convert from one image format to another:
`virt-sparsify {{path/to/image}} --convert {{qcow2|raw|vdi|...}} {{path/to/new_image}}`

View File

@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
- Compile a source code file into an object file:
`mpicc -c {{path/to/file.c}}`
`mpicc -c {{path/to/file}}.c`
- Link an object file and make an executable:
`mpicc -o {{executable}} {{path/to/object_file.o}}`
`mpicc -o {{executable}} {{path/to/object_file}}.o`
- Compile and link source code in a single command:
`mpicc -o {{executable}} {{path/to/file.c}}`
`mpicc -o {{executable}} {{path/to/file}}.c`

View File

@@ -11,11 +11,11 @@ source: https://github.com/tldr-pages/tldr.git
- Compile a Java source file:
`mpijavac {{path/to/source_file.java}}`
`mpijavac {{path/to/source_file}}.java`
- Pass application-specific classpaths to compiler:
`mpijavac -cp {{path/to/app.jar}} {{path/to/source_file.java}}`
`mpijavac -cp {{path/to/app}}.jar {{path/to/source_file}}.java`
- Show the flags necessary to build MPI Java applications:
@@ -27,4 +27,4 @@ source: https://github.com/tldr-pages/tldr.git
- Show full invoked Java compiler command line:
`mpijavac {{path/to/source_file.java}} --showme`
`mpijavac {{path/to/source_file}}.java --showme`

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Show a notification with the title "Test" and the content "This is a test":
`notify-send "{{Test}}" "{{This is a test}}"`
`notify-send "Test" "This is a test"`
- Show a notification with a custom icon:

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- Search for processes run by a specific user:
`pgrep {{[-u|--euid]}} root {{process_name}}`
`pgrep {{[-u|--euid]}} {{username}} {{process_name}}`

View File

@@ -22,11 +22,11 @@ source: https://github.com/tldr-pages/tldr.git
- Write and edit text in the command-line with `vi`-like keybindings (e.g. `yy`):
`set -o {{vi}}`
`set -o vi`
- Return to default mode:
- Return to default (`emacs`) mode:
`set -o {{emacs}}`
`set -o emacs`
- List all modes: