rawake


Namerawake JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryRemote computer awake (rawake)
upload_time2024-01-23 16:59:46
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords rawake remote awake
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Remote Computer Awake (rawake)

## Installation
```bash
$ pip install -U rawake # install latest version
$ rawake --version # verify installation
```

## Configuration
The `rawake` configuration is a python-base configuration file. Configuration should be stored at `~/.config/rawake/config.py`

*Example:*
```python
from rawake.config import Config, Computer

DEFAULT_SSH_SUSPEND_COMMAND = "sudo systemctl suspend"

CONFIGURATION = Config(
    computers=[
        Computer(
            name="remote-server",
            ip_address="192.168.0.10",
            mac_address="22:1b:5c:44:12:6b",
            ssh_port=2222,
            ssh_suspend_command=DEFAULT_SSH_SUSPEND_COMMAND,
        ),
        Computer(
            name="other-server",
            ip_address="192.168.0.200",
            mac_address="a4:44:c3:61:10:b8",
            ssh_suspend_command="sudo shutdown -h now",
        ),
    ],
)
```

## Listing the configuration
```bash
$ rawake --list
[
  {
    "name": "other-server",
    "mac_address": "a4:44:c3:61:10:b8",
    "ip_address": "192.168.0.200",
    "ss_suspend_command": "sudo shutdown -h now",
    "ssh_port": 22
  },
  {
    "name": "remote-server",
    "mac_address": "22:1b:5c:44:12:6b",
    "ip_address": "192.168.0.10",
    "ss_suspend_command": "sudo systemctl suspend",
    "ssh_port": 2222
  }
]
```

## Suspend remote computer:
`rawake` requires a username:password SSH connection to the remote host to be able to execute the configured suspend command.
```bash
$ rawake --suspend remote-server
SSH authentication:
username:username
password:<password>
```

## Awake remote computer:
For awaking a remote computer, `rawake` sends a [Wake-On-Lan magic packet](https://en.wikipedia.org/wiki/Wake-on-LAN).
```bash
rawake --awake remote-server
```


## Development

### Python dev environment:

- Create new Python virtual environment:
  ```bash
  pyenv virtualenv 3.11 rawake
  ```
- Activate the virtualenv:
  ```bash
  pyenv activate rawake
  ```

- Install dev and test dependencies:
    - `pip install .[dev]`
    - `pip install .[test]`
- Install git pre-commit hooks
    - `pre-commit install`
    - `pre-commit autoupdate`

### Running the tests:
  ```bash
  pytest .
  ```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rawake",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "rawake,remote,awake",
    "author": "",
    "author_email": "\"Jorge F. S\u00e1nchez\" <rawake@jfsanchez.net>",
    "download_url": "https://files.pythonhosted.org/packages/36/81/bcdeacdefcca651fe54e122a5e0a30753e32182e9493df5baf8923cf43c0/rawake-0.1.1.tar.gz",
    "platform": null,
    "description": "# Remote Computer Awake (rawake)\n\n## Installation\n```bash\n$ pip install -U rawake # install latest version\n$ rawake --version # verify installation\n```\n\n## Configuration\nThe `rawake` configuration is a python-base configuration file. Configuration should be stored at `~/.config/rawake/config.py`\n\n*Example:*\n```python\nfrom rawake.config import Config, Computer\n\nDEFAULT_SSH_SUSPEND_COMMAND = \"sudo systemctl suspend\"\n\nCONFIGURATION = Config(\n    computers=[\n        Computer(\n            name=\"remote-server\",\n            ip_address=\"192.168.0.10\",\n            mac_address=\"22:1b:5c:44:12:6b\",\n            ssh_port=2222,\n            ssh_suspend_command=DEFAULT_SSH_SUSPEND_COMMAND,\n        ),\n        Computer(\n            name=\"other-server\",\n            ip_address=\"192.168.0.200\",\n            mac_address=\"a4:44:c3:61:10:b8\",\n            ssh_suspend_command=\"sudo shutdown -h now\",\n        ),\n    ],\n)\n```\n\n## Listing the configuration\n```bash\n$ rawake --list\n[\n  {\n    \"name\": \"other-server\",\n    \"mac_address\": \"a4:44:c3:61:10:b8\",\n    \"ip_address\": \"192.168.0.200\",\n    \"ss_suspend_command\": \"sudo shutdown -h now\",\n    \"ssh_port\": 22\n  },\n  {\n    \"name\": \"remote-server\",\n    \"mac_address\": \"22:1b:5c:44:12:6b\",\n    \"ip_address\": \"192.168.0.10\",\n    \"ss_suspend_command\": \"sudo systemctl suspend\",\n    \"ssh_port\": 2222\n  }\n]\n```\n\n## Suspend remote computer:\n`rawake` requires a username:password SSH connection to the remote host to be able to execute the configured suspend command.\n```bash\n$ rawake --suspend remote-server\nSSH authentication:\nusername:username\npassword:<password>\n```\n\n## Awake remote computer:\nFor awaking a remote computer, `rawake` sends a [Wake-On-Lan magic packet](https://en.wikipedia.org/wiki/Wake-on-LAN).\n```bash\nrawake --awake remote-server\n```\n\n\n## Development\n\n### Python dev environment:\n\n- Create new Python virtual environment:\n  ```bash\n  pyenv virtualenv 3.11 rawake\n  ```\n- Activate the virtualenv:\n  ```bash\n  pyenv activate rawake\n  ```\n\n- Install dev and test dependencies:\n    - `pip install .[dev]`\n    - `pip install .[test]`\n- Install git pre-commit hooks\n    - `pre-commit install`\n    - `pre-commit autoupdate`\n\n### Running the tests:\n  ```bash\n  pytest .\n  ```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Remote computer awake (rawake)",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/jfsanchez91/rawake/issues",
        "Homepage": "https://github.com/jfsanchez91/rawake"
    },
    "split_keywords": [
        "rawake",
        "remote",
        "awake"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe0065c1733d6ba9004cfe5edc522ee7263b2a3d1a087f7bc0d88eca34c69042",
                "md5": "53271931746dc198bf0303e72f726538",
                "sha256": "5f4c7cf3b9becace5a15e69b01ed77d17503c9ba1290b8fdd4a7e3fe72b53e3d"
            },
            "downloads": -1,
            "filename": "rawake-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53271931746dc198bf0303e72f726538",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7521,
            "upload_time": "2024-01-23T16:59:44",
            "upload_time_iso_8601": "2024-01-23T16:59:44.452316Z",
            "url": "https://files.pythonhosted.org/packages/fe/00/65c1733d6ba9004cfe5edc522ee7263b2a3d1a087f7bc0d88eca34c69042/rawake-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3681bcdeacdefcca651fe54e122a5e0a30753e32182e9493df5baf8923cf43c0",
                "md5": "24164ca7ec8c5b7e0d30c4a941514df6",
                "sha256": "20f11c9932a3b6f5e8838f85503f79a688385e7d4c909cee8e72822560d8c44b"
            },
            "downloads": -1,
            "filename": "rawake-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "24164ca7ec8c5b7e0d30c4a941514df6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9260,
            "upload_time": "2024-01-23T16:59:46",
            "upload_time_iso_8601": "2024-01-23T16:59:46.129791Z",
            "url": "https://files.pythonhosted.org/packages/36/81/bcdeacdefcca651fe54e122a5e0a30753e32182e9493df5baf8923cf43c0/rawake-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-23 16:59:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jfsanchez91",
    "github_project": "rawake",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rawake"
}
        
Elapsed time: 2.82378s