Show the memory usage
# in the following examples, the 22405 is the process id
# top -p 22405
# pmap -d 22405
show memory details
# pmap -x 22405
b5fdb000 10240 - - - rw--- [ anon ]
b69db000 4 - - - ----- [ anon ]
b69dc000 10240 - - - rw--- [ anon ]
b73dc000 4 - - - ----- [ anon ]
b73dd000 10240 - - - rw--- [ anon ]
b7ddd000 2048 - - - r---- locale-archive
b7fdd000 8 - - - rw--- [ anon ]
b7fe6000 28 - - - r--s- gconv-modules.cache
b7fed000 16 - - - rw--- [ anon ]
bf972000 268 - - - rw--- [ stack ]
anon is a large size memory? [FIXME]
This area is my sharing area. Include some technical/believing/life experiences. Hope you can enjoy with me. God bless you. :)
2009年7月14日 星期二
2009年6月28日 星期日
xargs experience
Step 1:
change to the directory which the tcpreplay file was located.
# ls | awk '{print "echo filename:"$1" ; tcpdump -nv host 207.46.2.152 -r "$1}' | sh
# ls | xargs -n 1 tcpdump -nv host 207.46.2.152 -r
Disable the write permission of all the directory include the sub-directory
# find -type d | xargs chmod a-w
Delete all the files that are below the CVS directory
# find ./* -name CVS | xargs -n 1 rm -rf
Delete all the found *.la files
# find /PathTOHere/puma5_toolchain/src/buildroot-2009.02/project_build_armeb/puma5/root/lib -name '*.la' | xargs rm -rf
change to the directory which the tcpreplay file was located.
# ls | awk '{print "echo filename:"$1" ; tcpdump -nv host 207.46.2.152 -r "$1}' | sh
# ls | xargs -n 1 tcpdump -nv host 207.46.2.152 -r
Disable the write permission of all the directory include the sub-directory
# find -type d | xargs chmod a-w
Delete all the files that are below the CVS directory
# find ./* -name CVS | xargs -n 1 rm -rf
Delete all the found *.la files
# find /PathTOHere/puma5_toolchain/src/buildroot-2009.02/project_build_armeb/puma5/root/lib -name '*.la' | xargs rm -rf
2009年6月22日 星期一
Signal type
kill is an application that can send signal to the specified application
e.g.
This will terminate the specified process (SIGKILL)
# kill -9 process-id
This will reload the specified process (SIGHUP)
# kill -1 process-id
The reference of the SIGNAL(7) man page
Signal Value Action Comment
-------------------------------------------------------------------------
SIGHUP 1 Term Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no readers
SIGALRM 14 Term Timer signal from alarm(2)
SIGTERM 15 Term Termination signal
SIGUSR1 30,10,16 Term User-defined signal 1
SIGUSR2 31,12,17 Term User-defined signal 2
SIGCHLD 20,17,18 Ign Child stopped or terminated
SIGCONT 19,18,25 Cont Continue if stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at tty
SIGTTIN 21,21,26 Stop tty input for background process
SIGTTOU 22,22,27 Stop tty output for background process
e.g.
This will terminate the specified process (SIGKILL)
# kill -9 process-id
This will reload the specified process (SIGHUP)
# kill -1 process-id
The reference of the SIGNAL(7) man page
Signal Value Action Comment
-------------------------------------------------------------------------
SIGHUP 1 Term Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no readers
SIGALRM 14 Term Timer signal from alarm(2)
SIGTERM 15 Term Termination signal
SIGUSR1 30,10,16 Term User-defined signal 1
SIGUSR2 31,12,17 Term User-defined signal 2
SIGCHLD 20,17,18 Ign Child stopped or terminated
SIGCONT 19,18,25 Cont Continue if stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at tty
SIGTTIN 21,21,26 Stop tty input for background process
SIGTTOU 22,22,27 Stop tty output for background process
2009年6月15日 星期一
ActiveX HowTo
Unregister ActiveX component (ActiveX can be two type of extension filename, .dll or .ocx)
Change path to the ActiveX directory, unregister DLL component by using the regsvr32 program with -u parameter
C:\WINDOWS\Downloaded Program Files>regsvr32 -u XXX.dll
C:\WINDOWS\Downloaded Program Files>regsvr32 -u XXX.ocx
After successfully unregister the ActiveX component, it will show a pop-up message that shows the following descriptions:
DllUnregisterServer at XXX.dll success.
Change path to the ActiveX directory, unregister DLL component by using the regsvr32 program with -u parameter
C:\WINDOWS\Downloaded Program Files>regsvr32 -u XXX.dll
C:\WINDOWS\Downloaded Program Files>regsvr32 -u XXX.ocx
After successfully unregister the ActiveX component, it will show a pop-up message that shows the following descriptions:
DllUnregisterServer at XXX.dll success.
2009年6月4日 星期四
wincvs tutorial
Test version 2.0.2.4 (Build 4)
1. What is the first step?
A. Login to the cvs server via wincvs
Admin -> Login -> Login settings -> enable CVSROOT field, fill the string as following type
:ssh:user-name@CVS-server-address:port:cvs-folder-path
set the global settings in the Tab: Globals
Enable the following setting
Checkout text files with Unix LF (0xa)
2. How to checkout cvs modules?
A. You can use the manually isuue command (procedure 3) or simply run the following command
Remote -> Checkout modules (Must specify the module name first)
3. How to update (sync) the CVS code of working directory?
A. Admin -> Command Line -> Enter the command line
Input the submit cvs command
e.g
cvs -q up
4. How to issue other command (e.g. like checkout other branches of module..)?
A. Following the previous procedure 3 instructments, then issue the following command
cvs co -r cvs_branch module-name
1. What is the first step?
A. Login to the cvs server via wincvs
Admin -> Login -> Login settings -> enable CVSROOT field, fill the string as following type
:ssh:user-name@CVS-server-address:port:cvs-folder-path
set the global settings in the Tab: Globals
Enable the following setting
Checkout text files with Unix LF (0xa)
2. How to checkout cvs modules?
A. You can use the manually isuue command (procedure 3) or simply run the following command
Remote -> Checkout modules (Must specify the module name first)
3. How to update (sync) the CVS code of working directory?
A. Admin -> Command Line -> Enter the command line
Input the submit cvs command
e.g
cvs -q up
4. How to issue other command (e.g. like checkout other branches of module..)?
A. Following the previous procedure 3 instructments, then issue the following command
cvs co -r cvs_branch module-name
AJAX - JQuery introduction
AJAX 的API包括JQuery.js ProtoType.js JQuery.js ProtoType.js 的license為M.I.T Licenese
JQuery的主要功能包括 * 不同平台的browser顯示的畫面具有一致性 * 可以有AJAX 做到local端動態只有更新某一個division顯示畫面的功能
Google Map API 底層有包AJAX API
AJAX 的目的是讓Browser User unaware 去update web pages的某一些部份(some division), 不用手動去做page refresh, 底層是利用Java Script 去切割成一塊一塊的division, 然後利用event trigger的方式,當某一塊division被event trigger 需要update時, 那一塊division就會主動連到server去做page refresh
JQuery的主要功能包括 * 不同平台的browser顯示的畫面具有一致性 * 可以有AJAX 做到local端動態只有更新某一個division顯示畫面的功能
Google Map API 底層有包AJAX API
AJAX 的目的是讓Browser User unaware 去update web pages的某一些部份(some division), 不用手動去做page refresh, 底層是利用Java Script 去切割成一塊一塊的division, 然後利用event trigger的方式,當某一塊division被event trigger 需要update時, 那一塊division就會主動連到server去做page refresh
Linux Command - dos2unix, Windows Linux difference endline code
Line Ending patterns are different in various operation system
Windows / MS-Dos: [CR][LF] 0d 0a
Mac: [CR] 0d
Unix/Linux: [LF] oa
// You will find many "0x0a 0x0d" hex code pattern in the dump of windows file
# hexdump File.h.win32 | grep 0a0d
0000010 3e68 0a0d 6923 636e 756c 6564 3c20 7473
[omit]
0000220 6365 3b74 0a0d 0a0d 2a2f 202a 7546 636e
0000260 3b29 0a0d 6f76 6469 4220 6675 6566 4d72
0000280 6820 6e61 6c64 7265 3b29 0a0d 6e69 2074
// after we convert the file from windows file mode to unix file mode, we will no more see the pattern "0a0d"
# dos2unix -n File.h.unix File.h.win32
# hexdump File.h.unix | grep 0a0d
We can use dos2unix command to do the code translation, the command format is as following
# dos2unix -n Windows-text-original-file Unx-text-destinated-file
Windows / MS-Dos: [CR][LF] 0d 0a
Mac: [CR] 0d
Unix/Linux: [LF] oa
// You will find many "0x0a 0x0d" hex code pattern in the dump of windows file
# hexdump File.h.win32 | grep 0a0d
0000010 3e68 0a0d 6923 636e 756c 6564 3c20 7473
[omit]
0000220 6365 3b74 0a0d 0a0d 2a2f 202a 7546 636e
0000260 3b29 0a0d 6f76 6469 4220 6675 6566 4d72
0000280 6820 6e61 6c64 7265 3b29 0a0d 6e69 2074
// after we convert the file from windows file mode to unix file mode, we will no more see the pattern "0a0d"
# dos2unix -n File.h.unix File.h.win32
# hexdump File.h.unix | grep 0a0d
We can use dos2unix command to do the code translation, the command format is as following
# dos2unix -n Windows-text-original-file Unx-text-destinated-file
標籤:
Linux Command
訂閱:
文章 (Atom)