Thursday, August 30, 2018

How to export a mysql database using Command Prompt?

First check if your command line recognizes mysql command. If not go to command & type in:
set path=c:\wamp\bin\mysql\mysql5.1.36\bin
Then use this command to export your database:
mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql
You will then be prompted for the database password.
This exports the database to the path you are currently in, while executing this command

CSS is not loading on Magento 2 site

Refused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”

Refused to apply style from 'https://xxxxxxxxxxxx.com/pub/static/version1502029409/adminhtml/Magento/backend/en_US/css/styles-old...' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."


The problem was solved when I re-deployed the assets for admin pages.
I run these commands:
  1. grunt clean; grunt exec; grunt less
  2. bin/magento setup:static-content:deploy -f -s standard
  3. bin/magento cache:clean
Maybe, the CSS has to be re-deployed whenever the Sales email templates are updated.

Sunday, October 2, 2016

Magento 2.0 - Display custom attribute on product listing page

In product list page you can display like this.
$attribute = $_product->getResource()->getAttribute('attribute identifier'); if ($attribute) { $brick_value = $attribute ->getFrontend()->getValue($_product); }

Sunday, July 31, 2016

Virtualbox does not run: NS_ERROR_FAILURE

The most simple decision, that i found:
  1. enter into the folder /home/$user/.VirtualBox/
  2. find there file VirtualBox.xml-prev, this is backed up the configurations of Virtual Box
  3. delete VirtualBox.xml
  4. and change name VirtualBox.xml-prev to VirtualBox.xml

Tuesday, June 14, 2016

Use different PHP version CLI executable for one command

Maybe you can try to fix the environnement!
$ php -v
PHP 5.4.x (cli) ...
$ set PATH="/usr/lib64/php5.6/bin:$PATH"
$ php -v
PHP 5.6.x (cli) ...
Or, if you don't want to modify the PATH for your shell session, you can scope the change for the current command only:
$ php -v
PHP 5.4.x (cli) ...
$ env PATH="/usr/lib64/php5.6/bin:$PATH" php -v
PHP 5.6.x (cli) ...
$ php -v
PHP 5.4.x (cli) ...
If you can't change path then you can execute command as follows,(Eg: php -v)
First you want to know php-cli path
$ /php-cli-path -v

Eg:-
/usr/local/php70/bin/php-cli -v

rsync

rsync - how to suppress "skipping non-regular file" messages:-

Three basic behaviors are possible when  rsync  encounters  a  symbolic
       link in the source directory.

       By  default,  symbolic  links  are  not  transferred at all.  A message
       "skipping non-regular" file is emitted for any symlinks that exist.

       If --links is specified, then symlinks are recreated with the same tar-
       get on the destination.  Note that --archive implies --links.

       If  --copy-links is specified, then symlinks are "collapsed" by copying
       their referent, rather than the symlink.

       Rsync can also distinguish "safe"  and  "unsafe"  symbolic  links.   An
       example  where  this  might be used is a web site mirror that wishes to
       ensure that the rsync module that is copied does not  include  symbolic
       links  to  /etc/passwd  in  the  public  section  of  the  site.  Using
       --copy-unsafe-links will cause any links to be copied as the file  they
       point  to  on  the  destination.   Using --safe-links will cause unsafe
       links to be omitted altogether.  (Note that you  must  specify  --links
       for --safe-links to have any effect.)

       Symbolic  links  are  considered  unsafe  if they are absolute symlinks
       (start with /), empty, or if they contain  enough  ".."  components  to
       ascend from the directory being copied.

       Here's  a summary of how the symlink options are interpreted.  The list
       is in order of precedence, so if your combination of options isn't men-
       tioned, use the first line that is a complete subset of your options:

       --copy-links
              Turn all symlinks into normal files (leaving no symlinks for any
              other options to affect).

       --links --copy-unsafe-links
              Turn all unsafe symlinks into files and duplicate all safe  sym-
              links.

       --copy-unsafe-links
              Turn  all unsafe symlinks into files, noisily skip all safe sym-
              links.

       --links --safe-links
              Duplicate safe symlinks and skip unsafe ones.

       --links
              Duplicate all symlinks.

Saturday, June 11, 2016

How to unzip/extract a .tar.gz file in linux?

Type man tar for more information, but this command should do the trick:
tar -xvzf community_images.tar.gz
To explain a little further, tar collected all the files into one package, community_images.tar. The gzip program applied compression, hence the gz extension. So the command does a couple things.
  • f: this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file.
  • z: tells tar to decompress the archive using gzip
  • x: tar can collect files or extract them. x does the latter.
  • v: makes tar talk a lot. Verbose output shows you all the files being extracted.