Control a mac with nodejs server - node.js

I do not really know where to post this question.. I have a nodejs server running on my mac. It listen for message if it receives "shutdown" then I run a command which turns off the mac. This works really great locally in my network. Now how to do the same but outside my local network. Lets say that I want to turn of my computer outside my house always using my nodejs script? Using dns setup? Thanks in advance!

Related

Connect postman from an RDP windows 10 client back to a node web restapi running on the macbook pro host?

I am trying to run postman in a windows 10 RDP client, and I want to test a node application running on the host computer. The host is a macbook pro and the application is running on localhost:3000 there. I can't simply use https://localhost:3000 in postman, because localhost there is for that machine. Is there a way?
I am thinking that it might be a big security hole. The more I think about it, the more I see a problem with it. I mean, I can share folders - as you do - but that is pretty controlled. I could well be wrong though

PYMODBUS: How to get master to communicate with slave?

I'm working on a project where I have two Debian VMs that both have Pymodbus installed. I'm trying to setup a virtual testing environment where I can perform various cyber attacks on the two from a third Kali VM while they communicate. Unfortunately, I'm very new to unix and PLC programming, and am having some difficulty getting the two to communicate with each other. Ideally, the master should send data to the slave, who then updates some information and sends a response back. Does anyone know how to begin to get these two to work together? I'm really at a loss here, and I have no idea where to begin. Thank you so much, I really appreciate it.
I got pymodbus from here: https://pypi.python.org/pypi/pymodbus
Documentation located here: https://github.com/riptideio/pymodbus
P.S. I used pip to install the above .whl file, but I've seen other people install pymodbus by simply running a command, which makes me worry that I've done this all wrong.
You can run a test in one Debian VM system.
1. run the server file, and set the ip and port.
2. run the client file, and connect to the ip and port.
That is tcp/ip method and you can do serial method by the same file.Just look the comments in the above files. If any questions, let me know.
server picture:
client picture:
updated:
1.connect two PCs by local area network.Make sure two PCs can ping each other.
2.set synchronous-server.py:
StartTcpServer(context, identity=identity, address=("0.0.0.0", 5020))
which means listen all the coming connection requests from all ip.
3.setsynchronous-client.py(let's assume the server pc ip is "192.168.1.10", you should replace this ip to real server ip):
client = ModbusClient('192.168.1.10', port=5020)
4.run the two py files and it should works now.

How can I test a OPC-UA server running on Raspberry Pi from a Windows computer?

As a part of a job assignment where I am to implement and test an OPC server on a Raspberry Pi, I found and implemented a node.js server found at this Github repository (sample_server.js).
Now, being new to OPC in general, I tried downloading the MatrikonOPC Explorer to connect to the server, but it refused to find the server. At first I thought I was just not putting in the right things (endpoint URL goes somewhere?) into the connect prompt, but having read some more, (I think) I now understand that the explorer uses the regular OPC specification while my server is a OPC-UA server. Please correct me if I'm wrong here.
Anyway, I would like to see if this server actually works and can be accessed. What is a good way of testing this? If possible, I would like to test it over the network, from my Windows PC (they are both on the same network, and I have ensured they are pingable from eachother).
It turns out my suspicion was right - the problem was solved by adding a UA proxy that translated the OPC-UA to OPC Classic, allowing the explorer to detect and access the server.

AR Drone over the internet

I have an ar drone that i want to fly via the browser. It currently works on localhost but as the live server is not using my machine, the drone doesn't react to the commands.
How do I get the drone to fly while connected from my machine but controlled over the internet?
I'm not worried about latency as i only need it to take off and land.
I have a signalR project about ArDrone it's control drone over internet and it works. I can send you codes
#Chris you might want to check the NVextender at http://developers.NVdrones.com. There will be a Javascript SDK that you can run in Node that maybe will allow you to achieve what you are looking for.

Local pi server running node and websockets

I'm just wondering is it possible to run a local server using node (node would be running on a raspberry pi) and communicate with it via a web browser on a different machine on the same network using websockets? I'm looking into using a browser as a control system for a project I'm working on. If it is possible is there any references I can look at?
Thank you,
Techhead55.
EDIT
I already have node up and running on the pi, it's just that I'm not sure if you can and how you implement a local server and use sockets to communicate with it in a bowser on the same network.
Not sure if you specifically ask about Node, but here is an example of a WebSocket server running on Pi, and browsers connecting to that server: http://tavendo.com/blog/post/pypy-on-the-pi/
The example does Publish & Subscribe over WebSocket using WAMP (http://wamp.ws).
Here is a similar example running on Arduino Yun that shows how to connected hardware, and publish data in real-time via WebSocket, receiving data in a browser, and real-time rendering a chart: http://tavendo.com/blog/post/arduino-yun-with-autobahn/
Disclosure: I am original author of Autobahn and work for Tavendo.
Yes.
Here is great manual from Matthias Rüedlinger:
http://blog.rueedlinger.ch/2013/03/raspberry-pi-and-nodejs-basic-setup/
Also installation of ghost with node on RPI is very nice :)
http://bit.ly/1cFwFAQ

Resources