#๐Ÿ”’ run cmd commands remotely

46 messages ยท Page 1 of 1 (latest)

iron basin
#

i was wondering, is there any way i can somehow connect my phone and my pc so i can run commands in cmd remotely?

livid oarBOT
#

@iron basin

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

lyric ingot
#

SSH?

iron basin
#

both devices will be in same network tho

silver vortex
#

What exactly do you want if ssh is not suitable?

somber vine
#

if you're looking for an app like interface, kde connect is nice

lyric ingot
#

Instead of making the helpers tease the information out of you, please provide what exactly you're after, and the python element to the question.

iron basin
#

so basically i want to control League of Legend's LCU api remotely, to do that i have to send requests to my local client that runs on my pc from my phone

silver vortex
#

OK. If you want to remote into your PC, consider turning on RDP and installing an RDP client on your phone.

#

If you want a Python solution, consider making a web frontend.

iron basin
#

i dont need any kind of mouse control or gui, just to post requests

steep garnet
#

you can make a fastapi that you send request to it and then it execute some commands

#

is it secure, no but it should serve what you want

iron basin
#

i know only to expose the lcu with flask

steep garnet
#

you can send the command as part of the request body

iron basin
#

still didn't understand pithink

steep garnet
#

so from what I understood you want to run some commands in your terminal
and you want to pass these commands from your phone
is that right?

iron basin
#

yeah

#

these commands should be requests to the lcu

steep garnet
#

if so then you can make an endpoint which takes accept commands in the body

http://127.0.0.1/execute -d
`{
   "commands" : "shutdown /s /f /t 0"
}`
iron basin
#

yeah thats should work

#

it would be better if those commands could be python...

silver vortex
#

If you have a Linux background, you could set up OliveTin under WSL.

iron basin
silver vortex
#

it's a golang binary running a tiny webserver

#

there's a Windows version and I'd make a wild guess it will use <20Mb ram

iron basin
#

i mean lightweight so people dont have to install whole wsl

silver vortex
#

I didn't realise at first, but there is a native Windows binary

iron basin
#

oh really?

#

mind sharing the link?

silver vortex
#

On the github releases

iron basin
#

oh

#

i think its not what i was searching for...

#

thats to control servers or something

silver vortex
#

It's to run pre-specified shell commands on a computer over a webui.

#

You could code up your own flask app to do this as xVip suggested, but the functionality you need to do this safely on a local network already exists here.

iron basin
#

ohh cool

iron basin
silver vortex
#

Yes. You could write an api endpoint that runs your command as xVip suggested. And then make a quick frontend to trigger the request.

iron basin
#

cool

livid oarBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.