### Install Git and Visual Studio Code Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Practical example demonstrating the installation of both a command-line tool (Git) and a graphical application (Visual Studio Code) using Homebrew. ```shell brew install git ``` ```shell brew install --cask visual-studio-code ``` ```shell git --version ``` -------------------------------- ### Install Software from Brewfile Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Installs all packages and applications listed in the Brewfile. This command automates the setup of multiple software components. ```bash brew bundleCopier ``` -------------------------------- ### Complete Project Setup with dotenv Source: https://blog.crea-troyes.fr/8034/node-js-variable-denvironnement-fichier-env-et-dotenv A full example of a Node.js server using dotenv to manage port and message configuration, demonstrating separation of configuration from code. ```env PORT=5000 MESSAGE_ACCUEIL=Bienvenue sur mon super serveur Node.js ``` ```javascript require('dotenv').config(); module.exports = { port: Number(process.env.PORT), message: process.env.MESSAGE_ACCUEIL }; ``` ```javascript const express = require('express'); const config = require('./config'); const app = express(); app.get('/', (req, res) => { res.send(config.message); }); app.listen(config.port, () => { console.log("Serveur lancé sur le port", config.port); }); ``` -------------------------------- ### Install Software from a Brewfile Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Installs all software packages listed in a Brewfile. This is useful for automating the setup of development environments. ```bash brew bundle ``` -------------------------------- ### Node.js WebSocket Server Setup Source: https://blog.crea-troyes.fr/6043/structurer-son-code-js-ou-php-a-limage-du-main-en-python Initializes a Node.js project and installs the 'ws' module for creating a WebSocket server. This sets up the foundation for real-time communication. ```shell mkdir ws-server && cd ws-server npm init -y npm install ws ``` -------------------------------- ### Python Version Output Example Source: https://blog.crea-troyes.fr/15110/jwt_tool-cli-analyser-les-jwt-ou-json-web-tokens Example output showing the installed Python version. Ensure you have a compatible version installed before proceeding with jwt_tool installation. ```bash Python 3.12.2 ``` -------------------------------- ### Create and Initialize Project Source: https://blog.crea-troyes.fr/5991/coder-un-portfolio-avec-ollama-et-lia-en-local Set up a new project directory, initialize it as a Git repository, and create essential frontend files. ```bash # 3) Créer le projet mkdir mon-portfolio && cd mon-portfolio git init touch index.html styles.css script.js README.md ``` -------------------------------- ### GET Request for All Exercises Source: https://blog.crea-troyes.fr/12484/endpoint-definition-simple-exemples-et-fonctionnement Example of a GET request to retrieve all exercises from the API. ```http GET /api/exercices ``` -------------------------------- ### Test WhatWeb Installation Source: https://blog.crea-troyes.fr/8666/whatweb-cli-analysez-les-technologies-utilisees-dun-site Run a basic test to ensure WhatWeb is installed and working. This command analyzes the technologies used by 'example.com'. ```bash ruby whatweb example.com ``` -------------------------------- ### GET Request for Specific Exercise Source: https://blog.crea-troyes.fr/12484/endpoint-definition-simple-exemples-et-fonctionnement Example of a GET request to retrieve a specific exercise by its ID. ```http GET /api/exercices/1 ``` -------------------------------- ### GET Request for Users Source: https://blog.crea-troyes.fr/12484/endpoint-definition-simple-exemples-et-fonctionnement Example of a GET request to retrieve a list of users from an API endpoint. ```http GET /api/users ``` -------------------------------- ### Installer Web3.js Source: https://blog.crea-troyes.fr/7267/comment-lire-et-ecrire-sur-la-blockchain-depuis-un-site-web Installez la bibliothèque Web3.js pour interagir avec la blockchain Ethereum depuis votre projet Node.js. ```bash npm init -y npm install web3Copier ``` -------------------------------- ### HTTP GET Request Example Source: https://blog.crea-troyes.fr/14754/httpie-tutoriel-debutant-pour-lalternative-a-curl Fetches data from a specified URL using the GET method. HTTPie automatically defaults to GET if no method is specified. ```shell http GET https://jsonplaceholder.typicode.com/posts/1Copier ``` -------------------------------- ### Create and Navigate to Tools Directory Source: https://blog.crea-troyes.fr/8666/whatweb-cli-analysez-les-technologies-utilisees-dun-site Prepare your environment by creating a dedicated directory for tools and navigating into it. This helps organize your projects. ```bash mkdir -p ~/tools cd ~/tools ``` -------------------------------- ### Start MySQL Service Source: https://blog.crea-troyes.fr/9069/20-packages-homebrew-essentiels-pour-developpeur-web Starts the MySQL service managed by Homebrew. This command is used after MySQL has been installed. ```bash brew services start mysqlCopier ``` -------------------------------- ### Installer setuptools compatible Source: https://blog.crea-troyes.fr/12680/shodan-cli-tutoriel-pour-utiliser-shodan-depuis-le-terminal Assure la compatibilité de setuptools pour l'installation de Shodan CLI. ```bash ~/.local/pipx/venvs/shodan/bin/python -m pip install "setuptools<70" ``` -------------------------------- ### Install a Recon-ng Module from Marketplace Source: https://blog.crea-troyes.fr/14233/recon-ng-le-guide-complet-pour-debuter-efficacement Install a new module from the Recon-ng marketplace to extend its capabilities. This example installs a module for finding subdomains via Google. ```bash marketplace install recon/domains-hosts/google_site_web ``` -------------------------------- ### Créer un nouveau projet SvelteKit Source: https://blog.crea-troyes.fr/6296/tutoriel-svelte-framework-codez-une-application-web-en-spa Utilisez cette commande pour initialiser un nouveau projet SvelteKit. L'assistant vous guidera à travers les options de configuration. ```bash npm create mon-projet@latestCopier ``` -------------------------------- ### Installer et lancer htop Source: https://blog.crea-troyes.fr/11615/base-du-terminal-infos-systeme-et-commandes-de-secours Installe la commande 'htop' (une version améliorée de 'top') avec 'sudo apt install htop' ou 'brew install htop', puis lancez-la avec 'htop'. ```bash sudo apt install htopCopier ``` ```bash brew install stopCopier ``` ```bash htopCopier ``` -------------------------------- ### Install Google Chrome using Homebrew Cask Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Example of installing the Google Chrome browser using Homebrew Cask. ```shell brew install --cask google-chrome ``` -------------------------------- ### Readable Project Structure Example Source: https://blog.crea-troyes.fr/8531/methodologie-un-code-lisible-et-facile-a-comprendre This example demonstrates a more organized project structure with dedicated directories for different file types (e.g., js, css), improving clarity and maintainability. ```text /projet /js api.js dom.js tasks.js /css style.css index.html ``` -------------------------------- ### Install npm Package Source: https://blog.crea-troyes.fr/9069/20-packages-homebrew-essentiels-pour-developpeur-web Installs a JavaScript package using npm, Node.js's package manager. Example shown for React. ```bash npm install react ``` -------------------------------- ### Example Git User Configuration Source: https://blog.crea-troyes.fr/5673/jour-27-debuter-avec-git-tutoriel-complet-pour-debutant An example of how to set the Git user name and email. ```bash git config --global user.name "Alban L." git config --global user.email "alban@example.com" ``` -------------------------------- ### Start and Check Tor Service on Linux Source: https://blog.crea-troyes.fr/5816/tutoriel-complet-surfer-en-anonyme-sur-internet-terminal Starts the Tor service and checks its status on Linux systems. This command is used after installing Tor. ```bash sudo systemctl start torCopier systemctl status torCopier ``` -------------------------------- ### Installer des paquets à partir d'un fichier requirements.txt Source: https://blog.crea-troyes.fr/6180/pip-pipx-et-pip3-tutoriel-dun-gestionnaire-de-paquets Une fois le fichier requirements.txt créé, votre collègue peut utiliser cette commande pour installer toutes les dépendances nécessaires à l'exécution du projet. Cela garantit un environnement cohérent. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Test GET Request with Postman Source: https://blog.crea-troyes.fr/12484/endpoint-definition-simple-exemples-et-fonctionnement Use this example to test a GET request to a user endpoint. Postman can then display the JSON response from the server. ```http GET https://api.monsite.com/usersCopier ``` -------------------------------- ### Installer des outils essentiels (Nginx, MySQL, PHP, Git) Source: https://blog.crea-troyes.fr/7008/construire-son-minilab-guide-complet-pour-developpeur-web Installez un ensemble d'outils couramment utilisés par les développeurs web, y compris un serveur web (Nginx), une base de données (MySQL), un langage de script (PHP) et un système de contrôle de version (Git). ```bash sudo apt install nginx mysql-server php gitCopier ``` -------------------------------- ### Create a Brewfile for Software Installation Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Define the software packages and casks to be installed using Homebrew. This file automates the setup of your development environment. ```shell brew "git" brew "node" brew "python" cask "visual-studio-code" cask "google-chrome" ``` -------------------------------- ### Install Ollama and download a model Source: https://blog.crea-troyes.fr/5863/aider-ollama-installer-lia-locale-pour-le-developpement Installs Ollama using Homebrew and downloads a lightweight coding model. This setup is for macOS users with Homebrew. ```bash brew install ollama olama serve olama pull qwen2.5-coder:7b ``` -------------------------------- ### Create and Navigate to Project Directory Source: https://blog.crea-troyes.fr/6010/jujutsu-git-guide-complet-pour-maitriser-jj-pas-a-pas Use these commands to create a new directory for your project and move into it. ```bash mkdir site-demo cd site-demo ``` -------------------------------- ### Project File Structure Example Source: https://blog.crea-troyes.fr/7258/login-web3-avec-metamask-la-connexion-sans-mot-de-passe This example shows a basic project structure for a web3 login application using HTML, JavaScript, and PHP. You can adapt the backend language to your preferences. ```plaintext /login-web3-tuto ├── index.html ├── script.js ├── verify.php ``` -------------------------------- ### Install Claude Code via Native Script (macOS/Linux/WSL) Source: https://blog.crea-troyes.fr/5801/claude-code-tutoriel-complet-pour-developpeurs Install Claude Code using a native installation script for macOS, Linux, or WSL. This method may handle additional setup steps. ```bash curl -fsSL https://claude.ai/install.sh | bashCopier ``` -------------------------------- ### Installer PostCSS, postcss-cli et cssnano Source: https://blog.crea-troyes.fr/9049/minifier-vos-fichiers-html-css-js-php-depuis-le-terminal Installez les dépendances nécessaires pour utiliser PostCSS avec cssnano afin de minifier vos fichiers CSS. Ces outils sont couramment utilisés dans les workflows professionnels. ```bash npm install -g postcss postcss-cli cssnano ``` -------------------------------- ### Get Homebrew Installation Prefix Source: https://blog.crea-troyes.fr/6210/homebrew-le-guide-complet-pour-debuter-facilement Display the directory where Homebrew installs packages. This can vary depending on your Mac's architecture (Apple Silicon or Intel). ```shell brew --prefix ``` -------------------------------- ### PHP XSS Attack Input Example Source: https://blog.crea-troyes.fr/13728/injection-de-code-dans-les-meta-donnees-html-pdf-et-photo Example of a malicious input string for the PHP GET parameter injection, designed to trigger an alert box. ```php ?desc="> ``` -------------------------------- ### Install httpx using Go Source: https://blog.crea-troyes.fr/11175/httpx-et-pentesting-scan-des-infos-et-failles-dun-domaine Install the httpx tool using the Go package manager. The -v flag provides verbose output during installation. ```bash go install -v github.com/projectdiscovery/httpx/cmd/httpx@latestCopier ``` -------------------------------- ### Retrieve Whois Information for example.com Source: https://blog.crea-troyes.fr/8780/whois-en-terminal-cli-comprendre-installer-et-tout-utiliser A practical example demonstrating how to query Whois for 'example.com' to obtain domain registration details. ```bash whois example.com ``` -------------------------------- ### Example: Getting the First Element of a Simple Array Source: https://blog.crea-troyes.fr/7815/php-8-5-array_first-et-array_last-pour-trier-vos-tableaux Demonstrates using array_first() to get the first value from a simple indexed array. The original array remains unchanged. ```php $prenoms = ['Alice', 'Bernard', 'Chloé', 'David']; $premier = array_first($prenoms); echo $premier; ``` ```php print_r($prenoms); ``` -------------------------------- ### Install DNSX Source: https://blog.crea-troyes.fr/12368/dnsx-loutil-dns-incontournable-en-pentesting-de-masse Installs the DNSX tool using Go's install command. The binary will be placed in the ~/go/bin directory. ```bash go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latestCopier ``` -------------------------------- ### Install and Use PM2 Process Manager Source: https://blog.crea-troyes.fr/8083/node-js-coder-une-liste-de-taches-ou-todo-pas-a-pas Install PM2 globally and use it to start your Node.js application. PM2 ensures your app stays running, monitors resources, and manages logs. ```bash npm install pm2 -g pm2 start app.js ``` -------------------------------- ### Example Administration Wordlist Source: https://blog.crea-troyes.fr/14509/ffuf-tutoriel-complet-pour-debutant-en-fuzzing-web A sample wordlist for identifying administration panels. ```bash admin administrator backend panel gestion connexion login ``` -------------------------------- ### Install Django and Start a Project Source: https://blog.crea-troyes.fr/6180/pip-pipx-et-pip3-tutoriel-dun-gestionnaire-de-paquets Install Django using pip and initiate a new project. Django is a full-featured web framework providing a structured environment for robust web application development. ```bash pip install django ``` ```bash django-admin startproject monsite cd monsite python manage.py runserver ``` -------------------------------- ### Basic Express Server Setup Source: https://blog.crea-troyes.fr/7953/bien-structurer-son-projet-node-js-guide-complet-debutant Set up a basic HTTP server using the Express framework. This code initializes an Express app, defines a root route, and starts the server on a specified port. ```javascript const express = require('express'); const app = express(); app.use(express.json()); app.get('/', (req, res) => { res.send('Bienvenue sur notre projet Node.js'); }); const PORT = 3000; app.listen(PORT, () => { console.log(`Serveur en cours d'exécution sur http://localhost:${PORT}`); });Copier ``` -------------------------------- ### Installer Shodan CLI avec pipx Source: https://blog.crea-troyes.fr/12680/shodan-cli-tutoriel-pour-utiliser-shodan-depuis-le-terminal Installe le gestionnaire de paquets Shodan CLI en utilisant pipx. ```bash pipx install shodan ``` -------------------------------- ### WordPress functions.php File Guide Source: https://blog.crea-troyes.fr/category/php Master the WordPress functions.php file to customize your site, add features, and gain autonomy without plugins. This guide offers simple explanations and concrete examples. ```php #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before { background-image: url(' . get_template_directory_uri() . '/images/mon-logo-admin.png) !important; background-position: 0 0; color: #fff; background-size: 20px 20px; } '; } add_action('admin_head', 'mon_logo_admin'); // Ajouter un menu personnalisé dans l'admin WordPress function mon_menu_admin() { add_menu_page( 'Mon Menu', // Titre de la page 'Mon Menu', // Titre du menu 'manage_options', // Capacité requise 'mon-menu', // Slug du menu 'mon_menu_page_html', // Fonction d'affichage get_template_directory_uri() . '/images/mon-menu-icon.png', // Icône 6 // Position ); } add_action('admin_menu', 'mon_menu_admin'); function mon_menu_page_html() { // Contenu de la page du menu echo '