From 60190f32c7d78736088fcf7b3c25bbb8d6a02510 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Tue, 20 Jan 2026 00:21:53 +0000 Subject: [PATCH] Update cheatsheets --- tldr/alembic | 29 ++++++++++++++++++++++++++++ tldr/linux/cfdisk | 1 + tldr/linux/cu | 1 + tldr/linux/gio | 8 ++++++++ tldr/linux/gio-trash | 4 ++++ tldr/linux/iscsiadm | 37 ++++++++++++++++++++++++++++++++++++ tldr/linux/minicom | 1 + tldr/linux/mkfs.ext4 | 4 ++++ tldr/linux/parted | 2 +- tldr/linux/slurmrestd | 3 ++- tldr/picocom | 1 + tldr/shfmt | 18 +++++++++++++----- tldr/windows/mimikatz-crypto | 3 ++- 13 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 tldr/alembic create mode 100644 tldr/linux/iscsiadm diff --git a/tldr/alembic b/tldr/alembic new file mode 100644 index 00000000..7844e34f --- /dev/null +++ b/tldr/alembic @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# alembic + +> Database migration tool for SQLAlchemy. +> More information: . + +- Initialize Alembic in a project: + +`alembic init {{path/to/directory}}` + +- Create a new migration script with autogeneration: + +`alembic revision --autogenerate -m "{{message}}"` + +- Upgrade the database to the latest revision: + +`alembic upgrade head` + +- Downgrade the database by one revision: + +`alembic downgrade -1` + +- Show the migration history: + +`alembic history` diff --git a/tldr/linux/cfdisk b/tldr/linux/cfdisk index 582ae599..bd7512d8 100644 --- a/tldr/linux/cfdisk +++ b/tldr/linux/cfdisk @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # cfdisk > Manage partition tables and partitions on a hard disk using a curses UI. +> See also: `parted`. > More information: . - Start the partition manipulator with a specific device: diff --git a/tldr/linux/cu b/tldr/linux/cu index 09043b86..afa74614 100644 --- a/tldr/linux/cu +++ b/tldr/linux/cu @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # cu > Call Up another system and act as a dial-in/serial terminal or perform file transfers with no error checking. +> See also: `picocom`, `minicom`, `tio`. > More information: . - Open a given serial port: diff --git a/tldr/linux/gio b/tldr/linux/gio index 5271d800..8085eabd 100644 --- a/tldr/linux/gio +++ b/tldr/linux/gio @@ -29,6 +29,14 @@ source: https://github.com/tldr-pages/tldr.git `gio trash {{path/to/file}}` +- Empty the trash: + +`gio trash --empty` + - Launch an application from a `.desktop` file: `gio launch {{path/to/file}}.desktop` + +- Mark a `.desktop` file as trusted, allowing it to be executed: + +`gio set {{path/to/file}}.desktop metadata::trusted true` diff --git a/tldr/linux/gio-trash b/tldr/linux/gio-trash index 98de3278..5b753942 100644 --- a/tldr/linux/gio-trash +++ b/tldr/linux/gio-trash @@ -17,6 +17,10 @@ source: https://github.com/tldr-pages/tldr.git `gio trash --list` +- Empty the trash: + +`gio trash --empty` + - Restore a specific item from trash using its ID: `gio trash trash://{{id}}` diff --git a/tldr/linux/iscsiadm b/tldr/linux/iscsiadm new file mode 100644 index 00000000..b33aee25 --- /dev/null +++ b/tldr/linux/iscsiadm @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# iscsiadm + +> Manage iSCSI sessions, nodes, and discovery. +> More information: . + +- Show active iSCSI sessions: + +`sudo iscsiadm {{[-m|--mode]}} session` + +- List all known iSCSI nodes: + +`sudo iscsiadm {{[-m|--mode]}} node` + +- Discover available iSCSI targets on a portal (no authentication): + +`sudo iscsiadm {{[-m|--mode]}} discovery {{[-t|--type]}} sendtargets {{[-p|--portal]}} {{ip_address}}` + +- Log in to a specific iSCSI target without authentication: + +`sudo iscsiadm {{[-m|--mode]}} node {{[-T|--targetname]}} {{iqn}} {{[-p|--portal]}} {{ip_address}}:3260 {{[-l|--login]}}` + +- Log out from a specific iSCSI target: + +`sudo iscsiadm {{[-m|--mode]}} node {{[-T|--targetname]}} {{iqn}} {{[-p|--portal]}} {{ip_address}}:3260 {{[-u|--logout]}}` + +- Create an iSCSI node when discovery is blocked (for CHAP authentication): + +`sudo iscsiadm {{[-m|--mode]}} node {{[-o|--op]}} new {{[-T|--targetname]}} {{iqn}} {{[-p|--portal]}} {{ip_address}}:3260` + +- Configure CHAP authentication for an iSCSI target: + +`sudo iscsiadm {{[-m|--mode]}} node {{[-T|--targetname]}} {{iqn}} {{[-p|--portal]}} {{ip_address}}:3260 {{[-o|--op]}} update {{[-n|--name]}} node.session.auth.authmethod {{[-v|--value]}} CHAP` diff --git a/tldr/linux/minicom b/tldr/linux/minicom index 38f5631c..1fa2a70c 100644 --- a/tldr/linux/minicom +++ b/tldr/linux/minicom @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # minicom > Communicate with the serial interface of a device. +> See also: `picocom`, `cu`, `tio`. > More information: . - Open a given serial port: diff --git a/tldr/linux/mkfs.ext4 b/tldr/linux/mkfs.ext4 index 1dec4618..507884d0 100644 --- a/tldr/linux/mkfs.ext4 +++ b/tldr/linux/mkfs.ext4 @@ -15,3 +15,7 @@ source: https://github.com/tldr-pages/tldr.git - Create an ext4 filesystem with a volume-label: `sudo mkfs.ext4 -L {{volume_label}} {{/dev/sdXY}}` + +- Create an ext4 filesystem owned by a specific user and group: + +`sudo mkfs.ext4 -E root_owner={{uid}}:{{gid}} {{/dev/sdXY}}` diff --git a/tldr/linux/parted b/tldr/linux/parted index 6e2838a9..4be4fb10 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`, `cfdisk`, `partprobe`. > More information: . - List partitions on all block devices: diff --git a/tldr/linux/slurmrestd b/tldr/linux/slurmrestd index 376690ee..ff907441 100644 --- a/tldr/linux/slurmrestd +++ b/tldr/linux/slurmrestd @@ -5,7 +5,8 @@ source: https://github.com/tldr-pages/tldr.git --- # slurmrestd -> Interface to Slurm via REST API. It can be used in two modes: Inetd Mode and Listen Mode. +> Interface to Slurm via REST API. +> Note: Can be used in two modes: Inetd Mode and Listen Mode. > More information: . - Change the [g]roup ID (and drop supplemental groups) before processing client requests: diff --git a/tldr/picocom b/tldr/picocom index a61df584..3c843dd7 100644 --- a/tldr/picocom +++ b/tldr/picocom @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # picocom > Minimal program to emulate serial consoles. +> See also: `minicom`, `cu`, `tio`. > More information: . - Connect to a serial console with the default baud rate of 9600: diff --git a/tldr/shfmt b/tldr/shfmt index 6d0ce849..9f764e81 100644 --- a/tldr/shfmt +++ b/tldr/shfmt @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # shfmt > Shell parser, formatter, and interpreter. -> More information: . +> More information: . - Print a formatted version of a shell script: @@ -14,12 +14,20 @@ source: https://github.com/tldr-pages/tldr.git - List unformatted files: -`shfmt --list {{path/to/directory}}` +`shfmt {{[-l|--list]}} {{path/to/directory}}` - Write the result to the file instead of printing it to the terminal: -`shfmt --write {{path/to/file}}` +`shfmt {{[-w|--write]}} {{path/to/file}}` -- Simplify the code, removing redundant pieces of syntax (i.e. removing "$" from vars in expressions): +- Simplify the code, removing redundant pieces of syntax (e.g. removing "$" from vars in expressions): -`shfmt --simplify {{path/to/file}}` +`shfmt {{[-s|--simplify]}} {{path/to/file}}` + +- Specify the amount of spaces to use for indentation (0 for tabs, which is also the default): + +`shfmt {{[-i|--indent]}} {{4}} {{path/to/file}}` + +- Format the code according to Google's style guide: + +`shfmt {{[-i|--indent]}} 2 {{[-ci|--case-indent]}} {{[-w|--write]}} {{path/to/file}}` diff --git a/tldr/windows/mimikatz-crypto b/tldr/windows/mimikatz-crypto index 37b03509..27a39e6e 100644 --- a/tldr/windows/mimikatz-crypto +++ b/tldr/windows/mimikatz-crypto @@ -5,7 +5,8 @@ source: https://github.com/tldr-pages/tldr.git --- # mimikatz crypto -> Manipulate Windows cryptographic services and certificates. +> Manipulate Windows cryptographic services and certificates, allowing you to list and export certificates and keys, even those marked as non-exportable. +> It generally requires elevated privileges, especially when accessing system keys. > More information: . - List cryptographic providers: