Update cheatsheets

This commit is contained in:
ivuorinen
2025-07-06 00:23:01 +00:00
parent abbad12043
commit bc2926a603
20 changed files with 406 additions and 7 deletions

View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# elasticsearch-keystore
> Manage secure settings (e.g., passwords, tokens, and credentials) used by Elasticsearch.
> More information: <https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-keystore.html>.
- Create a new keystore (not password-protected):
`elasticsearch-keystore create`
- Create a new password-protected keystore:
`elasticsearch-keystore create -p`
- Add a setting interactively:
`elasticsearch-keystore add {{setting_name}}`
- Add a setting from standard input:
`echo "{{setting_value}}" | elasticsearch-keystore add --stdin {{setting_name}}`
- Remove a setting from the keystore:
`elasticsearch-keystore remove {{setting_name}}`
- Change the keystore password:
`elasticsearch-keystore passwd`
- List all settings stored in the keystore:
`elasticsearch-keystore list`
- Upgrade the keystore format (after an Elasticsearch upgrade):
`elasticsearch-keystore upgrade`

22
tldr/jj-abandon Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj abandon
> Abandon a revision, rebasing descendants onto its parent(s).
> Abandoning a revision removes its associated change ID.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-abandon>.
- Abandon revisions specified by given revsets (e.g. `B::D`, `A..D`, `B|C|D`, etc.):
`jj abandon {{revsets}}`
- Abandon revisions, without deleting their bookmarks and moving them to the parent revisions instead:
`jj abandon --retain-bookmarks {{revsets}}`
- Abandon revisions, without modifying the contents of their children:
`jj abandon --restore-descendants {{revsets}}`

17
tldr/jj-absorb Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj absorb
> Split changes in the source revision and move each change to the closest mutable ancestor where the corresponding lines were modified last.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-absorb>.
- Move all changes from a revision to other revisions automatically:
`jj absorb {{[-f|--from]}} {{revset}} {{[-t|--into]}} {{revsets}}`
- Move only changes in given files from a revision to other revisions:
`jj absorb {{[-f|--from]}} {{revset}} {{[-t|--into]}} {{revsets}} {{filesets}}`

21
tldr/jj-commit Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj commit
> Update the description and create a new change on top.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-commit>.
- Open editor to write the commit message and then create a new empty commit on top:
`jj commit`
- Commit with the given message:
`jj commit {{[-m|--message]}} "{{message}}"`
- Interactively choose which changes to include:
`jj commit {{[-i|--interactive]}}`

21
tldr/jj-describe Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj describe
> Update the change description or other metadata.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-describe>.
- Update the description of the current change:
`jj {{[desc|describe]}}`
- Update the description of given revsets:
`jj {{[desc|describe]}} {{revsets}}`
- Update the description to the given message:
`jj {{[desc|describe]}} {{[-m|--message]}} {{message}}`

14
tldr/jj-edit Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj edit
> Set the specified revision as the working-copy revision.
> Note: It is generally recommended to instead use `jj new` and `jj squash`.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-edit>.
- Set the given revision as the working copy:
`jj edit {{revset}}`

21
tldr/jj-evolog Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj evolog
> Show how a change has evolved over time, listing the previous commits it has pointed to.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-evolog>.
- Show how a revision has evolved over time:
`jj evolog {{[-r|--revision]}} {{revset}}`
- Show diff statistics in the evolution log:
`jj evolog {{[-r|--revision]}} {{revset}} --stat`
- Show summary of each change in the evolution log:
`jj evolog {{[-r|--revision]}} {{revset}} {{[-s|--summary]}}`

25
tldr/jj-new Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj new
> Create a new empty change.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-new>.
- Create a new empty change on top of current revision:
`jj new`
- Create a new empty change on top of specific revision:
`jj new {{revision}}`
- Create a new merge change on top of multiple revisions:
`jj new {{revset1 revset2 ...}}`
- Create a new empty change before and after specified revisions:
`jj new {{[-B|--insert-before]}} {{revsets}} {{[-A|--insert-after]}} {{revsets}}`

21
tldr/jj-restore Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj restore
> Restore files from another revision.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-restore>.
- Restore files from a revision into another revision:
`jj restore {{[-f|--from]}} {{revset}} {{[-t|--into]}} {{revset}} {{filesets}}`
- Undo the changes in a revision as compared to the merge of its parents:
`jj restore {{[-c|--changes-in]}} {{revset}} {{filesets}}`
- Interactively choose what parts to restore:
`jj restore {{[-f|--from]}} {{revset}} {{[-t|--into]}} {{revset}} {{[-i|--interactive]}}`

21
tldr/jj-revert Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj revert
> Apply the reverse of the given revision(s).
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-revert>.
- Apply the reverse of the revisions specified by the given revsets (e.g. `B::D`, `A..D`, `B|C|D`, etc.):
`jj revert {{[-r|--revisions]}} {{revsets}}`
- Apply the reverse on top of specified revisions:
`jj revert {{[-r|--revisions]}} {{revsets}} {{[-d|--destination]}} {{revsets}}`
- Apply the reverse before and/or after specified revisions:
`jj revert {{[-r|--revisions]}} {{revsets}} {{[-B|--insert-before]}} {{revsets}} {{[-A|--insert-after]}} {{revsets}}`

21
tldr/jj-show Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj show
> Show commit description and changes in a revision.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-show>.
- Show commit description and changes in a revision:
`jj show {{revset}}`
- Show a summary of changes in a revision:
`jj show {{[-s|--summary]}} {{revset}}`
- Show a histogram of changes in a revision:
`jj show --stat {{revset}}`

