Update cheatsheets

This commit is contained in:
ivuorinen
2025-07-10 00:21:00 +00:00
parent b467fadfef
commit a75032eb46
30 changed files with 577 additions and 25 deletions

View File

@@ -8,6 +8,18 @@ source: https://github.com/tldr-pages/tldr.git
> The Device Tree Compiler, a tool for recompiling device trees between formats.
> More information: <https://github.com/dgibson/dtc>.
- Decompile a `.dtb` file into a readable `.dts` file:
- Compile a device tree source `.dts` file into a binary device tree blob `.dtb` file:
`dtc -I dts -O dtb -o {{path/to/output_file.dtb}} {{path/to/input_file.dts}}`
- Compile a device tree source `.dts` file into a binary device tree blob overlay `.dtbo` file:
`dtc -@ -I dts -O dtb -o {{path/to/output_file.dtbo}} {{path/to/input_file.dts}}`
- Decompile a device tree blob `.dtb` file into a readable device tree source `.dts` file:
`dtc -I dtb -O dts -o {{path/to/output_file.dts}} {{path/to/input_file.dtb}}`
- Decompile the current device tree from the system into a readable device tree source `.dts` file:
`dtc -I fs -O dts /proc/device-tree`

View File

@@ -5,21 +5,25 @@ source: https://github.com/tldr-pages/tldr.git
---
# exercism
> Download and solve problems.
> Download coding exercises in any language and submit your solutions.
> More information: <https://exercism.org/docs/using/solving-exercises/working-locally>.
- Configure the application token and the preferred workspace for Exercism:
- Configure exercism following instructions for the API token:
`exercism configure --token={{your-application-token}} --workspace={{/path/to/preferred/workspace}}`
`exercism configure`
- Download a specific exercise:
- Download `hello-world` for any programming language into exercism workspace:
`exercism download --exercise={{exercise_slug}} --track={{track_slug}}`
`exercism download --track {{programming_language}} --exercise hello-world`
- Submit an exercise:
- Open an exercise directory on the website:
`exercism submit {{path/to/file}}`
`exercism open {{path/to/directory}}`
- Print the path to the solution workspace:
- Test your solution. It will also tell you if you are missing tools for the programming language:
`exercism workspace`
`exercism test {{path/to/directory}}`
- Submit your solution. You can share from the website or ask a community mentor for help:
`exercism submit {{path/to/directory}}`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- List files and folders inside a remote folder:
`filen ls {{remote_folder}`
`filen ls {{remote_folder}}`
- Delete a remote file or folder (move it to trash):

12
tldr/impacket-psexec Normal file
View File

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

View File

@@ -6,9 +6,10 @@ 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.
> Changes that have zero or multiple matching regions in ancestral revisions won't be moved.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-absorb>.
- Move all changes from a revision to other revisions automatically:
- Move all eligible and unambiguous changes from a revision to other revisions automatically:
`jj absorb {{[-f|--from]}} {{revset}} {{[-t|--into]}} {{revsets}}`

26
tldr/jj-git-clone Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj git clone
> Create a new repo backed by a clone of a Git repo.
> Note: Unless `--colocate` is used, it is not a valid Git repository and `git` commands can't be used on it.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-clone>.
- Create a new repo backed by a clone of a Git repo into a new directory (the default directory is the repository name):
`jj git clone {{source}} {{path/to/directory}}`
- Create a clone and use the given name for newly created remote:
`jj git clone --remote {{remote_name}} {{source}}`
- Clone a Git repo, only fetching the 10 most recent commits:
`jj git clone --depth {{10}} {{source}}`
- Clone colocating the Jujutsu repo with the Git repo (allowing the use of both `jj` and `git` commands in the same directory):
`jj git clone --colocate {{source}}`

