This file contains 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
//Method 1 | |
//Js is not dynamic. I can not pass variables from PHP->to JS->to PHP, in the same page. | |
//Your php code | |
$arrToJSON = array( | |
"dataPHPtoJs"=>"yourData", | |
"asYouWant"=>"<div class=\".class1\">soemting</div>" | |
); | |
return json_encode(array($arrToJSON)); |
This file contains 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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
ScriptAlias /cgi-bin/ /var/cgi-bin/ | |
<Directory "/var/cgi-bin"> | |
AllowOverride None | |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | |
Require all granted |
This file contains 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
{"lastUpload":"2021-01-05T18:42:04.067Z","extensionVersion":"v3.4.3"} |
This file contains 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
@ECHO off | |
REM - DATABASE BACKUP ROUTINE | |
ECHO. | |
ECHO 1 - dbTest STARTING backup ... | |
mysqldump -u root -pMYPASSWD --routines --add-drop-database --databases dbNameInMySql> C:/Users/backup/dbNameDumped.sql | |
ECHO dbTest - BACKUP DONE... | |
ECHO. | |
rar a -ag+YYYY{_}MM{_}DD{_}HHMMSS{_}NN C:/Users/backup/ C:/Users/backup/FinalFolder/ |
This file contains 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
Show your branch name on the Linux prompt. Updated | |
1-Go to ~/ directory, or /home/"username"; | |
2-type sudo subl .bashrc. So this will be the full command ila@ig:~$ sudo subl .bashrc. That will open the .bashrc file | |
3-After this Introductory sentence of the .bashrc: | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
4-Put this function declaration: | |
# Add git branch if its present to PS1 |
This file contains 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
Meu Dockerfile | |
FROM ribafs/ubuntu-maria | |
ENV MYSQL_ROOT_PASSWORD root | |
ENV MYSQL_ROOT_DATABASE testes | |
RUN apt-get update | |
EXPOSE 3306 | |
ADD ["script.sql", "/tmp/script.sql"] # Cria o banco e muda a senha para vazia | |
CMD ["start-mysql"] | |
RUN mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "CREATE DATABASE testes" |
This file contains 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
/* | |
Installation -> http://docs.guzzlephp.org/en/latest/overview.html#installation | |
https://www.youtube.com/watch?v=GunXVUqvO-s | |
https://www.udemy.com/http-clients-with-laravel-use-and-consume-services-and-apis/ | |
add Guzzle as a dependency using the composer.phar CLI: |
This file contains 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
upstream web_backend{ | |
server 192.168.1.11:3000; | |
server 192.168.1.12:3000; | |
} | |
server { | |
listen 3000; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains 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
https://www.nginx.com/blog/top-5-posts-r12-microservices/ | |
https://thenewstack.io/from-monolith-to-microservices/ | |
https://medium.com/@NeotericEU/how-can-you-refactor-a-monolithic-application-into-microservices-2eef8e323840 | |
https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/ | |
https://www.nginx.com/blog/refactoring-a-monolith-into-microservices/ | |
https://www.nginx.com/blog/refactoring-a-monolith-into-microservices/ | |
https://howtodoinjava.com/microservices/microservices-definition-principles-benefits/ | |
https://www.owasp.org/index.php/PHP_Security_Cheat_Sheet | |
https://www.garron.me/en/go2linux/how-benchmark-stress-your-apache-nginx-or-iis-server.html | |
https://kuntalchandra.wordpress.com/2015/10/10/install-apache-bench-ubuntu-14-04/ |
This file contains 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
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; |
NewerOlder