18
tldr/jj-simplify-parents Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj simplify-parents
> Simplify parent edges for the specified revision(s).
> For example, "A -> B -> C | A -> C" gets simplified to "A -> B -> C".
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-simplify-parents>.
- Simplify parent edges of given revisions:
`jj simplify-parents {{[-r|--revisions]}} {{revsets}}`
- Simplify parent edges of given revisions and trees of their descendants:
`jj simplify-parents {{[-s|--source]}} {{revsets}}`

25
tldr/jj-squash Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj squash
> Move changes from a revision into another revision.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-squash>.
- Move all changes from current revision to its parent:
`jj squash`
- Move all changes from given revision to its parent:
`jj squash {{[-r|--revision]}} {{revset}}`
- Move all changes from given revision(s) to given other revision:
`jj squash {{[-f|--from]}} {{revsets}} {{[-t|--into]}} {{revset}}`
- Interactively choose which parts to squash:
`jj squash {{[-i|--interactive]}}`

View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# counter strike 2
> Host a headless Counter Strike 2 server.
> More information: <https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers>.
- Run a game with one map:
`{{path/to/cs2}} -dedicated +map {{de_dust2}}`
- Run a game with specified maximum number of players:
`{{path/to/cs2}} -dedicated +map {{de_dust2}} -maxplayers {{64}}`
- Run a game with specified server IP and port:
`{{path/to/cs2}} -dedicated +map {{de_dust2}} -ip {{1.2.3.4}} -port {{27015}}`
- Shut the server down:
`quit`

12
tldr/linux/cs2 Normal file
View File

@@ -0,0 +1,12 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# cs2
> This command is an alias of `counter strike 2`.
- View documentation for the original command:
`tldr counter strike 2`

29
tldr/linux/dnf-install Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# dnf install
> Install packages on Red Hat-based distributions.
> More information: <https://dnf.readthedocs.io/en/latest/command_ref.html#install-examples>.
- Install packages by name:
`sudo dnf {{[in|install]}} {{package1 package2 ...}}`
- Install a package from a local file:
`sudo dnf {{[in|install]}} {{path/to/file}}`
- Install a package from the internet:
`sudo dnf {{[in|install]}} {{https://example.com/package.rpm}}`
- Add the Extra Packages for Enterprise Linux (EPEL) repositories:
`sudo dnf {{[in|install]}} https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm`
- Add Remi's RPM repository:
`sudo dnf {{[in|install]}} https://rpms.remirepo.net/enterprise/remi-release-8.rpm`

View File

@@ -29,6 +29,6 @@ source: https://github.com/tldr-pages/tldr.git
`expac {{[-d|--delim]}} '
' {{[-l|listdelim]}} '
' {{[-l|--listdelim]}} '
' {{[-Q|--query]}} '%n
%O' $(pacman -Qeq)`

View File

@@ -15,3 +15,15 @@ source: https://github.com/tldr-pages/tldr.git
- Start a Factorio server:
`{{path/to/factorio}} --start-server {{path/to/save_file.zip}}`
- Create a new save file with specific settings:
`{{path/to/factorio}} --create {{path/to/save.zip}} --map-gen-settings {{path/to/map-gen-settings.json}} --map-settings {{path/to/map-settings.json}}`
- Shut the server gracefully:
`/quit`
- Display help:
`{{path/to/factorio}} {{[-h|--help]}}`

25
tldr/minecraft Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# minecraft
> Run a headless Minecraft server.
> More information: <https://minecraft.wiki/w/Tutorial:Setting_up_a_Java_Edition_server>.
- Start a Minecraft server and generate a world if it doesn't exist:
`java -jar {{path/to/server.jar}} --nogui`
- Set the minimum and maximum amount of memory a server is allowed to have (Note: Setting them the same prevents lag caused by heap scaling):
`java -Xms{{1024M}} -Xmx{{2048M}} -jar {{path/to/server.jar}} --nogui`
- Start a server with a GUI:
`java -jar {{path/to/server.jar}}`
- Shut the server down:
`stop`

View File

@@ -10,20 +10,28 @@ source: https://github.com/tldr-pages/tldr.git
- Create disk image with a specific size (in gigabytes):
`qemu-img create {{image_name.img}} {{gigabytes}}G`
`qemu-img create {{path/to/image_file.img}} {{gigabytes}}G`
- Show information about a disk image:
`qemu-img info {{image_name.img}}`
`qemu-img info {{path/to/image_file.img}}`
- Increase or decrease image size:
`qemu-img resize {{image_name.img}} {{gigabytes}}G`
`qemu-img resize {{path/to/image_file.img}} {{gigabytes}}G`
- Dump the allocation state of every sector of the specified disk image:
`qemu-img map {{image_name.img}}`
`qemu-img map {{path/to/image_file.img}}`
- Convert a VMware .vmdk disk image to a KVM .qcow2 disk image:
- Convert a VMware `.vmdk` disk image to a KVM `.qcow2` disk image:
`qemu-img convert -f {{vmdk}} -O {{qcow2}} {{path/to/file/foo.vmdk}} {{path/to/file/foo.qcow2}}`
`qemu-img convert -f vmdk -O qcow2 {{path/to/image_file.vmdk}} {{path/to/image_file.qcow2}}`
- [c]reate an internal snapshot of a KVM `.qcow2` disk image:
`qemu-img snapshot -c {{snapshot_tag_name}} {{path/to/image_file.qcow2}}`
- [a]pply an internal snapshot to a KVM `.qcow2` disk image:
`qemu-img snapshot -a {{snapshot_tag_name}} {{path/to/image_file.qcow2}}`