25
tldr/jj-git-fetch Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj git fetch
> Fetch from a Git remote, downloading objects and refs from the remote repository.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-fetch>.
- Fetch the latest changes from the default remote repository:
`jj git fetch`
- Fetch the latest changes from a given remote repository:
`jj git fetch --remote {{remote}}`
- Fetch the latest changes only from given branches:
`jj git fetch {{[-b|--branch]}} {{branch}}`
- Fetch the latest changes from all remotes:
`jj git fetch --all-remote`

26
tldr/jj-git-init Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj git init
> Create a new Git backed Jujutsu repo.
> Note: Unless `--colocate` is used, it is not a valid Git repository and `git` commands can't be used on it.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-init>.
- Create a new Git backed repo in the current directory:
`jj git init`
- Create a new Git backed repo in the given directory:
`jj git init {{path/to/directory}}`
- Initialize the Jujutsu repository as a valid Git repository (allowing the use of both `jj` and `git` commands in the same directory):
`jj git init --colocate`
- Initialize the Jujutsu repository backed by an existing Git repository:
`jj git init --git-repo {{git_repo}}`

37
tldr/jj-git-push Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj git push
> Push to a Git remote.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-push>.
- Push a bookmark to the given remote (defaults to `git.push` setting):
`jj git push {{[-b|--bookmark]}} {{bookmark}} --remote {{remote}}`
- Push a new bookmark:
`jj git push {{[-b|--bookmark]}} {{bookmark}} {{[-N|--allow-new]}}`
- Push all tracked bookmarks:
`jj git push --tracked`
- Push all bookmarks (including new bookmarks):
`jj git push --all`
- Push all bookmarks pointing to given revisions:
`jj git push {{[-r|--revisions]}} {{revset}}`
- Push changes/commits by creating new bookmarks (Name format is as per `templates.git_push_bookmark` setting, defaults to `"push-" ++ change_id.short()`):
`jj git push {{[-c|--change]}} {{revset}}`
- Push a revision with the given name:
`jj git push --named {{name}}={{revision}}`

29
tldr/jj-git-remote Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# jj git remote
> Manage Git remotes.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-remote>.
- List all Git remotes:
`jj git remote list`
- Add a Git remote:
`jj git remote add {{remote}} {{url}}`
- Change the URL of a Git remote:
`jj git remote set-url {{remote}} {{url}}`
- Remove a Git remote:
`jj git remote remove {{remote}}`
- Rename a Git remote:
`jj git remote rename {{old_name}} {{new_name}}`

35
tldr/linux/dnf-builddep Normal file
View File

@@ -0,0 +1,35 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# dnf builddep
> Install dependencies to build a given package.
> Not default to `dnf` but supported via `dnf-plugins-core`.
> See also: `dnf`.
> More information: <https://dnf-plugins-core.readthedocs.io/en/latest/builddep.html>.
- Install dependencies for a given package:
`dnf builddep {{path/to/specification.spec}}`
- Install dependencies for a given package but ignore unavailable:
`dnf builddep --skip-unavailable {{path/to/specification.spec}}`
- Define the RPM macro to a given expression:
`dnf builddep {{[-D|--define]}} '{{expression}}'`
- Define an argument for a `.spec` file path:
`dnf builddep --spec {{argument}}`
- Define an argument for a `.rpm` file path:
`dnf builddep --srpm {{argument}}`
- Display help:
`dnf builddep --help-cmd`

31
tldr/linux/dnf-changelog Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# dnf changelog
> View the changelogs for a given package.
> Not default to `dnf` but supported via `dnf-plugins-core`.
> See also: `dnf`.
> More information: <https://dnf-plugins-core.readthedocs.io/en/latest/changelog.html>.
- View all changelogs for a given package:
`dnf changelog {{package}}`
- View all changelogs for a given package after a specified date:
`dnf changelog --since {{date}} {{package}}`
- View the last `n` number of changelogs for a given package:
`dnf changelog --count {{number}} {{package}}`
- Show only new items for upgradeable packages:
`dnf changelog --upgrades {{package}}`
- Display help:
`dnf changelog --help-cmd`

View File

