find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./media -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
Author: Harshvardhan Malpani
How to view current deployment mode Magento2 and change it
php bin/magento deploy:mode:show
php bin/magento deploy:mode:set production
php bin/magento deploy:mode:set developer
How to Update Magento 2.1x to latest version via SSH
composer require magento/product-community-edition 2.1.9 --no-update composer update rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento indexer:reindex
Updating Magento 1 via SSH
cd ~/public
chmod 750 mage
./mage mage-setup .
./mage config-set preferred_state stable
./mage sync
./mage install https://connect20.magentocommerce.com/community Mage_All_Latest --force
php shell/indexer.php reindexall
rm -rf downloader/.cache/ var/cache/
Magento 2.1x Cron Jobs
Cron Jobs
Add through cPanel/WHM
Time interval – 10 minutes -> */10 * * * *
Replace ^username^ with user dir
php /home/^username^/public_html/bin/magento cron:run >/dev/null 2>&1
php /home/^username^/public_html/update/cron.php >/dev/null 2>&1
php /home/^username^/public_html/bin/magento setup:cron:run >/dev/null 2>&1
Using Crontab editor in Terminal
Use command crontab -e
*/10 * * * * php /home/^USERNAME AND PATH^/public_html/bin/magento cron:run >/dev/null 2>&1
*/15 * * * * php /home/^USERNAME AND PATH^/public_html/bin/magento indexer:reindex >/dev/null 2>&1
How to unlike all Facebook pages from your profile and Clean your newsfeed
Hello humans, I have tried to keep this tutorial simple and detailed. Please proceed with caution.
The following tutorial and the procedure will unlike pages you have liked from your profile, Please be clear about that the fact that the code provided here is clean and does not intend to do any harm to your Facebook account.
Note – This code uses jQuery library in its original form. So you do not need to be scared while using this “scary” looking code.
Continue reading “How to unlike all Facebook pages from your profile and Clean your newsfeed”
Start a magento instance programmatically
This Code:
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
umask(0);
Mage::app('admin');
Mage::register('isSecureArea', 1);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
//your mage code here
Inserting into SQL without specifying primary column
If Primary key is set to Auto-increment, there are chances that you would not want to provide its value in insert query.
Here is how to do it in MySQL:
INSERT INTO table_name VALUES (NULL, 'column b', 'col c');
Assumption^: The first column is the primary key set to AI
Similarly you can skip columns for other non-required data:
INSERT INTO table_name(
col b,col c)
VALUES ('column b', 'col c');
Flushing Magento cache – The Programmer way
Mage::app()->getCacheInstance()->flush();
How to root Xiaomi Redmi 2 Prime without flashing custom recovery
In this article, I am going to explain rooting procedure of your MI REDMI 2 PRIME. Applies to redmi 2 also. Jump to Requirements -> Downloads -> Pre Root Checks -> Root Procedure
Requirements:
- ADB and Fastboot
- TWRP Recovery Image
- SuperSU update package
- USB connection with android debugging
- and of course all drivers installed.
Downloads from shared folder contain:
- adb and fastboot drivers as
adb.zip
- twrp recovery image as
twrp.zip
- SuperSU update package as
UPDATE-SuperSU-v2.46.zip
Pre – Root Checks
- USB Debugging is on. If not, go to
developer settings
and then turn “Device’s USB Debugging” On - Device drivers are configured correctly and your system detects the device. If not, install MI PC SUITE and restart your system.
- ADB recognizes your phone as an active device with some random name. If not, kill adb server and then check again
Procedure to root Xiaomi Redmi 2 Prime
- Copy SuperSU update package (.zip) to your device and remember the location.
- Check ADB connection using command –
adb devices
. If this command shows an attached device as above, use commandadb reboot bootloader
to restart phone in fastboot mode
- Enter command
fastboot boot twrp.img
. twrp.img is the name of your recovery file which is in the same folder as adb.exe and fastboot.exe - You’ll see the phone booting to recovery mode using TWRP recovery. Select
install
option to flash supersu package - Choose that zip file to be flashed in the file explorer. Tap on “Select Storage” to browse SD card or Internal Memory
- Swipe the big dot below to install the package
Reboot
system to finish. No need to wipe cache- Done! Simply use any root app to check your phone is rooted.
Fully tested root procedure for Xiaomi Redmi 2 Prime running MIUI version 6.7.1 (Model HM2LTE-IN)