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
<?php | |
# MAGENTO 2 - REMOVE UNEUSED PRODUCT IMAGES | |
# copy into magento_path/var | |
require dirname(__DIR__, 1) . '/app/bootstrap.php'; | |
use Magento\Framework\App\Bootstrap; | |
use Magento\Framework\App\State; |
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
<?php | |
require __DIR__ . '/app/bootstrap.php'; | |
use Magento\Framework\App\Bootstrap; | |
use Magento\Framework\App\State; | |
use Magento\Framework\Registry; | |
use \Magento\Sales\Api\OrderRepositoryInterface; | |
use Magento\Sales\Model\InvoiceOrder as ApiInvoiceOrder; | |
use Magento\Sales\Api\Data\InvoiceItemCreationInterfaceFactory; |
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
<?php | |
require __DIR__ . '/app/bootstrap.php'; | |
use Magento\Framework\App\Bootstrap; | |
use Magento\Framework\App\State; | |
use Magento\Framework\Registry; | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); |
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
/** | |
* Esse é um estudo sobre Hashcash que acabou se tornando Proof of Work (POW) | |
* | |
* As semelhança que eu identifiquei: | |
* - Ambos usam da capacidade computacional para resolver um desafio, que é encontrar um quantidade de zeros "0" | |
* em uma hash SHA-256. | |
* | |
* As diferenças que eu identifiquei: | |
* - Hashcash foi inicial feito para enviar spam de email. É um desafio enviado para pelo servidor, parecido com | |
* versão:timestamp_de_validade:nonce:SHA-256:SOLUÇÃO. A solução é o que o cliente (navegador) precisa descobrir. |
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
clear; | |
php -v | |
echo ''; | |
echo "Versão atual: " | |
read current; | |
echo "Alterar para a versão: "; |
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
sudo apt update | |
sudo apt install software-properties-common | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt update | |
sudo apt install php5.6 -y | |
sudo apt install php7.0 -y | |
sudo apt install php7.1 -y | |
sudo apt install php7.2 -y |
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 "Qual a versão do php? " | |
read version; | |
sudo apt install php$version-dom -y | |
sudo apt install php$version-curl -y | |
sudo apt install php$version-mcrypt -y | |
sudo apt install php$version-intl -y | |
sudo apt install php$version-mbstring -y | |
sudo apt install php$version-zip -y | |
sudo apt install php$version-gd -y |
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
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
sudo php composer-setup.php | |
sudo php -r "unlink('composer-setup.php');" | |
sudo mv composer.phar /usr/bin/composer | |
composer --version |