Skip to content

Instantly share code, notes, and snippets.

View MaxSouza's full-sized avatar
🎯
Focusing

Max Souza MaxSouza

🎯
Focusing
  • 121Ecommerce
  • Gaspar, SC - Brazil
View GitHub Profile
@MaxSouza
MaxSouza / magento2-installation
Last active October 28, 2017 00:01
Magento 2 Installation
--- Install Composer ---
cd /usr/local/bin
sudo curl -s http://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
----------------------------------------------------------
--- Install Dependencies ---
@MaxSouza
MaxSouza / reset-password-mysql-macos
Created April 18, 2018 01:55
Resetando a senha do mysql macos
If you don't remember the password you set for root and need to reset it, follow these steps:
Stop the mysqld server, this varies per install
Run the server in safe mode with privilege bypass
sudo mysqld_safe --skip-grant-tables;
In a new window connect to the database, set a new password and flush the permissions & quit:
mysql -u root
@MaxSouza
MaxSouza / terminal-with-branch-git-highlight
Created November 23, 2018 16:42
Terminal with branch of git
#Put on your .bashrc or .bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
@MaxSouza
MaxSouza / clear-cache-programmatically
Created February 7, 2019 00:26
Clear cache programmatically
You can clear the cache programmatically by calling the \Magento\Framework\ App\CacheInterface::remove() method.
@MaxSouza
MaxSouza / reset-customer-password-sql-magento-2
Created April 3, 2019 13:57
Reset customer password by sql magento 2
UPDATE `customer_entity`
SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1')
WHERE `entity_id` = 1;
@MaxSouza
MaxSouza / magento-install
Created December 19, 2019 18:25
Magento Install
bin/magento setup:install --base-url=http://dev.magento2/ \
--db-host=localhost --db-name=magento2 \
--db-user=root --db-password=root \
--admin-firstname=Magento --admin-lastname=User
--admin-email=user@example.com \
--admin-user=admin --admin-password=admin123
--language=en_US \
--currency=USD --timezone=America/Chicago
--cleanup-database \
--use-rewrites=1