Skip to content

Instantly share code, notes, and snippets.

View Nav-Appaiya's full-sized avatar
🏠
Available

Nav Appaiya Nav-Appaiya

🏠
Available
View GitHub Profile
@Nav-Appaiya
Nav-Appaiya / gist:c01261b21455e1236c816cac0abe1398
Created January 12, 2022 12:54
speed up composer with prestissimo
$ composer global require hirak/prestissimo
@Nav-Appaiya
Nav-Appaiya / gist:2397191bc21bd6c482760bb47bf25996
Created January 12, 2022 12:54
If you have installed composer v2, and want to install composer v1 in addition you can do:
wget https://getcomposer.org/composer-1.phar
chmod a+x composer-1.phar
sudo mv composer-1.phar /usr/local/bin/composer1
And use composer1 on old projects:
cd <OLD-PROJECT>
composer1 install
max_execution_time=7200
max_input_time=7200
memory_limit=2G
post_max_size=1G
upload_max_filesize=1G
Composer 1 and 2 both at the same time on the Server:
cd /home/master/ && wget https://getcomposer.org/download/1.10.17/composer.phar
chmod +x composer.phar
mv composer.phar composer
SSH via Master Credentials and run these commands:Now if you wish to use composer 1 instead of using composer commands like composer install, Kindly run commands as follows for composer 1:
/home/master/composer install
@Nav-Appaiya
Nav-Appaiya / magento2
Created December 26, 2021 22:26
Cannot rm because generated/code is not empty magento 2 issue
this is because of permission issues with the generated/code folder, so try this
sudo find var/ generated/ vendor/ pub/static/ pub/media/ app/etc/ -type f -exec chmod g+w {} \;
sudo find var/ generated/ vendor/ pub/static/ pub/media/ app/etc/ -type d -exec chmod g+ws {} \;
Also if your generated/ folder is getting populated once you removed everything, while shop is in maintance mode,
this could have something to do with your cron job which is regenerating those files. Disable cronjobs first!
@Nav-Appaiya
Nav-Appaiya / gist.execute
Last active September 5, 2022 19:21
Add files of 20MB or larger to gitignore (like backups or huge logs) | Ps. the limit for git is 250MB
find . -size +20M | cat >> .gitignore
@Nav-Appaiya
Nav-Appaiya / create magento 2 admin
Created December 22, 2021 13:26
cli magento 2 admin
php bin/magento admin:user:create --admin-user=john --admin-password=doe123445 [email protected] --admin-firstname=John --admin-lastname=Doe
@Nav-Appaiya
Nav-Appaiya / Re: Pub.Static 404
Created December 21, 2021 22:13
Magento 2 usefull snippets migration & installation
Please run below command in magento root directory
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
@Nav-Appaiya
Nav-Appaiya / list-of-free-apis
Created November 25, 2021 20:08
list-of-free-apis
https://rapidapi.com/collection/list-of-free-apis
@Nav-Appaiya
Nav-Appaiya / gist:79353311154c5be40c3697c0ed2c9f90
Created August 29, 2021 18:30
wp-config.php with debug + Query Monitor options to define
define( 'WP_CACHE', false );
//define('QM_DB_EXPENSIVE', true);
define('QM_SHOW_ALL_HOOKS', false);
define('QM_DISABLE', true);
define('QM_HIDE_CORE_ACTIONS', true);
define('QM_DISABLE_ERROR_HANDLER', false);
define('QM_DARK_MODE', true);
define('QM_HIDE_SELF', true);
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG', false );