From 6db54f94106b34daffe82eeb04e362a54a93fcfc Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Wed, 2 Oct 2024 00:17:10 +0000 Subject: [PATCH] Update cheatsheets --- tldr/$ | 29 +++++++++++++++++++++++++++++ tldr/ghdl | 2 +- tldr/greater-than | 25 +++++++++++++++++++++++++ tldr/less-than | 14 ++++++++++++++ tldr/linux/apt-clone | 29 +++++++++++++++++++++++++++++ tldr/vertical-bar | 17 +++++++++++++++++ tldr/vinmap | 29 +++++++++++++++++++++++++++++ tldr/yadm | 38 ++++++++++++++++++++++++++++++++++++++ tldr/yadm-alt | 14 ++++++++++++++ tldr/yadm-bootstrap | 14 ++++++++++++++ tldr/yadm-clone | 35 +++++++++++++++++++++++++++++++++++ tldr/yadm-config | 25 +++++++++++++++++++++++++ tldr/yadm-decrypt | 14 ++++++++++++++ tldr/yadm-encrypt | 18 ++++++++++++++++++ tldr/yadm-enter | 18 ++++++++++++++++++ tldr/yadm-git-crypt | 26 ++++++++++++++++++++++++++ tldr/yadm-gitconfig | 26 ++++++++++++++++++++++++++ tldr/yadm-init | 22 ++++++++++++++++++++++ tldr/yadm-introsepct | 26 ++++++++++++++++++++++++++ tldr/yadm-list | 17 +++++++++++++++++ tldr/yadm-perms | 14 ++++++++++++++ tldr/yadm-transcrypt | 31 +++++++++++++++++++++++++++++++ tldr/yadm-upgrade | 18 ++++++++++++++++++ 23 files changed, 500 insertions(+), 1 deletion(-) create mode 100644 tldr/$ create mode 100644 tldr/greater-than create mode 100644 tldr/less-than create mode 100644 tldr/linux/apt-clone create mode 100644 tldr/vertical-bar create mode 100644 tldr/vinmap create mode 100755 tldr/yadm create mode 100755 tldr/yadm-alt create mode 100755 tldr/yadm-bootstrap create mode 100755 tldr/yadm-clone create mode 100755 tldr/yadm-config create mode 100755 tldr/yadm-decrypt create mode 100755 tldr/yadm-encrypt create mode 100755 tldr/yadm-enter create mode 100755 tldr/yadm-git-crypt create mode 100755 tldr/yadm-gitconfig create mode 100755 tldr/yadm-init create mode 100755 tldr/yadm-introsepct create mode 100755 tldr/yadm-list create mode 100755 tldr/yadm-perms create mode 100755 tldr/yadm-transcrypt create mode 100755 tldr/yadm-upgrade diff --git a/tldr/$ b/tldr/$ new file mode 100644 index 00000000..a6ec1eb3 --- /dev/null +++ b/tldr/$ @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# Dollar sign + +> Expand a bash variable. +> More information: . + +- Print a variable: + +`echo ${{VARIABLE}}` + +- Print the exit status of the previous command: + +`echo $?` + +- Print a random number between 0 and 32767: + +`echo $RANDOM` + +- Print one of the prompt strings: + +`echo ${{PS1|PS2|PS3|PS4}}` + +- Expand with the output of `command` and run it. Same as enclosing `command` in backtics: + +`$({{command}})` diff --git a/tldr/ghdl b/tldr/ghdl index 267cc8c3..c6132ce9 100644 --- a/tldr/ghdl +++ b/tldr/ghdl @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # ghdl > Open-source simulator for the VHDL language. -> More information: . +> More information: . - Analyze a VHDL source file and produce an object file: diff --git a/tldr/greater-than b/tldr/greater-than new file mode 100644 index 00000000..585e70c8 --- /dev/null +++ b/tldr/greater-than @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# Greater than + +> Redirect output to a file. +> More information: . + +- Redirect `stdout` to a file: + +`{{command}} > {{path/to/file}}` + +- Append to a file: + +`{{command}} >> {{path/to/file}}` + +- Redirect both `stdout` and `stderr` to a file: + +`{{command}} &> {{path/to/file}}` + +- Redirect both `stdout` and `stderr` to `/dev/null` to keep the terminal output clean: + +`{{command}} &> /dev/null` diff --git a/tldr/less-than b/tldr/less-than new file mode 100644 index 00000000..b913e99e --- /dev/null +++ b/tldr/less-than @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# Less than + +> Redirect a file to `stdin`. +> Achieves the same effect as `cat file.txt |`. +> More information: . + +- Redirect a file to `stdin`: + +`{{command}} < {{path/to/file.txt}}` diff --git a/tldr/linux/apt-clone b/tldr/linux/apt-clone new file mode 100644 index 00000000..0d1f3a35 --- /dev/null +++ b/tldr/linux/apt-clone @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# apt-clone + +> Clone/backup/restore the package state of a Debian-based system. +> More information: . + +- Clone the package state of the current system into a specified directory: + +`apt-clone clone {{path/to/directory}}` + +- Create a clone file (`tar.gz`) for backup purposes: + +`apt-clone clone --destination {{path/to/backup.tar.gz}}` + +- Restore the package state from a clone file: + +`apt-clone restore {{path/to/backup.tar.gz}}` + +- Show information about a clone file (e.g., the release, architecture): + +`apt-clone info {{path/to/backup.tar.gz}}` + +- Check if the clone file can be restored on the current system: + +`apt-clone restore {{path/to/backup.tar.gz}} --destination {{path/to/restore}}` diff --git a/tldr/vertical-bar b/tldr/vertical-bar new file mode 100644 index 00000000..2d58fe5d --- /dev/null +++ b/tldr/vertical-bar @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# Vertical bar + +> Pipe data between programs. +> More information: . + +- Pipe `stdout` to `stdin`: + +`{{command}} | {{command}}` + +- Pipe both `stdout` and `stderr` to `stdin`: + +`{{command}} |& {{command}}` diff --git a/tldr/vinmap b/tldr/vinmap new file mode 100644 index 00000000..239fd5fc --- /dev/null +++ b/tldr/vinmap @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# vinmap + +> A multithreaded Nmap scanner that splits IP ranges into chunks, performs parallel scans, and merges XML or JSON results. +> More information: . + +- Perform a basic scan of a subnet: + +`vinmap -ip {{192.168.1.0/24}}` + +- Scan a domain with version and OS detection, saving results to a specific file: + +`vinmap -ip {{example.com}} -s "-sV -O" -o {{path/to/scan_results.xml}}` + +- Scan an IP range using 10 chunks and 20 concurrent threads, uses half of the system's CPU cores if not specified: + +`vinmap -ip {{10.0.0.1-10.0.0.255}} -n 10 -t 20` + +- Output scan results in JSON format: + +`vinmap -ip {{192.168.1.1-192.168.1.100}} -f json` + +- Scan multiple IPs with default settings and save merged XML output: + +`vinmap -ip {{192.168.1.1,192.168.1.2,...}}` diff --git a/tldr/yadm b/tldr/yadm new file mode 100755 index 00000000..929c1cad --- /dev/null +++ b/tldr/yadm @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm + +> A dotfiles manager that works by using `git`. +> Some subcommands such as `init`, `clone`, `push`, and `pull` have their own usage documentation. +> More information: . + +- Override the `yadm` directory. `yadm` stores its configurations relative to this directory: + +`yadm --yadm-dir` + +- Override the `yadm` data directory: `yadm` stores its data relative to this directory: + +`yadm --yadm-data` + +- Override the location of the `yadm` repository: + +`yadm --yadm-repo` + +- Override the location of the `yadm` configuration file: + +`yadm --yadm-config` + +- Override the location of the `yadm` encryption configuration: + +`yadm --yadm-encrypt` + +- Override the location of the `yadm` encrypted files archive: + +`yadm --yadm-archive` + +- Override the location of the `yadm` bootstrap program: + +`yadm --yadm-bootstrap` diff --git a/tldr/yadm-alt b/tldr/yadm-alt new file mode 100755 index 00000000..5dd430b0 --- /dev/null +++ b/tldr/yadm-alt @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-alt + +> Create symbolic links and process templates for any managed files. +> Learn more about templates: . +> More information: . + +- Create symbolic links between alternate files manually: + +`yadm alt` diff --git a/tldr/yadm-bootstrap b/tldr/yadm-bootstrap new file mode 100755 index 00000000..10b3537d --- /dev/null +++ b/tldr/yadm-bootstrap @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-bootstrap + +> Execute Yadm's bootstrap file. +> This file should be created in `$HOME/.config/yadm/bootstrap`. +> More information: . + +- Execute bootstrap executable: + +`yadm bootstrap` diff --git a/tldr/yadm-clone b/tldr/yadm-clone new file mode 100755 index 00000000..4fd0dc22 --- /dev/null +++ b/tldr/yadm-clone @@ -0,0 +1,35 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-clone + +> Works just like `git clone`. In addition you can pass extra flags to configure your repository. +> If there is a bootstrap file in the repository, you will be prompted to execute it. +> See also: `git clone`. +> More information: . + +- Clone an existing repository: + +`yadm clone {{remote_repository_location}}` + +- Clone an existing repository, then execute the bootstrap file: + +`yadm clone {{remote_repository_location}} --bootstrap` + +- Clone an existing repository and after cloning, do not execute the bootstrap file: + +`yadm clone {{remote_repository_location}} --no-bootstrap` + +- Change the worktree that `yadm` will use during cloning: + +`yadm clone {{remote_repository_location}} --w {{worktree_file}}` + +- Change the branch that `yadm` gets files from: + +`yadm clone {{remote_repository_location}} -b {{branch}}` + +- Override an existing repository local branch: + +`yadm clone {{remote_repository_location}} -f` diff --git a/tldr/yadm-config b/tldr/yadm-config new file mode 100755 index 00000000..6535563c --- /dev/null +++ b/tldr/yadm-config @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-config + +> Pass options to `yadm`'s config file. Change the `.config` of the repository managed by `yadm`. +> See also: . + +- Set or update a `yadm`'s Git configuration: + +`yadm config {{key.inner-key}} {{value}}` + +- Get a value from `yadm`'s Git configuration: + +`yadm config --get {{key}}` + +- Unset a value in `yadm`'s Git configuration: + +`yadm config --unset {{key}}` + +- List all values in `yadm`'s Git configuration: + +`yadm config --list` diff --git a/tldr/yadm-decrypt b/tldr/yadm-decrypt new file mode 100755 index 00000000..69e9a2d7 --- /dev/null +++ b/tldr/yadm-decrypt @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-decrypt + +> Decrypt files that were encrypted by `yadm`. +> When activating this command you will be prompted for a password. +> More information: . + +- Decrypt files: + +`yadm decrypt` diff --git a/tldr/yadm-encrypt b/tldr/yadm-encrypt new file mode 100755 index 00000000..8395756e --- /dev/null +++ b/tldr/yadm-encrypt @@ -0,0 +1,18 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-encrypt + +> Encrypt files listed in the designated encrypt file. +> After the files are encrypted they will be save in the designated archive folder. +> More information: . + +- Encrypt files listed in the designated encrypt file: + +`yadm encrypt` + +- Create the necessary files and folders for encryption: + +`touch {{path/to/encrypt_file}} && mkdir {{path/to/archive_folder}}` diff --git a/tldr/yadm-enter b/tldr/yadm-enter new file mode 100755 index 00000000..b6183065 --- /dev/null +++ b/tldr/yadm-enter @@ -0,0 +1,18 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-enter + +> Run a sub-shell with all Git variables set. This sub-shell can be used to easily interact with the local `yadm` repository using Git commands. +> This could be useful if you are using a tool which uses Git directly. +> More information: . + +- Run a sub-shell with all Git variables set: + +`yadm enter` + +- Exit the sub-shell: + +`exit` diff --git a/tldr/yadm-git-crypt b/tldr/yadm-git-crypt new file mode 100755 index 00000000..a2de14b3 --- /dev/null +++ b/tldr/yadm-git-crypt @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm git-crypt + +> Git Crypt enables transparent encryption and decryption of files in a git repository. +> See also: `git-crypt`. +> More information: . + +- Initialize repo to use Git Crypt: + +`yadm git-crypt init` + +- Share the repository using GPG: + +`yadm git-crypt add-gpg-user {{user_id}}` + +- After cloning a repository with encrypted files, unlock them: + +`yadm git-crypt unlock` + +- Export a symmetric secret key: + +`yadm git-crypt export-key {{path/to/key_file}}` diff --git a/tldr/yadm-gitconfig b/tldr/yadm-gitconfig new file mode 100755 index 00000000..ee751dc1 --- /dev/null +++ b/tldr/yadm-gitconfig @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-gitconfig + +> Pass options to `git config`. Change the `.gitconfig` of the repository managed by `yadm`. +> See also: `git config`. +> More information: . + +- Update or set a Git configuration value: + +`yadm gitconfig {{key.inner-key}} {{value}}` + +- Get a value from `yadm`'s Git configuration: + +`yadm gitconfig --get {{key}}` + +- Unset a value in `yadm`'s Git configuration: + +`yadm gitconfig --unset {{key}}` + +- List all values in `yadm`'s Git configuration: + +`yadm gitconfig --list` diff --git a/tldr/yadm-init b/tldr/yadm-init new file mode 100755 index 00000000..682fea15 --- /dev/null +++ b/tldr/yadm-init @@ -0,0 +1,22 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-init + +> Initialize a new, empty repository for tracking dotfiles. +> The repository is stored in `$HOME/.local/share/yadm/repo.git`. +> More information: . + +- Execute: + +`yadm init` + +- Override the worktree: + +`yadm init -w {{path/to/worktree_folder}}` + +- Overwrite an existing repository: + +`yadm init -f {{path/to/local_repository}}` diff --git a/tldr/yadm-introsepct b/tldr/yadm-introsepct new file mode 100755 index 00000000..bc00af21 --- /dev/null +++ b/tldr/yadm-introsepct @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-introspect + +> Look at data that is managed by `yadm`. +> The purpose of introspection is to support command line completion. +> More information: . + +- Output commands: + +`yadm introspect commands` + +- Output configs: + +`yadm introspect configs` + +- Output switches for the main `yadm` command: + +`yadm introspect switches` + +- Output repo: + +`yadm introspect repo` diff --git a/tldr/yadm-list b/tldr/yadm-list new file mode 100755 index 00000000..03c2c2c0 --- /dev/null +++ b/tldr/yadm-list @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-list + +> Print a list of files managed by `yadm`. +> More information: . + +- Print a list of files managed by `yadm` in the current directory: + +`yadm list` + +- List all files managed by `yadm` completely: + +`yadm list -a` diff --git a/tldr/yadm-perms b/tldr/yadm-perms new file mode 100755 index 00000000..af1f81e8 --- /dev/null +++ b/tldr/yadm-perms @@ -0,0 +1,14 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-perms + +> Update permissions. +> It is usually unnecessary to run this command, as `yadm` automatically processes permissions by default. This automatic behavior can be disabled by setting the configuration `yadm.auto-perms` to `"false"`. +> More information: . + +- Change file permissions: + +`yadm perms` diff --git a/tldr/yadm-transcrypt b/tldr/yadm-transcrypt new file mode 100755 index 00000000..56600ae1 --- /dev/null +++ b/tldr/yadm-transcrypt @@ -0,0 +1,31 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-transcrypt + +> If `transcrypt` is installed, this command allows you to pass options directly to `transcrypt`. +> With the environment configured to use the yadm repository. +> Transcrypt enables transparent encryption and decryption of files in a Git repository. +> More information: . + +- Set the symmetric cipher to utilize for encryption: + +`yadm transcrypt --cipher={{cipher}}` + +- Pass the password to derive the key from: + +`yadm transcrypt --password={{password}}` + +- Assume yes and accept defaults for non-specified options: + +`yadm transcrypt --yes` + +- Display the current repository's cipher and password: + +`yadm transcrypt --display` + +- Re -encrypt all encrypted files using new credentials: + +`yadm transcrypt --rekey` diff --git a/tldr/yadm-upgrade b/tldr/yadm-upgrade new file mode 100755 index 00000000..60a446f1 --- /dev/null +++ b/tldr/yadm-upgrade @@ -0,0 +1,18 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yadm-upgrade + +> Upgrade `yadm` to the latest version. +> Upgrading will attempt to de-initialize and re-initialize your submodules. +> More information: . + +- Upgrade `yadm` to the latest version: + +`yadm upgrade` + +- Force the upgrade regardless of changes: + +`yadm upgrade -f`