Executing shell/ssh commands via web app [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to run commands on my home server via a web app. Is there a way to do this?
I have no interest in returning the output, I just want to execute commands like irsend when a button is pressed on the page.

You can't execute commands directly from the browser, that is why child_process.exec() does not work when browserify your code.
You will need to send an HTTP request of some kind to the server and have it run the command there instead (using child_process.exec()/child_process.spawn()).

Related

python flask edit products buttons [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I'm making a code in python with flask that deals with registering products, and I'm using buttons that allow me to edit and delete the product, I can't get it to edit the product every time I try, it doesn't give me an error but it doesn't get edited, I do not know how to fix it
I checked the query to mysql but it's not that, and I've been checking for a long time and I don't know what it is
I am using html, python, js

How to add my Python program in cloud and run it in Android app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I programmed a Python program that can take a photo as an input and find faces (Face Detection). But I want to implement it in a cloud server.
My program should go and read the python code from the server and return a valuel.
Take your python program and make it an endpoint on a flask or django server.
Or if you don't want to host your server, put your program into for example an AWS Lambda and make it access it with API Gateway (https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-with-lambda-integration.html)

How to navigate a webpage with python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was made a python script for bruteforce (pen test) but before the bruteforce start, I need to go through some links clicking and login, so I want to do those stuff with python. Basically when I start that script it should login and click some links then start the bruteforce.
so, is there any way I can make my python script to do those basic stuff for me?
You might want to check these:
mechanize
Selenium
Spidermonkey
webkit
These tools will help you to emulate browser via script.

Run command in background with Fabric [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to run a background script with Fabric using Bash's '&' operator. Is there a reason the following doesn't work? I executed this command on the server itself and it runs fine.
#task
def run_script():
sudo('sh /home/ubuntu/wlmngcntl.sh start &', user='myuser')
I don't want to use something heavy like Celery to do this simple thing. I don't need to capture the output at all, all I want is for the task to execute this and return after.
This isn't a Fabric thing, but a Linux thing. When you close a session, the processes connected to that session are terminated.
This question has a lot of info... https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session
You could use the following (from that answer)
sudo('nohup sh /home/ubuntu/wlmngcntl.sh start &', user='myuser')

Best way to trigger a Node-RED flow from python script [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm running Node-RED on a raspberry pi. I want to trigger a flow at the end of a python script I'm running on the same rpi. What's the easiest input node to trigger and what would be an example of the python code to use with it? I'd like to pass a string variable back
Taking best to be easiest then the http-in node is probably best
And using something like this will work:
import urllib2
urllib2.urlopen("http://localhost:1880/start").read()
Where the http-in node has been configured to listen on /start

Categories