### Example CloudPanel Installation with MariaDB 10.11 Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/vultr/installation/installer.md Executes the CloudPanel installer script after verifying its SHA256 checksum, specifying Vultr as the cloud provider and MariaDB 10.11 as the database engine. This command is an example of a full installation. ```bash sha256sum -c && sudo CLOUD=vultr DB_ENGINE=MARIADB_10.11 bash install.sh ``` -------------------------------- ### Install Magento 2 via CLI Setup Script Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/magento.md Run the Magento setup:install script to complete the installation. Customize parameters such as backend frontname, encryption key, database details, base URLs, and admin user credentials according to your setup. ```bash php8.4 bin/magento setup:install --backend-frontname='admin' --key='18Av6ITivOZG3gwY1DhMDWtlLfx1spLP' --session-save='files' --db-host='127.0.0.1' --db-name='magento2' --db-user='magento2' --db-password='magento2' --base-url='https://www.domain.com/' --base-url-secure='https://www.domain.com/' --admin-user='admin' --admin-password='!admin123!' --admin-email='john@doe.com' --admin-firstname='John' --admin-lastname='Doe' ``` -------------------------------- ### Execute CloudPanel v1 Installation Script Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/getting-started/installation-other.md Run this command to download and execute the official CloudPanel v1 installer script, which will automate the setup process on your server. ```bash curl -sSL https://installer.cloudpanel.io/ce/v1/install.sh | sudo bash ``` -------------------------------- ### Execute Magento setup:install Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/magento-2.md Runs the Magento setup installation script, configuring the backend, database connection, base URLs, and initial admin user details. Parameters such as database credentials, URLs, and admin user information must be customized to your specific environment. ```php php7.4 bin/magento setup:install --backend-frontname='admin' --key='18Av6ITivOZG3gwY1DhMDWtlLfx1spLP' --session-save='files' --db-host='127.0.0.1' --db-name='magento2' --db-user='magento2' --db-password='magento2' --base-url='https://www.domain.com/' --base-url-secure='https://www.domain.com/' --admin-user='admin' --admin-password='!admin123!' --admin-email='john@doe.com' --admin-firstname='John' --admin-lastname='Doe' ``` -------------------------------- ### Get Started with Consola Logging Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/consola/README.md Basic example demonstrating how to import Consola and use its various log types like success, info, and error. ```javascript const consola = require('consola') // See types section for all available types consola.success('Built!') consola.info('Reporter: Some info') consola.error(new Error('Foo')) ``` -------------------------------- ### Building ES Module Lexer Project Setup Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/es-module-lexer/README.md This snippet provides a step-by-step guide for setting up the development environment and building the es-module-lexer project. It includes commands for cloning repositories, installing Emscripten SDK, downloading and extracting WASI SDK, and installing Chomp build tool, culminating in running tests. ```shell git clone https://github.com:guybedford/es-module-lexer git clone https://github.com/emscripten-core/emsdk cd emsdk git checkout 1.40.1-fastcomp ./emsdk install 1.40.1-fastcomp cd .. wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz gunzip wasi-sdk-12.0-linux.tar.gz tar -xf wasi-sdk-12.0-linux.tar mv wasi-sdk-12.0-linux.tar wasi-sdk-12.0 cargo install chompbuild cd es-module-lexer chomp test ``` -------------------------------- ### Create TYPO3 FIRST_INSTALL File Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/typo3.md Create an empty `FIRST_INSTALL` file within the TYPO3 public directory using the `touch` command. This file signals the TYPO3 installer to begin the web-based setup wizard upon browser access. ```bash touch ~/htdocs/www.domain.com/public/FIRST_INSTALL ``` -------------------------------- ### Moodle 3 Installation Steps on CloudPanel Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/moodle-3.md A sequence of shell commands to perform the installation of Moodle 3 on a CloudPanel server, including navigating to the temporary directory, downloading and extracting Moodle files, moving them to the domain's htdocs, resetting file permissions, and cleaning up temporary files. ```bash cd ~/tmp ``` ```bash curl -sL https://download.moodle.org/download.php/direct/stable311/moodle-latest-311.tgz | tar xfz - ``` ```bash cp -R moodle/* /home/cloudpanel/htdocs/www.domain.com/ ``` ```bash cd /home/cloudpanel/htdocs/ clpctl system:permissions:reset www.domain.com 775 ``` ```bash rm -rf ~/tmp/* ``` -------------------------------- ### SockJS Client Development Environment Setup Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/sockjs-client/README.md Provides initial setup instructions for the SockJS client development environment, including navigating to the project directory and installing necessary Node.js dependencies. ```Shell cd sockjs-client npm install ``` -------------------------------- ### http-proxy Shorthand Configuration Examples Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/http-proxy-middleware/README.md These JavaScript examples illustrate the shorthand syntax for configuring http-proxy. This simplified approach automatically sets the context and option.target based on the provided URL, making it convenient for basic proxy setups. Additional options can still be applied alongside the shorthand. ```javascript proxy('http://www.example.org:8000/api') // proxy('/api', {target: 'http://www.example.org:8000'}); proxy('http://www.example.org:8000/api/books/*/**.json') // proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'}); proxy('http://www.example.org:8000/api', { changeOrigin: true }) // proxy('/api', {target: 'http://www.example.org:8000', changeOrigin: true}); ``` -------------------------------- ### Install Uncomplicated Firewall (ufw) Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/guides/cloudflare/setup.md This command installs the 'ufw' package, a user-friendly frontend for managing iptables firewall rules, on Debian-based systems. ```bash apt update && apt -y install ufw ``` -------------------------------- ### Set up development environment for multicast-dns Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/multicast-dns/README.md Instructions for cloning the repository, installing dependencies, and running example scripts for development and testing purposes. ```Shell git clone git://github.com/mafintosh/multicast-dns.git npm install node example.js node cli.js $(hostname).local ``` -------------------------------- ### Set Up Autocomplete.js Development Environment Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/autocomplete.js/CONTRIBUTING.md Commands to install dependencies, start the local development server, and open the playground for Autocomplete.js. ```sh yarn yarn dev open http://localhost:8888/test/playground.html ``` -------------------------------- ### Mautic 4 Installation Steps with CloudPanel Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/mautic-4.md A step-by-step guide to installing Mautic 4 on a CloudPanel server, including preparing the environment, cloning the repository, installing dependencies, and setting permissions. ```bash cd /home/cloudpanel/htdocs/ ``` ```bash rm -rf /home/cloudpanel/htdocs/www.domain.com ``` ```bash git clone -b 4.0.0 https://github.com/mautic/mautic.git /home/cloudpanel/htdocs/www.domain.com ``` ```bash cd /home/cloudpanel/htdocs/www.domain.com/ php7.4 /usr/local/bin/composer install ``` ```bash cd /home/cloudpanel/htdocs/ clpctl system:permissions:reset www.domain.com 775 ``` -------------------------------- ### Development Setup for JSON5 Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/json5/README.md Steps to set up the JSON5 project for development, including cloning the repository, navigating into the directory, and installing dependencies. Essential for contributing to the project. ```sh git clone https://github.com/json5/json5 cd json5 npm install ``` -------------------------------- ### Create or edit Ghost start script file with Nano Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/nodejs/applications/ghost.md Command to open or create the 'ghost-start.sh' file in the 'scripts' directory using the Nano text editor. This file will contain the bash script responsible for starting the Ghost application. ```bash nano ~/scripts/ghost-start.sh ``` -------------------------------- ### Install Colord Library via npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md This command installs the 'colord' library using npm, making it available for use in your JavaScript or TypeScript project. ```bash npm i colord ``` -------------------------------- ### Install Acorn via npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/acorn/README.md This command installs the Acorn JavaScript parser using the Node Package Manager (npm). It's the easiest and recommended way to get started with Acorn. ```sh npm install acorn ``` -------------------------------- ### Install and Use Opener from Command Line Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/opener/README.md This snippet demonstrates how to install the 'opener' utility globally using npm and then use it from the command line to open URLs, local files, applications, or execute npm scripts. It provides cross-platform functionality for opening various types of content. ```bash npm install opener -g opener http://google.com opener ./my-file.txt opener firefox opener npm run lint ``` -------------------------------- ### Quick Start: Get MIME Type and Extension (Full Version) Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/webpack-dev-middleware/node_modules/mime/README.md Provides a quick example of how to use the full 'mime' module in Node.js. It demonstrates getting a MIME type from an extension and an extension from a MIME type. ```javascript const mime = require('mime'); mime.getType('txt'); // ⇨ 'text/plain' mime.getExtension('text/plain'); // ⇨ 'txt' ``` -------------------------------- ### Basic Colord Library Usage Examples in JavaScript Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md These JavaScript examples demonstrate how to import the 'colord' library and perform common color manipulations such as converting to grayscale, adjusting alpha, checking lightness, and darkening a color, then converting to different string formats. ```javascript import { colord } from "colord"; colord("#ff0000").grayscale().alpha(0.25).toRgbString(); // "rgba(128, 128, 128, 0.25)" colord("rgb(192, 192, 192)").isLight(); // true colord("hsl(0, 50%, 50%)").darken(0.25).toHex(); // "#602020" ``` -------------------------------- ### Build Project Documentation Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/snapdragon-util/node_modules/kind-of/README.md This command installs the necessary tools globally and then runs 'verb' to generate the project's readme file from its template. It ensures the documentation is up-to-date. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Run an Express.js Example Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/express/Readme.md Executes a specific example from the Express.js repository, demonstrating a feature like content negotiation. ```console $ node examples/content-negotiation ``` -------------------------------- ### Initialize a new Snapdragon instance Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/snapdragon/README.md Basic setup for using Snapdragon by requiring the module and creating a new instance. This is the first step before using its parsing or compiling capabilities. ```js var Snapdragon = require('snapdragon'); var snapdragon = new Snapdragon(); ``` -------------------------------- ### Install Execa via npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@docusaurus/plugin-content-docs/node_modules/execa/readme.md Instructions on how to install the Execa library using the npm package manager. ```bash $ npm install execa ``` -------------------------------- ### Log in to Server via SSH Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/fuelphp.md Use this command to establish an SSH connection to your server as the designated site user. This is the first step to perform manual project setup tasks. ```bash ssh john-doe@server-ip-address ``` -------------------------------- ### Build project documentation Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/kind-of/README.md This command installs the necessary global tools for documentation generation and then runs the 'verb' command to build the project's readme file from its template. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### SSH Login to Server with Site User Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/mautic.md Log in to the server via SSH using the specific site user account to gain access to the site's directory for further project setup and command execution. ```bash ssh john-doe@server-ip-address ``` -------------------------------- ### Initialize dploy Project Structure for Various Applications Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/dploy/installation.md Initializes the dploy project by creating the ~/.dploy directory, config.yml, and the project directory structure. It downloads a pre-configured config file based on the specified application template from the templates repository. This command should be run as the site user and requires a Git Repository SSH URL and Deploy Directory as input. ```bash dploy init ``` ```bash dploy init laravel ``` ```bash dploy init symfony ``` ```bash dploy init magento2 ``` ```bash dploy init wordpress ``` ```bash dploy init woocommerce ``` ```bash dploy init ghost ``` ```bash dploy init static-html-site ``` ```bash dploy init python ``` -------------------------------- ### Generate Random Colors with Colord Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Demonstrates how to use the `random()` function from the `colord` library to generate new Colord instances with random color values. Examples show conversion to hexadecimal and RGBA formats. ```js import { random } from "colord"; random().toHex(); // "#01c8ec" random().alpha(0.5).toRgb(); // { r: 13, g: 237, b: 162, a: 0.5 } ``` -------------------------------- ### Create Mautic Site using CloudPanel CLI Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/mautic.md Use the CloudPanel command-line interface as a root user to quickly provision a new Mautic 6 PHP site, specifying the domain, PHP version, vhost template, and site user credentials. ```bash clpctl site:add:php --domainName=www.domain.com --phpVersion=8.2 --vhostTemplate='Mautic 6' --siteUser='john-doe' --siteUserPassword='!secretPassword!' ``` -------------------------------- ### Get hue value with .hue() Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md No description ```js colord("hsl(90, 50%, 50%)").hue(); // 90 colord("hsl(-10, 50%, 50%)").hue(); // 350 ``` -------------------------------- ### Get alpha value with .alpha() Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md No description ```js colord("#ffffff").alpha(); // 1 colord("rgba(50, 100, 150, 0.5)").alpha(); // 0.5 ``` -------------------------------- ### Build and Test Project Components Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/nprogress/Notes.md This section details the process for building and testing individual components. It involves installing component dependencies, initiating the build process, and then opening the component's dedicated test page in a browser. ```shell component install component build open test/component.html ``` -------------------------------- ### Minify Color String Representations with Colord Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Illustrates the usage of the `.minify()` method to convert a color to its shortest string representation. It requires extending `colord` with the `minify` plugin. Examples cover various color formats and an option for alpha hex. ```js import { colord, extend } from "colord"; import minifyPlugin from "colord/plugins/minify"; extend([minifyPlugin]); colord("black").minify(); // "#000" colord("#112233").minify(); // "#123" colord("darkgray").minify(); // "#a9a9a9" colord("rgba(170,170,170,0.4)").minify(); // "hsla(0,0%,67%,.4)" colord("rgba(170,170,170,0.4)").minify({ alphaHex: true }); // "#aaa6" ``` -------------------------------- ### Ghost startup script with NVM and background execution Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/nodejs/applications/ghost.md Bash script content for starting the Ghost application. It loads NVM (Node Version Manager) to ensure the correct Node.js environment, then starts Ghost from a specified directory, redirects output to a log file, and runs it in the background. ```bash #!/bin/bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm ghost start --dir $HOME/htdocs/ghost.moby.io/ --no-setup-linux-user > $HOME/logs/ghost.log & ``` -------------------------------- ### Install FuelPHP Dependencies via Composer Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/fuelphp.md Navigate to your site's document root and then execute Composer to install all required PHP dependencies for FuelPHP. The '-n' flag ensures a non-interactive installation. ```bash cd ~/htdocs/www.domain.com/ php7.2 /usr/local/bin/composer install -n ``` -------------------------------- ### Support CIE XYZ Color Space with Colord Plugin Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Adds support for the CIE XYZ color model. The conversion logic is ported from the CSS Color Module Level 4 Specification. It shows examples of converting colors to and from the XYZ color space. ```js import { colord, extend } from "colord"; import xyzPlugin from "colord/plugins/xyz"; extend([xyzPlugin]); colord("#ffffff").toXyz(); // { x: 95.047, y: 100, z: 108.883, a: 1 } colord({ x: 0, y: 0, z: 0 }).toHex(); // "#000000" ``` -------------------------------- ### Install enhanced-resolve Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/enhanced-resolve/README.md Instructions for installing the enhanced-resolve package using npm or Yarn, providing the necessary commands for project setup. ```sh # npm npm install enhanced-resolve # or Yarn yarn add enhanced-resolve ``` -------------------------------- ### Build documentation with verb-generate-readme Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/object.pick/README.md This command installs the necessary global packages (`verb` and `verb-generate-readme`) and then runs `verb` to generate the readme and API documentation for the project based on its configuration. ```sh $ npm install -g verb verb-generate-readme && verb ``` -------------------------------- ### Install Ghost CLI globally using npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/nodejs/applications/ghost.md Command to install the latest version of the Ghost command-line interface globally via npm. This CLI tool is essential for managing Ghost installations, including setup and updates. ```bash npm install ghost-cli@latest -g ``` -------------------------------- ### Install Mautic Dependencies with Composer Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/mautic.md Change the current directory to the cloned Mautic project and install all required PHP dependencies using Composer, specifying PHP version 8.2. ```bash cd ~/htdocs/www.domain.com/ php8.2 /usr/local/bin/composer install ``` -------------------------------- ### Run Project Unit Tests Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/snapdragon-util/node_modules/kind-of/README.md This command installs all project dependencies and then executes the unit tests. It's recommended for familiarizing oneself with the library and its API. ```sh $ npm install && npm test ``` -------------------------------- ### Verify clean-css Project Installation Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/clean-css/README.md Commands to run various verification tasks for the clean-css project, including benchmarks, browserify build, linting with JSHint, and running all tests. ```bash npm run bench # for clean-css benchmarks (see [test/bench.js](https://github.com/clean-css/clean-css/blob/master/test/bench.js) for details) npm run browserify # to create the browser-ready clean-css version npm run check # to lint JS sources with [JSHint](https://github.com/jshint/jshint/) npm test # to run all tests ``` -------------------------------- ### Install Ghost project with MySQL and custom settings Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/nodejs/applications/ghost.md Command to install a Ghost project, configuring it to use a MySQL database with specified credentials, port, and installation directory. It also disables default setup for Linux user, SSL, and Nginx, as these are handled by CloudPanel. ```bash ghost install --db mysql --port 2368 \ --dbhost 127.0.0.1 \ --dbuser $DATABASE_USER_NAME \ --dbpass $DATABASE_USER_PASSWORD \ --dbname $DATABASE_NAME \ --process local \ --no-setup-linux-user \ --no-setup-ssl \ --no-setup-nginx \ --dir /home/$SITE_USER/htdocs/$DOMAIN/ ``` -------------------------------- ### Run CloudPanel Installer with Database Engine Selection Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/hetzner-cloud/installation/installer.md Download the CloudPanel installer script, verify its integrity using SHA256 checksum, and then execute it. The installation can be customized by specifying the desired Linux distribution and database engine via environment variables. ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_11.4 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_10.11 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_10.6 bash install.sh ``` -------------------------------- ### Run CloudPanel Installer with Database Engine Selection on Debian 11 Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/digital-ocean/installation/installer.md These commands initiate the CloudPanel installation process. They download the installer script, verify its integrity using SHA256, and then execute it. Each variant specifies a different database engine (MySQL 8.0, MySQL 5.7, MariaDB 11.4, MariaDB 10.11, or MariaDB 10.6) for CloudPanel to use. The `CLOUD=do` parameter is set for DigitalOcean environments. ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=do bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=do DB_ENGINE=MYSQL_5.7 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=do DB_ENGINE=MARIADB_11.4 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=do DB_ENGINE=MARIADB_10.11 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=do DB_ENGINE=MARIADB_10.6 bash install.sh ``` -------------------------------- ### Run EventSource example server and clients Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/eventsource/README.md Steps to set up and run the provided EventSource server and client examples, including a Node.js client, a browser client, and a curl command for direct SSE interaction. ```shell npm install node ./example/sse-server.js node ./example/sse-client.js # Node.js client open http://localhost:8080 # Browser client - both native and polyfill curl http://localhost:8080/sse # Enjoy the simplicity of SSE ``` -------------------------------- ### Measure HTTP Request Timings with http-timer Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@szmarczak/http-timer/README.md This JavaScript example demonstrates how to use the `@szmarczak/http-timer` module to capture and log detailed timing information for an HTTP GET request. It shows the setup, making a request, and consuming the response to ensure the 'end' event fires, revealing the `timings` object with various timing points and calculated phases. ```javascript 'use strict'; const https = require('https'); const timer = require('@szmarczak/http-timer'); const request = https.get('https://httpbin.org/anything'); const timings = timer(request); request.on('response', response => { response.on('data', () => {}); // Consume the data somehow response.on('end', () => { console.log(timings); }); }); ``` -------------------------------- ### Login to Instance via SSH Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/vultr/installation/installer.md Connects to the server instance using SSH. Replace 'path_to_your_private_key' with the actual path to your private key file and 'serverIpAddress' with the server's IP address. ```bash ssh -i path_to_your_private_key root@serverIpAddress ``` -------------------------------- ### Clone Express.js Repository and Install Dependencies Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/express/Readme.md Clones the Express.js GitHub repository and installs its development dependencies, useful for running examples or contributing. ```console $ git clone git://github.com/expressjs/express.git --depth 1 $ cd express $ npm install ``` -------------------------------- ### Custom Comment Removal with `remove` Function Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/postcss-discard-comments/README.md Example demonstrating how to use the `remove` option with a custom function to selectively remove comments. This example removes comments that start with '@'. ```javascript var css = '/* headings *//*@ h1 */h1{margin:0 auto}/*@ h2 */h2{color:red}'; console.log(postcss(comments({ remove: function(comment) { return comment[0] == "@"; } })).process(css).css); //=> /* headings */h1{margin:0 auto}h2{color:red} ``` -------------------------------- ### Make Axios Requests with URL and Optional Config Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/axios/README.md An example of making a GET request by directly passing the URL to the `axios` function. This is a simplified syntax for common GET operations. ```js // Send a GET request (default method) axios('/user/12345'); ``` -------------------------------- ### Generate Project Readme Documentation Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/to-regex-range/README.md This command installs the necessary tools globally and then runs the `verb` command to generate the project's `readme.md` file from its template. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Install @babel/plugin-transform-shorthand-properties using yarn Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@babel/plugin-transform-shorthand-properties/README.md This command installs the @babel/plugin-transform-shorthand-properties plugin as a development dependency using yarn. It serves as an alternative package manager to npm for project setup. ```sh yarn add @babel/plugin-transform-shorthand-properties --dev ``` -------------------------------- ### Generate project documentation with Verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/repeat-string/README.md Commands to install the necessary Verb tools globally and then run Verb to generate the project's readme and API documentation from source files. ```sh $ npm install -g verb verb-generate-readme && verb ``` -------------------------------- ### Clean Up Temporary Directory Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/fuelphp.md After successfully installing FuelPHP, this command removes all temporary files and directories from the `~/tmp` folder. This helps in keeping the server clean and organized. ```bash rm -rf ~/tmp/* ``` -------------------------------- ### Create Slim Project using Composer Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/slim.md Initializes a new Slim project within the specified domain directory using Composer. This command downloads the Slim skeleton application and sets up the project structure. ```bash php8.2 /usr/local/bin/composer create-project slim/slim-skeleton:~4 www.domain.com ``` -------------------------------- ### Run CloudPanel Installer with Specific Database Engine Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/hetzner-cloud/installation/installer.md Downloads the CloudPanel installer script, verifies its SHA256 checksum, and then executes it with sudo. The commands specify Hetzner as the cloud provider and allow selection of a particular database engine (MySQL or MariaDB) for the CloudPanel installation. ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MYSQL_5.7 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_11.4 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_10.11 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo CLOUD=hetzner DB_ENGINE=MARIADB_10.6 bash install.sh ``` -------------------------------- ### JavaScript: Example Usage of stringifyInfo Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@discoveryjs/json-ext/README.md Provides a simple example demonstrating how to use `stringifyInfo` to get the `minLength` property of a stringified JSON object, which represents its minimal byte length. ```JavaScript const { stringifyInfo } = require('@discoveryjs/json-ext'); console.log( stringifyInfo({ test: true }).minLength ); // > 13 // that equals '{\"test\":true}'.length ``` -------------------------------- ### Install Dependencies and Run Unit Tests Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/snapdragon-util/README.md This command first installs all project dependencies listed in `package.json` and then executes the defined test scripts. It's essential for verifying the library's functionality and API integrity. ```sh $ npm install && npm test ``` -------------------------------- ### Retrieve Neos setup password Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/neos-7.md Display the content of the SetupPassword.txt file, which contains the one-time password required to access and complete the Neos web-based installation wizard. ```bash cat /home/cloudpanel/htdocs/www.domain.com/Data/SetupPassword.txt ``` -------------------------------- ### Update and Start Laravel Supervisor Worker Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/laravel-7.md Instructs Supervisor to reread its configuration files, update its internal process list, and then start the defined `laravel-worker` process. ```bash supervisorctl reread supervisorctl update supervisorctl start laravel-worker:* ``` -------------------------------- ### Install Keyv Storage Adapters Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/keyv/README.md These commands install various official storage adapters for Keyv, allowing you to use different databases like Redis, MongoDB, SQLite, PostgreSQL, and MySQL as your key-value store backend. ```bash npm install --save @keyv/redis npm install --save @keyv/mongo npm install --save @keyv/sqlite npm install --save @keyv/postgres npm install --save @keyv/mysql ``` -------------------------------- ### Install Supervisor Daemon Manager Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/laravel-7.md Installs the Supervisor process control system on the server, which is used to manage long-running PHP scripts like Laravel queues. ```bash apt install -y supervisor ``` -------------------------------- ### Basic Express.js Hello World Application Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/express/Readme.md Demonstrates how to create a simple 'Hello World' web server using Express.js, listening on port 3000. ```js const express = require('express') const app = express() app.get('/', function (req, res) { res.send('Hello World') }) app.listen(3000) ``` -------------------------------- ### Build Project Documentation with Verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/http-proxy-middleware/node_modules/to-regex-range/README.md This command installs the necessary `verb` and `verb-generate-readme` tools globally, then runs `verb` to generate the project's `readme.md` file from its template. It ensures the documentation is up-to-date. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Install Mime Module via NPM Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/webpack-dev-middleware/node_modules/mime/README.md Instructions on how to install the 'mime' module using Node Package Manager (NPM). This is the recommended way to get the module for Node.js projects. ```shell npm install mime ``` -------------------------------- ### Start Test Server for Browser Testing Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/lunr/CONTRIBUTING.md Launch a local server to run tests directly in a web browser. The server will be accessible on port 3000, and tests can be viewed at the `/test` endpoint. ```Shell make server ``` -------------------------------- ### Install TypeScript Definitions for Commander.js Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/html-minifier-terser/node_modules/commander/Readme.md Instructions for installing TypeScript definition files for the Commander.js package and the necessary Node.js types. It also provides an example of how to correctly run `ts-node` with git-style sub-commands. ```bash npm install commander npm install --save-dev @types/node ``` ```bash node -r ts-node/register pm.ts ``` -------------------------------- ### Get ArrayBuffer byte length in JavaScript Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/array-buffer-byte-length/README.md Demonstrates how to use the 'array-buffer-byte-length' module to get the byte length of an ArrayBuffer. It shows examples for a valid ArrayBuffer and a non-ArrayBuffer input (an array) to illustrate its behavior. ```js const assert = require('assert'); const byteLength = require('array-buffer-byte-length'); assert.equal(byteLength([]), NaN, 'an array is not an ArrayBuffer, yields NaN'); assert.equal(byteLength(new ArrayBuffer(0)), 0, 'ArrayBuffer of byteLength 0, yields 0'); ``` -------------------------------- ### Build Documentation with Verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/object-copy/node_modules/kind-of/README.md Instructions to install necessary tools and generate the project's readme file using Verb, a documentation generation tool. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Install and Run Braces Benchmarks Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/braces/README.md Instructions to install the necessary development dependencies and then execute the performance benchmarks for the 'braces' library. This allows users to verify the performance claims independently. ```bash npm i -d && npm benchmark ``` -------------------------------- ### Get brightness with .brightness() Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Returns the brightness of a color (from 0 to 1). The calculation logic is modified from [Web Content Accessibility Guidelines](https://www.w3.org/TR/AERT/#color-contrast). ```js colord("#000000").brightness(); // 0 colord("#808080").brightness(); // 0.5 colord("#ffffff").brightness(); // 1 ``` -------------------------------- ### Execute Current Package's Binary with get-bin-path Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@docusaurus/plugin-content-docs/node_modules/execa/readme.md Explains how to execute the current package's binary using `execa` combined with `get-bin-path`. This method validates the `package.json` `bin` field setup, avoiding hard-coded paths. ```javascript const {getBinPathSync} = require('get-bin-path'); const binPath = getBinPathSync(); const subprocess = execa(binPath); ``` -------------------------------- ### Development: Setting Up JSON5 Project Locally Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@docusaurus/plugin-content-docs/node_modules/json5/README.md Steps to set up the JSON5 project for local development. This involves cloning the repository, navigating into the project directory, and installing all necessary dependencies. ```sh git clone https://github.com/json5/json5 cd json5 npm install ``` -------------------------------- ### Install and use cssesc with Ruby Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/cssesc/README.md Instructions to install the `ruby-cssesc` wrapper gem and an example of how to use its `CSSEsc.escape` method in Ruby. This allows Ruby applications to leverage CSS escaping functionality. ```bash gem install ruby-cssesc ``` ```ruby require 'ruby-cssesc' CSSEsc.escape('I ♥ Ruby', is_identifier: true) ``` -------------------------------- ### Install Babel Loader and Dependencies Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/babel-loader/README.md Installs babel-loader, @babel/core, @babel/preset-env, and webpack as development dependencies using npm. This setup is compatible with webpack 4.x/5.x, babel-loader 8.x, and babel 7.x. ```bash npm install -D babel-loader @babel/core @babel/preset-env webpack ``` -------------------------------- ### Build project documentation with verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/snapdragon-node/node_modules/define-property/README.md This command installs the necessary tools globally and then runs `verb` to generate the project's `readme.md` file from its template. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Mix Colors with Colord Plugin using LAB Color Space Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md A plugin adding color mixing utilities. Unlike other libraries that mix RGB values, Colord mixes colors through LAB color space, producing better results. It shows examples of mixing two colors and also provides special mixtures like tints, shades, and tones. ```js import { colord, extend } from "colord"; import mixPlugin from "colord/plugins/mix"; extend([mixPlugin]); colord("#ffffff").mix("#000000").toHex(); // "#777777" colord("#800080").mix("#dda0dd").toHex(); // "#af5cae" colord("#cd853f").mix("#eee8aa", 0.6).toHex(); // "#e3c07e" colord("#008080").mix("#808000", 0.35).toHex(); // "#50805d" ``` ```js const color = colord("#ff0000"); color.tints(3).map((c) => c.toHex()); // ["#ff0000", "#ff9f80", "#ffffff"]; color.shades(3).map((c) => c.toHex()); // ["#ff0000", "#7a1b0b", "#000000"]; color.tones(3).map((c) => c.toHex()); // ["#ff0000", "#c86147", "#808080"]; ``` -------------------------------- ### Check if color is dark with .isDark() Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Same as calling `brightness() < 0.5`. ```js colord("#111111").isDark(); // true colord("#aabbcc").isDark(); // false colord("#ffffff").isDark(); // false ``` -------------------------------- ### Check if color is light with .isLight() Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Same as calling `brightness() >= 0.5`. ```js colord("#111111").isLight(); // false colord("#aabbcc").isLight(); // true colord("#ffffff").isLight(); // true ``` -------------------------------- ### Generate project documentation with verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/object-visit/README.md This command installs the necessary tools (`verb` and `verb-generate-readme`) globally and then runs `verb` to generate the project's readme file based on its template. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### API Reference for 'open' package Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/open/readme.md This section details the API of the 'open' package, which uses platform-specific commands like `open` on macOS, `start` on Windows, and `xdg-open` on other platforms. It describes the main `open(target, options?)` function, its parameters, and return value. ```APIDOC open(target, options?) Returns: Promise Description: Returns a promise for the spawned child process. Parameters: target: Type: string Description: The thing you want to open. Can be a URL, file, or executable. Opens in the default app for the file type. options: Type: object Properties: wait: Type: boolean Default: false Description: Wait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app. Note that it waits for the app to exit, not just for the window to close. On Windows, you have to explicitly specify an app for it to be able to wait. background (macOS only): Type: boolean Default: false Description: Do not bring the app to the foreground. app: Type: string | string[] Description: Specify the app to open the `target` with, or an array with the app and app arguments. The app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows. You may also pass in the app's full path. For example on WSL, this can be `/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe` for the Windows installation of Chrome. url: Type: boolean Default: false Description: Uses `URL` to encode the target before executing it. We do not recommend using it on targets that are not URLs. Especially useful when dealing with the double-quotes on Windows caveat. allowNonzeroExitCode: Type: boolean Default: false Description: Allow the opened app to exit with nonzero exit code when the `wait` option is `true`. We do not recommend setting this option. The convention for success is exit code zero. ``` -------------------------------- ### Install kind-of with Bower Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/http-proxy-middleware/node_modules/is-number/node_modules/kind-of/README.md Instructions to install the `kind-of` library using the Bower package manager. This command adds `kind-of` as a dependency to your project, suitable for front-end web development. ```sh $ bower install kind-of --save ``` -------------------------------- ### Update Linux System and Install Core Packages Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/hetzner-cloud/installation/installer.md Update your system's package list and upgrade existing packages. Then, install essential tools like 'curl', 'wget', and 'sudo' required for the CloudPanel installation script. ```bash apt update && apt -y upgrade && apt -y install curl wget sudo ``` -------------------------------- ### Install uuid module using npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/webpack-log/node_modules/uuid/README.md This command installs the 'uuid' package, a simple and fast generator for RFC4122 UUIDs, into your project dependencies. It's the first step to start using the module in a CommonJS environment. ```shell npm install uuid ``` -------------------------------- ### SSH Login for Matomo Project Setup Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/matomo.md Initiate the Matomo project setup by logging into the server via SSH using the dedicated site user credentials, which is the first step for command-line operations. ```bash ssh john-doe@server-ip-address ``` -------------------------------- ### Install CloudPanel with Database Engine Source: https://github.com/cloudpanel-io/docs/blob/master/v2/tmp/other.md Run the CloudPanel installer script for your chosen operating system and database engine. The script downloads and sets up CloudPanel, configuring it with the specified database. Ensure you select the correct command for your environment. ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.9 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.8 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.6 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MYSQL_5.7 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.9 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.8 bash ``` ```bash curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo DB_ENGINE=MARIADB_10.7 bash ``` -------------------------------- ### Run Project Tests and Open in Browser Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/nprogress/Notes.md This snippet provides commands to install dependencies and run tests for the project using npm. It also includes an option to open the test results directly in a web browser for visual inspection. ```shell npm install npm test ``` ```shell open test/index.html ``` -------------------------------- ### Generate project documentation with Verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/map-visit/README.md This command installs the necessary Verb packages globally and then runs Verb to generate the project's `readme.md` file from its template. It ensures the documentation is up-to-date with the project's configuration. ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Install kind-of with npm Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/http-proxy-middleware/node_modules/is-number/node_modules/kind-of/README.md Instructions to install the `kind-of` library using the npm package manager. This command adds `kind-of` as a dependency to your project, making it available for use in your JavaScript applications. ```sh $ npm install --save kind-of ``` -------------------------------- ### Install dependencies and run unit tests Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/nanomatch/README.md This command installs all necessary project dependencies and then executes the comprehensive suite of unit tests to ensure the library's functionality and stability. ```sh $ npm install && npm test ``` -------------------------------- ### Install and use cssesc with Sass Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/cssesc/README.md Instructions to install the `sassy-escape` gem and an example of how to use its `escape` function within Sass stylesheets. This enables CSS escaping directly within your Sass compilation process. ```bash gem install sassy-escape ``` ```scss body { content: escape('I ♥ Sass', $is-identifier: true); } ``` -------------------------------- ### Install Python 3.8 via PPA on Ubuntu Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/python/guides/adding-a-python-version.md This command updates the package list again and then installs Python 3.8 from the newly added 'deadsnakes/ppa' repository. This method ensures you get the latest updates for Python 3.8. ```bash apt update && apt -y install python3.8 ``` -------------------------------- ### Install @ampproject/remapping Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@ampproject/remapping/README.md Provides instructions on how to install the @ampproject/remapping library using npm. ```sh npm install @ampproject/remapping ``` -------------------------------- ### JavaScript Example: Get Original Position for Generated Code Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/remark-mdx/node_modules/source-map/README.md Demonstrates how to use `originalPositionFor` to find the original source location given a line and column in the generated code. Includes examples for valid and out-of-bounds inputs. ```JavaScript consumer.originalPositionFor({ line: 2, column: 10 }) // { source: 'foo.coffee', // line: 2, // column: 2, // name: null } consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) // { source: null, // line: null, // column: null, // name: null } ``` -------------------------------- ### Run Brace Expansion Benchmarks Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/http-proxy-middleware/node_modules/braces/README.md Instructions to install development dependencies and execute the performance benchmarks for brace expansion libraries. ```bash npm i -d && npm benchmark ``` -------------------------------- ### Get command from shebang string in JavaScript Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/execa/node_modules/shebang-command/readme.md This JavaScript example demonstrates how to use the 'shebang-command' module to extract the command from a shebang string. It shows how to require the module and provides examples for common shebang formats, illustrating the expected output. ```javascript const shebangCommand = require('shebang-command'); shebangCommand('#!/usr/bin/env node'); //=> 'node' shebangCommand('#!/bin/bash'); //=> 'bash' ``` -------------------------------- ### Prepare Environment for Yii Project Creation Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/php/applications/yii.md These commands guide the site user through logging into the server via SSH, navigating to the htdocs directory, and removing any pre-existing site directories created by CloudPanel. This prepares the environment for a fresh Yii project installation. ```bash ssh john-doe@server-ip-address ``` ```bash cd htdocs && rm -rf www.domain.com ``` -------------------------------- ### Asynchronous directory walk with Readable Stream using fsWalk.walkStream examples Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/@nodelib/fs.walk/README.md Examples of calling `fsWalk.walkStream` to get a Readable Stream for recursive directory traversal, showing usage with just a path, an empty options object, and a Settings instance. ```ts const stream = fsWalk.walkStream('path'); const stream = fsWalk.walkStream('path', {}); const stream = fsWalk.walkStream('path', new fsWalk.Settings()); ``` -------------------------------- ### Quick Start Examples for detect-port CLI Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/react-dev-utils/node_modules/detect-port-alt/README.md These examples demonstrate basic usage of the detect-port command-line tool. You can find a random available port, check a specific port, or display the help message for more options. ```shell # get an available port randomly $ detect # detect pointed port $ detect 80 # more help $ detect --help ``` -------------------------------- ### Deploy Application Branch with Dploy Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/dploy/installation.md Execute the `dploy deploy` command to deploy a specific branch (e.g., 'main') of the application to the server. This initiates the deployment process, including cloning the repository and setting up symlinks. ```bash dploy deploy main ``` -------------------------------- ### Build documentation with verb Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/map-cache/README.md These commands show how to generate readme and API documentation using the `verb` tool. The first command installs `verb` and runs the docs script, while the second assumes `verb` is globally installed. ```sh $ npm install verb && npm run docs ``` ```sh $ verb ``` -------------------------------- ### Get luminance with .luminance() (a11y plugin) Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Returns the relative luminance of a color, normalized to 0 for darkest black and 1 for lightest white as defined by [WCAG 2.0](https://www.w3.org/TR/WCAG20/#relativeluminancedef). ```js colord("#000000").luminance(); // 0 colord("#808080").luminance(); // 0.22 colord("#ccddee").luminance(); // 0.71 colord("#ffffff").luminance(); // 1 ``` -------------------------------- ### Create FIRST_INSTALL file for TYPO3 wizard Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/applications/typo3-v11.md Create an empty file named FIRST_INSTALL in the public directory of the TYPO3 project. This file triggers the TYPO3 installation wizard upon browser reload. ```bash touch /home/cloudpanel/htdocs/www.domain.com/public/FIRST_INSTALL ``` -------------------------------- ### Define Commands and Options with Actions in Commander.js Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/terser/node_modules/commander/Readme.md Provides a comprehensive example of defining various commands ('setup', 'exec', '*') with options, aliases, and actions. It demonstrates how to process arguments and options for different commands and include command-specific help examples. ```js var program = require('commander'); program .version('0.1.0') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook'); program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(''); console.log('Examples:'); console.log(''); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); ``` -------------------------------- ### Compare colors with .isEqual(color2) Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/colord/README.md Determines whether two values are the same color. ```js colord("#000000").isEqual("rgb(0, 0, 0)"); // true colord("#000000").isEqual("rgb(255, 255, 255)"); // false ``` -------------------------------- ### Execute CloudPanel Installation Script Source: https://github.com/cloudpanel-io/docs/blob/master/v1/docs/getting-started/installation-digital-ocean-installer.md This command downloads and executes the CloudPanel v1 installer script, specifically configured for Digital Ocean environments, to begin the installation process. ```bash curl -sSL https://installer.cloudpanel.io/ce/v1/install.sh | sudo CLOUD=do bash ``` -------------------------------- ### Run Unit Tests and Install Dependencies Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/micromatch/README.md This command installs all necessary project dependencies and then executes the unit tests. It is a fundamental step for developers to get familiarized with the library and its API, ensuring code quality and functionality. ```sh $ npm install && npm test ``` -------------------------------- ### JavaScript Example for Tokenizer Locator Function Source: https://github.com/cloudpanel-io/docs/blob/master/v2/node_modules/remark-parse/readme.md Illustrates the `tokenizer.locator` function, which is crucial for inline tokenizers to improve parsing performance by indicating potential entity start positions. It takes `value` and `fromIndex` and returns the index where an entity might start, or -1. ```js function locateMention(value, fromIndex) { return value.indexOf('@', fromIndex) } ``` ```APIDOC tokenizer.locator(value, fromIndex): Parameters: value (string): Value which may contain an entity fromIndex (number): Position to start searching at Returns: number: Index at which an entity may start, and -1 otherwise. ``` -------------------------------- ### Run CloudPanel Installer Script with Database Engine Options Source: https://github.com/cloudpanel-io/docs/blob/master/v2/docs/getting-started/microsoft-azure/installation/installer.md Execute the CloudPanel installer script, downloading it from the official source, verifying its integrity with SHA256, and then running it with specified database engine options for various Linux distributions. Choose the command corresponding to your desired database. ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \necho "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \nsha256sum -c && sudo CLOUD=msa bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \necho "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \nsha256sum -c && sudo CLOUD=msa DB_ENGINE=MARIADB_11.4 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \necho "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \nsha256sum -c && sudo CLOUD=msa DB_ENGINE=MARIADB_10.11 bash install.sh ``` ```bash curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \necho "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \nsha256sum -c && sudo CLOUD=msa DB_ENGINE=MARIADB_10.6 bash install.sh ```