Magento 2 add a user via command line cli

Magento does not allow resetting password of an existing user using the command prompt CLI.

But it allows creating new admin users via CLI.

Login to the command line and change directory to your magento 2 root directory.

e.g. cd  /var/www/magento2

Enter the below command and press enter.

php bin/magento admin:user:create

The CLI will prompt for username, password, email address, first name and last name for the user being created.

How to promote your eCommerce business in 2020

As online platforms and publishers look to grab bigger shares of digital commerce budgets, the number and variety of paid and organic formats available to marketers  to promote their e-businesses have taken off in the last few years, including shoppable media options.  Below is a list of current options.

Product Shopping Ads

These are feed-based sponsored product ads that started on Google Shopping and have proliferated across nearly every channel, including Snapchat, Microsoft Advertising, YouTube, Facebook and Instagram, Amazon, Pinterest and other marketplace and retailer sites. These ads feature a single product.

Multi-Product Shopping Ads

As shopping ads have gained popularity, platforms have been iterating on the format. Google Showcase Shopping ads feature multiple related products and typically show on broader category queries. Facebook and Instagram offer multi-product, swipeable Carousel ads as well as the newer Collection ads which combine brand and direct-response elements. Snapchat’s Collection ads are full-screen ads featuring a set of products. Users can tap each product image to surface more product details in the ad.

Dynamic Product Ads

These can be effective, but also need to be managed well. Dynamic product ads are the ones users often complain about seeing after they’ve already purchased a product. The ads automatically show users the exact or similar products they recently viewed on an advertiser’s website or app. Many platforms, vendors and publishers support this type of advertising, including (but not limited to)
Amazon, Google, Facebook and Instagram, Snapchat, Verizon Media, AdRoll and Criteo.

Shoppable Influencer Posts

Brands know influencers (celebrities and creators) can drive sales from their social posts and videos. Social platforms have been testing formats that let users click to shop right from influencers’ posts. Instagram and TikTok are among those experimenting with this type of format for influencers on their platforms.

Product Display Ads

These are similar to standard Product Shopping Ads, but aren’t associated with search. Amazon’s version is now called Sponsored Display. The ads feature a single product and can be targeted on and off Amazon to audiences based on relevant Amazon shopping activities

Shoppable Posts/Images

These are organic (unpaid) posts on social networks that can be used to promote and link to products. Examples include Pinterest product pins, Instagram shoppable posts, and the new Amazon Posts, currently in beta.

Shop the Look: A variation of Shoppable Posts, Pinterest was the first to offer an organic, interactive Shop the Look format with clickable hotspots on products featured in images. Fashion and home decor marketers can tag products shown in their images (items in an outfit or furniture shown in a living room, for example) manually or work with Pinterest Marketing Partners Olapic or Curalate. Google has tested a paid version called Shoppable Image Ads in Image Search.  Publishers are also testing Shoppable Media solutions that can help brands shorten the gap between product discovery and purchase. Verizon Media’s Touchpoints ads, for example, are full-screen interactive mobile ads that enable users to tap on products to learn more and click to shop from the retailer’s website. POPSUGAR publisher Group Nine is testing shoppable ads for brands that feature the products they sell on Amazon and Walmart.

Shoppable Video Ads

These ads let users take buying actions right from a video on their devices, including TVs. In addition to YouTube and social platforms, over-the-top OTT (or advanced TV) vendors are making television content and ads shoppable as well.

Shoppable UGC

Turn content your customers are creating into authentic and effective marketing content. Marketers can do this themselves or use a vendor such as Olapic or TINT to re-purpose UGC content into shoppable, sales-generating social posts.

Shoppable Story Ads

Snapchat’s Shoppable Story ads can run in Discover and between stories. Instagram’s version lets marketers add Product Stickers to their Stories that users can click on to see more product details and a link to the company’s website.

Comment Selling

Yep, you can use comments to sell products on Facebook and Instagram posts directly to commenters. CommentSold, Soldsie, PopItUp and Shoppe are among the vendors in this space.

ref : PERIODIC TABLE OF 2020 DIGITAL COMMERCE MARKETING by Marketing Land

How to Extract a .gz File or directory in Linux using command prompt / terminal / shell / bash

Extract GZ archive file in Linux Terminal

To extract the GZ archive to the current directory, use below command.

$ gunzip archive.gz

.gz files are compressed with gzip compression algorithm. To extract .gz files we use gunzip command is used in Linux.

if the operation is successful, nothing is shown and linux command prompt is given back to the user

Extract GZ file and see verbose output

