Go Back   Linux CentOS, Control Panel, Hot girl, TOP 10 GOOGLE, Server - System - Manager, Operation System, Thiet ke website, Hack war3, hack map, dota hacking > Dành cho webmaster > Server Manager

Hack map cua war3 version 1.24e - co the chuyen tien
Hack gunz.2it.in mới update ngày 2/3/2010 (test by Admin)
Hướng dẫn Hack gold member tại quán net để mang về nhà
hack map dota cho war3 ver 1.24a, hackmap 1.24b, hack map 1.24c, hack dota 1.24d, hack map war3 1.24e, co the chuyen tien
crack windows 7 all version (using activators)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 26-09-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 276
Thanks: 1
Thanked 0 Times in 0 Posts
Default NTP (Network Time Protocol) Server on CentOS 5

Step 1
Code:
#yum install ntp
or download ntp rpmpkg
Step 2
Code:
# crontab -e
*/15 * * * * ntpdate 210.72.145.44
Step 3
Code:
# vi /etc/ntp.conf
(add or replace the text as follows)
server 210.72.145.44 prefer
(set the default source is from "TIME OF THE NET SERVER IN CHINA")
server 218.21.130.42
(an other source server)
restrict 0.0.0.0 mask 0.0.0.0 nomodify
(allow all client)
Step 4
Code:
# chkconfig ntpd on
# vi /etc/sysconfig/ntpd
 SYNC_HWCLOCK=yes
(write the sync time to CMOS)
Final
Code:
# pgrep ntpd
(checking the ntpd process ID)
# netstat -ntlup
(checking the sync status)
# ntpq -p
(checking the port’s status)
configure the firewall rule, make sure the UDP:123 is accept.
#service ntpd start
 (start the ntp server)
Client may get the ntpserver time after 5~10 min.
 **************************************************
Elvis Woo NTP (Network Time Protocol) Server on CentOS 5
Reply With Quote
  #2 (permalink)  
Old 26-09-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 276
Thanks: 1
Thanked 0 Times in 0 Posts
Default Đồng Hồ Trên Linux - Network Time Protocol ( NTP )

Chỉnh đồng hồ

Câu lệnh date được dùng để truy cập và thiết lập đồng hồ hệ thống

[root@centos ~]# date
Mon Jun 23 16:47:43 ICT 2008

Chúng ta có thể thiết lập định dạng thời gian cho câu lệnh date với tùy chọn "+"

[root@centos ~]# date '+%D %T'
06/23/08 16:48:19
[root@centos ~]# date '+%H:%M:%S %d/%m/%y'
16:49:16 23/06/08

Ngoài ra, ta cũng có thể hiển thị các ngày khác với ngày hiện thời

[root@centos ~]# date -d 'yesterday'
Sun Jun 22 16:49:41 ICT 2008
[root@centos ~]# date -d '3 months ago'
Sun Mar 23 16:50:02 ICT 2008

date cũng có thể được dùng để hiển thị ngày cuủ một file cụ thể:

[root@centos ~]# date -r /etc/ntp.conf
Sat Nov 10 19:34:05 ICT 2007

hwclock là câu lệnh dùng để kiểm soat đông hồ phần cứng do BIOS quản lư. Khi dùng date để thay đổi giờ th́ đồng hồ phần cứng sẽ không bị ảnh hưởng, do đó tại lần khởi động máy kế tiếp, hệ thống sẽ lấy thông tin thời gian từ đồng hồ phần cứng. Để dùng câu lệnh hwclock, ta phải dùng account root.

foo:~ # hwclock
Fri 27 Jun 2003 14:01:24 SAST -0.462635 seconds

Đồng hồ phần cứng có thể được thiết lập theo thời gian của vùng bạn ở hay theo UTC. Khi hệ thống khởi động, đồng hồ hệ thống sẽ lấy giá trị từ đông hồ phần cứng bằng một trong hai câu lệnh sau:

hwclock --hctosys --utc # BIOS clock is UTC
hwclock --hctosys --localtime # BIOS clock is local time

Thiết lập giờ hiện tại và giờ hệ thống (BIOS)

hwclock –-hctosys // set đồng hồ hệ thống (BIOS) cho đồng hồ hiện tại
hwclock --systohc // ngược với hctosys

