From bc2926a603fec1bf1059766b964d5bbb88709f3f Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Sun, 6 Jul 2025 00:23:01 +0000 Subject: [PATCH] Update cheatsheets --- tldr/elasticsearch-keystore | 41 +++++++++++++++++++++++++++++++++++++ tldr/jj-abandon | 22 ++++++++++++++++++++ tldr/jj-absorb | 17 +++++++++++++++ tldr/jj-commit | 21 +++++++++++++++++++ tldr/jj-describe | 21 +++++++++++++++++++ tldr/jj-edit | 14 +++++++++++++ tldr/jj-evolog | 21 +++++++++++++++++++ tldr/jj-new | 25 ++++++++++++++++++++++ tldr/jj-restore | 21 +++++++++++++++++++ tldr/jj-revert | 21 +++++++++++++++++++ tldr/jj-show | 21 +++++++++++++++++++ tldr/jj-simplify-parents | 18 ++++++++++++++++ tldr/jj-squash | 25 ++++++++++++++++++++++ tldr/linux/counter-strike-2 | 25 ++++++++++++++++++++++ tldr/linux/cs2 | 12 +++++++++++ tldr/linux/dnf-install | 29 ++++++++++++++++++++++++++ tldr/linux/expac | 2 +- tldr/linux/factorio | 12 +++++++++++ tldr/minecraft | 25 ++++++++++++++++++++++ tldr/qemu-img | 20 ++++++++++++------ 20 files changed, 406 insertions(+), 7 deletions(-) create mode 100644 tldr/elasticsearch-keystore create mode 100644 tldr/jj-abandon create mode 100644 tldr/jj-absorb create mode 100644 tldr/jj-commit create mode 100644 tldr/jj-describe create mode 100644 tldr/jj-edit create mode 100644 tldr/jj-evolog create mode 100644 tldr/jj-new create mode 100644 tldr/jj-restore create mode 100644 tldr/jj-revert create mode 100644 tldr/jj-show create mode 100644 tldr/jj-simplify-parents create mode 100644 tldr/jj-squash create mode 100644 tldr/linux/counter-strike-2 create mode 100644 tldr/linux/cs2 create mode 100644 tldr/linux/dnf-install create mode 100644 tldr/minecraft diff --git a/tldr/elasticsearch-keystore b/tldr/elasticsearch-keystore new file mode 100644 index 00000000..68be76af --- /dev/null +++ b/tldr/elasticsearch-keystore @@ -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: . + +- 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` diff --git a/tldr/jj-abandon b/tldr/jj-abandon new file mode 100644 index 00000000..2df12a86 --- /dev/null +++ b/tldr/jj-abandon @@ -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: . + +- 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}}` diff --git a/tldr/jj-absorb b/tldr/jj-absorb new file mode 100644 index 00000000..97fc0098 --- /dev/null +++ b/tldr/jj-absorb @@ -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: . + +- 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}}` diff --git a/tldr/jj-commit b/tldr/jj-commit new file mode 100644 index 00000000..1ab1b650 --- /dev/null +++ b/tldr/jj-commit @@ -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: . + +- 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]}}` diff --git a/tldr/jj-describe b/tldr/jj-describe new file mode 100644 index 00000000..ec16190a --- /dev/null +++ b/tldr/jj-describe @@ -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: . + +- 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}}` diff --git a/tldr/jj-edit b/tldr/jj-edit new file mode 100644 index 00000000..8873fcfa --- /dev/null +++ b/tldr/jj-edit @@ -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: . + +- Set the given revision as the working copy: + +`jj edit {{revset}}` diff --git a/tldr/jj-evolog b/tldr/jj-evolog new file mode 100644 index 00000000..9e72edc8 --- /dev/null +++ b/tldr/jj-evolog @@ -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: . + +- 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]}}` diff --git a/tldr/jj-new b/tldr/jj-new new file mode 100644 index 00000000..9ba294f0 --- /dev/null +++ b/tldr/jj-new @@ -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: . + +- 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}}` diff --git a/tldr/jj-restore b/tldr/jj-restore new file mode 100644 index 00000000..19852e7a --- /dev/null +++ b/tldr/jj-restore @@ -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: . + +- 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]}}` diff --git a/tldr/jj-revert b/tldr/jj-revert new file mode 100644 index 00000000..37ccc95b --- /dev/null +++ b/tldr/jj-revert @@ -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: . + +- 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}}` diff --git a/tldr/jj-show b/tldr/jj-show new file mode 100644 index 00000000..00500c21 --- /dev/null +++ b/tldr/jj-show @@ -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: . + +- 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}}` diff --git a/tldr/jj-simplify-parents b/tldr/jj-simplify-parents new file mode 100644 index 00000000..b25b0f5c --- /dev/null +++ b/tldr/jj-simplify-parents @@ -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: . + +- 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}}` diff --git a/tldr/jj-squash b/tldr/jj-squash new file mode 100644 index 00000000..3288200f --- /dev/null +++ b/tldr/jj-squash @@ -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: . + +- 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]}}` diff --git a/tldr/linux/counter-strike-2 b/tldr/linux/counter-strike-2 new file mode 100644 index 00000000..814f087c --- /dev/null +++ b/tldr/linux/counter-strike-2 @@ -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: . + +- 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` diff --git a/tldr/linux/cs2 b/tldr/linux/cs2 new file mode 100644 index 00000000..89a7bb47 --- /dev/null +++ b/tldr/linux/cs2 @@ -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` diff --git a/tldr/linux/dnf-install b/tldr/linux/dnf-install new file mode 100644 index 00000000..a75e115c --- /dev/null +++ b/tldr/linux/dnf-install @@ -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: . + +- 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` diff --git a/tldr/linux/expac b/tldr/linux/expac index 4ce03b0f..cf336f12 100644 --- a/tldr/linux/expac +++ b/tldr/linux/expac @@ -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)` diff --git a/tldr/linux/factorio b/tldr/linux/factorio index d291ca9a..9860e122 100644 --- a/tldr/linux/factorio +++ b/tldr/linux/factorio @@ -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]}}` diff --git a/tldr/minecraft b/tldr/minecraft new file mode 100644 index 00000000..2372414c --- /dev/null +++ b/tldr/minecraft @@ -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: . + +- 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` diff --git a/tldr/qemu-img b/tldr/qemu-img index 8ced30b6..d9f779a2 100644 --- a/tldr/qemu-img +++ b/tldr/qemu-img @@ -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}}`