Tuesday, December 1, 2009
Ubuntu desktop vs server kernel
http://www.enterprisenetworkingplanet.com/img/examples/ubuntu_server_config_diff.html
http://www.enterprisenetworkingplanet.com/netos/article.php/3709221
http://lists.netisland.net/archives/plug/plug-2008-06/msg00189.html
Wednesday, November 18, 2009
ntpq
to display the status of the daemon on the local machine, or
ntpq -p ntp_server
to display the status of the daemon on the remote host ntp_server. The command should print a table with one status line for each reference time source which has been configured for the NTP daemon on the specified host:
remote refid st t when poll reach delay offset jitter
=======================================================================
LOCAL(0) LOCAL(0) 12 l 30 64 377 0.000 0.000 0.000
*GENERIC(0) .DCFa. 0 - 24 64 377 0.000 0.050 0.003
+172.16.3.103 .PPS. 1 u 36 64 377 1.306 -0.019 0.043
The table above shows the output for a NTP daemon which has 3 reference time sources: its own local clock, a DCF77 radio clock as refclock-0, plus an NTP daemon on the network, with IP address 172.16.3.103.
If the first character of a line is not blank then it contains a qualifier for the corresponding reference time source. Immediately after the daemon has been started all qualifiers are blank. The NTP daemon needs several polling cycles to check the available time sources and declare one of them as the reference it synchronizes to.
An asterisk * in the first column marks the reference time source which is currently preferred by the NTP daemon, the + character marks high quality candidates for the reference time which could be used if the currently selected reference time source should become unavailable.
The column remote displays the IP address or the host name of the reference time source, where LOCAL refers to the local clock. The refid shows the type of the reference clock, where e.g. LOCAL or LCL refers to the local clockagain, .DCFa. refers to a standard DCF77 time source, and .PPS. indicates that the reference clock is disciplined by a hardware pulse-per-second signal. Other identifiers are possible, depending on the type of the reference clock.
The column st reflects the stratum number of the reference time source. In the example above, the local clock has stratum 12, the remote time server at 172.16.3.103 has stratum 1 which is the best you can see across the network, and the local radio clock has stratum 0, so the radio clock is currently being preferred.
Every time a when count reaches the poll number in the same line, the NTP daemon queries the time from the corresponding time source and resets the when count to 0. The query results of each polling cycle are filtered and used as a measure for the clock's quality and reachability.
The column reach shows if a reference time source could be reached at the last polling intervals, i.e. data could be read from the reference time source, and the reference time source was synchronized. The value must be interpreted as an 8 bit shift register whose contents is displayed as octal values. If the NTP daemon has just started, the value is 0. Each time a query was successful a '1' is shifted in from the right, so after the daemon has been started the sequence of reach numbers 0, 1, 3, 7, 17, 37, 77, 177, 377. The maximum value 377 means that the eight last queries were completed successfully. The NTP daemon must have reached a reference time source several times (reach not 0) before it selects a preferred time source and puts an asterisk in the first column.
The columns delay, offset and jitter show some timing values which are derived from the query results. In some versions of ntpq the last column is labeled disp (for dispersion) instead of jitter. All values are in in milliseconds. The delay value is derived from the roundtrip time of the queries. The offset value shows the difference between the reference time and the system clock. The jitter value indicates the magnitude of jitter between several time queries.
Monday, November 9, 2009
REPLACE vs. INSERT ... ON DUPLICATE UPDATE in MySQL
REPLACE is a MySQL extension to the SQL standard. It either inserts, or deletes and inserts.
For another MySQL extension to standard SQL — that either inserts or updates — it should be use “INSERT ... ON DUPLICATE KEY UPDATE Syntax”.
If you specify ON DUPLICATE KEY UPDATE, and a row is inserted that would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row is performed.
REPLACE (http://dev.mysql.com/doc/refman/5.1/en/replace.html)
INSERT ... ON DUPLICATE UPDATE (http://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html)
Wednesday, October 7, 2009
Recover MySQL Database root password
Taken from: http://www.debianadmin.com/recover-mysql-database-root-password.html
Ubuntu version
Monday, September 28, 2009
Sed Links
- IBM Developer Works Common Threads: Sed by Example:
- Sed FAQ<http://sed.sourceforge.net/sedfaq.html>
- Grymoire Sed Tutorial<http://www.grymoire.com/Unix/Sed.html>
- Sed and Regular Expressions<http://main.rtfiber.com.tw/~changyj/sed>
- Sourceforge project Sed<http://sed.sourceforge.net>
- SedSed<http://sedsed.sourceforge.net>
- Sed specification<http://www.opengroup.org/onlinepubs/009695399/utilities/sed.html>
- Regular expressions specification<http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html>
- Sed Tutorial<http://www.panix.com/~elflord/unix/sed.html>
- Sed Users Mailing List<http://groups.yahoo.com/group/sed-users>
Thursday, August 20, 2009
Playing with DATE and FOR in XP DOS
Wednesday, August 19, 2009
Configure TIMEZONE in Ubuntu 9.04, the current stable version, released in April 2009, codenamed Jaunty Jackalope
tzconfig command is deprecated.
Friday, July 10, 2009
UDP server in Perl
Wednesday, June 24, 2009
AnkhSVN
AnkhSVN is a Subversion SourceControl Provider for Visual Studio. The software allows you to perform the most common version control operations directly from inside the Microsoft Visual Studio IDE. With AnkhSVN you no longer need to leave your IDE to perform tasks like viewing the status of your source code, updating your Subversion working copy and committing changes. You can even browse your repository and you can plug-in your favorite diff tool.
AnkhSVN is an active open source project with multiple committers from around the world (including CollabNet).
The site is: http://ankhsvn.open.collab.net/
Tuesday, June 23, 2009
The Thread Control Escape Rule
When trying to determine if your code's access of a certain resource is thread safe you can use the thread control escape rule:
If a resource is created, used and disposed within
the control of the same thread,
and never escapes the control of this thread,
the use of that resource is thread safe.
Resources can be any shared resource like an object, array, file, database connection, socket etc. In Java you do not always explicitly dispose objects, so "disposed" means losing or null'ing the reference to the object.
Taken from: http://tutorials.jenkov.com/java-concurrency/thread-safety.html