From 20442da91f66b8da6a236b7040a6d6e9ef46f8cb Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 31 Oct 2024 00:17:43 +0000 Subject: [PATCH] Update cheatsheets --- tldr/dbt | 37 +++++++++++++++++++++++++++++++++++++ tldr/idevice_id | 17 +++++++++++++++++ tldr/idevicebackup | 18 ++++++++++++++++++ tldr/idevicebackup2 | 25 +++++++++++++++++++++++++ tldr/idevicecrashreport | 21 +++++++++++++++++++++ tldr/idevicedate | 21 +++++++++++++++++++++ tldr/idevicediagnostics | 21 +++++++++++++++++++++ tldr/ideviceimagemounter | 17 +++++++++++++++++ tldr/ideviceinfo | 17 +++++++++++++++++ tldr/idevicename | 17 +++++++++++++++++ tldr/idevicepair | 17 +++++++++++++++++ tldr/idevicescreenshot | 17 +++++++++++++++++ tldr/idevicesetlocation | 17 +++++++++++++++++ tldr/idevicesyslog | 17 +++++++++++++++++ tldr/iproxy | 25 +++++++++++++++++++++++++ tldr/npm-adduser | 25 +++++++++++++++++++++++++ tldr/npm-dedupe | 33 +++++++++++++++++++++++++++++++++ tldr/npm-version | 29 +++++++++++++++++++++++++++++ tldr/nxc-winrm | 25 +++++++++++++++++++++++++ tldr/swift | 2 +- tldr/windows/reg | 2 +- 21 files changed, 418 insertions(+), 2 deletions(-) create mode 100644 tldr/dbt create mode 100644 tldr/idevice_id create mode 100644 tldr/idevicebackup create mode 100644 tldr/idevicebackup2 create mode 100644 tldr/idevicecrashreport create mode 100644 tldr/idevicedate create mode 100644 tldr/idevicediagnostics create mode 100644 tldr/ideviceimagemounter create mode 100644 tldr/ideviceinfo create mode 100644 tldr/idevicename create mode 100644 tldr/idevicepair create mode 100644 tldr/idevicescreenshot create mode 100644 tldr/idevicesetlocation create mode 100644 tldr/idevicesyslog create mode 100644 tldr/iproxy create mode 100644 tldr/npm-adduser create mode 100644 tldr/npm-dedupe create mode 100644 tldr/npm-version create mode 100644 tldr/nxc-winrm diff --git a/tldr/dbt b/tldr/dbt new file mode 100644 index 00000000..7d8f3159 --- /dev/null +++ b/tldr/dbt @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# dbt + +> A tool to model transformations in data warehouses. +> More information: . + +- Debug the dbt project and the connection to the database: + +`dbt debug` + +- Run all models of the project: + +`dbt run` + +- Run all tests of `example_model`: + +`dbt test --select example_model` + +- Build (load seeds, run models, snapshots, and tests associated with) `example_model` and its downstream dependents: + +`dbt build --select example_model+` + +- Build all models, except the ones with the tag `not_now`: + +`dbt build --exclude "tag:not_now"` + +- Build all models with tags `one` and `two`: + +`dbt build --select "tag:one,tag:two"` + +- Build all models with tags `one` or `two`: + +`dbt build --select "tag:one tag:two"` diff --git a/tldr/idevice_id b/tldr/idevice_id new file mode 100644 index 00000000..3b981a83 --- /dev/null +++ b/tldr/idevice_id @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevice_id + +> List attached iOS devices or print the device name of a given device. +> More information: . + +- List the UDIDs of all attached devices: + +`idevice_id --list` + +- List the UDIDs of all devices available via the network: + +`idevice_id --network` diff --git a/tldr/idevicebackup b/tldr/idevicebackup new file mode 100644 index 00000000..d9aa63e2 --- /dev/null +++ b/tldr/idevicebackup @@ -0,0 +1,18 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicebackup + +> Create or restore backups for iOS devices. +> Note: This tool is outdated. Please see `idevicebackup2`. +> More information: . + +- Create a backup of the device in the specified directory: + +`idevicebackup backup {{path/to/directory}}` + +- Restore a backup from the specified directory: + +`idevicebackup restore {{path/to/directory}}` diff --git a/tldr/idevicebackup2 b/tldr/idevicebackup2 new file mode 100644 index 00000000..4760d2d9 --- /dev/null +++ b/tldr/idevicebackup2 @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicebackup2 + +> Create or restore backups for devices running iOS 4 or later. +> More information: . + +- Create a backup of the device in the specified directory: + +`idevicebackup2 backup {{path/to/directory}}` + +- Restore a backup from the specified directory: + +`idevicebackup2 restore {{path/to/directory}}` + +- Enable encryption for backups: + +`idevicebackup2 encryption on {{password}}` + +- List the files in the last completed backup: + +`idevicebackup2 list` diff --git a/tldr/idevicecrashreport b/tldr/idevicecrashreport new file mode 100644 index 00000000..f5d831c2 --- /dev/null +++ b/tldr/idevicecrashreport @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicecrashreport + +> Retrieve crash reports from an iOS device. +> More information: . + +- Retrieve crash reports and move them to a specified directory: + +`idevicecrashreport {{path/to/directory}}` + +- Retrieve crash reports without removing them from the device: + +`idevicecrashreport --keep {{path/to/directory}}` + +- Extract crash reports into separate `.crash` files: + +`idevicecrashreport --extract {{path/to/directory}}` diff --git a/tldr/idevicedate b/tldr/idevicedate new file mode 100644 index 00000000..169ea78f --- /dev/null +++ b/tldr/idevicedate @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicedate + +> Display the current date or set it on an iOS device. +> More information: . + +- Display the current date and time: + +`idevicedate` + +- Set the date and time on the device to the system time: + +`idevicedate --sync` + +- Set the date and time to a specific timestamp: + +`idevicedate --set {{timestamp}}` diff --git a/tldr/idevicediagnostics b/tldr/idevicediagnostics new file mode 100644 index 00000000..1d6e6951 --- /dev/null +++ b/tldr/idevicediagnostics @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicediagnostics + +> Interact with the diagnostics interface of an iOS device. +> More information: . + +- Print diagnostics information: + +`idevicediagnostics diagnostics` + +- Print mobilegestalt key values: + +`idevicediagnostics mobilegestalt {{key1}} {{key2}}` + +- Shutdown, restart or sleep the device: + +`idevicediagnostics {{shutdown|restart|sleep}}` diff --git a/tldr/ideviceimagemounter b/tldr/ideviceimagemounter new file mode 100644 index 00000000..b3082db4 --- /dev/null +++ b/tldr/ideviceimagemounter @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# ideviceimagemounter + +> Mount disk images on an iOS device. +> More information: . + +- Mount a disk image on the connected device: + +`ideviceimagemounter {{path/to/image_file}} {{path/to/signature_file}}` + +- List currently mounted disk images: + +`ideviceimagemounter --list` diff --git a/tldr/ideviceinfo b/tldr/ideviceinfo new file mode 100644 index 00000000..eb6613dc --- /dev/null +++ b/tldr/ideviceinfo @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# ideviceinfo + +> Show information about the first connected iOS device. +> More information: . + +- Display detailed information about the connected device: + +`ideviceinfo` + +- Show information about a specific device by UDID: + +`ideviceinfo --udid {{device_udid}}` diff --git a/tldr/idevicename b/tldr/idevicename new file mode 100644 index 00000000..800e4c7b --- /dev/null +++ b/tldr/idevicename @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicename + +> Display the device name or set it to a new name. +> More information: . + +- Display the current device name: + +`idevicename` + +- Set a new device name: + +`idevicename {{new_name}}` diff --git a/tldr/idevicepair b/tldr/idevicepair new file mode 100644 index 00000000..35fe9365 --- /dev/null +++ b/tldr/idevicepair @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicepair + +> Manage host pairings with iOS devices. +> More information: . + +- Pair a device with the host: + +`idevicepair pair` + +- List devices paired with the host: + +`idevicepair list` diff --git a/tldr/idevicescreenshot b/tldr/idevicescreenshot new file mode 100644 index 00000000..4853bb4e --- /dev/null +++ b/tldr/idevicescreenshot @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicescreenshot + +> Get a screenshot from the connected iOS device. +> More information: . + +- Save a screenshot with the default file name as a TIFF image: + +`idevicescreenshot` + +- Save a screenshot with a specific file name: + +`idevicescreenshot {{path/to/file.tiff}}` diff --git a/tldr/idevicesetlocation b/tldr/idevicesetlocation new file mode 100644 index 00000000..bfab2118 --- /dev/null +++ b/tldr/idevicesetlocation @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicesetlocation + +> Simulate a location on an iOS device. +> More information: . + +- Set a specific latitude and longitude: + +`idevicesetlocation {{latitude}} {{longitude}}` + +- Reset the simulated location: + +`idevicesetlocation reset` diff --git a/tldr/idevicesyslog b/tldr/idevicesyslog new file mode 100644 index 00000000..ba595f2e --- /dev/null +++ b/tldr/idevicesyslog @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# idevicesyslog + +> Relay syslog messages from a connected iOS device. +> More information: . + +- Relay syslog messages from the connected device: + +`idevicesyslog` + +- Suppress kernel messages and print everything else: + +`idevicesyslog --no-kernel` diff --git a/tldr/iproxy b/tldr/iproxy new file mode 100644 index 00000000..0541cab7 --- /dev/null +++ b/tldr/iproxy @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# iproxy + +> A proxy that binds local TCP ports to be forwarded to the specified ports on a usbmux device. +> More information: . + +- Bind a local TCP port and forward it to a port on the connected USB device: + +`iproxy {{local_port}}:{{device_port}}` + +- Bind multiple local TCP ports and forward them to the respective ports on the connected USB device: + +`iproxy {{local_port1}}:{{device_port1}} {{local_port2}}:{{device_port2}}` + +- Bind a local port and forward it to a specific device by UDID: + +`iproxy --udid {{device_udid}} {{local_port}}:{{device_port}}` + +- Bind a local port and forward it to a network-connected device with WiFi sync enabled: + +`iproxy --network {{local_port}}:{{device_port}}` diff --git a/tldr/npm-adduser b/tldr/npm-adduser new file mode 100644 index 00000000..c6f0b7fb --- /dev/null +++ b/tldr/npm-adduser @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# npm adduser + +> Add a registry user account. +> More information: . + +- Create a new user in the specified registry and save credentials to `.npmrc`: + +`npm adduser --registry={{registry_url}}` + +- Log in to a private registry with a specific scope: + +`npm login --scope={{@mycorp}} --registry={{https://registry.mycorp.com}}` + +- Log out from a specific scope and remove the auth token: + +`npm logout --scope={{@mycorp}}` + +- Create a scoped package during initialization: + +`npm init --scope={{@foo}} {{--yes}}` diff --git a/tldr/npm-dedupe b/tldr/npm-dedupe new file mode 100644 index 00000000..cda7a4bc --- /dev/null +++ b/tldr/npm-dedupe @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# npm dedupe + +> Reduce duplication in the `node_modules` directory. +> More information: . + +- Deduplicate packages in `node_modules`: + +`npm dedupe` + +- Follow `package-lock.json` or `npm-shrinkwrap.json` during deduplication: + +`npm dedupe --lock` + +- Run deduplication in strict mode: + +`npm dedupe --strict` + +- Skip optional/peer dependencies during deduplication: + +`npm dedupe --omit={{optional|peer}}` + +- Enable detailed logging for troubleshooting: + +`npm dedupe --loglevel=verbose` + +- Limit deduplication to a specific package: + +`npm dedupe {{package_name}}` diff --git a/tldr/npm-version b/tldr/npm-version new file mode 100644 index 00000000..9200e867 --- /dev/null +++ b/tldr/npm-version @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# npm version + +> Bump a node package version. +> More information: . + +- Check current version: + +`npm version` + +- Bump the minor version: + +`npm version minor` + +- Set a specific version: + +`npm version {{version}}` + +- Bump the patch version without creating a Git tag: + +`npm version patch --no-git-tag-version` + +- Bump the major version with a custom commit message: + +`npm version major -m "{{Upgrade to %s for reasons}}"` diff --git a/tldr/nxc-winrm b/tldr/nxc-winrm new file mode 100644 index 00000000..dee229ef --- /dev/null +++ b/tldr/nxc-winrm @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# nxc winrm + +> Pentest and exploit Windows Remote Management (winrm). +> More information: . + +- Search for valid credentials by trying out every combination in the specified lists of [u]sernames and [p]asswords: + +`nxc winrm {{192.168.178.2}} -u {{path/to/usernames.txt}} -p {{path/to/passwords.txt}}` + +- Specify the domain to authenticate to (avoids an initial SMB connection): + +`nxc winrm {{192.168.178.2}} -u {{username}} -p {{password}} -d {{domain_name}}` + +- Execute the specified command on the host: + +`nxc winrm {{192.168.178.2}} -u {{username}} -p {{password}} -x {{whoami}}` + +- Execute the specified PowerShell command on the host as administrator using LAPS: + +`nxc winrm {{192.168.178.2}} -u {{username}} -p {{password}} --laps -X {{whoami}}` diff --git a/tldr/swift b/tldr/swift index ee666f0f..7ce8c3c1 100644 --- a/tldr/swift +++ b/tldr/swift @@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git - Start a REPL (interactive shell): -`swift` +`swift repl` - Execute a program: diff --git a/tldr/windows/reg b/tldr/windows/reg index 35c40c3b..9f86a0f8 100644 --- a/tldr/windows/reg +++ b/tldr/windows/reg @@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git - View documentation for searching, viewing, and comparing keys: -`tldr reg {{compare|flags|query}}` +`tldr reg {{compare|query}}` - View documentation for exporting and importing registry keys not preserving the key ownerships and ACLs: