Update cheatsheets

This commit is contained in:
ivuorinen
2025-08-07 00:22:23 +00:00
parent c22ca08b6b
commit 9c36a48bd3
35 changed files with 316 additions and 38 deletions

View File

@@ -6,9 +6,9 @@ source: https://github.com/tldr-pages/tldr.git
# devenv
> Fast, Declarative, Reproducible and Composable Developer Environments using Nix.
> More information: <https://devenv.sh>.
> More information: <https://devenv.sh/getting-started/#commands>.
- Initialise the environment:
- Initialize the environment:
`devenv init`
@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Start processes with `devenv`:
`devenv up --config /{{file}}/{{path}}/`
`devenv up --config {{path/to/file}}`
- Clean the environment variables and re-enter the shell in offline mode:

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Create and manage sequences of dependent code changes (stacks) for Git and GitHub.
> More information: <https://graphite.dev/docs/get-started>.
- Initialise `gt` for the repository in the current directory:
- Initialize `gt` for the repository in the current directory:
`gt init`

View File

@@ -9,6 +9,10 @@ source: https://github.com/tldr-pages/tldr.git
> Note: A local repository needs to be defined in `/etc/pacman.conf` and `vifm` needs to be installed for this to fully function.
> More information: <https://github.com/aurutils/aurutils>.
- Initialize the repository that matches the path in `/etc/pacman.conf`:
`repo-add {{path/to/database.db.tar.gz}}`
- Search the AUR database for a package:
`aur search {{keyword}}`

17
tldr/linux/efivar Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# efivar
> Manage UEFI variables.
> More information: <https://manned.org/efivar>.
- List all UEFI variables:
`efivar {{[-l|--list]}}`
- Print the contents of a variable:
`efivar {{[-n|--name]}} {{146b234d-4052-4e07-b326-11220f8e1fe8-lBoot0000}} {{[-p|--print]}}`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Find filesystems in specific type:
`findmnt {{[-t|--types]}} {{ext4}}`
`findmnt {{[-t|--types]}} {{ext4,virtiofs,btrfs,...}}`
- Find filesystems with specific label:

View File

@@ -10,12 +10,24 @@ source: https://github.com/tldr-pages/tldr.git
- Install GRUB on a BIOS system:
`grub-install --target {{i386-pc}} {{path/to/device}}`
`sudo grub-install {{path/to/device}}`
- Install GRUB on a BIOS system while specifying architecture:
`sudo grub-install --target {{i386-pc}} {{path/to/device}}`
- Install GRUB on an UEFI system:
`grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --bootloader-id {{GRUB}}`
`sudo grub-install --efi-directory {{path/to/efi_directory}}`
- Install GRUB on an UEFI system while specifying architecture and boot menu text:
`sudo grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --bootloader-id {{GRUB}}`
- Install GRUB pre-loading specific modules:
`grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --modules "{{part_gpt part_msdos}}"`
`sudo grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --modules "{{part_gpt part_msdos}}"`
- Display help:
`grub-install {{[-?|--help]}}`

View File

@@ -8,9 +8,9 @@ source: https://github.com/tldr-pages/tldr.git
> Create device maps from partition tables.
> More information: <https://manned.org/kpartx>.
- Add partition mappings:
- Add partition mappings and print created mappings:
`kpartx -a {{whole_disk.img}}`
`kpartx -av {{whole_disk.img}}`
- Delete partition mappings:

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print all current sessions:
`loginctl list-sessions`
`loginctl`
- Print all properties of a specific session:

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Add the default Arch Linux keys:
`sudo pacman-key --populate {{archlinux}}`
`sudo pacman-key --populate`
- List keys from the public keyring:

View File

