This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rsync --rsync-path 'sudo rsync' -v -e "ssh -i /path/to/private_key" /local/path/to/file user@host:/remote_path_dest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Local WordPress installation with persistent data. | |
| # Quickly bring up containers to test WordPress things. The following folders are required in the root of the project as they are mounted as volumes: | |
| # - site | |
| # - database | |
| version: '3.1' | |
| services: | |
| site: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker rm $(docker ps -a -f status=exited -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker rmi $(docker images -f "dangling=true" -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // first | |
| docker exec -it {mysql_container_id} bash | |
| // then | |
| mysql -u {username} -h {mysql_container_name} -p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.1' | |
| services: | |
| app: | |
| image: php:7.2.2-apache-stretch | |
| volumes: | |
| - ./app:/var/www/html | |
| ports: | |
| - 8080:80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker exec -it {containerID} bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $log_file = "/internal/path/to/file/log.txt"; | |
| $fh = fopen($log_file, "a"); // or die("Could not open log file."); | |
| fwrite($fh, date("d-m-Y H:i:s")." - some data \n"); // or die("Could not write file!"); | |
| fclose($fh); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # protect .htaccess | |
| <files .htaccess> | |
| order allow,deny | |
| deny from all | |
| </files> | |
| # protect wpconfig.php | |
| <files wp-config.php> | |
| order allow,deny | |
| deny from all | |
| </files> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $var_cleaned = preg_replace("|[^0-9a-zA-Z -]|", '', $_POST['var']); | |
| ?> |
NewerOlder