Tùy theo phiên bản Linux, ta cần thay đổi một trong những file sau để thiết lập thời gian, t́m ra timezone của hệ thống.

/etc/sysconfig/clock # Redhat, newer SuSE – HWCLOCK value
/etc/rc.config # SuSE – GMT value
/etc/defaults/rcS # Debian – UTC value

/etc/localtime là một symbolic link hoặc là một bản sao của /usr/share/zoneinfo. Điều này được thiết lập lúc cài đặt hệ thống.

Câu lệnh zic dùng để thiết lập nội dung file /etc/localtime. Ví dụ

% zic -l "Africa/Johannesburg"

Network Time Protocol (NTP)

The Network Time Protocol (NTP) is a protocol used to help synchronize your Linux system's clock with an accurate time source. There are that allow the general public to synchronize with them.

* Stratum 1: NTP sites using an atomic clock for timing.
* Stratum 2: NTP sites with slightly less accurate time sources.

NTP cho phép đồng bộ đồng hồ của hệ thống với UTC (Universal Coordinate Time) thông qua một máy chủ thời gian. Cách dùng NTP đơn giản nhất là truy vấn thời gian của máy chủ bằng câu lệnh ntpdate. Câu lệnh này sẽ lấy thời gian từ máy chủ và cập nhật đồng hồ hệ thống.

Kiểm tra, cài đặt NTP:

Kiểm tra xem ntp có chạy không:

$ ps -ef | grep ntp
root 3275 3112 0 16:07 pts/2 00:00:00 vi /etc/ntp.conf
ntp 3557 1 0 17:27 ? 00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root 3563 3402 0 17:27 pts/3 00:00:00 grep ntp

Kiểm tra xem trên Server đă cài ntp chưa:

[root@centos ~]# rpm -qa | grep ntp
chkfontpath-1.10.1-1.1
ntp-4.2.2p1-7.el5

Nếu chưa có th́ cài nó lên.

# yum -y install ntp

Sau đó cấu h́nh cho ntpd start khi hệ thống khởi động:

$ chkconfig ntpd on

Làm việc với ntpd bằng các lệnh:

$ service ntpd stop
$ service ntpd start
$ service ntpd restart
$ service ntpd status

File cấu h́nh mặc định:

$ /etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

Kiểm tra ntp làm việc

[root@centos ~]# ntpq -p

remote refid st t when poll reach delay offset jitter
=================================================
ips61.reverse.n 132.239.1.6 2 u 28 64 3 10.472 148790. 8.879
LOCAL(0) .LOCL. 10 l 26 64 3 0.000 0.000 0.001

Cập nhật thời gian tại một server khác:

ntpdate –q <địa chỉ time_server>
Welcome to my blog: ??ng H? Trên Linux - Network Time Protocol ( NTP )
Reply With Quote
  #3 (permalink)  
Old 10-05-2010
Moderator
 
Join Date: Jul 2008
Location: Morocco
Posts: 192
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sannhac
Default Linux Tips - Linux, Clocks, and Time

Introduction

This document explains how to set your computer's clock from Linux, how to set your timezone, and other stuff related to Linux and how it does its time-keeping.
Your computer has two timepieces; a battery-backed one that is always running (the ``hardware'', ``BIOS'', or ``CMOS'' clock), and another that is maintained by the operating system currently running on your computer (the ``system'' clock). The hardware clock is generally only used to set the system clock when your operating system boots, and then from that point until you reboot or turn off your system, the system clock is the one used to keep track of time.
On Linux systems, you have a choice of keeping the hardware clock in UTC/GMT time or local time. The preferred option is to keep it in UTC because then daylight savings can be automatically accounted for. The only disadvantage with keeping the hardware clock in UTC is that if you dual boot with an operating system (such as DOS) that expects the hardware clock to be set to local time, the time will always be wrong in that operating system.
Setting your timezone