@@ -20,9 +20,9 @@ source: https://github.com/tldr-pages/tldr.git
`pct {{[en|enter]}} {{100}}`
- Create a container from template:
- Create a container from template with 4GB size:
`pct {{[cr|create]}} {{100}} {{/var/lib/vz/template/cache/distro-name.tar.zst}} -hostname {{hostname}} -password {{password}} --rootfs {{local-lvm}} --on-boot`
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:4`
- Resize the container's disk to 20G:

13
tldr/linux/pct-clone Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pct clone
> Clone a container.
> More information: <https://pve.proxmox.com/pve-docs/pct.1.html>.
- Clone a container with a custom name:
`pct clone {{template_id}} {{copy_id}} --hostname {{host_name}}`

29
tldr/linux/pct-create Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pct create
> Create LXC containers in Proxmox.
> More information: <https://pve.proxmox.com/pve-docs/pct.1.html>.
- Create a container from a template with 4GB size, give it 512MiB of memory and unlimited access to CPU:
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:4`
- Create a container from a template and give it a specific memory limit in megabytes:
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:{{4}} --memory {{8192}}`
- Create a container from a template and give it a hostname and a password:
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:{{4}} --hostname {{hostname}} --password {{password}}`
- Create a container from a template and give it network access:
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:{{4}} --net0 name={{eth0}},bridge={{vmbr0}},ip={{dhcp|manual|10.0.0.1/24}} --features nesting=1`
- Start a container immediately after creation:
`pct {{[cr|create]}} {{100}} {{local:vztmpl/distro-name.tar.zst}} --rootfs {{local-lvm}}:{{4}} --start`

17
tldr/linux/pct-resize Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pct resize
> Resize container storage.
> More information: <https://pve.proxmox.com/pve-docs/pct.1.html>.
- Resize the container size to 20GB:
`pct {{[resi|resize]}} {{100}} rootfs 20G`
- Add 10GB to the container storage:
`pct {{[resi|resize]}} {{100}} rootfs +10G`

17
tldr/linux/pct-status Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pct status
> Display the status of a container.
> More information: <https://pve.proxmox.com/pve-docs/pct.1.html>.
- Display if the container is running:
`pct status {{100}}`
- Display detailed container information:
`pct status {{100}} --verbose`

17
tldr/linux/pvesh Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pvesh
> Interface with the Proxmox VE API.
> More information: <https://pve.proxmox.com/pve-docs/pvesh.1.html>.
- List available nodes:
`pvesh get /nodes`
- Discover API paths:
`pvesh ls {{/}}`

25
tldr/linux/pvesm Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pvesm
> Manage Proxmox storage.
> More information: <https://pve.proxmox.com/pve-docs/pvesm.1.html>.
- Get status for all datastores:
`pvesm status`
- List storage contents:
`pvesm list {{storage_name}}`
- Add a directory storage:
`pvesm add dir {{storage_name}} --path {{path/to/directory}}`
- Remove a storage:
`pvesm remove {{storage_name}}`

21
tldr/linux/pveum Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pveum
> Manage proxmox users.
> More information: <https://pve.proxmox.com/pve-docs/pveum.1.html>.
- List users:
`pveum user list`
- Add a user:
`pveum user add {{username}}@pve`
- Delete a user:
`pveum user delete {{username}}@pve`

12
tldr/linux/qm-agent Normal file
View File

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

View File

@@ -10,4 +10,4 @@ source: https://github.com/tldr-pages/tldr.git
- Generate a cloudinit file for a specific configuration type:
`qm {{[clou|cloudinit]}} dump {{virtual_machine_id}} {{meta|network|user}}`
`qm {{[clou|cloudinit]}} {{[d|dump]}} {{virtual_machine_id}} {{meta|network|user}}`

View File

@@ -11,4 +11,4 @@ source: https://github.com/tldr-pages/tldr.git
- Import a VMDK/qcow2/raw disk image using a specific storage name:
`qm {{[di|disk]}} import {{vm_id}} {{path/to/disk}} {{storage_name}} --format {{qcow2|raw|vmdk}}`
`qm {{[di|disk]}} {{[i|import]}} {{vm_id}} {{path/to/disk}} {{storage_name}} --format {{qcow2|raw|vmdk}}`

View File

@@ -10,8 +10,8 @@ source: https://github.com/tldr-pages/tldr.git
- Move a virtual disk:
`qm {{[di|disk]}} move {{vm_id}} {{destination}} {{index}}`
`qm {{[di|disk]}} {{[m|move]}} {{vm_id}} {{destination}} {{index}}`
- Delete the previous copy of the virtual disk:
`qm {{[di|disk]}} move -delete {{vm_id}} {{destination}} {{index}}`
`qm {{[di|disk]}} {{[m|move]}} --delete {{vm_id}} {{destination}} {{index}}`

17
tldr/linux/qm-disk-rescan Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm disk rescan
> Rescan all storages and update disk sizes and unused disk images of a virtual machine.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
- Rescan all storages and update disk sizes and unused disk images of a specific virtual machine:
`qm disk rescan {{vm_id}}`
- Perform a dry-run of rescan on a specific virtual machine and do not write any changes to configurations:
`qm disk rescan --dryrun {{true}} {{vm_id}}`

View File

@@ -10,4 +10,4 @@ source: https://github.com/tldr-pages/tldr.git
- Add `n` gigabytes to a virtual disk:
`qm {{[di|disk]}} resize {{vm_id}} {{disk_name}} +{{n}}G`
`qm {{[di|disk]}} {{[resi|resize]}} {{vm_id}} {{disk_name}} +{{n}}G`

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

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm guest
> Manage a VM guest agent.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
- Print the status of a specific PID:
`qm {{[g|guest]}} {{[exec-s|exec-status]}} {{vm_id}} {{pid}}`
- Set a password for a specific user in a virtual machine interactively:
`qm {{[g|guest]}} {{[p|passwd]}} {{vm_id}} {{username}}`
- Execute a specific QEMU Guest Agent command:
`qm {{[g|guest]}} {{[c|cmd]}} {{virtual_machine_id}} {{fsfreeze-freeze|fsfreeze-status|fsfreeze-thaw|fstrim|get-fsinfo|...}}`
- Execute a specific command via a guest agent:
`qm {{[g|guest]}} exec {{vm_id}} {{command}} {{argument1 argument2 ...}}`

View File

@@ -10,4 +10,4 @@ source: https://github.com/tldr-pages/tldr.git
- Execute a specific QEMU Guest Agent command:
`qm {{[g|guest]}} cmd {{virtual_machine_id}} {{fsfreeze-freeze|fsfreeze-status|fsfreeze-thaw|fstrim|get-fsinfo|...}}`
`qm {{[g|guest]}} {{[c|cmd]}} {{virtual_machine_id}} {{fsfreeze-freeze|fsfreeze-status|fsfreeze-thaw|fstrim|get-fsinfo|...}}`

View File

@@ -10,4 +10,4 @@ source: https://github.com/tldr-pages/tldr.git
- Print the status of a specific PID:
`qm {{[g|guest]}} exec-status {{vm_id}} {{pid}}`
`qm {{[g|guest]}} {{[exec-s|exec-status]}} {{vm_id}} {{pid}}`

View File

@@ -10,8 +10,8 @@ source: https://github.com/tldr-pages/tldr.git
- Set a password for a specific user in a virtual machine interactively:
`qm {{[g|guest]}} passwd {{vm_id}} {{username}}`
`qm {{[g|guest]}} {{[p|passwd]}} {{vm_id}} {{username}}`
- Set an already hashed password for a specific user in a virtual machine interactively:
`qm {{[g|guest]}} passwd {{vm_id}} {{username}} --crypted 1`
`qm {{[g|guest]}} {{[p|passwd]}} {{vm_id}} {{username}} --crypted 1`

12
tldr/linux/qm-importdisk Normal file
View File

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

View File

@@ -3,7 +3,7 @@ syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm move disk
# qm move-disk
> This command is an alias of `qm disk move`.

View File

@@ -5,13 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# qm rescan
> Rescan all storages and update disk sizes and unused disk images of a virtual machine.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
> This command is an alias of `qm disk rescan`.
- Rescan all storages and update disk sizes and unused disk images of a specific virtual machine:
- View documentation for the original command:
`qm rescan {{vm_id}}`
- Perform a dry-run of rescan on a specific virtual machine and do not write any changes to configurations:
`qm rescan --dryrun {{true}} {{vm_id}}`
`tldr qm disk rescan`

33
tldr/linux/qm-set Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# qm set
> Set virtual machine options.
> More information: <https://pve.proxmox.com/pve-docs/qm.1.html>.
- Set a name for a VM in the GUI:
`qm set {{100}} --name {{vm_name}}`
- Set a VM to autostart on boot:
`qm set {{100}} --autostart {{0|1}}`
- Set the allotted core count of a VM:
`qm set {{100}} --cores {{4}}`
- Set the allotted amount of memory:
`qm set {{100}} --memory {{8192}}`
- Give a VM a network device and bridge it to the host network:
`qm set {{100}} --net{{0}} {{virtio|e1000|rtl8139|vmxnet3}},bridge=vmbr{{0}}`
- Delete a device:
`qm set {{100}} --delete {{device_name0}}`

12
tldr/linux/qm-unlink Normal file
View File

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

View File

@@ -19,12 +19,12 @@ source: https://github.com/tldr-pages/tldr.git
- Prepare a new ostree deployment with upgraded packages and reboot into it:
`rpm-ostree upgrade --reboot`
`rpm-ostree upgrade {{[-r|--reboot]}}`
- Reboot into the previous ostree deployment:
`rpm-ostree rollback --reboot`
`rpm-ostree rollback {{[-r|--reboot]}}`
- Install a package into a new ostree deployment and reboot into it:
`rpm-ostree install {{package}} --reboot`
`rpm-ostree install {{package}} {{[-r|--reboot]}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# airport
> Wireless network configuration utility.
> More information: <https://keith.github.io/xcode-man-pages/airport.1.html>.
> More information: <https://ss64.com/mac/airport.html>.
- Show current wireless status information:

View File

@@ -24,9 +24,9 @@ source: https://github.com/tldr-pages/tldr.git
`qemu-img map {{path/to/image_file.img}}`
- Convert a VMware `.vmdk` disk image to a KVM `.qcow2` disk image:
- Convert a VMware `.vmdk` disk image to a KVM `.qcow2` disk image and display [p]rogress:
`qemu-img convert -f vmdk -O qcow2 {{path/to/image_file.vmdk}} {{path/to/image_file.qcow2}}`
`qemu-img convert -f vmdk -O qcow2 -p {{path/to/image_file.vmdk}} {{path/to/image_file.qcow2}}`
- [c]reate an internal snapshot of a KVM `.qcow2` disk image: