From 5244514dab74228bf561f9f99fad68e812578627 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Sun, 10 Aug 2025 00:23:53 +0000 Subject: [PATCH] Update cheatsheets --- tldr/elasticsearch-saml-metadata | 21 ++++++++++++++++ tldr/linux/bindfs | 21 ++++++++++++++++ tldr/linux/lsfd | 2 +- tldr/linux/mkfs.btrfs | 4 +++ tldr/linux/nethogs | 2 +- tldr/linux/parted | 2 +- tldr/linux/parted.interactive | 42 ++++++++++++++++++++++++++++++++ tldr/linux/pct-exec | 21 ++++++++++++++++ tldr/osx/diskutil | 6 ++--- 9 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 tldr/elasticsearch-saml-metadata create mode 100644 tldr/linux/bindfs create mode 100644 tldr/linux/parted.interactive create mode 100644 tldr/linux/pct-exec diff --git a/tldr/elasticsearch-saml-metadata b/tldr/elasticsearch-saml-metadata new file mode 100644 index 00000000..df0f7821 --- /dev/null +++ b/tldr/elasticsearch-saml-metadata @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# elasticsearch-saml-metadata + +> Generate SAML Service Provider metadata for configuring a SAML Identity Provider. +> More information: . + +- Generate SAML metadata for a specific realm and print it to `stdout`: + +`elasticsearch-saml-metadata --realm {{realm_name}}` + +- Generate SAML metadata and write it to a specific file: + +`elasticsearch-saml-metadata --realm {{realm_name}} --out {{path/to/file.xml}}` + +- Display help: + +`elasticsearch-saml-metadata {{[-h|--help]}}` diff --git a/tldr/linux/bindfs b/tldr/linux/bindfs new file mode 100644 index 00000000..997fd48e --- /dev/null +++ b/tldr/linux/bindfs @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# bindfs + +> Mount a directory elsewhere with different permissions. +> More information: . + +- Mount a directory with same permissions: + +`sudo bindfs {{path/to/directory}} {{path/to/mount_point}}` + +- Map filesystem objects owned by `user1` to be owned by `user2` (also applies in reverse to newly created files): + +`sudo bindfs --map={{user1}}/{{user2}} {{path/to/directory}} {{path/to/mount_point}}` + +- Unmount a directory: + +`sudo umount {{path/to/mount_point}}` diff --git a/tldr/linux/lsfd b/tldr/linux/lsfd index 4675344d..6d7b9941 100644 --- a/tldr/linux/lsfd +++ b/tldr/linux/lsfd @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - Check what program has a specific file open: -`lsfd {{[-Q|--filter]}} "NAME == '{{/path/to/file}}'"` +`lsfd {{[-Q|--filter]}} "NAME == '{{path/to/file}}'"` - List open IPv4 or IPv6 sockets: diff --git a/tldr/linux/mkfs.btrfs b/tldr/linux/mkfs.btrfs index 0e33dc28..4d8b5606 100644 --- a/tldr/linux/mkfs.btrfs +++ b/tldr/linux/mkfs.btrfs @@ -9,6 +9,10 @@ source: https://github.com/tldr-pages/tldr.git > Defaults to `raid1`, which specifies 2 copies of a data block spread across 2 different devices. > More information: . +- Create a Btrfs filesystem on an empty partition: + +`sudo mkfs.btrfs {{/dev/sdXY}}` + - Create a btrfs filesystem on a single device: `sudo mkfs.btrfs {{[-m|--metadata]}} single {{[-d|--data]}} single {{/dev/sdX}}` diff --git a/tldr/linux/nethogs b/tldr/linux/nethogs index 4c2094d7..9d3cefb9 100644 --- a/tldr/linux/nethogs +++ b/tldr/linux/nethogs @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - Monitor bandwidth on multiple devices: -`sudo nethogs {{device1}} {{device2}}` +`sudo nethogs {{device1 device2 ...}}` - Specify refresh rate: diff --git a/tldr/linux/parted b/tldr/linux/parted index 28ce54c6..656232a0 100644 --- a/tldr/linux/parted +++ b/tldr/linux/parted @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # parted > A partition manipulation program. -> See also: `parted-interactive`, `partprobe`. +> See also: `parted.interactive`, `partprobe`. > More information: . - List partitions on all block devices: diff --git a/tldr/linux/parted.interactive b/tldr/linux/parted.interactive new file mode 100644 index 00000000..ace61aaf --- /dev/null +++ b/tldr/linux/parted.interactive @@ -0,0 +1,42 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# parted + +> A partition manipulation program. +> See also: `parted`, `partprobe`. +> More information: . + +- Start interactive mode with the specified disk selected: + +`sudo parted {{/dev/sdX}}` + +- Show partition information in interactive mode: + +`print` + +- Select a disk in interactive mode: + +`select {{/dev/sdX}}` + +- Create a 16 GB partition with the specified filesystem in interactive mode (`GPT` partition table): + +`mkpart {{partition_name}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}` + +- Create a 16 GB partition with the specified filesystem in interactive mode (`MBR` partition table): + +`mkpart {{primary|logical|extended}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}` + +- Resize a partition in interactive mode: + +`resizepart {{/dev/sdXN}} {{end_position_of_partition}}` + +- Remove a partition in interactive mode: + +`rm {{/dev/sdXN}}` + +- Display help: + +`?` diff --git a/tldr/linux/pct-exec b/tldr/linux/pct-exec new file mode 100644 index 00000000..ef101759 --- /dev/null +++ b/tldr/linux/pct-exec @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# pct exec + +> Launch a command inside a specified container. +> More information: . + +- Launch a command in a container: + +`pct {{[ex|exec]}} {{100}} {{command}}` + +- Open a bash shell in a container: + +`pct {{[ex|exec]}} {{100}} bash` + +- Pass arguments to the command: + +`pct {{[ex|exec]}} {{100}} -- {{command}} {{arguments}}` diff --git a/tldr/osx/diskutil b/tldr/osx/diskutil index eff0d04a..d5564680 100644 --- a/tldr/osx/diskutil +++ b/tldr/osx/diskutil @@ -15,12 +15,12 @@ source: https://github.com/tldr-pages/tldr.git - Repair the filesystem data structures of a volume: -`diskutil repairVolume {{/dev/disk_device}}` +`diskutil repairVolume {{/dev/disk}}` - Unmount a volume: -`diskutil unmountDisk {{/dev/disk_device}}` +`diskutil unmountDisk {{/dev/disk}}` - Eject a CD/DVD (unmount first): -`diskutil eject {{/dev/disk_device1}}` +`diskutil eject {{/dev/diskX}}`