@@ -6,6 +6,8 @@ source: https://github.com/tldr-pages/tldr.git
# dnf config-manager
> Manage DNF configuration options and repositories on Fedora-based systems.
> Not default to `dnf` but supported via `dnf-plugins-core`.
> See also: `dnf`.
> More information: <https://dnf-plugins-core.readthedocs.io/en/latest/config_manager.html>.
- Add (and enable) a repository from a URL:

View File

@@ -15,19 +15,19 @@ source: https://github.com/tldr-pages/tldr.git
- Permanently move the interface into the block zone, effectively blocking all communication:
`firewall-cmd --permanent --zone={{block}} --change-interface={{enp1s0}}`
`firewall-cmd --permanent --zone {{block}} --change-interface {{enp1s0}}`
- Permanently open the port for a service in the specified zone (like port 443 when in the `public` zone):
`firewall-cmd --permanent --zone={{public}} --add-service={{https}}`
`firewall-cmd --permanent --zone {{public}} --add-service {{https}}`
- Permanently close the port for a service in the specified zone (like port 80 when in the `public` zone):
`firewall-cmd --permanent --zone={{public}} --remove-service={{http}}`
`firewall-cmd --permanent --zone {{public}} --remove-service {{http}}`
- Permanently forward a port for incoming packets in the specified zone (like port 443 to 8443 when entering the `public` zone):
`firewall-cmd --permanent --zone={{public}} --add-rich-rule='rule family="{{ipv4|ipv6}}" forward-port port="{{443}}" protocol="{{udp|tcp}}" to-port="{{8443}}"'`
`firewall-cmd --permanent --zone {{public}} --add-rich-rule 'rule family "{{ipv4|ipv6}}" forward-port port "{{443}}" protocol "{{udp|tcp}}" to-port "{{8443}}"'`
- Reload firewalld to lose any runtime changes and force the permanent configuration to take effect immediately:

22
tldr/linux/i2cdetect Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# i2cdetect
> Scan I2C buses.
> See also: `i2cdump`, `i2cget`, `i2cset`.
> More information: <https://manned.org/i2cdetect>.
- List active I2C buses:
`i2cdetect -l`
- Scan devices on an I2C bus:
`i2cdetect {{i2c_bus}}`
- Scan devices on an I2C bus without asking for confirmation:
`i2cdetect -y {{i2c_bus}}`

27
tldr/linux/i2cdump Normal file
View File

@@ -0,0 +1,27 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# i2cdump
> Dump I2C device registers.
> See also: `i2cdetect`, `i2cget`, `i2cset`.
> Note: All addresses should be specified in hexadecimal.
> More information: <https://manned.org/i2cdump>.
- Dump all registers of an I2C device:
`i2cdump {{i2cbus}} {{device_address}}`
- Dump all registers of an I2C device without asking for confirmation:
`i2cdump -y {{i2cbus}} {{device_address}}`
- Dump all registers of an I2C device using a specific mode:
`i2cdump {{i2cbus}} {{device_address}} {{b|w|c|s|i}}`
- Dump registers from `start` to `end` of an I2C device:
`i2cdump -r {{start}}-{{end}} {{i2cbus}} {{device_address}}`

23
tldr/linux/i2cget Normal file
View File

@@ -0,0 +1,23 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# i2cget
> Read from an register of an I2C device.
> See also: `i2cdetect`, `i2cdump`, `i2cset`.
> Note: All addresses should be specified in hexadecimal.
> More information: <https://manned.org/i2cget>.
- Read from a register of an I2C device:
`i2cget {{i2cbus}} {{device_address}} {{register_address}}`
- Read from a register of an I2C device without asking for confirmation:
`i2cget -y {{i2cbus}} {{device_address}} {{register_address}}`
- Read from a register of an I2C device using a specific mode:
`i2cget {{i2cbus}} {{device_address}} {{register_address}} {{b|w|c|s|i}}`

23
tldr/linux/i2cset Normal file
View File

