Bash – How to know where the script is
To find out in which folder the script being executed is located, no matter where it is called from DIR=”$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )”
Il n'y a pas de questions bêtes
To find out in which folder the script being executed is located, no matter where it is called from DIR=”$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )”
In the Nginx configuration, just add the configuration fastcgi_param HTTP_AUTHORIZATION $http_authorization if_not_empty; so that the authentication variables are filled in. On the PHP side, to retrieve them $username = $_SERVER[‘PHP_AUTH_USER’]; $password = $_SERVER[‘PHP_AUTH_PW’];
To know which files are going to be modified, you have to start by fetching the branches git fetch then to see the files git log -p HEAD..origin and the differences (three dots, not two) git diff HEAD…origin
To recover deleted files automatically without specifying the path git ls-files -d | xargs git checkout —
To find a file by name in the terminal, just use find . -type f -name “nameFile”
sudo npm cache clean -f sudo npm install -g n sudo n stable sudo ln -sf /usr/local/n/versions/node/5.4.1/bin/node /usr/bin/node
Git sparse checkout lets you check out only part of a repository instead of its whole content. It is very handy when a repository is large and you only need one or two folders. The modern method (git 2.25 and later) Since git 2.25, a dedicated git sparse-checkout command makes this much simpler. The most … Read more
Installing WordPress with Composer used to be painful. Today it is simple and clean. Here is how to manage the WordPress core and its plugins entirely through Composer. The WordPress core The johnpbloch/wordpress project tracks the latest WordPress releases and is still the most used. In composer.json, you set the package and the install directory: … Read more
When setting up nginx it can happen that afterwards it is not possible to connect to the server and that you receive a “hostname not found” error In the terminal, we start by using curl -v domain.dev The error appears Rebuilt URL to: domain.dev/ * Hostname was NOT found in DNS cache * Trying 127.0.0.1… … Read more
To see all the routes configured in the Symfony 2 application, just use the command: php app/console router:debug