用镜头记录,用心灵体验 | 订阅本站 | 所有笔记 | 亲和力设计 | 流量

DB2 学习笔记

博客话题:DB2,Linux,Web,业余无线电,户外,摄影,截拳道,Thankpad,其他

December 2006

Refine and add new features to my web site

This site disappeared on Internet from the early of this year because of the server...

This site disappeared on Internet from the early of this year because of the server problem. Since then it's running on my thinkpad locally for 1 year. Now it's more like my personal blog. I have to have some refine work on my blog since I decided to publish it again. Also I added some new features.

Here's a work log.

upgrade MT to version 3.3 

changed to plugined tinymce


changed title appearance

There are 3 level Titles.

  1. site title
  2. category and monthly title
  3. entry title

Each pages have this title structure for search engine friendly, but only display the related title. Others are hided.

In the 2nd level pages, the site title is hided. Also in the 3rd level pages, both 1st level and 2nd level titles are hided.

Using style:

.subindex-container .index-logo,
.individual-container .index-logo,
.individual-container .subindex-logo {
display: none;
}

gave tags to each entry

Give one or more meaningful tags to each entry. The old keywords field is abandoned. 

neater monthly archive list

added keywords.js

I used keyword.js to hilight keywords which visitor used in search engine for linking in this page in my old site. I did some simple configure and add it into my blog.

I had following settings. 

// Configuration:
Keyword = {
hilite: true,
index: false,
refill1: true,
refill2: false,
element1: 'search',
element2: 'w', 
style_name: 'hilite',
style_name_suffix: true,
debug_referrer: '',
debug_meta: ''
};

added edit link to individual archive

Simply to add an edit link to individual entry view, that makes editing entries quicker without going to MT management first.

Add following code to individual template:

<a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="edit this entry, only for admin">Edit</a> 

changed download files location 

I organized all download files by date instead of by categories. That reduces the length of the file list in a same directory.

Current directory structure rule is /ref/year/month/files, exam:

/ref/2006/12/simple.zip

fixed new line problem for entries 

recheck the broken links

I have been using Xenu to check broken site links. It's still a good solution up to now. Recently, I got another solution that could play part of role of Xenu, CheckLinks. It's a plugin for MT that only check the links they are within entries. The reason I picked it up is that It's easier to have the edit link in the bad links report by CheckLinks. Here's a report from my site.  For having this feature, I use below Template. This template is used for checking all entries(maximum 9999 here) in your blog and printing only the entries with bad links. But rebuilding this template is as slow as when you check through your blog links with other tool. So better to uncheck the "Rebuild this template automatically when rebuilding index templates" at template setting if you are using it in Indexes Template. 

<MTEntries lastn="9999">
<MTCheckLinks include_local="1">
<MTCheckLinksHere>
<$MTEntryBody$>
<$MTEntryExtended$>
</MTCheckLinksHere>
<MTIfBadLinks>
<dl class="badlinks">
<dt><a href="<$MTEntryLink$>"><$MTEntryTitle$></a> (<a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="in <$MTCatetoryTitle$>">edit</a>) Have bad links:</dt>
<MTBadLinks load_entries="1">
<dd><$MTBadLinkStatus trim_to="3"$>: <$MTBadLinkURL$> [<a href="<$MTBadLinkURL$>"><$MTBadLinkText$></a>]</dd>
</MTBadLinks>
</dl>
</MTIfBadLinks>
</MTCheckLinks>
</MTEntries> 

A note: If you are refering any Entries Tag like "MTEntryTitle" within CheckLinks Tag <MTBadLinks>, you must specify load_entries="1" otherwise there's error raising during rebuilding this template.

 

set up category rss feeds and links

managed external links by blogroll

I downloaded a new plugin Blogroll for managing my links. 

Use Blogroll I could manage and group my links, and publish them in template.

Using following code in template: 

<MTBlogrollCategories>   
<h3><$MTBlogrollCategoryLabel$></h3> 
<ul><MTBlogrollLinks> 
<li><a href="<$MTBlogrollLinkURI$>" title="<MTBlogrollLinkDesc>"<MTIfNonEmpty tag="BlogrollLinkRel"> rel="<MTBlogrollLinkRel>"</MTIfNonEmpty> <MTIfNonEmpty tag="BlogrollLinkTarget">target="<MTBlogrollLinkTarget>"</MTIfNonEmpty>><$MTBlogrollLinkName$></a></li> 
</MTBlogrollLinks></ul> 
</MTBlogrollCategories> 

related tags on tag search 

I downloaded a new plugin TagSupplymentals that brings much features on tags. I use MTRelatedEntries and MTRelatedTags.

Using following code in template:

<ul>
<h3>Related Entries</h3>
<MTRelatedEntries lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTRelatedEntries>
</ul> 
 
<ul>
<h3>Related Tags</h3>
<MTEntryTags>
<MTRelatedTags>
<li><a xhref="<$MTTagSearchLink$>"><$MTTagName$></a> (<$MTTagCount$>)</li>
</MTRelatedTags>
</MTEntryTags>
</ul>

 

related entries by tags

See above. 

more clear search result

On the search result list, as default only show the entry title and entry summary. So the searcher could have an overview on all search result. If he wants more info about the entry there's a link to expand the entry area to show entry body.

Template:

<MTEntriesHeader>
<!--start #top-alpha-->
<div id="top-alpha">
<label id="hidebodybar" class="hidbodybar"></label>
<!--end #top-alpha-->
</div>
</MTEntriesHeader>
<!--start #entry~-->
<div class="entry" id="entry<$MTEntryID pad="1"$>">
<a name="a<$MTEntryID pad="1"$>" />

