Execute an EC2 command via the browser (Google Chrome) - javascript

I need to execute a command on AWS EC2 on demand, rather than a scheduled cron. How can I trigger a script on the command line on my EC2 by just using the web browser?
I have made an attempt via a webhook via Zapier but struggling to link this into the EC2 CLI.

Use Systems Manager Run Command or Fabric over SSH (example here, though it won't work from within a browser).

Related

How to run k6 tests on amazon cloud

I want to run some load tests but my pc cannot handle more requests than the server. So I would like to run these tests on amazon ecs. Is there a way to run k6 on amazon cloud instead of their loadimpact cloud, if so, how?
Yes you can run k6 on Amazon cloud. The easiest way is probably to stand up a Centos or Ubuntu server in ec2 and then install k6 on it. This is how I have run it. Then install InfluxDB on the server also along with Grafana. Feed the output of the load test from k6 into InfluxDB and there is a community Grafana dashboard that will display stats from the load test. It will be close to using LoadImpact. You will still need to use LoadImpact to create the scripts if you are using the web browser plugin. But that is free.
You can run k6 inside a docker container too. I have not done that yet, but a coworker did. I am going to look into using ECS to run the container version of k6. But I have not tried it yet. You would still want an ec2 instance with InfluxDB to grab the data out of k6.

Lighsail Bitnami MEAN Stack Application Continuous Running

I have an MEAN application running on server through Amazon Lightsail. I installed my application in the /projects folder and once I ssh onto the server and run node bin/www (where my main startup scripts live) the site runs perfectly. The issue comes once I close the ssh shell the site goes down (node stops running). Does lightsail / AWS provide any utilities to keep up the server or do I need to manually install a service that keeps it up so I can point a domain at the IP and it is consistently running?

Is there a way to run a Node.js application within a Tomcat server?

I have a REST Web Service running within Tomcat and I do not want to run the Node.js application manually. Can I somehow run my Node application using Tomcat?
You cannot run Nodejs server inside tomcat.
I would suggest to ge to http://nodejs.org/ and read some docs and refer some videos.
I have used openshift to host my node js application
please refer this link to know more about where to host nodejs application

NodeJs talks to ubuntu server on EC2

Recently I have installed a nodejs app on my EC2 directory, listening to one of the port from EC2 instance. I also have a couple of executable python scripts on my EC2 ubuntu Linux server.
The way I run those executable python script is to use putty and connect to ubuntu via command line( for windows, Sure for Mac I use terminal). I am just wondering, is it possible to have the nodejs app does the same job, so I will have a UI based on the web app, which can talk to ubuntu and execute those scripts (python scripts such as "python run.py".
Please advice, thank you!
If I'm understanding correctly, the Python scripts are on the same server as the Node app, and you'd like to run them from Node.js
var execScript = require('child_process').execFile;
execScript('/path/to/python/script.py');
Should probably do the trick.
Can also add options or callbacks as needed, see the docs here: http://nodejs.org/api/child_process.html

Installing NodeJS and SocketIO in a Remote Server

My project is a Real Time Two-Player Facebook Game, and what I need is a tool that will help me build the game with quick responses to enable the "Real Time" function of the game. I have just found out about the Node JS and Socket IO. I have some knowledge in JavaScript so I stepped up and watched a few tutorials that discuss the functions of Node JS and Socket IO.
Here's the link to the videos that I have watched:
http://www.youtube.com/watch?v=mSE6xHkcX0w
I understand the basic of the Node JS and Socket IO and successfully installed it in my localhost. The problem is when I uploaded the files from my localhost to my remote server, some functions of the program are not working well. I don't know how to node my JavaScript file when it is on the server, because if it's in my localhost, I am using command prompt to run it.
node app.js
Node is not a web framework.
Chances are, you're using a web host that's generalized for web frameworks like PHP and Ruby on Rails. You're going to need virtual private server hosting, or Node-specific hosting, because Node requires a virtual machine to run. You otherwise won't be able to run Node Package Manager or Node itself.
Joyent has provided a list of hosts here.
If you chose to use a VPS or dedicated machine, an installation guide would be found here. This is how you would install Node on CentOS.
wget http://nodejs.org/dist/v<version>/node-v<version>.tar.gz
tar -zxf node-v<version>.tar.gz
cd node-v<version>
./configure
make -j <number of cores>
make install

Categories