Update cheatsheets

This commit is contained in:
ivuorinen
2024-10-08 00:16:55 +00:00
parent 34878bb630
commit 31e38d1972
26 changed files with 539 additions and 6 deletions

4
tldr/^
View File

@@ -20,3 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
- Replace `string1` with `string2` in the previous command and add `string3` to its end:
`^{{string1}}^{{string2}}^{{string3}}`
- Replace all occurrences of `string1`:
`^{{string1}}^{{string2}}^:&`

25
tldr/adb-reboot Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# adb reboot
> Reboot a connected Android device or emulator.
> More information: <https://manned.org/adb>.
- Reboot the device normally:
`adb reboot`
- Reboot the device into bootloader mode:
`adb reboot bootloader`
- Reboot the device into recovery mode:
`adb reboot recovery`
- Reboot the device into fastboot mode:
`adb reboot fastboot`

17
tldr/compopt Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# compopt
> Print or change the completion options for a command.
> More information: <https://manned.org/compopt>.
- Print the options for the currently executing completion:
`compopt`
- Print the completion options for given command:
`compopt {{command}}`

26
tldr/disown Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# disown
> Allow sub-processes to live beyond the shell that they are attached to.
> See also the `jobs` command.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-disown>.
- Disown the current job:
`disown`
- Disown a specific job:
`disown %{{job_number}}`
- Disown all jobs:
`disown -a`
- Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit:
`disown -h %{{job_number}}`

14
tldr/fc
View File

@@ -5,10 +5,10 @@ source: https://github.com/tldr-pages/tldr.git
---
# fc
> Open the most recent command and edit it.
> Open the most recent command for editing and then run it.
> More information: <https://manned.org/fc>.
- Open in the default system editor:
- Open the last command in the default system editor and run it after editing:
`fc`
@@ -24,6 +24,14 @@ source: https://github.com/tldr-pages/tldr.git
`fc -l -r`
- List commands in a given interval:
- Edit and run a command from history:
`fc {{number}}`
- Edit commands in a given interval and run them:
`fc '{{416}}' '{{420}}'`
- Display help:
`fc --help`

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Show a given author's commits from the last 10 days and whether they are GPG signed:
`git standup -a {[name|email}} -d {{10}} -g`
`git standup -a {{name|email}} -d {{10}} -g`
- Show all the commits from all contributors for the last 10 days:

33
tldr/help Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# help
> Display information about Bash builtin commands.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-help>.
- Display the full list of builtin commands:
`help`
- Print instructions on how to use the `while` loop construct:
`help while`
- Print instructions on how to use the `for` loop construct:
`help for`
- Print instructions on how to use `[[ ]]` for conditional commands:
`help [[ ]]`
- Print instruction on how to use `(( ))` to evaluate arithmetic expressions:
`help \( \)`
- Print instructions on how to use the `cd` command:
`help cd`

37
tldr/linux/pve-firewall Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pve-firewall
> Manage Proxmox VE Firewall.
> More information: <https://pve.proxmox.com/wiki/Firewall>.
- Compile and print all firewall rules:
`pve-firewall compile`
- Show information about the local network:
`pve-firewall localnet`
- Restart the Proxmox VE Firewall service:
`pve-firewall restart`
- Start the Proxmox VE Firewall service:
`pve-firewall start`
- Stop the Proxmox VE Firewall service:
`pve-firewall stop`
- Simulate all firewall rules:
`pve-firewall simulate`
- Show the status of Proxmox VE Firewall:
`pve-firewall status`

37
tldr/linux/pvecm Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pvecm
> Proxmox VE Cluster Manager.
> More information: <https://pve.proxmox.com/pve-docs/pvecm.1.html>.
- Add the current node to an existing cluster:
`pvecm add {{hostname_or_ip}}`
- Add a node to the cluster configuration (internal use):
`pvecm addnode {{node}}`
- Display the version of the cluster join API available on this node:
`pvecm apiver`
- Generate new cluster configuration:
`pvecm create {{clustername}}`
- Remove a node from the cluster configuration:
`pvecm delnode {{node}}`
- Display the local view of the cluster nodes:
`pvecm nodes`
- Display the local view of the cluster status:
`pvecm status`

