From ce2d49bb005a98a47e421d31c4aa02addecd4cfd Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Wed, 18 Sep 2024 00:16:22 +0000 Subject: [PATCH] Update cheatsheets --- tldr/chatgpt | 33 +++++++++++++++++++++++++++++++++ tldr/docker-container-remove | 2 +- tldr/docker-container-rm | 2 +- tldr/docker-rm | 2 +- tldr/libreoffice | 25 +++++++++++++++++++++++++ tldr/npm | 2 +- 6 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 tldr/chatgpt create mode 100644 tldr/libreoffice diff --git a/tldr/chatgpt b/tldr/chatgpt new file mode 100644 index 00000000..ccccf5e5 --- /dev/null +++ b/tldr/chatgpt @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# chatgpt + +> Shell script to use OpenAI's ChatGPT and DALL-E from the terminal. +> More information: . + +- Start in chat mode: + +`chatgpt` + +- Give a [p]rompt to answer to: + +`chatgpt --prompt "{{What is the regex to match an email address?}}"` + +- Start in chat mode using a specific [m]odel (default is `gpt-3.5-turbo`): + +`chatgpt --model {{gpt-4}}` + +- Start in chat mode with an [i]nitial prompt: + +`chatgpt --init-prompt "{{You are Rick, from Rick and Morty. Respond to questions using his mannerism and include insulting jokes.}}"` + +- Pipe the result of a command to `chatgpt` as a prompt: + +`echo "{{How to view running processes on Ubuntu?}}" | chatgpt` + +- Generate an image using DALL-E: + +`chatgpt --prompt "{{image: A white cat}}"` diff --git a/tldr/docker-container-remove b/tldr/docker-container-remove index b5cac415..73d013b8 100644 --- a/tldr/docker-container-remove +++ b/tldr/docker-container-remove @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # docker container remove > This command is an alias of `docker rm`. -> More information: . +> More information: . - View documentation for the original command: diff --git a/tldr/docker-container-rm b/tldr/docker-container-rm index efb14548..819bf9ab 100644 --- a/tldr/docker-container-rm +++ b/tldr/docker-container-rm @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # docker container rm > This command is an alias of `docker rm`. -> More information: . +> More information: . - View documentation for the original command: diff --git a/tldr/docker-rm b/tldr/docker-rm index 749d33fd..a1f240e5 100644 --- a/tldr/docker-rm +++ b/tldr/docker-rm @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # docker rm > Remove containers. -> More information: . +> More information: . - Remove containers: diff --git a/tldr/libreoffice b/tldr/libreoffice new file mode 100644 index 00000000..ab33d486 --- /dev/null +++ b/tldr/libreoffice @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# libreoffice + +> CLI for the powerful and free office suite LibreOffice. +> More information: . + +- Open one or more files in read-only mode: + +`libreoffice --view {{path/to/file1 path/to/file2 ...}}` + +- Display the content of one or more files: + +`libreoffice --cat {{path/to/file1 path/to/file2 ...}}` + +- Print files using a specific printer: + +`libreoffice --pt {{printer_name}} {{path/to/file1 path/to/file2 ...}}` + +- Convert all `.doc` files in current directory to PDF: + +`libreoffice --convert-to {{pdf}} {{*.doc}}` diff --git a/tldr/npm b/tldr/npm index 0d683a96..e763bf1b 100644 --- a/tldr/npm +++ b/tldr/npm @@ -27,7 +27,7 @@ source: https://github.com/tldr-pages/tldr.git - Download the latest version of a package and install it globally: -`npm install {{-g|--global}} {{package_name}}0` +`npm install {{-g|--global}} {{package_name}}` - Uninstall a package and remove it from the list of dependencies in `package.json`: