Giter Site home page Giter Site logo

stop-server's Introduction

stop-server

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 :)

Usage

  1. Install stop-server
npm install -g stop-server
stop-server start # Need to be done only once
  1. 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:

  1. That's all :)

Important depending on your OS, you need to allow commands to be used without sudo:

# Run 'sudo visudo' and add
your-username ALL=NOPASSWD: /sbin/shutdown       # OS X and Linux
your-username ALL=NOPASSWD: /usr/sbin/pm-suspend # Linux only

Uninstall

npm rm -g stop-server

How it works?

stop-server is a simple Express server with a few routes:

POST http://your-local-ip:5709/power-off
POST http://your-local-ip:5709/sleep

It's also automatically started on log in using user-startup.

License

MIT - typicode

stop-server's People

Contributors

derhuerst avatar gochomugo avatar typicode avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.