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.

My linux aliases

Command line aliases to save me from typing “npm” and “git” all the time:

 

Edit .bashrc and add this to the end

alias g='git'
alias n='npm'
alias gpp='git pull && git push'
alias gac='git add . && git commit'
alias y='yarn'

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

Systemd – Daemon Hubot (Coffee script)

Here is the content of the file /etc/systemd/system/hubot.service

After creating the file, execute

sudo systemctl daemon-reload && sudo systemctl enable hubot && sudo systemctl start hubot

Replace SLACK_TOKEN below

[Unit]
Description=Hubot
Requires=network.target
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/pi/hubot
User=pi

Restart=always
TimeoutStartSec=10
RestartSec=10

; Configure Hubot environment variables, use quotes around vars with whitespace as shown below.
Environment="HUBOT_SLACK_TOKEN=SLACK_TOKEN"

; which node => /home/pi/.nvm/versions/node/v8.0.0/bin/node
; which coffee (need to install it globally npm install -g coffee-script) => /home/pi/.nvm/versions/node/v8.0.0/bin/coffee
ExecStart=/home/pi/.nvm/versions/node/v8.0.0/bin/node /home/pi/.nvm/versions/node/v8.0.0/bin/coffee /home/pi/hubot/node_modules/hubot/bin/hubot --name pixibot -a slack

[Install]
WantedBy=multi-user.target

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: