Magent 2 – Install via composer

This installation assumes that you have PHP, apache2, MySql, composer installed already.

1. Install via composer:

  composer create-project --repository=https://repo.magento.com/ magento/project-community-edition <install-directory-name>

2. Set file permissions

  cd <install-directory-name>
  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 {} +
  sudo chown -R :www-data . // Ubuntu
  sudo chmod u+x bin/magento

3. Create MySql database say: m2

4. Create new virtual host using script: vh

 vh new mage2 -p ~/<install-directory-name>

5. Run installation command

  php bin/magento setup:install \
--base-url="http://mage2.loc/" \
--db-host="localhost" \
--db-name="m2" \
--db-user="root" \
--db-password="root" \
--admin-firstname="admin" \
--admin-lastname="admin" \
--admin-email="admin@example.com" \
--admin-user="admin" \
--admin-password="admin123" \
--language="en_US" \
--currency="USD" \
--timezone="America/Chicago" \
--use-rewrites="1" \
--backend-frontname="admin"

6. Browse to http://mage2.loc

7. Install sample data

  php bin/magento sampledata:deploy

HP Printer install – HP LaserJet Pro MFP M26nw – ubuntu

1. Download and install https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
2. List on terminal the scanner/printer

 scanimage -L

device `hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100′ is a Hewlett-Packard HP_LaserJet_Pro_MFP_M26nw all-in-one
3. scanimage -d “hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100” –format tiff > image.tiff
4. convert to pdf
scanimage -d “hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100” –format png –resolution 600 | convert png:- scan.pdf

Solve – cors problem


app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

app.get('/', function(req, res, next) {
  // ....
});

app.post('/', function(req, res, next) {
 // ....
});



Ubuntu dbVis – No suitable Java Virtual Machine could be found on your system

Error:

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8 and at most 9.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

Solution:

sudo apt update && sudo apt autoremove -y && sudo apt clean && sudo apt dist-upgrade -y && sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install oracle-java8-installer