<!--start #top-entry~-->
<div class="top-entry" id="top-entry<$MTEntryID pad="1"$>">
<label class="hidebodybar" id="hidebodybar<$MTEntryID pad="1"$>"></label>
<!--end #top-entry~-->
</div>
<h3 class="entryheader" id="a<$MTEntryID pad="1"$>"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h3>
<!--start #entryinfo~-->
<div class="entryinfo" id="entryinfo<$MTEntryID pad="1"$>">
<MTIfOne name="Category Archive">
<p class="subtitle"><$MTEntryDate format="%x"$></p>
<MTElse>
<p class="subtitle">In <a href="<$MTEntryLink archive_type="Category"$>"><$MTEntryCategory$></a>, <$MTEntryDate format="%x"$></p>
</MTElse>
</MTIfOne>
<!--end #entryinfo~-->
</div>
<!--start #entrysummary~-->
<div class="entrysummary" id="entrysummary<$MTEntryID pad="1"$>">
<$MTEntryBody convert_breaks="0" words="16"$>...
<!--end #entrysummary~-->
</div>
<!--start #entrybody~-->
<div class="entrybody" id="entrybody<$MTEntryID pad="1"$>">
<$MTEntryBody convert_breaks="0"$>
<MTEntryIfExtended><p>继续阅读 "<a href="<$MTEntryPermalink$>#more"><$MTEntryTitle$></a>" 的剩余内容</p></MTEntryIfExtended>
<!--end #entrybody~-->
</div>
<!--start #entryfooter~-->
<div class="entryfooter" id="entryfooter<$MTEntryID pad="1"$>">
<MTEntryIfTagged><p>标签 Tags: 其它与<MTEntryTags glue=", "><a href="<$MTTagSearchLink$>"><$MTTagName$></a> (<$MTTagCount$>)</MTEntryTags> 相关的话题</p></MTEntryIfTagged>
<p class="posted">
Posted by <$MTEntryAuthorUsername$> at <$MTEntryDate format="%X"$>
<MTEntryIfAllowComments> | <a href="<$MTEntryPermalink archive_type="Individual"$>#comments">Comments (<$MTEntryCommentCount$>)</a></MTEntryIfAllowComments>
<MTEntryIfAllowPings> | <a href="<$MTEntryPermalink archive_type="Individual"$>#trackbacks">TrackBack (<$MTEntryTrackbackCount$>)</a></MTEntryIfAllowPings>
| <a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="edit this entry, only for admin">Edit</a>
</p>
<!--end #entryfooter~-->
</div>
<!--end #entry-->
</div>

Javascript: hide-body.js

flexible style sheet

I had this new bar on the top of page.

text bar for changing style

It makes possible to switch different style sheet on current page by one click.

For doing this, needs switch-css.js, and the defination in the head.

<link rel="stylesheet" type="text/css" href="<$MTBlogURL$>css/screen.css" media="screen" title="BlockStyle" />
<link rel="alternate stylesheet" type="text/css" href="<$MTBlogURL$>css/screen-clearstyle.css" media="screen" title="ClearStyle" />
<script type="text/javascript" language="javascript" src="<$MTBlogURL$>switch-css.js"></script>
And the label tag with ID definition in the page. The css links would be generated by the .js above dynamically.
<label id="switchcssbar"></label>

The code refer to:

tested none-css appearance 

To see what my blog is like without style sheet, click below link. If you want to change it back, choose the block Style links on the top of any page. I'm ready to change this site as None Style

tested printable view

To see how it works, select "File - Print Preview" in your Internet Browser.

The format is defined in print.css .

made the old site work

Made some neccesary changes on my old site for showing it in sub folder well.

change to mysql database

power editing basename 

I think this would be helpful, lots of people want to have this feature. 

add style to preformatted tag <pre>

I used <pre> tag for several cases:

  • programming code (exam: javascripts)
  • command (exam: unix shell commands)
  • output (exam: screen output of a command)
  • refererence (exam: a short paragraph from other blog)

But they do have different requirements for showing up. So I add several class styles for the tag.

  • .code
  • .cmd
  • .output
  • .refer (with word wrap)

For the .refer class style, I referred to pre标签自动换行方案.

Update: Read an article What are semantics?, learned that I should use <blockquote> tag to wrap the resource that I refer to. So I need to use <blockquote> tag instead of class style .refer.

upgrade to TinyMCE 2.09

Refined Page structure

Refinced CSS

I split my css file as multi-level and use import keyword to link them up. I have following structure. The base.css and extend.css is used by each style sheet. The difference is that the extend.css is also refered by TinyMCE in MT. About TinyMCE please read this article .

base.css      extend.css
          \      /
           \    /
         screen.css
         screen-linestyle.css
         screen-clearstyle.css

I reset padding and margin as 0 in my base.css that makes crossing browsers development easier. Here's a style list about Firefox 1.5 default style sheet for HTML elements for reference.

I tried to have more comfortable color for pages. Here are some links would be helpful on this. The safe 216 web colors, a list of online colour tool.

 

Disable listing directory


Create a file ".htaccess" at the root path of web site and have following line:

Options All -Indexes 

Rewrite url for old site


Add below lines to /.htaccess.

