Coder Social home page Coder Social logo

mehdiirh / lazyhelper Goto Github PK

View Code? Open in Web Editor NEW
117.0 1.0 6.0 1.02 MB

A simple interface to help lazy people like me to shutdown/reboot/sleep their computer remotely.

Home Page: https://lazyhelper.mehdirh.dev

License: MIT License

Python 66.57% HTML 0.63% Shell 2.35% CSS 6.67% JavaScript 23.78%
helper remote assistant

lazyhelper's Introduction

🦥 Lazy Helper !

A simple interface to help lazy people like me to shut down/reboot/sleep/lock/etc. their computer remotely.

img.png

- USAGE

If you're a lazy guy, like me. or a busy one, you may leave your PC on when you're going to sleep or watch a movie on TV.

There you are! This is the solution you're looking for :)

Just install and run LazyHelper; after that, you can shut down your Linux PC with your mobile!

- API

LazyHelper API is described Here

- Pre-requirements

python  v3.6  //  or higher
node.js v16   //  or higher

- Installation

git clone https://github.com/mehdiirh/LazyHelper.git && cd LazyHelper

LazyHelper🦥 likes lazy people, so because you're too lazy to install step by step, it will install itself :)

You will be asked to create a superuser, please do it to use the authentication system.

Execute:

sudo bash install.sh && source venv/bin/activate

After that:

cd templates/
npm install
npm run build
cd ..

Yay !

To use "copy to clipboard" feature, you need to install xclip

Now you can run your LazyHelper:

./manage.py runserver 0.0.0.0:8081  # <- you can change the port 

Connect your phone and PC to the same network and access it from your PC's local IP address :

192.168.*.*:<port>

- [Optional] Set host name

sudo nano /etc/hosts

Add this line after 127.0.0.1 localhost:

127.0.0.1    <your-host-name>  # like: mehdi

Execute this command:

hostnamectl set-hostname <your-host-name>

Reboot!

Now you can access your PC from your-host-name.local ( like mehdi.local ) from any device on your network.

- Daemonize

sudo nano /etc/systemd/system/LazyHelper.service

Edit this service based on your configs, then hit Ctrl+X and Enter to save

[Unit]
Description=LazyHelper
After=network.target

[Service]
WorkingDirectory=  # Like: /home/mehdi/python/projects/LazyHelper
ExecStart= # Like: /home/mehdi/python/projects/LazyHelper/venv/bin/python manage.py runserver 0.0.0.0:8081
Restart=always

[Install]
WantedBy=multi-user.target

Execute:

sudo systemctl enable LazyHelper
sudo systemctl start LazyHelper

Done !

- Add Custom Commands and Buttons

For security reasons, any custom command that you want to execute must be pre-defined in the admin panel.

To add custom commands, go through these steps:

Add custom commands:

  • Login
  • Go to admin panel (/admin/).
  • In the CONFIG section click on Commands and add your custom commands.

Now you are allowed to use these commands using API,

If you want to see these commands as buttons on your homepage, do these steps:

Add custom buttons

  • Login
  • Go to admin panel (/admin/).
  • In the CONFIG section click on Buttons and add your custom buttons.

- Disable authentication ( NOT RECOMMENDED )

To use LazyHelper, you have to log in by default, if you want to disable this behavior, go to the "settings" section, disable "login-required" and save

❗️SECURITY WARNING

By disabling authentication, anyone on your network can access your PC.
They can execute every defined command.

Especially if you're on a public network, never disable authentication.

- License

This project is licensed under the MIT License - see the LICENSE.md file for details

- Acknowledgments

I appreciate Fatemeh's works, because of designing the awesome UX for LazyHelper.


Your Pull Requests are so welcome !

Currently, I have no idea how to make this work on Windows. If you know, please submit a PR.

Also, any UI/UX improvements are welcome

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.