Update cheatsheets

This commit is contained in:
ivuorinen
2026-01-20 00:21:53 +00:00
parent 01e38ccf44
commit 60190f32c7
13 changed files with 104 additions and 8 deletions

29
tldr/alembic Normal file
View File

@@ -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: <https://manned.org/alembic>.
- 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`

View File

@@ -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: <https://manned.org/cfdisk>.
- Start the partition manipulator with a specific device:

View File

@@ -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: <https://manned.org/cu>.
- Open a given serial port:

View File

@@ -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`

View File

@@ -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}}`

37
tldr/linux/iscsiadm Normal file
View File

@@ -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: <https://manned.org/iscsiadm>.
- 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`

View File

@@ -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: <https://manned.org/minicom>.
- Open a given serial port:

View File

@@ -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}}`

View File

@@ -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: <https://www.gnu.org/software/parted/manual/parted.html#Invoking-Parted>.
- List partitions on all block devices:

View File

@@ -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: <https://slurm.schedmd.com/slurmrestd.html>.
- Change the [g]roup ID (and drop supplemental groups) before processing client requests:

View File

@@ -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: <https://manned.org/picocom>.
- Connect to a serial console with the default baud rate of 9600:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# shfmt
> Shell parser, formatter, and interpreter.
> More information: <https://pkg.go.dev/mvdan.cc/sh>.
> More information: <https://pkg.go.dev/mvdan.cc/sh#section-readme>.
- 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}}`

View File

@@ -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: <https://github.com/gentilkiwi/mimikatz>.
- List cryptographic providers: