Coder Social home page Coder Social logo

powertool's Introduction

powertool

https://coveralls.io/repos/github/raghur/powertool/badge.svg?branch=master https://travis-ci.org/raghur/powertool.svg?branch=master Documentation Status Updates

Python utility to wake up(wol) and suspend Linux machines remotely

  • Free software: MIT license

Features

  • Wake up remote machines using hostname/ip.
  • Suspend remote machines using hostname

Wake on lan (WOL)

Wake up feature uses WOL magic packet. Since mac addresses are hard to remember/use, this tool lets you wake up or suspend machines by their name or IP.

  1. First register your machines

    powertool register -b 192.168.1.255 aa:bb:cc:dd:ee:ff you@host
    
    • -b Broadcast_IP - this is the subnet on which your machine's ip is. If your machine's ip is 192.168.1.xxx, then this is 192.168.1.255(default)
    • aa:bb:cc:dd:ee:ff - your machines' mac address. You can find this on your machine or on the router's device list.
    • you@host - your username on the remote host - this is used by the sleep function to do a passwordless ssh and run pm-suspend.
  2. register saves machine details so that you can later do this:

    powertool wol host
    powertool sleep host
    
  3. register just saves machine details to a ~/.powertool as a json file.

Sleep/suspend

Sleep/suspend feature has quite a few dependencies

  • you should have password-less ssh to the remote host. There are a lot of guides on the internet on how to set this up - like this one http://www.linuxproblem.org/art_9.html. Verify that it works by running ssh user@host - you should not be prompted for a password.

  • You should have pm-utils package on your remote machine http://manpages.ubuntu.com/manpages/precise/man8/pm-action.8.html

  • Your user should be able to run sudo pm-suspend without being prompted for password. To set this up, login to the remote machine and do the following:

    sudo visudo
    # add the following - where user is your username on the remote machine
    user ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend
    

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

powertool's People

Contributors

pyup-bot avatar raghur avatar

Stargazers

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