How can I sync my computer time with a specific website? - time

How can I sync my computer time with a specific website?
i want to my computer time is exactly same with this site:
http://www.tsetmc.com/Loader.aspx?ParTree=15131F

You can only sync your computers to a specific server, if that server provides an interface (normally via ntp) to publish its clock's time. If the server you want to use doesn't provide such a service, then the best you can do is to sync your computer's clock to a public NTP server.
One thing you could do is to ask the site's administrator whether the server is providing ntp services, or what public NTP server they are using to keep that server's clock in sync, and also sync your machine against that one.

Related

Is there another possible way to display a webpage(selfwritten) not on localhost but on any mobile browser other then paying for a webserver?

I am starting to write my thesis and I will work using Blender and Three.js for the project. As it will have a gps functionality it would be better to run it on mobilephones' browsers. I would like to know if there is any other way to do that then through a paid webserver, or without simulation or there isn't.
One option is to use a computer on your local network instead:
Set up a web server on your computer. Popular choices are nginx
or Apache.
Copy your files to the directory used by your web server.
Find out the IP address of that computer.
Enter that IP address in your mobile browser.
Of course those steps are very general, the concrete details depend on your operating system.

Disable domain IP caching

I have have few projects that I'm holding on one of my VPS from DigitalOcean. In order to keep them up even my VPS may come down, I bought another VPS from DigitalOcean with idea to sync the projects on both server, so if the main goes down the second will take the lead.
So I set a Cronjob, on the second server, that is checking the projects state on the main, and in case the response is negative, using the DigitalOcean API I change the domain A record to to direct to the second server, until the problem on the main server is not fixed.
I was afraid that the IP propagation will take too much time, but it seems to do it very fast.
Instead there is another problem. It seems the computer is caching the IP address, so it still direct to the main server.
I tested this with few computers and with service like HideMyAss.
Question: Is there a way I can tell from my server to the client that the IP is changed or to not cache my IP?
Thank you

Setting Windows server as NTP server but keeping client settings untouched

I'm working on an installation module (C#) for a distributed system.
One of the requirements is being able to setup one of the servers as an NTP server (windows time service).
I've followed several MS articles, for example:this one
but it seems that each one also requires to configure the NTP client settings (for example changing the server type from Nt5DS to NTP).
Any idea of how to keep a server's existing NTP client settings untouched while setting it as NTP server?
Thanks,
After investigating this issue for a while, looks like that's impossible.
After reading this post, I understand that the same registry key is used for both NTP client and server protocols, meaning, if the same machine needs to be a client and a serve but the client should work with, let's say, NT5DS and the server's protocol is obviously NTP than it can't work.

USB sync of local database to WP7

I have a requirement where data on SQL server needs to be synced to WP7 devices through USB.
I initially thought of writing a WCF Lib., but it'll go online & sync even if device is connected to USB in local network (Where it's easy & cheaper to get data over local network rather than go to internet & get it).
I have coded isolated storage to save the data synced, but i need an efficient way of getting data from local network, while it's connected to local network.
My questions are:
Is there a way to request data from local network when connected to local network in WCF?
Does someone have a C# code i can use to write synchronization routines to usb over local network? (I would love to have the code, if anyone has this)
Is there a better way of achieving what I'm trying to do?
I'm hoping for some quick answers for this problem, any help is greatly appreciated.
Thanks.
My recommendation would be for your WCF API to have an DNS name pointing to an internal IP address, which is not available outside of the local network and in the routing it will get resolved through USB and another DNS name pointing to an external IP Address which is only available outside of the local network. Your application would try to connect using the local IP address first, which should go through the local network and if it fails it should retry the with external option.
You can use NetworkInterface.NetworkInterfaceType to detect a connection of type Ethernet.
Implementing a full sync protocol is complicated and not something I would recommend attempting unless you really have to.
If you do go down this route I'd recommend using item based message queues and then syncing the queues (and replaying as necessary) rather than trying to sync database tables. It'll depend on the requirements of your application and nature of the data though.
Further to both Murven and Matt's answers, I'd recommend looking into the Microsoft Sync Framework, which supports WP7 as a client, commonly uses WCF on the server, and has great support for a wide range of edge cases.
You can then, as per Matt's answer, watch for connectivity changes and, on USB connection, start a sync to a local IP.
When it comes to targeting mango, you can implement it as a ResourceIntensiveTask and it will run when USB is connected, even if the app isn't running.

How do I determine the identity of a Windows machine?

I have a program consisting of a server and a client processes. Both run on Windows systems - Windows 2000 or later versions. The two processes can run on the same machine or on two different machines.
How can the client determine if it is run on the same machine as the server? If the server is not running the client can't work anyway and doesn't care where the server possibly is - so this case is out of the question. I've heard that each Windows machine has an UUID - can I obtain it and use for that purpose?
Windows networking requires computer names to be unique, so calling the GetComputerName api and having the client and server swap names (and compare the received name to the name they see) should suffice. If the client and server can start up independently of one another then you'll need some sort of protocol for this process. It seems logical for the client to initiate the exchange, and the server to only send its name when it has received a name from a client. The client can then abort the connection if it sees the same name.
I believe most virtual machine systems will allow the virtual machine to have its own name, so it should still be possible for you to test on virtual machines. However I don't have extensive experience of all the virtualisation technologies out there, so can't say for sure.
Previous question about generating a unique machine id that might help.
Link to previous answer which mentions MachineGUID
It is straightforward to add an API to the server that reports its machine name. The environment variable is COMPUTERNAME. The client could check that, right?
Do you need to deal with any of these cases?
The client is running, but the server is not responding, and you want to know whether the unresponsive server is on a remote machine.
The client and the server are running in two distinct virtual machines on the same host machine, and you want to report that as "running on the same machine."
The client is running in a virtual machine hosted by the same machine as the server is running on, and you want to report that as "running on the same machine."
The client and the server are running on uncoordinated networks and both might have been assigned the same name.
The server is possibly hostile, and will attempt to deceive the client.
The network card will have a unique MAC. If both server and client report the same MAC then they are using the same network card. If both client and server are running in different virtual machines but using the same network card, do you consider them running on the same machine or different machines?
how about trying to establish a loopback tcp connection? or maybe checking for some lock file created by the server in a predefined folder...
I don't know exactly how, but there's for sure something equivalent in Win32 to the /proc filesystem in Unix (I think there are free replacements for the windows taskmanager, maybe you could look at their sources) where you could search for your server process.

Resources