Update cheatsheets

This commit is contained in:
ivuorinen
2025-08-03 00:24:25 +00:00
parent ff81eb885b
commit 2062b222e5
38 changed files with 158 additions and 90 deletions

View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# gpu-screen-recorder
> Record the screen and encode the video with a GPU.
> More information: <https://git.dec05eba.com/gpu-screen-recorder/about/>.
- Select a source using a desktop portal and record it:
`gpu-screen-recorder -w portal -o {{path/to/video.mp4}}`
- Specify a specific video source:
`gpu-screen-recorder -w {{screen|DP-1|HDMI-A1|...}} -o {{path/to/video.mp4}}`
- List video capture sources:
`gpu-screen-recorder --list-capture-options`
- List audio capture sources:
`gpu-screen-recorder {{--list-audio-devices|--list-application-audio}}`
- Record using the replay buffer:
`gpu-screen-recorder -w {{screen}} -r {{30}} -c {{mp4}} -ro {{path/to/directory}} -o {{whatever}}`
- Capture a video from the replay buffer:
`pkill -SIGUSR1 -f gpu-screen-recorder`
- Run `gpu-screen-recorder` in the background:
`systemctl start --user gpu-screen-recorder`

View File

@@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git
- Load a specific keyboard layout for the current console:
`sudo loadkeys {{en|de|fi|dvorak|...}}`
`sudo loadkeys {{en|de|fi|dvorak|defkeymap|...}}`
- Load a default keymap:

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> JavaScript and Node.js package manager.
> Manage Node.js projects and their module dependencies.
> More information: <https://www.npmjs.com>.
> More information: <https://docs.npmjs.com/cli/npm>.
- Create a `package.json` file with default values (omit `--yes` to do it interactively):
@@ -15,28 +15,28 @@ source: https://github.com/tldr-pages/tldr.git
- Download all the packages listed as dependencies in `package.json`:
`npm install`
`npm {{[i|install]}}`
- Download a specific version of a package and add it to the list of dependencies in `package.json`:
`npm install {{package_name}}@{{version}}`
`npm {{[i|install]}} {{package_name}}@{{version}}`
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
`npm install {{package_name}} {{[-D|--save-dev]}}`
`npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}`
- Download the latest version of a package and install it globally:
`npm install {{[-g|--global]}} {{package_name}}`
`npm {{[i|install]}} {{[-g|--global]}} {{package_name}}`
- Uninstall a package and remove it from the list of dependencies in `package.json`:
`npm uninstall {{package_name}}`
`npm {{[r|uninstall]}} {{package_name}}`
- List all locally installed dependencies:
`npm list`
`npm {{[ls|list]}}`
- List all top-level globally installed packages:
`npm list {{[-g|--global]}} --depth {{0}}`
`npm {{[ls|list]}} {{[-g|--global]}} --depth {{0}}`

View File

