Tuesday, October 4, 2011

What time is it?

Digging about Windows features a bit, I found Windows could also be used as an NTP server, and since I’ve been working on a native Windows environment lately, those are great news :)

Among other ways, there are two main ways Windows could set a remote clock:

  1. Via DC - If remote computer is in a domain, the DC (Domain Controller) is responsible of setting the time
  2. Via DHCP – if the remote machine has an active DHCP client, Windows can also send the clock via internal clock or fetch the time from a remote NTP server and return the current time to the remote machine.

This article is divided into two groups:

  • Windows 2000
  • Windows XP/Vista/2003/2008/7

The reason for this division is because Microsoft had changed the Windows Registry values since Windows 2000 (XP and up has much more granularity now), and that using XP and up machines with a Domain Controller turns on this feature by default.

Configuring Windows 2000 to act as an NTP server
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  3. In the right pane, right-click ReliableTimeSource, and then click Modify.
  4. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  5. Locate and then click the following registry subkey:

    HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  6. In the right pane, right-click LocalNTP, and then click Modify.
  7. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
  8. Quit Registry Editor.
  9. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:

    net stop w32time && net start w32time

  10. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:

    w32tm –s

Configuring Windows Windows XP/Vista/2003/2008/7 to act as an NTP server
  1. Create a text file and the file format to reg
  2. Open the file in notepad and copy the following:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer]
    "Enabled"=dword:00000001

  3. Save the file and execute it
  4. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:
  5. net stop w32time && net start w32time
  6. Run the following command on all the computers other than the Time Server to reset the local computer's time against the Time Server:
  7. w32tm –s

More information could be found in the below links from Microsoft:

Windows 2000

Windows XP/Vista/2003/2008/7

Have fun ^_^

Saturday, October 1, 2011

(90%) Gone in 60 seconds

I've decided that I need a software that could lock a folder in my machine. On one hand, Since the open source software out there to deal with locking folders lack a GUI I like (and I'm a sucker for GUI eye candies), and on the other hand I'm just too lazy to write a kernel driver to hook to SSDT and use NewNtQueryDirectoryFile()  (kernel32.dll).

Enters Folder Lock from NewSoftwares, with an easy to use GUI, great features with a matching price - 50$

As much as I like supporting developers, 50$ was too rich for my blood so I’ve decided to remove it, and by doing that accidently found a way to get around the problem – TrialPay

TrialPay offers the product for free as long as you purchase something else from them.

Browsing a bit, I’ve found a game I like for 10$ before a 10% discount. To that add the fact that new users get a 50% off on their first purchase.

So instead of purchasing a 50$ worth of software I’ve ended up with a free software plus a nifty game for 4.5$… not too shabby :)

Think about it next time you’d want to buy a software online.

Cheers ^_^