@@ -0,0 +1,23 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# i2cset
> Set the value of a register of an I2C device.
> See also: `i2cdetect`, `i2cdump`, `i2cget`.
> Note: All addresses should be specified in hexadecimal.
> More information: <https://manned.org/i2cset>.
- Write to a register of an I2C device:
`i2cset {{i2cbus}} {{device_address}} {{register_address}} {{value}}`
- Write to a register of an I2C device without asking for confirmation:
`i2cset -y {{i2cbus}} {{device_address}} {{register_address}} {{value}}`
- Write to a register of an I2C device using a specific mode:
`i2cset {{i2cbus}} {{device_address}} {{register_address}} {{value}} {{b|w|c|s|i}}`

13
tldr/linux/yumdownloader Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# yumdownloader
> Historical YUM package downloader for Fedora installations; now deprecated.
> This command is an alias of `dnf download`.
- View documentation for the original command:
`tldr dnf download`

25
tldr/mailsy Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# mailsy
> Quickly generate a disposable email using `mail.tm` API.
> More information: <https://github.com/BalliAsghar/Mailsy>.
- Create an email address:
`mailsy g`
- Fetch emails (press `<Enter>` to open email in browser):
`mailsy m`
- Show details about the account:
`mailsy me`
- Dispose the email address:
`mailsy d`

View File

@@ -19,3 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Create directories with specific permissions:
`mkdir {{[-m|--mode]}} {{rwxrw-r--}} {{path/to/directory1 path/to/directory2 ...}}`
- Create multiple nested directories recursively:
`mkdir {{[-p|--parents]}} {{path/to/{a,b}/{x,y,z}/{h,i,j}}}`

18
tldr/mpic++ Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# mpic++
> Open MPI wrapper compiler for C++.
> See also: `mpirun`.
> More information: <https://www.open-mpi.org/doc/v3.0/man1/mpic++.1.php>.
- Compile an Open MPI program:
`mpic++ {{path/to/source_file}}`
- Show all the wrapper-supplied flags:
`mpic++ --showme`

22
tldr/mpicc Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# mpicc
> Open MPI C wrapper compiler.
> The wrappers are simply thin shells on top of a C compiler, they add the relevant compiler and linker flags to the command-line that are necessary to compile/link Open MPI programs, and then invoke the underlying C compiler to actually perform the command.
> More information: <https://www.mpich.org/static/docs/latest/www1/mpicc.html>.
- Compile a source code file into an object file:
`mpicc -c {{path/to/file.c}}`
- Link an object file and make an executable:
`mpicc -o {{executable}} {{path/to/object_file.o}}`
- Compile and link source code in a single command:
`mpicc -o {{executable}} {{path/to/file.c}}`

12
tldr/mpiexec Normal file
View File

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

22
tldr/mpirun Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# mpirun
> Execute serial and parallel jobs in Open MPI.
> See also: `mpic++`.
> More information: <https://docs.open-mpi.org/en/main/man-openmpi/man1/mpirun.1.html>.
- Execute an Open MPI program:
`mpirun {{path/to/executable}}`
- Execute an Open MPI program with `n` parallel processes:
`mpirun -n {{n}} {{path/to/executable}}`
- Allow more processes than available physical cores:
`mpirun -oversubscribe {{path/to/executable}}`

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Update a specific input (dependency) of the flake in the current directory:
`nix flake lock --update-input {{input}}`
`nix flake update {{input}}`
- Show all the outputs of a flake on github:

View File

