Dec 31, 2008

How often does Windows NTP correct the clock against the NTP server?

How often does Windows NTP correct the clock against the NTP server?
Well after many hours of investigating I found the answer is more complicated that I thought. An entire list of settings and defaults can be found here:
http://technet.microsoft.com/en-us/library/cc775797.aspx

To answer this question the important registry key is The "MaxPollInterval" registry key. This key controls in timing at which the computer will query for NTP time.

The Key can be found here:
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config
Data type = REG_DWORD
Default value = 15

Description
Specifies the longest interval (in units of 2 to the n power seconds, where n is the value of this entry) that is allowed for system polling. While the system does not request samples less frequently than this, a provider may refuse to produce samples when requested to do so.
(http://technet.microsoft.com/en-us/library/cc739293.aspx)

The clock then corrects itself based on other values in the registry in its range. So basically if left at default it will poll every 32,768 seconds or 546.1333 Minutes or 9.10222 Hours.

The Correction
The "FrequencyCorrectRate" registry entry Controls the rate at which the time service corrects the clock.

The Key can be found here:
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config
Data type = REG_DWORD
Default value = 4

The Effect this key has is One over the rate at which the clock is corrected. If this value is too small, the clock will be unstable and will overcorrect. If the value is too large, the clock will take a long time to synchronize.
(http://technet.microsoft.com/en-us/library/cc775797.aspx)
This value, in units equal to the reciprocal of the rate at which the clock is corrected, is multiplied by the number of clock ticks in 64 seconds, to produce the base gain in the phase-locked loop (PLL) of the clock correction algorithm.
(http://technet.microsoft.com/en-us/library/cc738293.aspx)


Ok that's nice, but what does that translate to?
Well basically there is a correction algorithm that is built in that will correct the clock in small increments until it is in sync with the source. I could not find this algorithm so if you know what it is please post it in a reply.

If you have more questions about Windows Time Service check the official blog at:
http://blogs.msdn.com/w32time/default.aspx

Internet Time Sources
If you are looking for an external time server the PDC or Primary NTP server for your facility should point externally. NIST or the National Institute of Science and Technology keep the world clock for the US which is in Boulder, Colorado. They also keep several servers around the USA running for people to sync to. You can find the list at:
http://tf.nist.gov/tf-cgi/servers.cgi

Dec 29, 2008

How to Install a plug-in or update Eclipse

Obtain the update site url from the eclipse plugin you would like to add or update. This can usually be found on the project web site.

Open Eclipse > Help > Software Updates > Available Software [tab] > Add Site [button] > Add url to the location field > Check the appropriate options under the update site > Install [button]

How to disable XML and other Validation in Eclipse

Window > Preferences > Validation and uncheck the appropriate Validator. This will also help speed up the Eclipse refresh time.

Dec 11, 2008

MD5 Password Generation via Linux

You can run the following command in Linux to generate an MD5 password:

echo -n "the_password" | md5sum

Nov 18, 2008

GUI Tool for working with Web Services

soapUI is a free and open source desktop application for
  • inspecting Web Services
  • invoking Web Services
  • developing Web Services
  • Web Services Simulation and Mocking
Functional, Load and Compliance testing of Web Services
It is mainly aimed at developers and testers providing or consuming Web Services (Java, .net, etc). Functional and Load Testing can be done both interactively in soapUI or within an automated build or integration process using the soapUI command line tools.

http://www.soapui.org/

GUI Tool Alternative to Keytool

Portecle is a user friendly GUI application for creating, managing and examining keystores, keys, certificates, certificate requests, certificate revocation lists and more.

http://sourceforge.net/projects/portecle

Nov 12, 2008

Run Specific Test in Maven

mvn test -Dtest=[test filename minus extension]

Free CSS Editor

CSSVista is a free Windows application for web developers that lets you edit your CSS code live in both Internet Explorer and Firefox simultaneously.

http://litmusapp.com/labs

Oct 22, 2008

java.lang.IllegalAccessError

This is most likely due to a bad jar file or two different versions of the same jar file included in the path. Try upgrading or downloading the jar file again.

Oct 21, 2008

Linux Mounted Driver cannot remove directory error message

When running rm -rf [directory name] the following error message occurs:
rm: cannot remove directory '[directory name]': File exists

If this occurs when trying to remove a file from a mounted drive, try unmounting the drive and remounting it.

Oct 20, 2008

How to change the default location of a Maven repository

Modify the settings.xml file to include the new repository location. Change the following line in the settings.xml file:

/path/to/local/repo

Oct 17, 2008

How Add Source to Eclipse

From the main menu at the top select Project/Properties
Select the Java Build Path on the right
Click on the Libraries tab
Browse the tree of libraries until you find the appropriate library
Expand the tree and click on Source attachment
Click the Edit button
Click the External Files button
Select the location of the source files (must be a zip or jar file)

Oct 15, 2008

Linux Commands

How to search files for specific terms:
grep -r [search term] .

How to add items such as svn, mvn, java, etc. to your PATH and set environment variables for all users:
Edit the /etc/profile file and then run .[space]/etc/profile with
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

How to set an environment variable:
export JAVA_HOME=/usr/java/
export ANT_HOME=/usr/ant/

How to find out where and command is installed such as java, ant, mvn:
which java
which ant
which mvn

How to stop a running program:
First determine the pid of the program:
ps -ef | grep [program name]

Then use the pid to kill the program:
kill -9 [pid]

How to search for a file:
find . -name [filename]

How to unmout a drive (Notice the command is umount and NOT UNmount):
umount [mount location]

How to clear the Java Web Start cache:
javaws -uninstall

How to view the Java Web Start Console
javaws -viewer

How to mount a drive:
mount -t [new mount name (this directory must exist)] [mount location]
mount -t /home/user/share /mnt/floppy

Oct 14, 2008

Windows Vista Connect.dll Error Message

Error message

Component GUID:{7071ECA3-663B-4BC1-A1FA-B97F3B917C55}
Component file: [C:\Windows\system32\connect.dll]
Error: (0x8007277B) .

Additional Info:
Failed to detect Internet connectivity

Description

Received the following error message when trying to connect to the Internet on a Windows Vista computer.

Solutions

TCP/IP stack repair options for use with Windows Vista.
  1. Start, Programs\Accessories and right click on Command Prompt, select "Run as Administrator" to open a command prompt.
  2. Reset WINSOCK entries to installation defaults: netsh winsock reset catalog
  3. Reset IPv4 TCP/IP stack to installation defaults. netsh int ipv4 reset reset.log
  4. Reset IPv6 TCP/IP stack to installation defaults. netsh int ipv6 reset reset.log
  5. Reboot the machine.
Reinstall network/modem Driver

Uninstall the network/modem driver from Device Manager: select the items and hit Delete. Reboot.

Anti Virus and Firewall Software

Installation or Removal of Anti Virus or Firewall product can prevent the network devices from getting an IP.

Windows Update

Windows update has been known to cause this issue.  Uninstall the most recent windows updates.

Jul 20, 2008

How to import data into MySQL

Description

Importing Data into MySQL

Solution

mysql [my_db_name] -u [user_name] -p[password] <>

Jun 1, 2008

How to install MySQL Server 5.0.51a on Windows Vista

Description

Installing MySQL Server 5.0.51a on Windows Vista

Solution
  1. Use mysql-essential-5.0.51a-win32.msi
  2. Download and run Resource Hacker http://www.angusj.com/resourcehacker/
  3. Open ...\MySQL Server 5.0\bin\MySQLInstanceConfig.exe with Resource Hacker
  4. Navigate to 24\1\1033
  5. Delete all text in the window
  6. Press "Compile script"
  7. Exit Resource Hacker and save the result (overwrite the initial MySQLInstanceConfig.exe)
  8. Now MySQLInstanceConfig.exe should start normally.

Mar 14, 2008

javax.servlet cannot be resolved when using Java 6

Error Message

The import javax.servlet cannot be resolved when using Java 6

Description

Java 5 uses the j2ee.jar library for javax.servelet where Java 6 uses the javaee.jar library

Solution

Add javaee.jar to the project class path. Note: Use the jdk or skd and not the jre.
In Eclipse > Project Properties > Java Build Path > Add External JARs > javaee.jar which can be found in the %JAVA_HOME%\sdk\lib