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

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');

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:

Downloads from shared folder contain:
  1. adb and fastboot drivers as adb.zip
  2. twrp recovery image as twrp.zip
  3. SuperSU update package as UPDATE-SuperSU-v2.46.zip

Final folder view looks like:
work folder layout

Pre – Root Checks

  1. USB Debugging is on. If not, go to developer settings and then turn “Device’s USB Debugging” Onusb debugging check
  2. Device drivers are configured correctly and your system detects the device. If not, install MI PC SUITE and restart your system.
    device driver check
  3. ADB recognizes your phone as an active device with some random name. If not, kill adb server and then check againadb connection check

 

Procedure to root Xiaomi Redmi 2 Prime

  1. Copy SuperSU update package (.zip) to your device and remember the location.update file in explorer
  2. Check ADB connection using command – adb devices . If this command shows an attached device as above, use command adb reboot bootloader to restart phone in fastboot modefastboot mode
  3. 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.exeadb commands for bootloader
  4. You’ll see the phone booting to recovery mode using TWRP recovery. Select install option to flash supersu packageteamwin logorecovery install
  5. Choose that zip file to be flashed in the file explorer. Tap on “Select Storage” to browse SD card or Internal Memorysupersu select
  6. Swipe the big dot below to install the packageswipe to install supersu
  7. Reboot system to finish. No need to wipe cacheinstall successful
  8. Done! Simply use any root app to check your phone is rooted.

    successfully rooted redmi prime successfully rooted redmi prime

 

Fully tested root procedure for Xiaomi Redmi 2 Prime running MIUI version 6.7.1 (Model HM2LTE-IN)