13
tldr/linux/pveperf Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pveperf
> A benchmarking tool in Proxmox Server. Gather CPU and hard disk performance data for the hard disk.
> More information: <https://pve.proxmox.com/pve-docs/pveperf.1.html>.
- Show CPU and hard disk performance data for the hard disk mounted at `/`:
`pveperf`

13
tldr/linux/qm-nbdstop Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm nbdstop
> Stop embedded nbd server.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
- Stop embedded nbd server:
`qm nbdstop {{VM_ID}}`

25
tldr/linux/qm-stop Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm stop
> Stop a virtual machine.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
- Stop a virtual machine immediately:
`qm stop {{VM_ID}}`
- Stop a virtual machine and wait for at most 10 seconds:
`qm stop --timeout {{10}} {{VM_ID}}`
- Stop a virtual machine and skip lock (only root can use this option):
`qm stop --skiplock {{true}} {{VM_ID}}`
- Stop a virtual machine and don't deactivate storage volumes:
`qm stop --keepActive {{true}} {{VM_ID}}`

21
tldr/linux/sestatus Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# sestatus
> Print the current SELinux status.
> More information: <https://manned.org/sestatus>.
- Print the current status:
`sestatus`
- Print the current states of all policy booleans:
`sestatus -b`
- Print the current file and process contexts:
`sestatus -v`

26
tldr/linux/speaker-test Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# speaker-test
> Speaker test tone generator for ALSA.
> See also: `aplay`, `arecord`, `amixer`.
> More information: <https://manned.org/speaker-test>.
- Test the default speakers with pink noise:
`speaker-test`
- Test the default speakers with a sine wave:
`speaker-test {{-t|--test}} sine {{-f|--frequency}} {{frequency}}`
- Test the default speakers with a predefined WAV file:
`speaker-test {{-t|--test}} wav`
- Test the default speakers with a WAV file:
`speaker-test {{-t|--test}} wav {{-w|--wavfile}} {{path/to/file}}`

33
tldr/linux/vzdump Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# vzdump
> Backup Utility for virtual machines and containers.
> More information: <https://pve.proxmox.com/pve-docs/vzdump.1.html>.
- Dump a guest virtual machine into the default dump directory (usually `/var/lib/vz/dump/`), excluding snapshots:
`vzdump {{vm_id}}`
- Back up the guest virtual machines with the IDs 101, 102, and 103:
`vzdump {{101 102 103}}`
- Dump a guest virtual machine using a specific mode:
`vzdump {{vm_id}} --mode {{suspend|snapshot}}`
- Back up all guest systems and send an notification email to the root and admin users:
`vzdump --all --mode {{suspend}} --mailto {{root}} --mailto {{admin}}`
- Use snapshot mode (no downtime required) and a non-default dump directory:
`vzdump {{vm_id}} --dumpdir {{path/to/directory}} --mode {{snapshot}}`
- Back up all guest virtual machines excluding the IDs 101 and 102:
`vzdump --mode {{suspend}} --exclude {{101, 102}}`

12
tldr/npm-restart Normal file
View File

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

33
tldr/npm-run Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm run
> Run a script.
> More information: <https://www.npmjs.com>.
- Run a script:
`npm run {{script_name}}`
- Pass arguments to a script:
`npm run {{script_name}} -- {{argument}} {{--option}}`
- Run a script named `start`:
`npm start`
- Run a script named `stop`:
`npm stop`
- Run a script named `restart`:
`npm restart`
- Run a script named `test`:
`npm test`

12
tldr/npm-start Normal file
View File

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

12
tldr/npm-stop Normal file
View File

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

12
tldr/npm-test Normal file
View File

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

