This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Debugging
E:V:A edited this page Mar 30, 2018
·
1 revision
- Enhance your Bash skills
- Check your browser's console log
To make your life a little bit easier on the command line, you can edit your ~/.bashrc
file
to include the following.
# MM/PM2 Related
alias cazzo='pm2 stop mm && pm2 kill;'
alias mm2='cd $HOME/MagicMirror/installers/; pm2 flush && rm ~/.pm2/logs/mm-* ; pm2 start mm.sh && cd $OLDPWD'
# PM2 Logs
alias cloge='less ~/.pm2/logs/mm-error-0.log'
alias clogo='less ~/.pm2/logs/mm-out-0.log'
alias taile='tail -f ~/.pm2/logs/mm-error-0.log'
alias tailo='tail -f ~/.pm2/logs/mm-out-0.log'
# Check and Update Packages
alias getups='sudo apt-get update'
alias getnews='apt list --upgradable'
alias lpacks='sudo dpkg --list'
alias sethold='sudo apt-mark hold'
# Some MM Locations
alias go2conf='cd $HOME/MagicMirror/config/'
alias go2mods='cd $HOME/MagicMirror/modules/'
# Screenshot from remote terminal
alias selshot=' DISPLAY=:0 scrot -s'
# Show nodejs and npm versions
alias nvers='node -v && npm -v'
Now, when you wanna run MM with a new module and check the logs while it starts, just do this:
mm2
tailo # Use CTRL-C to quit
So if there is a crash, use cloge
to read the error log.
To enable your Browsers console log, use CTRL-SHIFT-I
to enable Debug Tools.
This can be used from either the main windows or from within a remote browser.