if you want to see what happens during the unzip operation , you can user the -v parameter with the command.

# gunzip -v file_name.gz

-v stands for verbose, which shows a log of actions happening while the archive is decompressed.

Also note, after decompressing using gubzip , the GZ extention is removed from the file. so , your compressed archive is no longer available but the extracted file.

Extract GZ file keep both orginal file and new

if you want to keep the archive as well, please use the -k parameter with the command as below.

# gunzip -k file_name.gz

View information about a GZ archive file

To view information about the compressive GZ gzip file, you can use the gunzip command like below, it does not uncompress the archive but give you vital information about the archive.

gunzip -l file_name.gz

Compress a file to a GZIP archive with GZ extension

Sometimes it is required to compress a file to save space, transfer safely or for other reasons. In Linux , you can use gzip command to compress a file. e.g.

gzip  file_name.txt

Compress a directory using gzip

On Linux, gzip is unable to compress a folder, it used to compress a single file only. To compress a folder, you should use tar + gzip, which is tar -z.

tar -zcvf outputFileName.tar.gz folderToCompress

Laravel Framework Cheat Sheet

Get laravel app base urbottom: 0px !important;border-top-width: 0px !important;

$app->make('url')->to('/');

$app['url']->to('/');

App::make('url')->to('/');

Laravel Scheduler – Cron Tutorial

Task scheduling is an important part of many web applications.

Here are several examples:

  • Check if new emails are received in a specified email accounts inbox, read them and take actions based on the information ( in every minute)
  • Perform batch jobs – etc dispatch order status change emails in an ecommerce system. (once a hour )
  • Clear logs ( once a day )

Laravel makes it super easy and intuitive to use linux CRON scheduler  to perform automated tasks for your web application.

Usually web applications achieve task scheduling by creating several cron jobs in Linux  that execute the required controller methods in the web application. Downside of this approach is that you need to create one cron job for each task.  So if there are 10 tasks , you have to create 10 cron jobs in Linux making it hard to manage.

Laravel adds a layer of programmable logic between the operating system and your web application that you can program your tasks with specified time interval to run them and use a single CRON job .

So once you create general cron job that invokes the laravel scheduler, you are free to programmatically add any number of tasks to run on various time intervals. There are many commonly used time intervals which can be accessed via easy to remember method names such as ->everyMinute(); which obviously runs a given task every minute.

TO be continued. Please provide your feedback below.

PHP7 Vulnerability that allows hackers to hijack web servers

The PHP programming language that powers most of the Internet based appications. It is used in the popular content management systems like WordPress, Joomla and Drupal, so it’s a big issue  whenever someone identify a security vulnerability within it.

A few days a ago, Emil ‘Neex’ Lerner, a Russian security expert, published a remote-code execution vulnerability in PHP version 7.

With this vulnerability,  an attacker could force a remote web server to execute their own random code just by entering a crafted URL. The attacker only needs to add “?a=” to the website address, followed by their code payload.

This attack makes it very easy to  start hacking a website,  so that even a non-technical user could abuse it.

Fortunately, the vulnerability only affects servers using the NGINX web server with the PHP-FPM extension. PHP-FPM is a modded version of FastCGI, with a several additional features intended for websites with high traffic.

Due to the availability of public sample ( POC) code and the extreme simplicity of exploiting this bug, website owners are advised to check server settings and update PHP as soon as possible if they run the vulnerable configuration.

Read More at : ZDNET

All About Site Kit by Google WordPress Plugin

Site Kit by Google is a plugin that brings all the Google related services for any WordPress website under a single dashboard.  It is so well made that it is extremely easy to install, configure and use.

It allows following Google Products and Services to be accessed from within your WordPress dashboard in a very intutive user interface.

Google Search Console

Google Search Console is a web service by Google which allows webmasters to check indexing status and optimize visibility of their websites.

Google AdSense

Google AdSense is a program run by Google through which website publishers in the Google Network of content sites serve text, images, video, or interactive media advertisements that are targeted to the site content and audience

Google Analytics

Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand

PageSpeed Insight

PageSpeed Insights (PSI) reports on the performance of a page on both mobile and desktop devices, and provides suggestions on how that page may be improved.

Tag Manager

Tag Manager creates an easy to manage way to create tags on your site without updating code.

Optimize

Create free A/B tests that help you drive metric-based design solutions to your site.

Installing Site Kit by Google WordPress Plugin

Installation is as easy as any other WP Plugin.

Confuguring Site Kit by Google WordPress Plugin

Just have to login to your Google Account when prompted to do so, and allow relavant permisions for your website. Then thats it!

