Friday 27 January 2012

unix permission directory explanation

directory (other)

x --> other can cd to it and traverse to sub dir under it (as long sub dir under it has the permission for it). can not do alter nor list file BUT can ls and ls -al to specific file and get the detail of it.


w --> other can not do anything, neither ls, touch, re, nor cd

r --> other can ls only (and autocomplete TAB works too), but will show only filename without any permission, date, ownership.


rwx --> you can do many things to folder/file under it

wx --> can cd and can alter file/folder under it, can also ls -al specific file and get the detail of a file, but can not get the whole list of file/folders under it.


rx --> can cd and can list the whole list of file INCLUDING the detail of the file. Can not alter file/folder including owned by him.


rw --> list the whole list WITHOUT the file detail. Can not do alter also (same like r only???)

Wednesday 25 January 2012

NTP on windows and linux

NTP (UDP 123)

one config as client and server in ntp.conf (might use another file like drift, keys and step ticker).

you can put "server LOCALHOST" but not necesary, as by defualt the driver creates 127.127.1.0 as ip local and in the config listed as it is.

Windows

1. net time /querysntp
2. net time /setsntp:XXXXXXX
3. net stop w32time ; net start w32time
4. w32tm /config /update
5. w32tm /resync

to test ntp server : w32tm /monitor /computers:xxxx.xxxx.xxx.xx

by GUI : go to "date/time setting", choose the 3rd tab, in the server field just type XXXXXXXXX (good hint!!!) and push synchronized.


Linux

ntpd is the service that sets and maintain system time, use port 123.

ntpdate is command which is not relate to ntp.conf
-- ntpdate -u XXXXXXX (u is used when port 123 is used alry, otherwise "ntp sockets is n used" message appears)

-- ntpdate (will give you "error no server to sync", u must put the server )

-- ntpdate XXXXXX (will update your time following the XXXX time)

-- ntpdate -q xxxxxxx (just testing the xxxxx time)

other command:
ntpd -d --> to see error/debug
ntpq -p --> list all the ntp servers that your pc using.


other errors:
bad file descriptor --> two ntpd are running, kill one of them

no server suitable for sync found --> usually happens when ntpdate -q XXXXXX right after restart ntpd on XXXXXX, wait for some time then try again. After a while ntpd server will be ready.

no associtae id 's returned --> after running ntpq -pn , caused by no "server xxxxx" parameter or no xxxxxx server, notice also if you put 127.127.1.0, do not wrongly mix with 127.127.0.1.


ESX:

For ntp client:
esxcfg-frewall -q ntpClients (-d to disable)

for ntp server:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002864

TIPS: stop the iptables on ESX !!!