@@ -19,8 +19,8 @@ source: https://github.com/tldr-pages/tldr.git
- Configure the browser used to open URLs by setting your preferred browser for `npm` commands:
`npm config set browser {{browser_name}}`
`npm {{[c|config]}} set browser {{browser_name}}`
- Control URL opening: set `browser` to `true` for the system URL opener, or `false` to print URLs in the terminal:
`npm config set browser {{true|false}}`
`npm {{[c|config]}} set browser {{true|false}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm cache
> Manage the npm package cache.
> More information: <https://docs.npmjs.com/cli/commands/npm-cache>.
> More information: <https://docs.npmjs.com/cli/npm-cache>.
- Add a specific package to the cache:
@@ -34,8 +34,8 @@ source: https://github.com/tldr-pages/tldr.git
- Show the cache path:
`npm config get cache`
`npm {{[c|config]}} get cache`
- Change the cache path:
`npm config set cache {{path/to/directory}}`
`npm {{[c|config]}} set cache {{path/to/directory}}`

View File

@@ -3,7 +3,7 @@ syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm check
# npm-check
> Check for outdated, incorrect, and unused npm package dependencies.
> More information: <https://github.com/dylang/npm-check>.

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Clean install of `npm` project dependencies for automated environments.
> Installs packages based on `package-lock.json` or `npm-shrinkwrap.json`.
> More information: <https://docs.npmjs.com/cli/commands/npm-ci>.
> More information: <https://docs.npmjs.com/cli/npm-ci>.
- Install project dependencies from `package-lock.json` or `npm-shrinkwrap.json`:

View File

@@ -3,35 +3,35 @@ syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm-config
# npm config
> Manage the `npm` configuration settings.
> More information: <https://docs.npmjs.com/cli/commands/npm-config>.
> More information: <https://docs.npmjs.com/cli/npm-config>.
- Show all configuration settings:
`npm config list`
`npm {{[c|config]}} list`
- List all configuration settings as `JSON`:
`npm config list --json`
`npm {{[c|config]}} list --json`
- Get the value of a specific configuration key:
`npm config get {{key}}`
`npm {{[c|config]}} get {{key}}`
- Set a configuration key to a specific value:
`npm config set {{key}} {{value}}`
`npm {{[c|config]}} set {{key}} {{value}}`
- Delete a configuration key:
`npm config delete {{key}}`
`npm {{[c|config]}} delete {{key}}`
- Edit the global npm configuration file in the default editor:
`npm config edit`
`npm {{[c|config]}} edit`
- Attempt to repair invalid configuration items:
`npm config fix`
`npm {{[c|config]}} fix`

View File

@@ -6,28 +6,28 @@ source: https://github.com/tldr-pages/tldr.git
# npm dedupe
> Reduce duplication in the `node_modules` directory.
> More information: <https://docs.npmjs.com/cli/commands/npm-dedupe>.
> More information: <https://docs.npmjs.com/cli/npm-dedupe>.
- Deduplicate packages in `node_modules`:
`npm dedupe`
`npm {{[ddp|dedupe]}}`
- Follow `package-lock.json` or `npm-shrinkwrap.json` during deduplication:
`npm dedupe --lock`
`npm {{[ddp|dedupe]}} --lock`
- Run deduplication in strict mode:
`npm dedupe --strict`
`npm {{[ddp|dedupe]}} --strict`
- Skip optional/peer dependencies during deduplication:
`npm dedupe --omit {{optional|peer}}`
`npm {{[ddp|dedupe]}} --omit {{optional|peer}}`
- Enable detailed logging for troubleshooting:
`npm dedupe --loglevel verbose`
`npm {{[ddp|dedupe]}} --loglevel verbose`
- Limit deduplication to a specific package:
`npm dedupe {{package_name}}`
`npm {{[ddp|dedupe]}} {{package_name}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm deprecate
> Mark a version or range of versions of an `npm` package as deprecated.
> More information: <https://docs.npmjs.com/cli/commands/npm-deprecate/>.
> More information: <https://docs.npmjs.com/cli/npm-deprecate/>.
- Deprecate a specific version of a package:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm doctor
> Check the health of the npm environment.
> More information: <https://docs.npmjs.com/cli/commands/npm-doctor>.
> More information: <https://docs.npmjs.com/cli/npm-doctor>.
- Run all default health checks for `npm`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm find-dupes
> Identify duplicate dependencies in `node_modules`.
> More information: <https://docs.npmjs.com/cli/commands/npm-find-dupes>.
> More information: <https://docs.npmjs.com/cli/npm-find-dupes>.
- List all duplicate packages within `node_modules`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm fund
> Retrieve funding information from packages.
> More information: <https://docs.npmjs.com/cli/commands/npm-fund>.
> More information: <https://docs.npmjs.com/cli/npm-fund>.
- List dependencies with funding URL for the project in the current directory:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm init
> Create a `package.json` file.
> More information: <https://docs.npmjs.com/cli/commands/npm-init>.
> More information: <https://docs.npmjs.com/cli/npm-init>.
- Initialize a new package with prompts:

View File

@@ -6,20 +6,20 @@ source: https://github.com/tldr-pages/tldr.git
# npm install
> Install Node packages.
> More information: <https://docs.npmjs.com/cli/commands/npm-install>.
> More information: <https://docs.npmjs.com/cli/npm-install>.
- Install dependencies listed in `package.json`:
`npm install`
`npm {{[i|install]}}`
- Download a specific version of a package and add it to the list of dependencies in `package.json`:
`npm install {{package_name}}@{{version}}`
`npm {{[i|install]}} {{package_name}}@{{version}}`
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
`npm install {{package_name}} {{[-D|--save-dev]}}`
`npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}`
- Download the latest version of a package and install it globally:
`npm install {{[-g|--global]}} {{package_name}}`
`npm {{[i|install]}} {{[-g|--global]}} {{package_name}}`

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Log in to a registry user account.
> See also: `npm logout` for logging out.
> More information: <https://docs.npmjs.com/cli/commands/npm-login>.
> More information: <https://docs.npmjs.com/cli/npm-login>.
- Log in to a registry user account and save the credentials to the `.npmrc` file:

View File

@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Log out of the registry user account.
> See also: `npm login` for logging in.
> More information: <https://docs.npmjs.com/cli/commands/npm-logout>.
> More information: <https://docs.npmjs.com/cli/npm-logout>.
- Log out of the registry user account:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm ls
> Print installed packages to `stdout`.
> More information: <https://docs.npmjs.com/cli/commands/npm-ls>.
> More information: <https://docs.npmjs.com/cli/npm-ls>.
- Print all versions of direct dependencies to `stdout`:

View File

@@ -3,7 +3,7 @@ syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm name
# npm-name
> Check whether a package or organization name is available on npm.
> More information: <https://github.com/sindresorhus/npm-name-cli>.

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm org
> Manage organizations.
> More information: <https://docs.npmjs.com/cli/commands/npm-org>.
> More information: <https://docs.npmjs.com/cli/npm-org>.
- Add a new user to an organization:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm outdated
> Check for outdated npm package dependencies.
> More information: <https://docs.npmjs.com/cli/commands/npm-outdated>.
> More information: <https://docs.npmjs.com/cli/npm-outdated>.
- Find packages that are outdated in a project:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm owner
> Manage ownership of published packages.
> More information: <https://docs.npmjs.com/cli/commands/npm-owner>.
> More information: <https://docs.npmjs.com/cli/npm-owner>.
- Add a new user as a maintainer of a package:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm query
> Print an array of dependency objects using CSS-like selectors.
> More information: <https://docs.npmjs.com/cli/commands/npm-query>.
> More information: <https://docs.npmjs.com/cli/npm-query>.
- Print direct dependencies:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm root
> Display path to `node_modules` directory.
> More information: <https://docs.npmjs.com/cli/commands/npm-root>.
> More information: <https://docs.npmjs.com/cli/npm-root>.
- Display path to the local `node_modules` directory:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm run
> Run a script.
> More information: <https://docs.npmjs.com/cli/commands/npm-run-script>.
> More information: <https://docs.npmjs.com/cli/npm-run>.
- Run a script:
@@ -30,4 +30,4 @@ source: https://github.com/tldr-pages/tldr.git
- Run a script named `test`:
`npm test`
`npm {{[t|test]}}`

View File

@@ -6,28 +6,28 @@ source: https://github.com/tldr-pages/tldr.git
# npm search
> Search for packages in the `npm` registry.
> More information: <https://docs.npmjs.com/cli/commands/npm-search>.
> More information: <https://docs.npmjs.com/cli/npm-search>.
- Search for a package by name:
`npm search {{package}}`
`npm {{[s|search]}} {{package}}`
- Search for packages by a specific keyword:
`npm search {{keyword}}`
`npm {{[s|search]}} {{keyword}}`
- Search for packages, including detailed information (e.g., description, author, version):
`npm search {{package}} --long`
`npm {{[s|search]}} {{package}} --long`
- Search for packages maintained by a specific author:
`npm search --author {{author}}`
`npm {{[s|search]}} --author {{author}}`
- Search for packages with a specific organization:
`npm search --scope {{organization}}`
`npm {{[s|search]}} --scope {{organization}}`
- Search for packages with a specific combination of terms:
`npm search {{term1 term2 ...}}`
`npm {{[s|search]}} {{term1 term2 ...}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm star
> Mark a package as favorite.
> More information: <https://docs.npmjs.com/cli/commands/npm-star>.
> More information: <https://docs.npmjs.com/cli/npm-star>.
- Star a public package from the default registry:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm team
> Manage teams in an organization on the `npm` registry.
> More information: <https://docs.npmjs.com/cli/commands/npm-team>.
> More information: <https://docs.npmjs.com/cli/npm-team>.
- Add a user to a team in an organization:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm token
> Manage and generate authentication tokens for the npm registry.
> More information: <https://docs.npmjs.com/cli/commands/npm-token>.
> More information: <https://docs.npmjs.com/cli/npm-token>.
- Create a new authentication token:

View File

@@ -6,16 +6,16 @@ source: https://github.com/tldr-pages/tldr.git
# npm uninstall
> Remove a package.
> More information: <https://docs.npmjs.com/cli/commands/npm-uninstall>.
> More information: <https://docs.npmjs.com/cli/npm-uninstall>.
- Remove a package from the current project:
`npm uninstall {{package_name}}`
`npm {{[r|uninstall]}} {{package_name}}`
- Remove a package globally:
`npm uninstall {{[-g|--global]}} {{package_name}}`
`npm {{[r|uninstall]}} {{[-g|--global]}} {{package_name}}`
- Remove multiple packages at once:
`npm uninstall {{package_name1 package_name2 ...}}`
`npm {{[r|uninstall]}} {{package_name1 package_name2 ...}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm unpublish
> Remove a package from the npm registry.
> More information: <https://docs.npmjs.com/cli/commands/npm-unpublish>.
> More information: <https://docs.npmjs.com/cli/npm-unpublish>.
- Unpublish a specific package version:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm unstar
> Remove the favorite/star mark from a package.
> More information: <https://docs.npmjs.com/cli/commands/npm-unstar>.
> More information: <https://docs.npmjs.com/cli/npm-unstar>.
- Unstar a public package from the default registry:

View File

@@ -6,20 +6,20 @@ source: https://github.com/tldr-pages/tldr.git
# npm update
> Update packages in the current project.
> More information: <https://docs.npmjs.com/cli/commands/npm-update>.
> More information: <https://docs.npmjs.com/cli/npm-update>.
- Update all packages in the current project:
`npm update`
`npm {{[up|update]}}`
- Update a specific package in the current project:
`npm update {{package}}`
`npm {{[up|update]}} {{package}}`
- Update a package globally:
`npm update {{[-g|--global]}} {{package}}`
`npm {{[up|update]}} {{[-g|--global]}} {{package}}`
- Update multiple packages at once:
`npm update {{package1 package2 ...}}`
`npm {{[up|update]}} {{package1 package2 ...}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# npm version
> Bump a node package version.
> More information: <https://docs.npmjs.com/cli/commands/npm-version>.
> More information: <https://docs.npmjs.com/cli/npm-version>.
- Check current version:

View File

@@ -6,32 +6,32 @@ source: https://github.com/tldr-pages/tldr.git
# npm view
> View registry information about a package.
> More information: <https://docs.npmjs.com/cli/commands/npm-view>.
> More information: <https://docs.npmjs.com/cli/npm-view>.
- View information about the latest version of a package:
`npm view {{package}}`
`npm {{[v|view]}} {{package}}`
- View information about a specific version of a package:
`npm view {{package}}@{{version}}`
`npm {{[v|view]}} {{package}}@{{version}}`
- View all available versions of a package:
`npm view {{package}} versions`
`npm {{[v|view]}} {{package}} versions`
- View the description of a package:
`npm view {{package}} description`
`npm {{[v|view]}} {{package}} description`
- View the dependencies of the latest version of a package:
`npm view {{package}} dependencies`
`npm {{[v|view]}} {{package}} dependencies`
- View the repository URL of a package:
`npm view {{package}} repository`
`npm {{[v|view]}} {{package}} repository`
- View the maintainers of a package:
`npm view {{package}} maintainers`
`npm {{[v|view]}} {{package}} maintainers`

View File

@@ -3,7 +3,7 @@ syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm why
# npm-why
> Identifies why an npm package is installed.
> More information: <https://github.com/amio/npm-why>.

View File

@@ -6,17 +6,18 @@ source: https://github.com/tldr-pages/tldr.git
# vagrant
> Manage lightweight, reproducible, and portable development environments.
> More information: <https://www.vagrantup.com>.
> Some subcommands such as `box`, `snapshot`, `halt`, etc. have their own usage documentation.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli>.
- Create Vagrantfile in current directory with the base Vagrant box:
- Create a `Vagrantfile` in the current directory with the base Vagrant box:
`vagrant init`
- Create Vagrantfile with the Ubuntu 20.04 (Focal Fossa) box from HashiCorp Atlas:
- Create a `Vagrantfile` with a box from the Vagrant Public Registry:
`vagrant init ubuntu/focal64`
`vagrant init {{ubuntu/focal64}}`
- Start and provision the vagrant environment:
- Start and provision the Vagrant environment:
`vagrant up`
@@ -28,7 +29,7 @@ source: https://github.com/tldr-pages/tldr.git
`vagrant halt`
- Connect to machine via SSH:
- Connect to the machine via SSH:
`vagrant ssh`

30
tldr/vagrant-snapshot Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant snapshot
> Manage snapshots of Vagrant machines.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/snapshot>.
- Take a snapshot of the machine (running or stopped):
`vagrant snapshot save {{snapshot_name}}`
- Restore a snapshot and start the machine:
`vagrant snapshot restore {{snapshot_name}}`
- Restore a snapshot without starting the machine:
`vagrant snapshot restore --no-start {{snapshot_name}}`
- Delete a snapshot:
`vagrant snapshot delete {{snapshot_name}}`
- List available snapshots of the machine:
`vagrant snapshot list`