How to check the Laravel version using CLI / command prompt and files on Windows or Linux

[vc_row][vc_column][vc_column_text]There are two ways to find the version of your Laravel application . You can either find it by running a command via CLI/ Command Prompt or you can check Laravel version in source files of your Laravel installation.[/vc_column_text][vc_tabs][vc_tab title=”Using Command” tab_id=”1572406098-1-97″][vc_column_text title=”Using command line CLI / Command prompt to find Laravel version” css=”.vc_custom_1572400844663{margin-bottom: 0px !important;}”]Open the terminal / cmd on your system. Now change directory to the web root directory of the Laravel installation and then run the following command to check the Laravel version.[/vc_column_text][mk_padding_divider size=”20″][vc_single_image image=”8915″ img_size=”full” onclick=”link_image”][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]On Linux[/mk_fancy_title][vc_column_text css=”.vc_custom_1572406835275{margin-bottom: 0px !important;}”]

$php artisan --version

[/vc_column_text][mk_padding_divider size=”20″][mk_fancy_title size=”20″ letter_spacing=”” margin_top=”20″ margin_bottom=”0″ font_family=”none”]On Winows[/mk_fancy_title][vc_column_text css=”.vc_custom_1572406843857{margin-bottom: 0px !important;}”]

c:\xampp\htdocs\laravel_application>php artisan --version

[/vc_column_text][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]How to check laravel version of a project[/mk_fancy_title][vc_column_text title=”Using command line CLI / Command prompt to find Laravel version” css=”.vc_custom_1576079694183{margin-bottom: 0px !important;}”]You could use either of two methods described above, using terminal/CMD or by inpecting the source files. Please comment if you face any problems following the instructions. We will try to help as fast as we can.[/vc_column_text][/vc_tab][vc_tab title=”Using Source Files” tab_id=”1572406098-2-75″][vc_single_image image=”8922″ img_size=”full” onclick=”link_image”][vc_column_text css=”.vc_custom_1572406696655{margin-bottom: 0px !important;}”]

Open below file in your laravel system using your favourit text editor.

/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

[/vc_column_text][mk_fancy_title size=”20″ margin_top=”20″ margin_bottom=”0″ font_family=”none”]Find laravel version using source files[/mk_fancy_title][/vc_tab][/vc_tabs][/vc_column][/vc_row][vc_row][vc_column][mk_padding_divider size=”20″][/vc_column][/vc_row][vc_row][vc_column][mk_padding_divider][vc_column_text css=”.vc_custom_1572405501990{margin-bottom: 0px !important;}”]

History of Laravel Releases

VersionReleaseBug Fixes UntilSecurity Fixes Until
V1June 2011
V2September 2011
v3February 2012
v4May 2013
5.0Feb 4th, 2015Aug 4th, 2015Feb 4th, 2016
5.1 (LTS)Jun 9th, 2015Jun 9th, 2017Jun 9th, 2018
5.2Dec 21st, 2015Jun 21st, 2016Dec 21st, 2016
5.3Aug 23rd, 2016Feb 23rd, 2017Aug 23rd, 2017
5.4Jan 24th, 2017Jul 24th, 2017Jan 24th, 2018
5.5 (LTS)Aug 30th, 2017Aug 30th, 2019Aug 30th, 2020
5.6Feb 7th, 2018Aug 7th, 2018Feb 7th, 2019
5.7Sep 4, 2018Feb 4th, 2019Sep 4th, 2019
5.8Feb 26th, 2019Aug 26th, 2019Feb 26th, 2020
6.0 (LTS)Sept 3rd, 2019Sept 3rd, 2021Sept 3rd, 2022

[/vc_column_text][vc_column_text css=”.vc_custom_1572405742781{margin-bottom: 0px !important;}”]More in for about versions : https://laravel-news.com/laravel-release-process

[/vc_column_text][/vc_column][/vc_row]

How to set a static front page for my WordPress blog / website?

Step 1 – Create or select a WordPress Page

First step is to create the new page. if you want to select an existing page, thats fine too.

To create a new page, goto WordPress admin area -> Pages -> Add New.

Once you have created and saved the new page, you are ready to set it as the websites front page.

Go to Settings -> Reading.

Step 2 – Set the selected page as the WordPress Home page

Go to Settings -> Reading.

Once there, tick “A static page (select below)” in the “Front page displays” section.
Then from the “Front page” drop-down menu choose the static page you wish to make as home page and click Save Changes.

Now browse your home page and verify everything is in order.
(You might want to clear WordPress cache if you are using any cache plugins to see the change. )