Shut down ⚡ your computer using Node.js and a phone (works on OS X, Linux and Windows)
Created because I usually watch movies on my computer from my bed and I wanted to be able to shut it down remotely :)
- Install
stop-server
npm install -g stop-server
stop-server start # Need to be done only once
- Visit http://localhost:5709/qr.html on your computer and scan the QR code or go directly to
http://your-local-ip:5709
on your phone. You should see this page:
- That's all :)
Important on OS X and Linux you need to allow shutdown
command to be used without sudo:
# Run 'sudo visudo' and add
your-username ALL=NOPASSWD: /sbin/shutdown
npm rm -g stop-server
stop-server is a simple Express server. When you call POST http://your-local-ip:5709
, it runs shutdown
.
It's also automatically started on log in using user-startup.
MIT - typicode