From 3081b6f11e58b08ec1d8602a43d9a247752ef9d7 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Sun, 22 Sep 2024 00:18:26 +0000 Subject: [PATCH] Update cheatsheets --- tldr/ffmpeg | 2 +- tldr/linux/bcachefs | 3 ++- tldr/linux/bcachefs-device | 21 +++++++++++++++++++++ tldr/linux/ceph | 2 +- tldr/linux/firewall-cmd | 23 ++++++++++++++--------- tldr/linux/xfs_repair | 13 +++++++++++++ tldr/lsd | 18 +++++++++--------- tldr/pulumi-about | 25 +++++++++++++++++++++++++ tldr/pulumi-preview | 25 +++++++++++++++++++++++++ 9 files changed, 111 insertions(+), 21 deletions(-) create mode 100644 tldr/linux/bcachefs-device create mode 100644 tldr/linux/xfs_repair create mode 100644 tldr/pulumi-about create mode 100644 tldr/pulumi-preview diff --git a/tldr/ffmpeg b/tldr/ffmpeg index bdfcfbba..a1c4c3a7 100644 --- a/tldr/ffmpeg +++ b/tldr/ffmpeg @@ -26,7 +26,7 @@ source: https://github.com/tldr-pages/tldr.git - Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end): -`ffmpeg -ss {{mm:ss}} -to {{mm2:ss2}} -i {{path/to/input_video.mp4}} -codec copy {{path/to/output_video.mp4}}` +`ffmpeg -i {{path/to/input_video.mp4}} -ss {{mm:ss}} -to {{mm2:ss2}} -codec copy {{path/to/output_video.mp4}}` - Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23: diff --git a/tldr/linux/bcachefs b/tldr/linux/bcachefs index 4c0701d0..874a25a0 100644 --- a/tldr/linux/bcachefs +++ b/tldr/linux/bcachefs @@ -6,7 +6,8 @@ source: https://github.com/tldr-pages/tldr.git # bcachefs > Manage `bcachefs` filesystems/devices. -> More information: . +> Some subcommands such as `device` have their own usage documentation. +> More information: . - Format a partition with `bcachefs`: diff --git a/tldr/linux/bcachefs-device b/tldr/linux/bcachefs-device new file mode 100644 index 00000000..749eefbb --- /dev/null +++ b/tldr/linux/bcachefs-device @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# bcachefs device + +> Manage devices within a running `bcachefs` filesystem. +> More information: . + +- Format and add a new device to an existing filesystem.: + +`sudo bcachefs device add --label={{group}}.{{name}} {{path/to/mountpoint}} {{path/to/device}}` + +- Migrate data off a device to prepare for removal: + +`bcachefs device evacuate {{path/to/device}}` + +- Permanently remove a device from a filesystem: + +`bcachefs device remove {{path/to/device}}` diff --git a/tldr/linux/ceph b/tldr/linux/ceph index 6ac01a5d..4285fd1d 100644 --- a/tldr/linux/ceph +++ b/tldr/linux/ceph @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # ceph > A unified storage system. -> More information: . +> More information: . - Check cluster health status: diff --git a/tldr/linux/firewall-cmd b/tldr/linux/firewall-cmd index 24e3a8fe..33082d0c 100644 --- a/tldr/linux/firewall-cmd +++ b/tldr/linux/firewall-cmd @@ -6,15 +6,12 @@ source: https://github.com/tldr-pages/tldr.git # firewall-cmd > The firewalld command-line client. +> View and adapt the runtime or permanent firewall configuration state. > More information: . -- View the available firewall zones: +- View all available firewall zones and rules in their runtime configuration state: -`firewall-cmd --get-active-zones` - -- View the rules which are currently applied: - -`firewall-cmd --list-all` +`firewall-cmd --list-all-zones` - Permanently move the interface into the block zone, effectively blocking all communication: @@ -28,10 +25,18 @@ source: https://github.com/tldr-pages/tldr.git `firewall-cmd --permanent --zone={{public}} --remove-service={{http}}` -- Permanently open two arbitrary ports in the specified zone: +- 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-port={{25565/tcp}} --add-port={{19132/udp}}` +`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 force rule changes to take effect: +- Reload firewalld to lose any runtime changes and force the permanent configuration to take effect immediately: `firewall-cmd --reload` + +- Save the runtime configuration state to the permanent configuration: + +`firewall-cmd --runtime-to-permanent` + +- Enable panic mode in case of Emergency. All traffic is dropped, any active connection will be terminated: + +`firewall-cmd --panic-on` diff --git a/tldr/linux/xfs_repair b/tldr/linux/xfs_repair new file mode 100644 index 00000000..b5fc72d3 --- /dev/null +++ b/tldr/linux/xfs_repair @@ -0,0 +1,13 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# xfs_repair + +> Repair an XFS filesystem. +> More information: . + +- Repair a partition: + +`sudo xfs_repair {{path/to/partition}}` diff --git a/tldr/lsd b/tldr/lsd index 6d89f333..7538eff8 100644 --- a/tldr/lsd +++ b/tldr/lsd @@ -17,26 +17,26 @@ source: https://github.com/tldr-pages/tldr.git `lsd -a` -- List all files and directories with trailing `/` added to directory names: +- List files and directories with trailing `/` added to directory names: `lsd -F` -- List all files and directories in long format (permissions, ownership, size, and modification date): +- List all files and directories in long format (permissions, ownership, size in human-readable format, and modification date): -`lsd -la` +`lsd -lha` -- List all files and directories in long format with size displayed using human-readable units (KiB, MiB, GiB): - -`lsd -lh` - -- List all files and directories in long format, sorted by size (descending): +- List files and directories in long format, sorted by size (descending): `lsd -lS` -- List all files and directories in long format, sorted by modification date (oldest first): +- List files and directories in long format, sorted by modification date (oldest first): `lsd -ltr` - Only list directories: `lsd -d {{*/}}` + +- Recursively list all directories in a tree format: + +`lsd --tree -d` diff --git a/tldr/pulumi-about b/tldr/pulumi-about new file mode 100644 index 00000000..b554a29a --- /dev/null +++ b/tldr/pulumi-about @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pulumi about + +> Print information about the Pulumi environment. +> More information: . + +- Print information about the Pulumi environment: + +`pulumi about` + +- Print information about the Pulumi environment in JSON format: + +`pulumi about --json` + +- Print information about the Pulumi environment of a specific stack: + +`pulumi about --stack {{stack_name}}` + +- Display help: + +`pulumi about --help` diff --git a/tldr/pulumi-preview b/tldr/pulumi-preview new file mode 100644 index 00000000..69602d87 --- /dev/null +++ b/tldr/pulumi-preview @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# pulumi preview + +> Show a preview of updates to a stack's resources. +> More information: . + +- Show a preview of updates to a stack's resources: + +`pulumi preview` + +- Show a preview of updates to a stack's resources in JSON format: + +`pulumi preview --json` + +- Preview updates as a rich diff showing overall changes: + +`pulumi preview --diff` + +- Display help: + +`pulumi preview --help`