From a75032eb4654868622daa5b611c478e71eea0bad Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 10 Jul 2025 00:21:00 +0000 Subject: [PATCH] Update cheatsheets --- tldr/dtc | 14 ++++++++++++- tldr/exercism | 22 +++++++++++--------- tldr/filen | 2 +- tldr/impacket-psexec | 12 +++++++++++ tldr/jj-absorb | 3 ++- tldr/jj-git-clone | 26 ++++++++++++++++++++++++ tldr/jj-git-fetch | 25 +++++++++++++++++++++++ tldr/jj-git-init | 26 ++++++++++++++++++++++++ tldr/jj-git-push | 37 ++++++++++++++++++++++++++++++++++ tldr/jj-git-remote | 29 ++++++++++++++++++++++++++ tldr/linux/dnf-builddep | 35 ++++++++++++++++++++++++++++++++ tldr/linux/dnf-changelog | 31 ++++++++++++++++++++++++++++ tldr/linux/dnf-config-manager | 2 ++ tldr/linux/firewall-cmd | 8 ++++---- tldr/linux/i2cdetect | 22 ++++++++++++++++++++ tldr/linux/i2cdump | 27 +++++++++++++++++++++++++ tldr/linux/i2cget | 23 +++++++++++++++++++++ tldr/linux/i2cset | 23 +++++++++++++++++++++ tldr/linux/yumdownloader | 13 ++++++++++++ tldr/mailsy | 25 +++++++++++++++++++++++ tldr/mkdir | 4 ++++ tldr/mpic++ | 18 +++++++++++++++++ tldr/mpicc | 22 ++++++++++++++++++++ tldr/mpiexec | 12 +++++++++++ tldr/mpirun | 22 ++++++++++++++++++++ tldr/nix-flake | 2 +- tldr/ocrmypdf | 16 +++++++-------- tldr/psexec.py | 38 +++++++++++++++++++++++++++++++++++ tldr/rsql | 37 ++++++++++++++++++++++++++++++++++ tldr/sccache | 26 ++++++++++++++++++++++++ 30 files changed, 577 insertions(+), 25 deletions(-) create mode 100644 tldr/impacket-psexec create mode 100644 tldr/jj-git-clone create mode 100644 tldr/jj-git-fetch create mode 100644 tldr/jj-git-init create mode 100644 tldr/jj-git-push create mode 100644 tldr/jj-git-remote create mode 100644 tldr/linux/dnf-builddep create mode 100644 tldr/linux/dnf-changelog create mode 100644 tldr/linux/i2cdetect create mode 100644 tldr/linux/i2cdump create mode 100644 tldr/linux/i2cget create mode 100644 tldr/linux/i2cset create mode 100644 tldr/linux/yumdownloader create mode 100644 tldr/mailsy create mode 100644 tldr/mpic++ create mode 100644 tldr/mpicc create mode 100644 tldr/mpiexec create mode 100644 tldr/mpirun create mode 100644 tldr/psexec.py create mode 100644 tldr/rsql create mode 100644 tldr/sccache diff --git a/tldr/dtc b/tldr/dtc index c8668ee5..77d757e5 100644 --- a/tldr/dtc +++ b/tldr/dtc @@ -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: . -- 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` diff --git a/tldr/exercism b/tldr/exercism index 2a8a2a57..823b01a8 100644 --- a/tldr/exercism +++ b/tldr/exercism @@ -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: . -- 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}}` diff --git a/tldr/filen b/tldr/filen index 822cb66a..738a2ef0 100644 --- a/tldr/filen +++ b/tldr/filen @@ -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): diff --git a/tldr/impacket-psexec b/tldr/impacket-psexec new file mode 100644 index 00000000..f701045b --- /dev/null +++ b/tldr/impacket-psexec @@ -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` diff --git a/tldr/jj-absorb b/tldr/jj-absorb index 97fc0098..23b868d5 100644 --- a/tldr/jj-absorb +++ b/tldr/jj-absorb @@ -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: . -- 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}}` diff --git a/tldr/jj-git-clone b/tldr/jj-git-clone new file mode 100644 index 00000000..307edf3b --- /dev/null +++ b/tldr/jj-git-clone @@ -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: . + +- 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}}` diff --git a/tldr/jj-git-fetch b/tldr/jj-git-fetch new file mode 100644 index 00000000..17961a5b --- /dev/null +++ b/tldr/jj-git-fetch @@ -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: . + +- 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` diff --git a/tldr/jj-git-init b/tldr/jj-git-init new file mode 100644 index 00000000..6d792d14 --- /dev/null +++ b/tldr/jj-git-init @@ -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: . + +- 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}}` diff --git a/tldr/jj-git-push b/tldr/jj-git-push new file mode 100644 index 00000000..f9644050 --- /dev/null +++ b/tldr/jj-git-push @@ -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: . + +- 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}}` diff --git a/tldr/jj-git-remote b/tldr/jj-git-remote new file mode 100644 index 00000000..3b17f536 --- /dev/null +++ b/tldr/jj-git-remote @@ -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: . + +- 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}}` diff --git a/tldr/linux/dnf-builddep b/tldr/linux/dnf-builddep new file mode 100644 index 00000000..bdb9fb2b --- /dev/null +++ b/tldr/linux/dnf-builddep @@ -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: . + +- 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` diff --git a/tldr/linux/dnf-changelog b/tldr/linux/dnf-changelog new file mode 100644 index 00000000..f3abff30 --- /dev/null +++ b/tldr/linux/dnf-changelog @@ -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: . + +- 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` diff --git a/tldr/linux/dnf-config-manager b/tldr/linux/dnf-config-manager index e14d96b8..2ea26b6c 100644 --- a/tldr/linux/dnf-config-manager +++ b/tldr/linux/dnf-config-manager @@ -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: . - Add (and enable) a repository from a URL: diff --git a/tldr/linux/firewall-cmd b/tldr/linux/firewall-cmd index 33082d0c..81af8a09 100644 --- a/tldr/linux/firewall-cmd +++ b/tldr/linux/firewall-cmd @@ -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: diff --git a/tldr/linux/i2cdetect b/tldr/linux/i2cdetect new file mode 100644 index 00000000..4498f9c9 --- /dev/null +++ b/tldr/linux/i2cdetect @@ -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: . + +- 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}}` diff --git a/tldr/linux/i2cdump b/tldr/linux/i2cdump new file mode 100644 index 00000000..64e6884c --- /dev/null +++ b/tldr/linux/i2cdump @@ -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: . + +- 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}}` diff --git a/tldr/linux/i2cget b/tldr/linux/i2cget new file mode 100644 index 00000000..36cd2f20 --- /dev/null +++ b/tldr/linux/i2cget @@ -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: . + +- 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}}` diff --git a/tldr/linux/i2cset b/tldr/linux/i2cset new file mode 100644 index 00000000..e5b541b0 --- /dev/null +++ b/tldr/linux/i2cset @@ -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: . + +- 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}}` diff --git a/tldr/linux/yumdownloader b/tldr/linux/yumdownloader new file mode 100644 index 00000000..4cf44b97 --- /dev/null +++ b/tldr/linux/yumdownloader @@ -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` diff --git a/tldr/mailsy b/tldr/mailsy new file mode 100644 index 00000000..1b0b6bb6 --- /dev/null +++ b/tldr/mailsy @@ -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: . + +- Create an email address: + +`mailsy g` + +- Fetch emails (press `` to open email in browser): + +`mailsy m` + +- Show details about the account: + +`mailsy me` + +- Dispose the email address: + +`mailsy d` diff --git a/tldr/mkdir b/tldr/mkdir index d7ae6b5a..dac722cd 100644 --- a/tldr/mkdir +++ b/tldr/mkdir @@ -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}}}` diff --git a/tldr/mpic++ b/tldr/mpic++ new file mode 100644 index 00000000..2871c592 --- /dev/null +++ b/tldr/mpic++ @@ -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: . + +- Compile an Open MPI program: + +`mpic++ {{path/to/source_file}}` + +- Show all the wrapper-supplied flags: + +`mpic++ --showme` diff --git a/tldr/mpicc b/tldr/mpicc new file mode 100644 index 00000000..04a92445 --- /dev/null +++ b/tldr/mpicc @@ -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: . + +- 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}}` diff --git a/tldr/mpiexec b/tldr/mpiexec new file mode 100644 index 00000000..a974674d --- /dev/null +++ b/tldr/mpiexec @@ -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` diff --git a/tldr/mpirun b/tldr/mpirun new file mode 100644 index 00000000..33d34680 --- /dev/null +++ b/tldr/mpirun @@ -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: . + +- 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}}` diff --git a/tldr/nix-flake b/tldr/nix-flake index b69e6624..eb5aabcc 100644 --- a/tldr/nix-flake +++ b/tldr/nix-flake @@ -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: diff --git a/tldr/ocrmypdf b/tldr/ocrmypdf index 62294272..f3cb840f 100644 --- a/tldr/ocrmypdf +++ b/tldr/ocrmypdf @@ -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: diff --git a/tldr/psexec.py b/tldr/psexec.py new file mode 100644 index 00000000..957ca406 --- /dev/null +++ b/tldr/psexec.py @@ -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: . + +- 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}}` diff --git a/tldr/rsql b/tldr/rsql new file mode 100644 index 00000000..143bed0f --- /dev/null +++ b/tldr/rsql @@ -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: . + +- 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"}}` diff --git a/tldr/sccache b/tldr/sccache new file mode 100644 index 00000000..f4f1f3c7 --- /dev/null +++ b/tldr/sccache @@ -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: . + +- 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`