command change timezone

April 10th, 2012 shell No comments

         Today ,want to change system 's timezone ,let us  to look  how to operate :

[root@279155 ~]# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5

Please select a country.
 1) Afghanistan           18) Israel                35) Palestine
 2) Armenia               19) Japan                 36) Philippines
 3) Azerbaijan            20) Jordan                37) Qatar
 4) Bahrain               21) Kazakhstan            38) Russia
 5) Bangladesh            22) Korea (North)         39) Saudi Arabia
 6) Bhutan                23) Korea (South)         40) Singapore
 7) Brunei                24) Kuwait                41) Sri Lanka
 8) Cambodia              25) Kyrgyzstan            42) Syria
 9) China                 26) Laos                  43) Taiwan
10) Cyprus                27) Lebanon               44) Tajikistan
11) East Timor            28) Macau                 45) Thailand
12) Georgia               29) Malaysia              46) Turkmenistan
13) Hong Kong             30) Mongolia              47) United Arab Emirates
14) India                 31) Myanmar (Burma)       48) Uzbekistan
15) Indonesia             32) Nepal                 49) Vietnam
16) Iran                  33) Oman                  50) Yemen
17) Iraq                  34) Pakistan
#? 9
Please select one of the following time zone regions.
1) east China - Beijing, Guangdong, Shanghai, etc.
2) Heilongjiang (except Mohe), Jilin
3) central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
4) most of Tibet & Xinjiang
5) west Tibet & Xinjiang
#? 1
The following information has been given:

        China
        east China - Beijing, Guangdong, Shanghai, etc.

Therefore TZ='Asia/Shanghai' will be used.
Local time is now:      Tue Apr 10 21:21:38 CST 2012.
Universal Time is now:  Tue Apr 10 13:21:38 UTC 2012.
Is the above information OK?
1) Yes
2) No
#? Yes
Please enter 1 for Yes, or 2 for No.
#? 1
You can make this change permanent for yourself by appending the line
        TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai
[root@279155 ~]#

   
   It is very easy ,if you have some interested ,want to try  ,come on baby….

how to lock your keyboard

April 10th, 2012 python No comments

Today  ,find  some simple python code  can  lock keyboard,let me  look up  these code:

# coding: UTF-8

import time

from ctypes import *

user32 = windll.LoadLibrary('user32.dll')
user32.BlockInput(True);

time.sleep(10);
user32.BlockInput(False);

if you have interested to try  ,GO…..

find which process take up memory

April 9th, 2012 shell No comments

     Today ,I  will teach you how to know which process  takes up most memory Top  10.

[root@279155 plugins]# top
top - 20:28:00 up 45 days, 17:45,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  26 total,   1 running,  25 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 99.3%id,  0.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    524800k total,   193384k used,   331416k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      15   0  2860 1344 1172 S  0.0  0.3   0:01.08 init
 1161 root      12  -4  2456  748  436 S  0.0  0.1   0:00.00 udevd
 1401 root      15   0 35532 1344  952 S  0.0  0.3   1:01.83 rsyslogd
 1428 root      18   0  3164  864  676 S  0.0  0.2   0:00.00 xinetd
 1435 root      18   0  8644  712  280 S  0.0  0.1   0:00.00 saslauthd
 1436 root      18   0  8644  496   64 S  0.0  0.1   0:00.00 saslauthd
 1475 root      15   0  7028 1184  632 S  0.0  0.2   0:07.31 crond
 7924 root      16   0 11492 3336 2636 S  0.0  0.6   0:00.02 sshd
 9265 root      15   0 11360 3256 2580 S  0.0  0.6   0:00.01 sshd
 9293 root      17   0 11360 3644 2952 S  0.0  0.7   0:00.15 sshd
 9296 root      15   0  6372 1760 1436 S  0.0  0.3   0:00.06 bash
 9512 root      15   0  2532  948  776 R  0.0  0.2   0:00.00 top
11380 root      18   0  7316 1696  936 S  0.0  0.3   0:00.00 nginx
17902 root      15   0  8468 1008  528 S  0.0  0.2   0:02.58 sshd
21989 root      15   0  6560 1224  828 S  0.0  0.2   0:00.00 screen
21990 root      15   0  6372 1760 1424 S  0.0  0.3   0:00.02 bash
21999 tcpdump   15   0  9612 5768 4956 S  0.0  1.1   0:30.82 tcpdump
[root@279155 plugins]#
[root@279155 plugins]# ps -eo "%mem comm" | sort -nr | head
 4.3 php-cgi
 4.0 php-cgi
 3.9 php-cgi
 3.7 php-cgi
 3.5 php-cgi
 2.4 mysqld
 2.3 nginx
 1.0 tcpdump
 0.8 php-cgi
 0.6 sshd
[root@279155 plugins]#

how to check server ‘s temperature

April 9th, 2012 shell No comments