Browser app to connect to several sshd - browser

I would like to draft a browser application which can connect to ~20 remote sshd. Per ssh connection multiple commands should be handled. After restarting the browser, the several running jobs should be displayed in the browser again.
How would you construct the application ? The application should run on a Raspberry Pi. So utilization is limited.

Check the wikepedia page for web based SSH. The basic idea is to have JavaScript on client to submit commands to server side web application. And server side application will connect to several different server sshd as proxy to send command and receive output.
Personally I will suggest to use WebSocket to implement the communication between client and server. But not sure what's the OS you will have and what library and programming language will be handy for you.

Related

Measuring the performance of VNC feeds

We have a web application which connects to a remote server through VNC. The user do some use cases on the VNC server through this connection.
I want to do the performance testing of the use cases. How to measure the speed (performance) of the VNC feed from my web application to the VNC server?
I could not find anything with JMeter or Load runner tools, Is there any tools available to measure this?
You can consider using a VNC client library like vernacular-vnc or TightVNC-Java-Viewer in order to connect to the VNC server and consume the video stream and/or send some client actions
The libraries can be used from i.e JSR223 Test Elements using Groovy or you can develop your own JMeter plugin

Check if my Nodejs server is running remotely

I have a Nodejs server running a website remotely in a Windows 10 machine. But the machine is sometimes turned off and I do not know that the website is down.
I was thinking of creating a Nodejs website and have it run in Heroku that sends a request to my website running in the windows machine every 5 minutes and notify me via email if it does not get a response. However, I wanted to know if there are better options available for situations like these.

Deploy ReactPHP on PHP host

I use the example for the chat server in ReactPHP. My server listens on port 8080
$socket = new React\Socket\Server(8080, $loop);
$server->listen($socket);
in my local PC. The written code is working correctly but when upload files into my Linux host, nothing works. I wrote a ticket to the support team from my hoster, they said that this is not possible in Linux. Is that correct?
ReactPHP core team member here. Your run-of-the-mill shared hosting won't be able to host this. You need your own server, VPS, or bare metal, to run ReactPHP as a server because you're dealing with a daemon process. And shared hosting generally doesn't support that.
My suggestion is to get a VPS somewhere and look into Supervisor to keep your process running and restart it when something happens to it. This also requires you to manage your own server with all the firewalling and networking knowledge that comes with it.

Is it possible to build a headless Node-based client from Meteor?

I'm working on a system where a remote machine (hooked up to a projector and some other hardware) is controlled via a Meteor application. Currently, we are using a home-grown DDP client written in C++ to accomplish this, but this approach is not as flexible as I would like:
There is duplication between C++ and JavaScript.
Upgrades are hard because we can't deploy both the server and the client at the same time, so we always have to think about backwards compatibility and ordering.
So I'm toying with the idea of rewriting the Meteor part of the C++ app in JavaScript. What I would like, ideally, is to have a special client of our app (call it headless, akin to to server and client) which:
is built from the same source as the rest of the Meteor app, so we can reuse the same business logic as on the server and web client,
runs in Node.js on the client machine so it can access the OS, and
doesn't contain any of the browser code, but adds some other code specific to controlling the machine and communicating with the C++ app.
Even better would be if this client would not contain any of the actual code, but just a piece of bootstrap code. The bootstrapper would download the actual application code from the server and re-download it when the server is updated, in the same way as happens for the HTML client. That would make updates much easier, because we can assume that server and client are always running the same version.
Does such a thing exist? If not, how close can I get without unreasonable effort? Searches for "meteor headless client" and "meteor node client" are not helping me, and the only somewhat related question I could find isn't well answered.
You should be able to get this to work by using the meteor-desktop package to build your remote headless client.
https://www.npmjs.com/package/meteor-desktop#architecture
In Electron app, there are two processes running along in your app.
The so-called main process and renderer process. Main process is just
a JS code executed in node, and the renderer is a Chromium process. In
this integration your Meteor app is being run in the renderer process
and your desktop specific code runs in the main process. They are
communicating through IPC events. Basically, the desktop side
publishes its API as an IPC event listeners. In your Meteor code,
calling it is as simple as Desktop.send('module', 'event');.
This will give you:
os access on this (desktop) client
hot code push (with caveats around the node modules)
provides Meteor.isDesktop to control which code runs on the browser vs the desktop client
If you wish to use the Meteor client as a headless client, and since client runs in the browser, I'd suggest your look at using a headless browser like PhantomJS, which can run your Meteor code without the UI, and has the ability to access the local file system.
Another option, which is not really what you describe but would make everything javascript, is to use the node ddp client, and write your code in modules you can easily import on the node side.
Is there a regular meteor client on the remote machine with custom hardware? Or is that the C++ program acting as a client? And then a server, in addition to your other client browser?
Sounds like you should actually do a few things differently:
Set up a dynamic DNS system with a custom domain and port forwarding so you can use the special hardware remote system as a server.
Run the Meteor server on that remote machine with hardware.
Instead of a full C++ app speaking DDP, just make a Node.js C++ addon that talks to the hardware and use that in the Meteor server code.

How to use Redis / Node.Js on a production server

I get what Redis and Node.js are but i don't understand how to run them on a live server. Locally its an install and you use the command line to get them running but i don't know how to install them on a live server.
I've already browsed around a bit but im still confused and also isn't Node.JS a server itself so its like running a server on a server? wouldn't that have effects on performance and what not?
I'm just confused on how it would work, any explanation will be great.. thanks
Redis & Node.js = Software
You install those on a physical machine, a computer. A node.js server is not a physical server, but an application that can handle HTTP requests. Normally, a node.js server runs on a port on a physical machine. So any HTTP requests sent to that port are handled by the node.js application. You can use a webserver, which is another piece of software that handles HTTP requests, like Nginx or Apache to manage multiple domains on a physical machine (the server). Redis also runs on a physical machine and listens on a specified port.
For example, I have a VPS with 4 websites on it managed by Nginx. Two of those websites are Laravel projects that connect to a MySQL server (on another machine) and to a Redis server on the same machine. The other two are node.js applications which don't need a database or Redis, so they just listen on their own ports and Nginx proxies all connections to their domainnames to those ports.
So you're not actually running a server on a server, but you're running software that handles certain things on a server.
There are different ways to run a node service. I strongly recommend docker to run everything but here is a short list of the most popular ones:
https://www.docker.com/ https://hub.docker.com/_/node/
http://pm2.keymetrics.io/
https://www.npmjs.com/package/forever (seems like a bit outdated)

Resources