33
tldr/ntfy Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ntfy
> Send and receive HTTP POST notifications.
> More information: <https://github.com/binwiederhier/ntfy>.
- Send a message to the `security` topic:
`ntfy pub security "{{Front door has been opened.}}"`
- Send with a title, priority and tags:
`ntfy publish --title="{{Someone bought your item}}" --priority={{high}} --tags={{duck}} {{ebay}} "{{Someone just bought your item: Platypus Sculpture}}"`
- Send at 8:30am:
`ntfy pub --at=8:30am {{delayed_topic}} "{{Time for school, sleepyhead...}}"`
- Trigger a webhook:
`ntfy trigger {{my_webhook}}`
- Subscribe to a topic (Ctrl-C to stop listening):
`ntfy sub {{home_automation}}`
- Display help:
`ntfy --help`

View File

@@ -24,6 +24,6 @@ source: https://github.com/tldr-pages/tldr.git
`redshift -g {{red}}:{{green}}:{{blue}}`
- Turn on Redshift with a constant unchanging color temperature:
- [P]urge existing temperature changes and set a constant unchanging color temperature in [O]ne-shot mode:
`redshift -O {{temperature}}`
`redshift -PO {{temperature}}`

21
tldr/unset Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# unset
> Remove shell variables or functions.
> More information: <https://manned.org/unset>.
- Remove the variable `foo`, or if the variable doesn't exist, remove the function `foo`:
`unset {{foo}}`
- Remove the variables foo and bar:
`unset -v {{foo}} {{bar}}`
- Remove the function my_func:
`unset -f {{my_func}}`

43
tldr/wget2 Normal file
View File

@@ -0,0 +1,43 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# wget2
> An improved version of `wget` for downloading files from the web.
> Supports HTTP, HTTPS, and HTTP/2 protocols with enhanced performance.
> By default, `wget2` uses multiple threads for faster downloads.
> More information: <https://gitlab.com/gnuwget/wget2>.
- Download the contents of a URL to a file using multiple threads (default behavior differs from `wget`):
`wget2 {{https://example.com/foo}}`
- Limit the number of threads used for downloading (default is 5 threads):
`wget2 --max-threads={{10}} {{https://example.com/foo}}`
- Download a single web page and all its resources (scripts, stylesheets, images, etc.):
`wget2 --page-requisites --convert-links {{https://example.com/somepage.html}}`
- Mirror a website, but do not ascend to the parent directory (does not download embedded page elements):
`wget2 --mirror --no-parent {{https://example.com/somepath/}}`
- Limit the download speed and the number of connection retries:
`wget2 --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}`
- Continue an incomplete download (behavior is consistent with `wget`):
`wget2 --continue {{https://example.com}}`
- Download all URLs stored in a text file to a specific directory:
`wget2 --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}`
- Download a file from an HTTP server using Basic Auth (also works for HTTPS):
`wget2 --user={{username}} --password={{password}} {{https://example.com}}`

25
tldr/windows/sdelete Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, windows]
source: https://github.com/tldr-pages/tldr.git
---
# sdelete
> Securely delete file/directory from disk, or clean the free space on a volume/physical disk.
> More information: <https://learn.microsoft.com/en-us/sysinternals/downloads/sdelete>.
- Delete files with 3 [p]asses:
`sdelete -p 3 {{path o ile1 path o ile2 ...}}`
- Delete folders and its [s]ubdirectories with 1 pass (default):
`sdelete -s {{path o\directory1 path o\directory2 ...}}`
- Clean the free space of volume D: with 3 [p]asses:
`sdelete -p 3 D:`
- Clean the free space with [z]eros of physical disk 2, which should not contain any volumes to be cleaned:
`sdelete -z 2`

12
tldr/windows/sdelete64 Normal file
View File

@@ -0,0 +1,12 @@
---
syntax: markdown
tags: [tldr, windows]
source: https://github.com/tldr-pages/tldr.git
---
# sdelete64
> This command is the 64 bit version of `sdelete`.
- View documentation for the original command:
`tldr sdelete`