RewriteEngine On
RewriteRule ^archives/([0-9]+/[0-9]+) $1
RewriteRule ^archives/(jeet_kune_do|outdoors) $1
RewriteRule ^archives/study_notes/(web|linux) $1
RewriteRule ^hobbies/(outdoors) $1
RewriteRule ^hobbies/ham/ amateur_radio
RewriteRule ^hobbies/sbenefit/ society_benefit
RewriteRule ^notes/*(db2|linux)* $1
RewriteRule ^notes/[a-z0-9\_\-]+.htm$ db2
RewriteRule ^archives/study_notes/[a-z0-9\_\-]+.html$ db2 
A little help on expression I used. 
  • ^ is maching the begin of aline.
  • $ is mathing the end of a line. 
  • $n is a reference for the expression within (), also could have $1, $2..., as I know, $0 should be the entire of $n.
  • | is the OR relationship.
  • + match at least one time.
Had this article  for reference. 

Posted by Alex at 10:05 AM | Edit | Taged: css (3), MT (25), plugin (8), refine (2), upgrade (5)

Using "ps" shell command

Here's a normal output from ps command with -ef parameters./home/zhangy/> ps -ef UID PID PPID C...

Here's a normal output from ps command with -ef parameters.

/home/zhangy/> ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Dec 03 - 13:32 /etc/init
root 3932 1 0 Dec 03 - 0:01 /usr/lib/errdemon
root 4670 1 1 Dec 03 - 416:09 /usr/sbin/syncd 60
root 5196 7498 0 Dec 03 - 0:06 /usr/local/sbin/sshd
...
  • -e: Print all processes info except kernel processes.
  • -f: Here tells ps to show user name instead of user id at UID and to show parameters for command at CMD.
The explanation for each column.
  • UID: The user who kicked off the process
  • PID: The process ID of the process
  • PPID: The process ID of the parent process
  • C: Usage of CPU
  • STIME: The starting time of the process
  • TTY:
  • TIME: The total run time of the process
  • CMD: The command with parameters and its full path

Tips

We use PID and PPID to track process tree. For killing any process, we should refer to PID. To track PPID we could kill a group of related processes.

STIME is very helpful to indicate the multi-process with the same script name. Usually they have different run time.

CMD is also helpful to get command name and path. 

Reference 

A full reference on column explaination from unix man page.

ADDR
(-l and l flags) Contains the segment number of the process stack, if normal;
if a kernel process, the address of the preprocess data area.

BND
(-o THREAD flag) The logical processor number of the processor to which the
kernel thread is bound (if any). For a process, this field is shown if all its
threads are bound to the same processor.

C
(-f, l, and -l flags) CPU utilization of process or thread, incremented each
time the system clock ticks and the process or thread is found to be running.
The value is decayed by the scheduler by dividing it by 2 once per second. For
the sched_other policy, CPU utilization is used in determining process
scheduling priority. Large values indicate a CPU intensive process and result
in lower process priority whereas small values indicate an I/O intensive
process and result in a more favorable priority.

CMD
(-f, -l, and l flags) Contains the command name. The full command name and its
parameters are displayed with the -f flag.

COMMAND
(s, u, and v) Contains the command name. The full command name and its
parameters are displayed with the -f flag.

F Field Table

Flags Hexadecimal Value Definition

SLOAD 0x00000001 Indicates that the process is operating in core memory.

SNOSWAP 0x00000002 Indicates that the process cannot be swapped out.

STRC 0x00000008 Indicates that the process is being traced.

SWTED 0x00000010 Indicates that the process stopped while being traced.

SFWTED 0x00000020 Indicates that the process stopped after a call to the fork
subroutine, while being traced.

SEWTED 0x00000040 Indicates that the process stopped after a call to the exec
subroutine, while being traced.

SLWTED 0x00000080 Indicates that the process stopped after a call to the load
or unload subroutine, while being traced.

SFIXPRI 0x00000100 Indicates that the process has a fixed priority, ignoring
the pcpu field descriptor.

SKPROC 0x00000200 Indicates a Kernel process.

SOMASK 0x00000400 Indicates restoration of the old mask after a signal is
received.

SWAKEONSIG 0x00000800 Indicates that the signal will abort the sleep
subroutine. The contents must not be equal to those of the PCATCH flag. The
contents of both PCATCH and SWAKEONSIG must be greater than those of PMASK.

SUSER 0x00001000 Indicates that the process is in user mode.

SLKDONE 0x00002000 Indicates that the process has done locks.

STRACING 0x00004000 Indicates that the process is a debugging process.

SMPTRACE 0x00008000 Indicates multi-process debugging.

SEXIT 0x00010000 Indicates that the process is exiting.

SSEL 0x00020000 Indicates that the processor is selecting: wakeup/waiting
danger.

SORPHANPGRP 0x00040000 Indicates an orphaned process group.

SNOCNTLPROC 0x00080000 Indicates that the session leader relinquished the
controlling terminal.

SPPNOCLDSTOP 0x00100000 Indicates that the SIGHLD signal is not sent to the
parent process when a child stops.

SEXECED 0x00200000 Indicates that process has been run.

SJOBSESS 0x00400000 Indicates that job control was used in the current
session.

SJOBOFF 0x00800000 Indicates that the process is free from job control.

PSIGDELIVERY 0x01000000 Indicates that the process is used by the
program-check handler.

SRMSHM 0x02000000 Indicates that the process removed shared memory during a
call to the exit subroutine.

SSLOTFREE 0x04000000 Indicates that the process slot is free.

SNOMSG 0x08000000 Indicates that there are no more uprintf subroutine
messages.

F
(-l and l flags) Some of the more important F field flags (hexadecimal and
additive) associated with processes and threads are shown below:

F Field Table

Flags Hex Value Definition

SLOAD 0x00000001 Indicates that the process is operating in core memory.

SNOSWAP 0x00000002 Indicates that the process cannot be swapped out.

STRC 0x00000008 Indicates that the process is being traced.

SKPROC 0x00000200 Indicates a kernel process.

SEXIT 0x00010000 Indicates that the process is exiting.

SEXECED 0x00200000 Indicates that the process has been run.

SEXECING 0x01000000 Indicates that the process is execing (performing an
exec).

TKTHREAD 0x00001000 Indicates that the thread is a kernel-only thread.

Note: You can see the definitions all process and thread flags by consulting
the p_flags and t_flags fields in the /usr/include/sys/proc.h and
/usr/include/sys/thread.h files respectively.

LIM
(v flag) The soft limit on memory used, specified via a call to the setrlimit
subroutine. If no limit has been specified, then shown as xx. If the limit is
set to the system limit, (unlimited), a value of UNLIM is displayed.

NI
(-l and l flags) The nice value; used in calculating priority for the sched
other policy.

PID
(all flags) The process ID of the process.

PGIN
(v flag) The number of disk I/Os resulting from references by the process to
pages not loaded in core.

PPID
(-f, l, and -l flags) The process ID of the parent process.

PRI
(-l and l flags) The priority of the process or kernel thread ; higher numbers
mean lower priority.

RSS
(v flag) The real-memory (resident set) size of the process (in 1KB units).

S
(-l and l flags) The state of the process or kernel thread :

For processes:

O
Nonexistent

A
Active

W
Swapped

I
Idle (waiting for startup)

Z
Canceled

T
Stopped

For kernel threads:

O
Nonexistent

R
Running

S
Sleeping

W
Swapped

Z
Canceled

T
Stopped

SC
(-o THREAD flag) The suspend count of the process or kernel thread. For a
process, the suspend count is defined as the sum of the kernel threads suspend
counts.

SCH
(-o THREAD flag) The scheduling policy for a kernel thread. The policies
sched_other, sched_fifo, and sched_rr are respectively displayed using: 0, 1,
2.

SIZE
(v flag) The virtual size of the data section of the process (in 1KB units).

SSIZ
(s flag) The size of the kernel stack. This value is always 0 (zero) for a
multi-threaded process.

STAT
(s, u, and v flags) Contains the state of the process:

0
Nonexistent

A
Active

I
Intermediate

Z
Canceled

T
Stopped

K
Available kernel process

STIME
(-f and u flags) The starting time of the process. The LANG environment
variables control the appearance of this field.

SZ
(-l and l flags) The size in 1KB units of the core image of the process.

THCNT
(-o thcount flag) The number of kernel threads owned by the process.

TID
(-o THREAD flag) The thread ID of the kernel thread.

TIME
(all flags) The total execution time for the process.

TRS
(v flag) The size of resident-set (real memory) of text.

TSIZ
(v flag) The size of text (shared-program) image.

TTY
(all flags) The controlling workstation for the process:

-
The process is not associated with a workstation.

?
Unknown.

Number
The TTY number. For example, the entry 2 indicates TTY2.

UID
(-f, -l, and l flags) The user ID of the process owner. The login name is
printed under the -f flag.

USER
(u flag) The login name of the process owner.

WCHAN
(-l flag) The event for which the process or kernel thread is waiting or
sleeping. For a kernel thread, this field is blank if the kernel thread is
running. For a process, the wait channel is defined as the wait channel of the
sleeping kernel thread if only one kernel thread is sleeping; otherwise a star
is displayed.

WCHAN
(l flag) The event on which process is waiting (an address in the system). A
symbol is chosen that classifies the address, unless numerical output is
requested.

%CPU
(u and v flags) The percentage of time the process has used the CPU since the
process started. The value is computed by dividing the time the process uses
the CPU by the elapsed time of the process. In a multi-processor environment,
the value is further divided by the number of available CPUs since several
threads in the same process can run on different CPUs at the same time.
(Because the time base over which this data is computed varies, the sum of all
%CPU fields can exceed 100%.)

%MEM
(u and v flags) The percentage of real memory used by this process.
 

A full reference on flag parameters from unix man page.

Flags

The following flags are preceded by a - (minus sign):

-A Writes to standard output information about all processes.

-a Writes to standard output information about all processes, except the session
leaders and processes not associated with a terminal.

-c Clist Displays only information about processes assigned to the workload
management classes listed in the Clist variable. The Clist variable is either a
comma separated list of class names or a list of class names enclosed in double
quotation marks (" "), which is separated from one another by a comma or by one
or more spaces, or both.

-d Writes information to standard output about all processes, except the session
leaders.

-e Writes information to standard output about all processes, except kernel
processes.

-F Format Same as -o Format

-f Generates a full listing.

-G Glist Writes information to standard output only about processes that are in
the process groups listed for the Glist variable. The Glist variable is either a
comma-separated list of process group identifiers or a list of process group
identifiers enclosed in double quotation marks (" ") and separated from one
another by a comma or by one or more spaces. This flag is equivalent to the -g
Glist flag.

-g Glist This flag is equivalent to the -G Glist flag.

-k Lists kernel processes.

-l Generates a long listing. See also the l flag.

-m Lists kernel threads as well as processes. Output lines for processes are
followed by an additional output line for each kernel thread. This flag does not
display thread-specific fields ( bnd, scount, sched, thcount, and tid), unless
the appropriate -o Format flag is specified.

-N Gathers no thread statistics. With this flag ps simply reports those
statistics that can be obtained by not traversing through the threads chain for
the process.

-n NameList Specifies an alternative system name-list file in place of the
default. The operating system does not use the -n flag, since information is
supplied directly to the kernel.

-o Format Displays information in the format specified by the Format variable.
Multiple field specifiers can be specified for the Format variable. The Format
variable is either a comma-separated list of field specifiers or a list of field
specifiers enclosed within a set of " " (double-quotation marks) and separated
from one another by a comma or by one or more spaces, or both.

Each field specifier has a default header. The default header can be overridden
by appending an = (equal sign) followed by the user-defined text for the header.
The fields are written in the order specified on the command line in column
format. The field widths are specified by the system to be at least as wide as
the default or user-defined header text. If the header text is null, (such as if
-o user= is specified), the field width is at least as wide as the default
header text. If all header fields are null, no header line is written.

The following field specifiers are recognized by the system:

args
Indicates the full command name being executed. All command-line arguments are
included, though truncation may occur. The default header for this field is
COMMAND.

bnd
Indicates to which (if any) processor a process or kernel thread is bound. The
default header for this field is BND.

class
Indicates the workload management class assigned to the process. the default
header for this field is CLASS.

comm
Indicates the short name of the command being executed. Command-line arguments
are not included. The default header for this field is COMMAND.

cpu
Determines process scheduling priority. CPU utilization of process or thread,
incremented each time the system clock ticks and the process or thread is
found to be running. The value is decayed by the scheduler by dividing it by 2
once per second. For the sched_other policy, Large values indicate a CPU
intensive process and result in lower process priority whereas small values
indicate an I/O intensive process and result in a more favorable priority.

etime
Indicates the elapsed time since the process started. The elapsed time is
displayed in the following format:

[[ dd-]hh:]mm:ss

where dd specifies the number of days, hh specifies the number of hours, mm
specifies the number of minutes, and ss specifies the number of seconds. The
default header for this field is ELAPSED.

group
Indicates the effective group ID of the process. The textual group ID is
displayed. If the textual group ID cannot be obtained, a decimal
representation is used. The default header for this field is GROUP.

nice
Indicates the decimal value of the process nice value. The default header for
this field is NI.

-o Format (Continued)

pcpu
Indicates the ratio of CPU time used to CPU time available, expressed as a
percentage. The default header for this field is %CPU.

pgid
Indicates the decimal value of the process group ID. The default header for
this field is PGID.

pid
Indicates the decimal value of the process ID. The default header for this
field is PID.

ppid
Indicates the decimal value of the parent process ID. The default header for
this field is PPID.

rgroup
Indicates the real group ID of the process. The textual group ID is displayed.
If the textual group ID cannot be obtained, a decimal representation is used.
The default header for this field is RGROUP.

ruser
Indicates the real user ID of the process. The textual user ID is displayed.
If the textual user ID cannot be obtained, a decimal representation is used.
The default header for this field is RUSER.

scount
Indicates the suspend count for a kernel thread. The default header for this
field is SC.

sched
Indicates the scheduling policy for a kernel thread. The default header for
this field is SCH.

tag
Indicates the Workload Manager application tag. The default header for this
field is TAG. The tag is a character string up to 30 characters long and may
be truncated when displayed by ps. For processes which do not set their tag,
this field displays as a hyphen (-).

thcount
Indicates the number of kernel threads owned by the process. The default
header for this field is THCNT.

-o Format (Continued)

THREAD
Indicates the following fields:
o User name (the uname field)
o Process and parent process IDs for processes (the pid and ppid fields)
o Kernel thread ID for threads (the tid field)
o The state of the process or kernel thread (the S field)
o The CPU utilization of the process or kernel thread (the C field)
o The priority of the process or kernel thread (the PRI field)
o The suspend count of the process or kernel thread (the scount field)
o The wait channel of the process or kernel thread (the WCHAN field)
o The flags of the process or kernel thread (the F field)
o The controlling terminal of the process (the tty field)
o The CPU to which the process or kernel thread is bound (the bnd field)
o The command being executed by the process (the comm field).

Threads are not actually displayed with the -o THREAD flag, unless the -m flag
is also specified.

tid
Indicates the thread ID of a kernel thread. The default header for this field
is TID.

time
Indicates the cumulative CPU time since the process started. The time is
displayed in the following format:

[ dd-]hh:mm:ss

where dd specifies the number of days, hh specifies the number of hours, mm
specifies the number of minutes, and ss specifies the number of seconds. The
default header for this field is TIME.

tty
Indicates the controlling terminal name of the process. The default header for
this field is TT.

user
Indicates the effective user ID of the process. The textual user ID is
displayed. If the textual user ID cannot be obtained, a decimal representation
is used. The default header for this field is USER.

vsz
Indicates, as a decimal integer, the size in kilobytes of the process in
virtual memory. The default header for this field is VSZ.

-o Format (Continued)

Otherwise, multiple fields in a specified format can be displayed by the Format
variable, including field descriptors. If field descriptors are used in the
Format variable, it must be enclosed in double quotation marks (" "). The
following table shows how field descriptors correspond to field specifiers:

Field Field Default

Descriptors Specifiers Headers

%a args COMMAND

%c comm COMMAND

%t etime ELAPSED

%G group GROUP

%n nice NI

%C pcpu %CPU

%r pgid PGID

%p pid PID

%P ppid PPID

%g rgroup RGROUP

%u ruser RUSER

%x time TIME

%y tty TTY

%U user USER

%z vsz VSZ

-p Plist Displays only information about processes with the process numbers
specified for the Plist variable. The Plist variable is either a comma separated
list of process ID numbers or a list of process ID numbers enclosed in double
quotation marks (" ") and separated from one another by a comma or by one or
more spaces, or both.

-t Tlist Displays only information about processes associated with the
workstations listed in the Tlist variable. The Tlist variable is either a comma
separated list of workstation identifiers or a list of workstation identifiers
enclosed in double quotation marks (" ") and separated from one another by a
comma or by one or more spaces, or both.

-U Ulist Displays only information about processes with the user ID numbers or
login names specified for the Ulist variable. The Ulist variable is either a
comma-separated list of user IDs or a list of user IDs enclosed in double
quotation marks (" ") and separated from one another by a comma and one or more
spaces. In the listing, the ps command displays the numerical user ID unless the
-f flag is used; then the command displays the login name. This flag is
equivalent to the -u Ulist flag. See also the u flag.

-u Ulist This flag is equivalent to the -U Ulist flag.

Options

The following options are not preceded by a - (minus sign):

a Displays information about all processes with terminals (ordinarily only the
user's own processes are displayed).

c Displays the command name, as stored internally in the system for purposes of
accounting, rather than the command parameters, which are kept in the process
address space.

e Displays the environment as well as the parameters to the command, up to a
limit of 80 characters.

ew Wraps display from the e flag one extra line.

eww Wraps display from the e flag as many times as necessary.

g Displays all processes.

l Displays a long listing having the F, S, UID, PID, PPID, C, PRI, NI, ADDR, SZ,
PSS, WCHAN, TTY, TIME, and CMD fields.

n Displays numerical output. In a long listing, the WCHAN field is printed
numerically rather than symbolically. In a user listing, the USER field is
replaced by a UID field.

s Displays the size (SSIZ) of the kernel stack of each process (for use by
system maintainers) in the basic output format. This value is always 0 (zero)
for a multi-threaded process.

t Tty Displays processes whose controlling tty is the value of the Tty variable,
which should be specified as printed by the ps command; that is, 0 for terminal
/dev/tty/0, lft0 for /dev/lft0 , and pts/2 for /dev/pts/2.

u Displays user-oriented output. This includes the USER, PID, %CPU, %MEM, SZ,
RSS, TTY, STAT, STIME, TIME, and COMMAND fields.

v Displays the PGIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU, %MEM fields.

w Specifies a wide-column format for output (132 columns rather than 80). If
repeated, (for example, ww), uses arbitrarily wide output. This information is
used to decide how much of long commands to print.

x Displays processes with no terminal.
 

Some examples from unix man page.

Examples

1. To display all processes, enter:

ps -e -f

2. To list processes owned by specific users, enter:

ps -f -l -ujim,jane,su

3. To list processes that are associated with the /dev/console and /dev/tty1
ttys, enter:

ps -t console,tty/1

4. To list processes not associated with a terminal, enter:

ps -t -

5. To display a specified format with field specifiers, enter:

ps -o ruser,pid,ppid=parent,args

The output is:
RUSER PID parent COMMAND

helene 34 12 ps -o ruser,pid,ppid=parent,args

6. To display a specified format with field descriptors, enter:

ps -o "< %u > %p %y : %a"

The output is:
< RUSER > PID TT : COMMAND

< helene > 34 pts/3 : ps -o < %u > %p %y : %a

7. To display information about processes and kernel threads controlled by the
current terminal , enter:

ps -lm

The output is similar to:
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD

240003 A 26 8984 7190 1 60 20 2974 312 pts/1 0:00 -ksh

400 S - - - 1 60 - - - - - -

200005 A 26 9256 8984 15 67 20 18ed 164 pts/1 0:00 ps

0 R - - - 15 67 - - - - - -

8. To display information about all processes and kernel threads, enter:

ps -emo THREAD

The output is similar to:
USER PID PPID TID S C PRI SC WCHAN FLAG TTY BND CMD

jane 1716 19292 - A 10 60 1 * 260801 pts/7 - biod

- - - 4863 S 0 60 0 599e9d8 8400 - - -

- - - 5537 R 10 60 1 5999e18 2420 - 3 -

luke 19292 18524 - A 0 60 0 586ad84 200001 pts/7 - -ksh

- - - 7617 S 0 60 0 586ad84 400 - - -

luke 25864 31168 - A 11 65 0 - 200001 pts/7 - -

- - - 8993 R 11 65 0 - 0 - - -
 

 

Posted by Alex at 7:04 PM | Comments (0) | Edit | Taged: ps (2)

Change db2 password in db2 level

DB2 depends on operation system level authorization to control DB2 system access.In some case, our db2...

DB2 depends on operation system level authorization to control DB2 system access.

In some case, our db2 account only allows to connect to instance or database, but not log on the system. In other words, we are not able to use the account to get a shell on unix or logon locally on windows.

As usual, when we need to change db2 password, we take action on the system level because it's more frank. But in the case above that we can't get logon, we have to do it on db2 level. There are 2 ways.

  • Use the GUI tool DB2 Configuration Assistance
  • Use the command line tools DB2 CLP or CE

Using DB2 Configuration Assistance

Right click on a database name, then choose "Change password".

CA tool interface

Note: When more than one databases live in same system, we might share the same account in multi-database. Changing password for one of them will affect all databases in this system. In other words, we don't need to do the change on each database, we could choose any we have privileges on the system.

Limitation: We are not able to change our password in the case of that we are only allowed to attach to the node but not connect to any database, or we don't get the catalog information for any database in the node.

For this limitation, it works out with the 2nd way. 

Using DB2 CLP and CE

We could use CLP and CE to change password for databases and nodes that we connected or attached to.

  • Change by connecting to database
C:\> db2 connect to SAMPLE user TEST using OLDPWD new NEWPWD confirm NEWPWD
C:\> db2 connect to SAMPLE user TEST using OLDPWD change password
  • Change by attaching to node, this way works out for the limitation in Configuration Assistance
C:\> db2 attach to NODE user TEST using OLDPWD new NEWPWD confirm NEWPWD
C:\> db2 attach to NODE user TEST using OLDPWD change password


Posted by Alex at 2:16 PM | Comments (0) | Edit | Taged: DB2 (15), Password (2)

初学单板滑雪

前几年,我是滑过一次双板的,连中级道也没上过。今年与朋友一道去滑雪,因为双板水平初级得不得了,也没什么留恋的,就改了单板。为此置备了一套滑雪服,更重要的是一套护具,护臀、护膝、护肘和护掌。滑雪前学习了一下绿野的单板教程,又在磊客 看了一个系列的单板教学视频 。单板滑雪和不同于双板,双板的保护性摔法是侧摔,单板则是后摔和前摔,如果不幸侧摔了,那一定很痛苦。因此对于膝盖和屁股的保护就特别重要。还因为初学经常要用手掌去触地,所以护掌也很重要。两次滑雪都是在云居滑雪场,雪道也还过得去,按官方的说法,有两条初级道,一条单板练习道,两条高级道。不过单板练习道一般被视为中级道,混满了单板和双板,而两条中级道被视为高级道。请看图示:下面按官方的说法引用雪道名称。初级与单板练习道使用牵引,如果像双板那样正面夹着塑胶盘上山,单板是横过来的,无法上坡滑行,所以要侧身夹着,有些辛苦。最初不适应,是用手拽着上去的,一次下来已经快精疲力竭了,呵呵。两条中级雪道使用索道座椅,比较舒服。单板要分前后脚,小时候玩滑冰,我是左脚在前的,平衡感好些,不过后来练习JKD,则是以更强健的右手为前手,因此单板也就选择了右前式。选板子的时候,后脚的固定器基本是0度,略略外八一点,而前脚则是外八的多一点。因为调整麻烦,也没有尝试比较其它角度,脚下感觉还算舒服。踌躇满志的固定好板子,从训练坡下去,就摔了好几下,然后费了九牛二虎之力上了初级道,也是一路摔下来。游侠过来告诉我们,单板不要在初级道练习了,因为坡太小,没法练习推坡,上单板练习道吧。开始还有些不解,觉得那里太陡,不过上去就明白了,的确如此。接着在北国的指导下练习推坡,但是掌握不好方向,有时是推坡,有时是向两边飘,算是把推坡和落叶飘一起给练了。第一天基本都是背坡练习,可以落叶飘下来,不过还是会摔跟头。有个规律,快的不摔慢的摔,陡的不摔缓的摔。大概是因为人在平地上静止时候容易掌握平衡,在滑的斜面上则在运动中容易掌握平衡。第一天下午尝试了一下中级道,选择了左面的坡,但是雪很硬,基本是一路坐着滑下来,站不起来。第二次滑雪,在中级道进行了几次面坡练习,开始找到一点感觉。面坡需要脚尖端的雪板刃触雪,为了让脚跟抬起,开始脚腕用了不少劲,感觉特别酸,还把雪鞋绑得特别紧,否则吃不上力。后来发现,只需要把小腿向前,膝盖向下,压着雪鞋前舌,虽然雪鞋没有太紧,后刃就自然抬起了,还保持了一定的弹性。同理,背坡时,后刃触雪,也不是用脚腕努力抬起脚尖,而是用身体重心带动小腿后侧压雪鞋的后保护板,前刃就自然离开了雪面。 下午中级道人很多,就上了右侧的高级道,雪还不错,比较厚,练习几次,可以背坡落叶飘下来。两次滑雪期间,跟头摔了无数,如果没有护具,不可想象,任何一样护具都起了作用。在几次顺坡下滑中,尝试用换刃的动作,不过基本都失败,而且摔下来都比较厉害。目前可以通过将雪板推到与滑行垂直的方向,比较自如的减速和刹车。关于转向,在右前滑行时,如果向右转,可以轻推左后脚实现,但如果左转,由于不会换刃,只能通过换前后脚来实现,比较慢。稍后补一些护具的图片进来。 参考信息2006年12月24日云居雪场情况汇报...

前几年,我是滑过一次双板的,连中级道也没上过。

今年与朋友一道去滑雪,因为双板水平初级得不得了,也没什么留恋的,就改了单板。为此置备了一套滑雪服,更重要的是一套护具,护臀、护膝、护肘和护掌。

滑雪前学习了一下绿野的单板教程,又在磊客 看了一个系列的单板教学视频

单板滑雪和不同于双板,双板的保护性摔法是侧摔,单板则是后摔和前摔,如果不幸侧摔了,那一定很痛苦。因此对于膝盖和屁股的保护就特别重要。还因为初学经常要用手掌去触地,所以护掌也很重要。

两次滑雪都是在云居滑雪场,雪道也还过得去,按官方的说法,有两条初级道,一条单板练习道,两条高级道。不过单板练习道一般被视为中级道,混满了单板和双板,而两条中级道被视为高级道。请看图示:

下面按官方的说法引用雪道名称。初级与单板练习道使用牵引,如果像双板那样正面夹着塑胶盘上山,单板是横过来的,无法上坡滑行,所以要侧身夹着,有些辛苦。最初不适应,是用手拽着上去的,一次下来已经快精疲力竭了,呵呵。两条中级雪道使用索道座椅,比较舒服。

单板要分前后脚,小时候玩滑冰,我是左脚在前的,平衡感好些,不过后来练习JKD,则是以更强健的右手为前手,因此单板也就选择了右前式。选板子的时候,后脚的固定器基本是0度,略略外八一点,而前脚则是外八的多一点。因为调整麻烦,也没有尝试比较其它角度,脚下感觉还算舒服。

踌躇满志的固定好板子,从训练坡下去,就摔了好几下,然后费了九牛二虎之力上了初级道,也是一路摔下来。游侠过来告诉我们,单板不要在初级道练习了,因为坡太小,没法练习推坡,上单板练习道吧。开始还有些不解,觉得那里太陡,不过上去就明白了,的确如此。

接着在北国的指导下练习推坡,但是掌握不好方向,有时是推坡,有时是向两边飘,算是把推坡和落叶飘一起给练了。第一天基本都是背坡练习,可以落叶飘下来,不过还是会摔跟头。有个规律,快的不摔慢的摔,陡的不摔缓的摔。大概是因为人在平地上静止时候容易掌握平衡,在滑的斜面上则在运动中容易掌握平衡。

第一天下午尝试了一下中级道,选择了左面的坡,但是雪很硬,基本是一路坐着滑下来,站不起来。

第二次滑雪,在中级道进行了几次面坡练习,开始找到一点感觉。面坡需要脚尖端的雪板刃触雪,为了让脚跟抬起,开始脚腕用了不少劲,感觉特别酸,还把雪鞋绑得特别紧,否则吃不上力。后来发现,只需要把小腿向前,膝盖向下,压着雪鞋前舌,虽然雪鞋没有太紧,后刃就自然抬起了,还保持了一定的弹性。

同理,背坡时,后刃触雪,也不是用脚腕努力抬起脚尖,而是用身体重心带动小腿后侧压雪鞋的后保护板,前刃就自然离开了雪面。 

下午中级道人很多,就上了右侧的高级道,雪还不错,比较厚,练习几次,可以背坡落叶飘下来。

两次滑雪期间,跟头摔了无数,如果没有护具,不可想象,任何一样护具都起了作用。在几次顺坡下滑中,尝试用换刃的动作,不过基本都失败,而且摔下来都比较厉害。

目前可以通过将雪板推到与滑行垂直的方向,比较自如的减速和刹车。关于转向,在右前滑行时,如果向右转,可以轻推左后脚实现,但如果左转,由于不会换刃,只能通过换前后脚来实现,比较慢。

稍后补一些护具的图片进来。 

参考信息

Posted by Alex at 7:38 AM | Comments (0) | Edit | Taged: 单板 (1), 滑雪 (1)

订阅几本杂志

给自己在2007年订阅了几本杂志:《科技新时代》、《程序员》、《商业周刊》。这是经过精挑细选的,比较适合自己的口味。科技新时代可以跟踪一些前沿的、有趣的新技术,满足自己的好奇心,并带来灵感。程序员是CSDN发行的技术刊物,虽然有些缺乏权威性,但可以很好的跟踪最新的技术。商业周刊是稍侧重于IT技术领域的商业类刊物,是美国《Business Weeks》的中文版,可以了解技术领域以外的一些最新消息和趋势。以上都通过网上订阅,网银缴费,比较方便。...

给自己在2007年订阅了几本杂志:《科技新时代》、《程序员》、《商业周刊》。这是经过精挑细选的,比较适合自己的口味。

  • 科技新时代可以跟踪一些前沿的、有趣的新技术,满足自己的好奇心,并带来灵感。
  • 程序员是CSDN发行的技术刊物,虽然有些缺乏权威性,但可以很好的跟踪最新的技术。
  • 商业周刊是稍侧重于IT技术领域的商业类刊物,是美国《Business Weeks》的中文版,可以了解技术领域以外的一些最新消息和趋势。
以上都通过网上订阅,网银缴费,比较方便。

Posted by Alex at 4:12 PM | Comments (0) | Edit | Taged: 杂志 (1), 订阅 (1)

Try Skype charged service for calling ordinary phones

I spent €10 on Skype Internet to phones service.It allows:call ordinary phones (include mobile phone) from...

I spent €10 on Skype Internet to phones service.

It allows:

Fee rate

  • Calling China Mobile, China Beijing/Shanghai/Guangzhou/Shenzhen costs €0.017 per minute.
  • Send SMS to China phone number costs €0.045 per message.

The fee rate is no matter where you are, it's only about where you are calling.

Payment way

I use my Visa credit card. The whole process was done within Firefox successfully. I start the online payment from aborad web site and was redirected to somewhere in China at the last stage for asking my credit card password as usual I pay in China.

 

Posted by Alex at 11:42 AM | Comments (0) | Edit | Taged: Skype (1)

Alex's picture

my email address in picture

搜索|Search

订阅更新|Subscribe to Feed

按月归档|By Month

2009
07
2008
11
10
07
05
04
03
02
01
2007
12
10
07
06
05
04
03
02
01
2006
12
11
10
09
08
07
06
05
04
03
02
01
2005
11
10
09
08
07
04
03
2004
12
11
10
09
08
07
06
05
04
03
02
01
2003
12
10
09
08
06
2002
09
08
04
03
02
2001
12
09
07
06
05

我读|My Books

友情链接|links

我的链接|My Links

我的朋友|My Friends

Creative Commons License
This blog is licensed under a Creative Commons License.
Movable Type 4 Logo