From 9bc209f58841a999495b5932d184f817b37cff7c Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Fri, 4 Jul 2025 00:20:35 +0000 Subject: [PATCH] Update cheatsheets --- tldr/hostname | 2 +- tldr/jj | 34 ++++++++++++++++++++++++++++++++++ tldr/jj-bookmark | 34 ++++++++++++++++++++++++++++++++++ tldr/jj-diff | 29 +++++++++++++++++++++++++++++ tldr/jj-git | 29 +++++++++++++++++++++++++++++ tldr/jj-log | 21 +++++++++++++++++++++ tldr/jj-operation | 33 +++++++++++++++++++++++++++++++++ tldr/jj-status | 14 ++++++++++++++ tldr/linux/dex | 6 +++--- tldr/linux/fwupdmgr | 4 ++++ tldr/linux/instaloader | 2 +- tldr/linux/lxc-start | 2 +- tldr/tcpdump | 16 ++++++++-------- tldr/zellij | 6 +++--- 14 files changed, 215 insertions(+), 17 deletions(-) create mode 100644 tldr/jj create mode 100644 tldr/jj-bookmark create mode 100644 tldr/jj-diff create mode 100644 tldr/jj-git create mode 100644 tldr/jj-log create mode 100644 tldr/jj-operation create mode 100644 tldr/jj-status diff --git a/tldr/hostname b/tldr/hostname index 3d816dac..3c3e329a 100644 --- a/tldr/hostname +++ b/tldr/hostname @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - Show the network address of the host name: -`hostname {{[-i|--ip-addresses]}}` +`hostname {{[-i|--ip-address]}}` - Show the FQDN (Fully Qualified Domain Name): diff --git a/tldr/jj b/tldr/jj new file mode 100644 index 00000000..eef84ef4 --- /dev/null +++ b/tldr/jj @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj + +> Jujutsu, a version control system. +> Some subcommands such as `log`, `desc`, `new`, `git`, etc. have their own usage documentation. +> More information: . + +- Update description of the revisions specified by given revsets (e.g. `B::D`, `A..D`, `B|C|D`, etc.): + +`jj describe {{[-r|--revision]}} {{revsets}}` + +- Create a new commit/revision on top of a given revision : + +`jj new {{revset}}` + +- Create a new merge commit on top of multiple revisions: + +`jj new {{revset1 revset2 ...}}` + +- Execute a jj subcommand without snapshotting the working copy: + +`jj --ignore-working-copy {{subcommand}}` + +- Execute a jj subcommand at an operation: + +`jj {{[--at-op|--at-operation]}} {{operation}} {{subcommand}}` + +- Display help for a specific subcommand (like `new`, `commit`, `desc`, etc.): + +`jj help {{subcommand}}` diff --git a/tldr/jj-bookmark b/tldr/jj-bookmark new file mode 100644 index 00000000..d0a1bf8c --- /dev/null +++ b/tldr/jj-bookmark @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj bookmark + +> Manage bookmarks in a `jj` repository. +> When using a Git backend, bookmarks correspond to Git branches. +> More information: . + +- Create a new bookmark at the given revision: + +`jj bookmark create {{[-r|--revision]}} {{revision}} {{name}}` + +- List all existing bookmarks and their targets: + +`jj bookmark list` + +- Move an existing bookmark to another revision: + +`jj bookmark move {{[-t|--to]}} {{revision}} {{name}}` + +- Track given remote bookmarks: + +`jj bookmark track {{name}}@{{remote}}` + +- Delete a bookmark, and propagate the deletion to remotes on the next push: + +`jj bookmark delete {{name}}` + +- Forget a bookmark locally, without marking its deletion to be pushed: + +`jj bookmark forget {{name}}` diff --git a/tldr/jj-diff b/tldr/jj-diff new file mode 100644 index 00000000..17eb477c --- /dev/null +++ b/tldr/jj-diff @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj diff + +> Compare file contents between two revisions. +> More information: . + +- Show changes of current revision: + +`jj diff` + +- Show changes of given revsets (e.g. `B::D`, `A..D`, `B|C|D`, etc.): + +`jj diff {{[-r|--revisions]}} {{revsets}}` + +- Show changes from given revision to given revision: + +`jj diff {{[-f|--from]}} {{from_revset}} {{[-t|--to]}} {{to_revset}}` + +- Show diff statistics: + +`jj diff --stat` + +- Show a Git-format diff: + +`jj diff --git` diff --git a/tldr/jj-git b/tldr/jj-git new file mode 100644 index 00000000..b5715afc --- /dev/null +++ b/tldr/jj-git @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj git + +> Run Git-related commands for a `jj` repository. +> More information: . + +- Create a new Git backed repository: + +`jj git init` + +- Create a new repository backed by a clone of a Git repository: + +`jj git clone {{source}}` + +- Fetch from a Git remote: + +`jj git fetch` + +- Push all tracked bookmarks to Git remote: + +`jj git push` + +- Push given bookmark to Git remote: + +`jj git push {{[-b|--bookmark]}} {{bookmark}}` diff --git a/tldr/jj-log b/tldr/jj-log new file mode 100644 index 00000000..58ff4615 --- /dev/null +++ b/tldr/jj-log @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj log + +> Show revision history as a graph. +> More information: . + +- Show revision history as a graph: + +`jj log` + +- Show only given revsets (e.g. `B::D`, `A..D`, `B|C|D`, etc.): + +`jj log {{[-r|--revisions]}} {{revsets}}` + +- Show log with a particular template for each line (e.g. 5 characters of commit hash and author): + +`jj log {{[-T|--template]}} 'commit_id.shortest(5) ++ " " ++ author'` diff --git a/tldr/jj-operation b/tldr/jj-operation new file mode 100644 index 00000000..21008ef8 --- /dev/null +++ b/tldr/jj-operation @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj operation + +> Work with the operation log of a `jj` repository. +> More information: . + +- Show operation log: + +`jj {{[op|operation]}} log` + +- Undo the last operation: + +`jj {{[op|operation]}} undo` + +- Undo a given operation: + +`jj {{[op|operation]}} undo {{operation}}` + +- Restore the repository to its state at a given operation: + +`jj {{[op|operation]}} restore {{operation}}` + +- Show changes to the repository in an operation: + +`jj {{[op|operation]}} show {{operation}}` + +- Show stat, summary and patch of modifications of an operation: + +`jj {{[op|operation]}} show {{--stat}} {{[-s|--summary]}} {{[-p|--patch]}} {{operation}}` diff --git a/tldr/jj-status b/tldr/jj-status new file mode 100644 index 00000000..ddaf1ed3 --- /dev/null +++ b/tldr/jj-status @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj status + +> Show high-level repository status. +> This includes the working copy commit and its parents, and a summary of the changes in the working copy and any existing conflicts in the working copy. +> More information: . + +- Show high-level status of the repository: + +`jj status` diff --git a/tldr/linux/dex b/tldr/linux/dex index 25deb827..4d83487b 100644 --- a/tldr/linux/dex +++ b/tldr/linux/dex @@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git - Execute all programs in the specified folders: -`dex {{[-a|--autostart]} {{[-s|--search-paths]}} {{path/to/directory1}}:{{path/to/directory2}}:{{path/to/directory3}}:` +`dex {{[-a|--autostart]}} {{[-s|--search-paths]}} {{path/to/directory1}}:{{path/to/directory2}}:{{path/to/directory3}}:` - Preview the programs would be executed in a GNOME specific autostart: -`dex {{[-a|--autostart]} {{[-e|--environment]}} {{GNOME}}` +`dex {{[-a|--autostart]}} {{[-e|--environment]}} {{GNOME}}` - Preview the programs would be executed in a regular autostart: -`dex {{[-a|--autostart]} {{[-d|--dry-run]}}` +`dex {{[-a|--autostart]}} {{[-d|--dry-run]}}` - Preview the value of the DesktopEntry property `Name`: diff --git a/tldr/linux/fwupdmgr b/tldr/linux/fwupdmgr index 70ad570d..acc16d94 100644 --- a/tldr/linux/fwupdmgr +++ b/tldr/linux/fwupdmgr @@ -28,3 +28,7 @@ source: https://github.com/tldr-pages/tldr.git - Remount `/boot` with more privileges if update complains about a read-only filesystem: `sudo mount {{[-o|--options]}} uid=1000,gid=1000,umask=0022 {{/dev/sdX}} /boot` + +- Show firmware update history: + +`fwupdmgr get-history` diff --git a/tldr/linux/instaloader b/tldr/linux/instaloader index 0696ea50..03641880 100644 --- a/tldr/linux/instaloader +++ b/tldr/linux/instaloader @@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git - Download all types of posts (login required): -`instaloader {{[-l|--login]}} {{username}} {{[-p|--password]}} {{password}} {[-s|--stories]}} --igtv --highlights {{profile_name}}` +`instaloader {{[-l|--login]}} {{username}} {{[-p|--password]}} {{password}} {{[-s|--stories]}} --igtv --highlights {{profile_name}}` diff --git a/tldr/linux/lxc-start b/tldr/linux/lxc-start index dd407538..349e8a43 100644 --- a/tldr/linux/lxc-start +++ b/tldr/linux/lxc-start @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - Start a container in the foreground: -`sudo lxc-start {{container_name}} {{[-F|--foreground]]}` +`sudo lxc-start {{container_name}} {{[-F|--foreground]}}` - Exit out of a foreground container (run this in a separate terminal): diff --git a/tldr/tcpdump b/tldr/tcpdump index ddfa44e6..9ac7a9d8 100644 --- a/tldr/tcpdump +++ b/tldr/tcpdump @@ -16,26 +16,26 @@ source: https://github.com/tldr-pages/tldr.git `sudo tcpdump {{[-i|--interface]}} {{eth0}}` -- Capture all TCP traffic showing contents (ASCII) in console: +- Capture all TCP traffic showing contents ([A]SCII) in console: -`tcpdump -A tcp` +`sudo tcpdump -A tcp` - Capture the traffic from or to a host: -`tcpdump host {{www.example.com}}` +`sudo tcpdump host {{www.example.com}}` - Capture the traffic from a specific interface, source, destination and destination port: -`sudo tcpdump {{[-i|--interface]} {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port {{80}}` +`sudo tcpdump {{[-i|--interface]}} {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port {{80}}` - Capture the traffic of a network: -`tcpdump net {{192.168.1.0/24}}` +`sudo tcpdump net {{192.168.1.0/24}}` -- Capture all traffic except traffic over port 22 and save to a dump file: +- Capture all traffic except traffic over port 22 and [w]rite to a dump file: -`tcpdump -w {{dumpfile.pcap}} port not {{22}}` +`sudo tcpdump -w {{dumpfile.pcap}} port not {{22}}` -- Read from a given dump file: +- [r]ead from a given dump file: `tcpdump -r {{dumpfile.pcap}}` diff --git a/tldr/zellij b/tldr/zellij index 531e46fc..ea828ac5 100644 --- a/tldr/zellij +++ b/tldr/zellij @@ -11,15 +11,15 @@ source: https://github.com/tldr-pages/tldr.git - Start a new named session: -`zellij --session {{name}}` +`zellij {{[-s|--session]}} {{name}}` - List existing sessions: -`zellij list-sessions` +`zellij {{[ls|list-sessions]}}` - Attach to the most recently used session: -`zellij attach` +`zellij {{[a|attach]}}` - Open a new pane (inside a zellij session):