Archive for May 17th, 2016

How to show images on new magento 2 installation in Ubuntu

On a new magento 2 install sometimes images and javascript files do not load. To fix it, one of the options is to redeploy static content.

Here is the command to execute from magento2 install directory:

vagrant@vagrant-ubuntu-trusty-64:/var/www/magento2$ php bin/magento setup:static-content:deploy

How to replace Windows new line characters in Ubuntu

I have tried executing a bash script edited in Windows, which gave me an error:

vagrant@vagrant-ubuntu-trusty-64:/var/www/magento2$ sh /vagrant/scripts/deploy.sh
: not foundripts/deploy.sh: 2: /vagrant/scripts/deploy.sh:
/vagrant/scripts/deploy.sh: 4: set: Illegal option -

I tried executing it with bash, which gave me more details showing windows new line character as a problem:

vagrant@vagrant-ubuntu-trusty-64:/var/www/magento2$ bash /vagrant/scripts/deploy.sh
/vagrant/scripts/deploy.sh: line 2: $'\r': command not found
: invalid option/deploy.sh: line 4: set: -

To solve this problem, I replaced Windows new lines with Linux:

sed -i 's/\r$//' /vagrant/scripts/deploy.sh

If you have this problem, replace filename with the name of your file:

sed -i 's/\r$//' filename

Linux Web Hosting

 

<edit> I have purchased Web Hosting Deals site several years ago, just couldn’t get to it yet. Still in it’s original form. I am planning to redo the whole site at some point, sign up with more hosting companies and do complete feature reviews of linux hosting companies.

Meanwhile, please feel free to comment and let us know which Linux hosts you use and why.