@@ -10,11 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Create a new searchable PDF/A file from a scanned PDF or image file:
`ocrmypdf {{path/to/input_file}} {{path/to/output.pdf}}`
- Replace a scanned PDF file with a searchable PDF file:
`ocrmypdf {{path/to/file.pdf}} {{path/to/file.pdf}}`
`ocrmypdf {{path/to/input}} {{path/to/output.pdf}}`
- Skip pages of a mixed-format input PDF file that already contain text:
@@ -22,11 +18,15 @@ source: https://github.com/tldr-pages/tldr.git
- Clean, de-skew, and rotate pages of a poor scan:
`ocrmypdf --clean --deskew --rotate-pages {{path/to/input_file}} {{path/to/output.pdf}}`
`ocrmypdf --clean --deskew --rotate-pages {{path/to/input.pdf}} {{path/to/output.pdf}}`
- Set the metadata of the searchable PDF file:
- Perform lossy optimization on a PDF without performing any OCR:
`ocrmypdf --title "{{title}}" --author "{{author}}" --subject "{{subject}}" --keywords "{{keyword; key phrase; ...}}" {{path/to/input_file}} {{path/to/output.pdf}}`
`ocrmypdf --tesseract-timeout 0 --optimize 2 --skip-text {{path/to/input.pdf}} {{path/to/output.pdf}}`
- Set the metadata of a searchable PDF file:
`ocrmypdf --title "{{title}}" --author "{{author}}" --subject "{{subject}}" --keywords "{{keyword; key phrase; ...}}" {{path/to/input.pdf}} {{path/to/output.pdf}}`
- Display help:

38
tldr/psexec.py Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# psexec.py
> Execute commands on a remote Windows machine using `RemComSvc`, providing PsExec-like functionality.
> Part of the Impacket suite.
> More information: <https://github.com/fortra/impacket>.
- Spawn an interactive shell on a remote target:
`psexec.py {{domain}}/{{username}}:{{password}}@{{target}}`
- Execute a specific command on a remote target:
`psexec.py {{domain}}/{{username}}:{{password}}@{{target}} {{command}}`
- Copy the filename for later execution, arguments are passed in the command:
`psexec.py -c {{filename}} {{domain}}/{{username}}:{{password}}@{{target}} {{command}}`
- Execute a command from a specific path on a remote target:
`psexec.py -path {{path}} {{domain}}/{{username}}:{{password}}@{{target}} {{command}}`
- Authenticate using pass-the-hash authentication instead of a password:
`psexec.py -hashes {{LM_Hash}}:{{NT_Hash}} {{domain}}/{{username}}@{{target}}`
- Use Kerberos authentication for the target:
`psexec.py -k -no-pass {{domain}}/{{username}}@{{target}}`
- Specify the IP address of the domain controller:
`psexec.py -dc-ip {{domain_controller_ip}} {{domain}}/{{username}}:{{password}}@{{target}}`

37
tldr/rsql Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# rsql
> SQL client to interface with databases and other data sources inside the terminal.
> More information: <https://github.com/theseus-rs/rsql>.
- Enter interactive mode:
`rsql`
- Connect to a database (e.g. PostgreSQL):
`rsql --url {{"postgresql://user:pass@localhost/mydb"}}`
- Connect to a PostgreSQL database with SSL:
`rsql --url {{"postgresql://user:pass@localhost/db?sslmode=require"}}`
- Connect to a MySQL database with a specified charset:
`rsql --url {{"mysql://user:pass@localhost/db?charset=utf8mb4"}}`
- Run a query and exit:
`rsql --url {{"sqlite://database.db"}} -- "SELECT * FROM users LIMIT 10"`
- Set default format:
`rsql --url {{"sqlite://db.sqlite"}} --format json`
- Connect to file and use custom line separator:
`rsql --url {{"delimited://data.txt?separator=|&has_header=true"}}`

26
tldr/sccache Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# sccache
> A fast C/C++/Rust compiler cache.
> Composed of a client and a server, both running on the machine.
> More information: <https://manned.org/sccache>.
- Show compilation statistics:
`sccache {{[-s|--show-stats]}}`
- Run `gcc` (or any compiler command) through `sccache`:
`sccache gcc {{path/to/file.c}}`
- Start `sccache` server in the foreground and print logs:
`sccache --stop-server; SCCACHE_LOG=trace SCCACHE_START_SERVER=1 SCCACHE_NO_DAEMON=1 sccache`
- Ask scheduler for distributed compilation status:
`sccache --dist-status`