How to synchronize hour between two Win7 machines to have the same timestamp - datetime

I developed a MFC application in C++ which I use to capture data from some USB sensors in order to save the information in a TXT file. For each data, I also save the timestamp with boost function.
I need to use my application also with another pc since I have to acquire data twice and I'd like to know what's the best method to synchronize the data between these two pcs.
I'm using the first pc to create a Wifi network and I'm able to connect the second pc to the first one and then I'm trying to use "net time" to set the NTP service without success.
Is there any tutorial or someone which can explain me how to synchronize date time between two Win7 pcs, please?

Perhaps this command? Run from the cmd prompt.
net time \\MasterPC /set /yes
where MasterPC is the network name of the computer you want to take the time from.

Related

How to configure ports used for communication between R and RStudio?

First, I'm not a R/RStudio user at all. I'm a Windows admin with the task to configure R and RStudio on a multi-user Citrix environment. To identify users between the multiple sessions, we are using the Palo Alto Terminal Server agent which will allocate a range of ports for each user and use them to identify each users. That's then used to give limited and specific access to resources for each users.
The problem is that the TS Agent also intercept the localhost connection that's created when you start RStudio (process rsession) and RStudio then cannot connect to R. One possible solution to solve this problem is to have control on the ports used when this local session is started.
I have made multiple research on the Internet but I have been unable to find if/how you can change the ports that are used. I have found different config files but none that seem to allow me to fix a single port or a port range.
Any insights on the way to fix the ports for the rsession process so I can better control them? Or another way to look at the problem: do you know the port range used by R/RStudio when they communicate together through the rsession? I can simply avoid using these range with the TS Agent.
I have only skimmed through the RStudio Source code, but it seems that the port is assigned randomly:
https://github.com/rstudio/rstudio/blob/bcc8655ba3676e3155d80296c421362881340a0f/src/node/desktop/src/main/application.ts#L226
However, it also seems like there is a startup parameter --www-port to set the port:
https://github.com/rstudio/rstudio/blob/bcc8655ba3676e3155d80296c421362881340a0f/src/node/desktop/src/main/session-launcher.ts#L592

How do I send keystrokes/interative gui to another Win10 machine?

I'm currently using AutoHotKey to create a variety of macros. I have two desktops side-by-side in a private (home) network. It is my desire to have the AHK Run command on PC1 make some sort of call to PC2. Both PCs are running Windows 10 (non-domain), and both use the same login credentials (same account via microsoft.com).
What I've tried: I have tried a few things, such as WMI, WinRM, schtasks. Each of these options work when dealing with non-interactive scripts. I am trying to call scripts that a) open GUI windows or b) send key strokes to PC2.
Other requirements:
The solution cannot require the password to be type in a prompt nor provided in the command-line call. The desired effect is that I press a button on my keyboard -> ahk command triggers -> script on PC2 is called.
As this network is shared with roommates (and whoever they allow to connect to our wifi), basic security is still a necessity.
This is not a language specific question - I am looking for the simplest/easiest/cleanest method. Thanks for reading.
Try a remote access connection app like TeamViewer. They allow you to control one PC from another across a network. https://www.teamviewer.com/en/
I have an astronomical observatory in my yard with four computers connected to all the observatory equipment. These four computers are controlled over my home network from one PC in the house.
The remote access app allows you to run an .exe on another computer which in my case is usually a compiled AHK script.
I have a number of tasks that require several PC's. A script running on the main PC will start secondary scripts on the observatory PC'c which in turn will send messages back and forth by sending text files to each others shared files. The PC receiving the text file will perform a specific action based on the message.
Here's a link to the observatory startup procedure. I a startup script on the main PC which turns on all the observatory equipment then starts a secondary startup script on each of the observatory PC's to load and position all the software and then connect all the cameras and associated equipment.
https://www.youtube.com/watch?v=UN4VoOKOcXo&feature=youtu.be
This just shows how the various scrips running on the observatory PC's load and position all the various app windows. Not exactly what you may need but it may give you some ideas about what you can do with the remote access software.
Lorence

I want to export data from a BLE112 dongle on BLE GUI to a csv or other similar type file

I have a device connected to my Bluegiga BLE112 dongle that sends temperature measurements every second. I am using BLE GUI to connect to and receive the data. I would like to store all the measurements in a csv file so I can import it into another program and analyze it. I have already enabled indications, so the data shows up and updates in the 'raw' column as shown:
but I cannot figure out how to store or export that data.
Unless BLE GUI has changed significantly (I haven't used it in about 1-2 years), you can't do anything like this.
You'd need to write your own app or laptop/desktop communication and parser/save.
HOWEVER! One option you could use that I used to do is try out my BLE Log parser:
http://www.sureshjoshi.com/development/summer-of-bluegiga-code/
http://www.sureshjoshi.com/development/blegui-log-parsing-and-filtering/
I wrote a little tool a couple years ago which would parse data coming from the log, and place it all in one place, so I could copy and use that elsewhere (I was using it for tracking advertising data on multiple devices).
NOTE: I haven't touched that code since that blog was written - no idea if it'll work.

Interprocess communication in Unix/AIX

Is that possible to achieve Inter process communication using any terminal or serial ports in AIX or Unix?
I would like to achieve this by using commands/scripting only where one process writes a string on terminal and another process reads same terminal and processes that string. I know that using pipe also this is possible but I do not have enough idea on that.
Also is there a way we can determine which all ports/terminals are available in AIX machine?
Or is it possible to create new terminal at run time (not the boot time) that will be used by only above two processes?
I think what you want are pty's? Or, another option would be unix domain sockets.
The answer to your first question is "no"... not really. When you write out to a tty, that output is sent out to the real device and not available to be read back.
The list of tty's on a system is: lsdev -Cctty
Creating tty's at run time is possible but not really what you want either. A tty is a child of a serial port and you can not add serial ports arbitrarily. They are real things. With AIX and Power systems, you can add devices while the system is up (hot swap) but that is getting (I'm assuming) way far off your original topic.
The basic different between a pty and a unix domain socket is a pty mimics the output and input process of a real tty in one direction. This is what telnet, rlogin, ssh, and many other daemons use when connections come in. It is easy to make ksh believe that it has a real tty by using pty's. If you don't need that, then they are added trouble that you don't need. Find a link on how to create and use a Unix domain socket and you will have what you need (or a pipe but a pipe requires a parent / child relationship which I assume you do not have).

Is it possible to control System Volume, and Get network information, Battery information on VB.Net with Mono

I was wondering if it was possible to be able to control/get the system volume, get network information (i.e is it a wired or wireless connection, name of network, etc.) and get battery information with VB.Net using Mono on Ubuntu 12.10? Thanks.
You can use the System.Diagnostics.Process class to call out to the shell and invoke the commands / get the information you require. There is an example here.

Resources