From 85f0642d2d424b74ddd01bb549ceeac18926bdef Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Mon, 3 Feb 2025 00:17:52 +0000 Subject: [PATCH] Update cheatsheets --- tldr/filebrowser | 41 +++++++++++++++++++++++++++++++++++++++++ tldr/find | 4 ++-- tldr/linux/lxc-ls | 25 +++++++++++++++++++++++++ tldr/rmlint | 14 +++++++------- tldr/trip | 35 +++++++++++++++++++++++++++++++++++ tldr/vagrant-box | 42 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 tldr/filebrowser create mode 100644 tldr/linux/lxc-ls create mode 100644 tldr/trip create mode 100644 tldr/vagrant-box diff --git a/tldr/filebrowser b/tldr/filebrowser new file mode 100644 index 00000000..cc37e160 --- /dev/null +++ b/tldr/filebrowser @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# filebrowser + +> Simple HTTP web server to manage files and directories. +> More information: . + +- Start a new server instance serving the current directory: + +`filebrowser` + +- Start a new server instance serving a specific root directory: + +`filebrowser {{-r|--root}} {{path/to/directory}}` + +- Start an instance with different host address (defaults to `127.0.0.1`) and port (defaults to `8080`): + +`filebrowser {{-a|--address}} {{host}} {{-p|--port}} {{port}} {{-r|--root}} {{path/to/directory}}` + +- Start an instance with a specified configuration file, storing the application database in a specific location (defaults to `filebrowser.db` on the current directory): + +`filebrowser {{-c|--config}} {{path/to/file}} {{-d|--database}} {{path/to/database.db}} {{-r|--root}} {{path/to/directory}}` + +- Set up a different default first-time account username and password (both default to `admin`) when setting up a new instance: + +`filebrowser --username {{username}} --password {{password}} {{-r|--root}} {{path/to/directory}}` + +- Set up the maximum amount of image processors used when generating thumbnails (defaults to `4`): + +`filebrowser --img-processors {{4}} {{-r|--root}} {{path/to/directory}}` + +- Disable image thumbnails as well as the Command Runner feature, limiting access for hosted script files from being executed inside the app: + +`filebrowser --disable-exec --disable-thumbnails {{-r|--root}} {{path/to/directory}}` + +- Disable resizing of image previews as well as detecting file types by reading their headers: + +`filebrowser --disable-preview-resize --disable-type-detection-by-header {{-r|--root}} {{path/to/directory}}` diff --git a/tldr/find b/tldr/find index 905d9461..5942bafe 100644 --- a/tldr/find +++ b/tldr/find @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - Find files matching multiple path/name patterns: -`find {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'` +`find {{root_path}} -path '{{*/path/*/*.ext}}' -or -name '{{*pattern*}}'` - Find directories matching a given name, in case-insensitive mode: @@ -36,6 +36,6 @@ source: https://github.com/tldr-pages/tldr.git `find {{root_path}} -daystart -mtime {{-1}} -exec {{tar -cvf archive.tar}} {} \+` -- Find empty files (0 byte) or directories and delete them verbosely: +- Search for either empty files or directories and delete them verbosely: `find {{root_path}} -type {{f|d}} -empty -delete -print` diff --git a/tldr/linux/lxc-ls b/tldr/linux/lxc-ls new file mode 100644 index 00000000..1443192c --- /dev/null +++ b/tldr/linux/lxc-ls @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# lxc-ls + +> List Linux containers. +> More information: . + +- List active containers (including frozen and running): + +`lxc-ls --active` + +- List only frozen containers: + +`lxc-ls --frozen` + +- List only stopped containers: + +`lxc-ls --stopped` + +- List containers in a fancy, column-based output: + +`lxc-ls --fancy` diff --git a/tldr/rmlint b/tldr/rmlint index 58a8eaeb..63b0c0c4 100644 --- a/tldr/rmlint +++ b/tldr/rmlint @@ -12,9 +12,9 @@ source: https://github.com/tldr-pages/tldr.git `rmlint {{path/to/directory1 path/to/directory2 ...}}` -- Check for space wasters, preferably keeping files in tagged directories (after the double slash): +- Check for duplicates bigger than a specific size, preferably keeping files in tagged directories (after the double slash): -`rmlint {{path/to/directory}} // {{path/to/original_directory}}` +`rmlint -s {{1MB}} {{path/to/directory}} // {{path/to/original_directory}}` - Check for space wasters, keeping everything in the untagged directories: @@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git `./rmlint.sh` -- Find duplicate directory trees: +- Find duplicate directory trees based on data, ignoring names: `rmlint --merge-directories {{path/to/directory}}` @@ -32,10 +32,10 @@ source: https://github.com/tldr-pages/tldr.git `rmlint --rank-by={{dl}} {{path/to/directory}}` -- Find only duplicates that have the same filename in addition to the same contents: +- Find files with identical filename and contents, and link rather than delete the duplicates: -`rmlint --match-basename {{path/to/directory}}` +`rmlint -c sh:link --match-basename {{path/to/directory}}` -- Find only duplicates that have the same extension in addition to the same contents: +- Use `data` as master directory. Find only duplicates in backup that are also in `data`. Do not delete any files in `data`: -`rmlint --match-extension {{path/to/directory}}` +`rmlint {{path/to/backup}} // {{path/to/data}} --keep-all-tagged --must-match-tagged` diff --git a/tldr/trip b/tldr/trip new file mode 100644 index 00000000..72534507 --- /dev/null +++ b/tldr/trip @@ -0,0 +1,35 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# trip + +> A network diagnostic tool. +> Combines the functionality of `traceroute` and `ping`. +> Designed to assist with the analysis of networking issues. +> More information: . + +- Basic usage with default parameters: + +`sudo trip {{example.com}}` + +- Trace without requiring elevated privileges (supported platforms only): + +`trip {{example.com}} --unprivileged` + +- Trace using `IPv6` only: + +`sudo trip {{example.com}} --ipv6` + +- Trace using the `udp` protocol: + +`sudo trip {{example.com}} --protocol {{udp}}` + +- Use custom destination port `443` for `tcp` tracing: + +`sudo trip {{example.com}} --protocol {{tcp}} --target-port {{443}}` + +- Use custom source port `5000` for `udp` tracing: + +`sudo trip {{example.com}} --protocol {{udp}} --source-port {{5000}}` diff --git a/tldr/vagrant-box b/tldr/vagrant-box new file mode 100644 index 00000000..722917ba --- /dev/null +++ b/tldr/vagrant-box @@ -0,0 +1,42 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# vagrant box + +> Manage Vagrant boxes (virtual machine images). +> See also: `vagrant`. +> More information: . + +- List all installed boxes: + +`vagrant box list` + +- Add a new box: + +`vagrant box add {{hashicorp/bionic64}}` + +- Add a box from a custom URL: + +`vagrant box add {{my-box}} {{https://example.com/my-box.box}}` + +- Remove an installed box: + +`vagrant box remove {{hashicorp/bionic64}}` + +- Update all boxes that are in use in the current Vagrant environment: + +`vagrant box update` + +- Update a specific box: + +`vagrant box update --box {{bento/debian-12}}` + +- Check if there is a new version available for the box that you are using: + +`vagrant box outdated` + +- Clean up old versions of installed boxes: + +`vagrant box prune`