Prettier, Webstorm, NVM and Linux

I installed Webstorm and wanted Prettier.

I simply installed the Prettier extension and added a File Watcher (as stated in the Doc)

But Prettier refused to run with “node not found” something…

I added this line to my .bashrc file to make sure NVM creates a symlink to the current node version:

<br />export NVM_SYMLINK_CURRENT=true

Then I edited my environment sudo nano /etc/environment and added this folder at the end of my PATH /home/tanguy/.nvm/current/bin (the NVM symlink)

Now Webstorm will launch and Node will be in the PATH so Prettier runs fine.

 

Oh and I had to add some command line arguments to the Prettier File Watcher on Webstorm because the plugin was not reading my eslintrc.js configuration file.

Docker container – Run a container with access to the host’s docker daemon and volumes


docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes --mount source=myvol1,target=/vol alpine sh

 

The above command runs a container (alpine image). Inside this container, you have access to the docker daemon of the host as well as the volumes.

Meaning that, from that container, you can manage containers (start, stop, inspect, …)

You can also start new containers with volumes.


apk update && apk add docker

docker run --rm -it --mount source=myvol1,target=/vol alpine sh

 

Netdata in Docker – Monitor my machine

Netdata: https://github.com/netdata/netdata & https://www.netdata.cloud/

is a wonderful tool to monitor a device and trigger alarms

To run it in a second on your local machine, use this docker command

docker run -d --name=netdata -p 19999:19999 -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /var/run/docker.sock:/var/run/docker.sock:ro --rm --cap-add SYS_PTRACE --security-opt apparmor=unconfined netdata/netdata

Then access the dashboard http://localhost:19999

Linux Mint – Cinnamon – Launch Expo View from command line – Launch Scale (Overview) View

Here is my config

flameshot_2019-01-03_13:14:57

Because I use Workspace grid (2D) and switcher to have my workspaces as a grid, I cannot use the shortcuts to show Expo view and Scale view. (The applet override the shortcuts to navigate through workspaces).

So I added my own custom keyboard shortcuts !

Expo view command

sh -c 'dbus-send --dest=org.Cinnamon --print-reply /org/Cinnamon org.Cinnamon.ShowExpo >/dev/null'

 

Scale view command

sh -c 'dbus-send --dest=org.Cinnamon --print-reply /org/Cinnamon org.Cinnamon.ShowOverview >/dev/null'

 

References:

Apache2.4 – Enable SSL and HTTP to HTTPS redirection

On clean Ubuntu 18.04 installation:

Initial installation: PHP & Apache2


sudo apt-get update

sudo apt-get upgrade

sudo apt-get install php

sudo apt-get install apache2

Enable mod_ssl and mod_rewrite then restart apache


sudo a2enmod ssl

sudo a2enmod rewrite

sudo systemctl restart apache2

Create your site, enable it


sudo nano /etc/apache2/sites-available/my_site.conf

sudo a2ensite my_site

sudo systemctl reload apache2

The content of the site looks like:



  RewriteEngine On
  RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined


  ServerName my_site.pro
  SSLEngine on
  SSLCertificateFile "/etc/ssl/my_site/certificate.crt"
  SSLCertificateKeyFile "/etc/ssl/my_site/private_key.key"

  ServerAdmin info@my_site
  DocumentRoot /var/www/html