The timezone under Linux is set by a symbolic link from /etc/localtime[Thành viên phải đăng kư mới xem được link này. ] to a file in the /usr/share/zoneinfo[Thành viên phải đăng kư mới xem được link này. ] directory that corresponds with what timezone you are in. For example, since I'm in South Australia, /etc/localtime is a symlink to /usr/share/zoneinfo/Australia/South. To set this link, type:
ln -sf ../usr/share/zoneinfo/your/zone /etc/localtime
Replace your/zone with something like Australia/NSW or Australia/Perth. Have a look in the directories under /usr/share/zoneinfo to see what timezones are available.
[1] This assumes that /usr/share/zoneinfo is linked to /etc/localtime as it is under Red Hat Linux.
[2] On older systems, you'll find that /usr/lib/zoneinfo is used instead of /usr/share/zoneinfo. See also the later section ``[Thành viên phải đăng kư mới xem được link này. ]''.
Setting UTC or local time

When Linux boots, one of the initialisation scripts will run the /sbin/hwclock program to copy the current hardware clock time to the system clock. hwclock will assume the hardware clock is set to local time unless it is run with the --utc switch. Rather than editing the startup script, under Red Hat Linux you should edit the /etc/sysconfig/clock file and change the ``UTC'' line to either ``UTC=true'' or ``UTC=false'' as appropriate.
Setting the system clock

To set the system clock under Linux, use the date command. As an example, to set the current time and date to July 31, 11:16pm, type ``date 07312316'' (note that the time is given in 24 hour notation). If you wanted to change the year as well, you could type ``date 073123161998''. To set the seconds as well, type ``date 07312316.30'' or ``date 073123161998.30''. To see what Linux thinks the current local time is, run date with no arguments.
Setting the hardware clock

To set the hardware clock, my favourite way is to set the system clock first, and then set the hardware clock to the current system clock by typing ``/sbin/hwclock --systohc'' (or ``/sbin/hwclock --systohc --utc'' if you are keeping the hardware clock in UTC). To see what the hardware clock is currently set to, run hwclock with no arguments. If the hardware clock is in UTC and you want to see the local equivalent, type ``/sbin/hwclock --utc''
The time in some applications is wrong

If some applications (such as date) display the correct time, but others don't, and you are running Red Hat Linux 5.0 or 5.1, you most likely have run into a bug caused by a move of the timezone information from /usr/lib/zoneinfo to /usr/share/zoneinfo. The fix is to create a symbolic link from /usr/lib/zoneinfo to /usr/share/zoneinfo: ``ln -s ../share/zoneinfo /usr/lib/zoneinfo''.
Summary

  • /etc/sysconfig/clock sets whether the hardware clock is stored as UTC or local time.
  • Symlink /etc/localtime to /usr/share/zoneinfo/... to set your timezone.
  • Run ``date MMDDhhmm'' to set the current system date/time.
  • Type ``/sbin/hwclock --systohc [--utc]'' to set the hardware clock.
Other interesting notes

The Linux kernel always stores and calculates time as the number of seconds since midnight of the 1st of January 1970 UTC regardless of whether your hardware clock is stored as UTC or not. Conversions to your local time are done at run-time. One neat thing about this is that if someone is using your computer from a different timezone, they can set the TZ environment variable and all dates and times will appear correct for their timezone.
If the number of seconds since the 1st of January 1970 UTC is stored as an signed 32-bit integer (as it is on your Linux/Intel system), your clock will stop working sometime on the year 2038. Linux has no inherent Y2K problem, but it does have a year 2038 problem. Hopefully we'll all be running Linux on 64-bit systems by then. 64-bit integers will keep our clocks running quite well until aproximately the year 292271-million.
Other programs worth looking at

  • rdate - get the current time from a remote machine; can be used to set the system time.
  • xntpd - like rdate, but it's extremely accurate and you need a permanent 'net connection. xntpd runs continuously and accounts for things like network delay and clock drift, but there's also a program (ntpdate) included that just sets the current time like rdate does.
Further information

  • date(1)
  • hwclock(8)
  • /usr/doc/HOWTO/mini/Clock
[Thành viên phải đăng kư mới xem được link này. ]
Reply With Quote
Reply

« Decode base64 | - »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT +8. The time now is 08:31 PM.


© Diễn đàn HackingArt (HA) được xây dựng và phát triển bởi các thành viên.
+ Diễn đàn HackingArt là nơi trao đổi của các webmaster chuyên nghiệp.

Search Engine Friendly URLs by vBSEO 3.2.0