Giter VIP home page Giter VIP logo

pyremotereboot's Introduction

pyRemoteReboot

Description

A small utility to reboot a computer by scheduling a date on a file stored on a remote web server. The script regularly checks an HTTP url and if the date retrieved is in the future, it schedules a reboot.

This is highly useful when your remote control software hangs up for some reason and you can't access your computer anymore.

Put simply, just register to a free webhost and use your favourite FTP client (FileZilla) to upload a simple text file nextreboots.txt with this content:

2016-12-25_15-30

And run the script pyRemoteReboot on your computer. Your computer will reboot on the 25th december 2016 at 15h30.

Usage

pyRemoteReboot v0.1

usage: pyRemoteReboot.py [startup] [email] [hide] [--help]

[optional] startup: This will add the app to windows startup.
[optional] email: Send an email everytime a reboot is scheduled.
[optional] hide: In combination with pyinstaller --noconsole, run in daemon mode
 (no console shown).

Note: Can also specify the arguments in a file config.cfg placed where this script is located.

License

MIT

FAQ

  • How can I package a (frozen) standalone application for Windows/Linux/MacOSX? The script supports pyinstaller to freeze this script for Windows or Linux or MacOSX. Just execute the following line:

pyinstaller pyremotereboot.py

And a frozen application ready to be run natively on any of these OSes without needing Python will be built.

  • Why this architecture? Why not a socket listener allowing direct connection and instant reboot? Most corporate networks have strict firewall and network security measures (which is good), and thus disallow making servers. Usually, TeamViewer (and other UDP hole punching softwares such as WebRTC like filepizza) can go through, but not the rest. UDP hole punching was beyond the timeframe alloted to make this (quick) script, so the approach is much simpler: it simply access a web resource through HTTP. In other words, a simple web page. Since outgoing HTTP is nearly always authorized by security measures, this allows this script to work in pretty much any condition, and thus to fulfill its purpose as a safe switch in case remote control softwares fail.

  • What if my computer freeze? Then you're screwed, the script cannot bypass that. You can maybe try to run the script as a higher privilege process, like ring-0 on Windows or root + level 1 on Linux, so that it takes precedence over the other processes (so maybe the other processes will freeze but not the higher privilege ones). But nothing can guarantee you that the script will work if the computer freezes. Only an external hardware could provide such a guarantee (and it may not be free from getting frozen itself...).

  • What about security? The script does not execute any foreign code, it simply fetch a date online on your own webhost, and then compares it with the current time and schedule a reboot if necessary. So at worst, your webhost might be compromised by a hacker, who could then schedule reboots on your computer. But that's all. Also, you can always take down the webhost or the script to remove this hindrance if it ever happens. Also, the script does only use your own webhost as a third-party provider, and the script is opensource, so no risk of getting information leakage.

pyremotereboot's People

Contributors

lrq3000 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.