— Cristian O. Balan (@oviliz) October 11, 2018
I found that Azure has a hard time to monitor disk usage on a Linux box. There are ways, but it seems to be too complicated to achieve such a basic thing. So I came up with the following script I call in a cron job as needed.
Make sure to adjust the THRESHOLD and emails as needed. Ideally, you’ll configure a mail server (e.g. Postfix) with SMTP credentials (e.g. SendGrid) and proper SPF records to make sure your emails don’t end up in Junk and miss them.
There are plenty of proper monitoring solutions and I always love those that give you a free tier such as HetrixTools Uptime Monitors or Datadog. However, not always these can be used.
I was looking at a way to disable the Reviews in Magento (using 2.2) but I was disappointed to learn that there is no such backend option…
If you know a little bit more on Magento 2, you may think that disabling a related module from CLI would do the trick.
bin/magento module:disable Magento_Review
However, there is a “trick” which I’ve learned from https://magento.stackexchange.com/a/95368.
We have to edit the app/etc/config.php, search for the line corresponding to our module and change its value from 1 to 0:
'Magento_Review' => 0,
After that, from your Magento root folder run
The result of this command would not tell you clearly if the module was disabled but you can check it using
The expected result should be this:
List of disabled modules: Magento_Review
Done! Check your website!
Certainly, this is better than editing the template code which is far too much. Hopefully, the guys from Varien would one day allow disabling simple features like this one from the backend.
While installing Node.js and npm, I’ve somehow ended up with different versions of nodejs and node.
# node -v v6.9.5 # nodejs -v v7.10.1
Getting inspired from Completely removing Node.js and Npm, I’ve managed to fix the mess:
git clone https://github.com/nodejs/node.git cd node/ ./configure sudo make uninstall
# node -v v7.10.1 # nodejs -v v7.10.1
I wanted to install Dropbox on my Ubuntu server so I’ve done some research and ended up with the following steps.
In conclusion, I decided to write a much more comprehensive and simple guide for my head.
Download Dropbox Headless
Please note that it is recommended to do that in your home directory, the reason why you have the
cd ~ command.
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
Run the Dropbox daemon
The previous command would create the
.dropbox-dist hidden directory in your home.
The official guide states:
If you’re running Dropbox on your server for the first time, you’ll be asked to copy and paste a link in a working browser to create a new account or add your server to an existing account. Once you do, your Dropbox folder will be created in your home directory.
After doing that Dropbox would start to sync into the server all the cloud files. Just stop with
Download the Dropbox Python script
This allows controlling Dropbox from the CLI:
cd ~ && wget -O dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py
Next, we need to give executable permissions to the
dropbox.py file and eventually symlink to
/usr/local/bin so we can run the command by simply typing
chmod +x dropbox.py && ln -sf /root/dropbox.py /usr/local/bin/dropbox
dropbox start and we’re good to go. Dropbox may get quite busy depending on how much stuff you have in the cloud.
dropbox help gives you a nice list of available options.
You may want to exclude some folders from being synced to your server and to do that simply run
dropbox exclude add ~/Dropbox/folder-to-exclude/
Now I can play with rsync! 🙂
Someone may want to set Dropbox to start after a reboot. I’ve tried a few ways but I failed. Is not that important to me but I’ll try later with a fresh mind. In case, I’ll update this post.