Update cheatsheets

This commit is contained in:
ivuorinen
2025-07-04 00:20:35 +00:00
parent d4cbcd5def
commit 9bc209f588
14 changed files with 215 additions and 17 deletions

View File

@@ -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):

34
tldr/jj Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/>.
- 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}}`

34
tldr/jj-bookmark Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-bookmark>.
- 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}}`

29
tldr/jj-diff Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-diff>.
- 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`

29
tldr/jj-git Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git>.
- 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}}`

21
tldr/jj-log Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-log>.
- 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'`

33
tldr/jj-operation Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-operation>.
- 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}}`

14
tldr/jj-status Normal file
View File

@@ -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: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-status>.
- Show high-level status of the repository:
`jj status`

View File

@@ -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`:

View File

@@ -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`

View File

@@ -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}}`

View File

@@ -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):

View File

@@ -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}}`

View File

@@ -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):