2011年11月29日 星期二

急診就醫當天請務必要申請"診斷證明書"

就醫(尤其是急診), 如果需要申請保險給付, 請記得一定要就醫當天申請"診斷證明書"否則日後申請要攜帶許多文件, 並且需要掛號(需額外付出掛號費用)... 實在是粉麻煩....@#$!%^@

http://www.mmh.org.tw/med_service/certificate.asp
門診: 需掛號,門診醫師診斷後開立。

※單純開立僅加收掛號費;如由醫師判斷病情,另收看診費用。

急診: 在急診申請,由急診醫師開立。
※若急診時未申請,需補開請掛門診,由當科醫師開立。

住院: 至病房護理站申辦。
※若出/離院時未申請,需補開請掛門診,由原醫師開立。

備註:
※再開立相同乙種診斷證明書者(一個月內曾開立),可直接至住院中心之證明書櫃檯申辦,一份150 (增加一份20元) 。
※申請『外籍監護工專用診斷證明書』,需另附二吋照片二張。(二天內雙掛號郵寄雇主及長照中心)

2011年10月3日 星期一

compression tools

bzip2 bunzip2 gzip gunzip zip unzip lzma unlzma or lzma -d 7za za e # 7za -h 7-Zip (A) 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03 p7zip Version 4.65 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs) Usage: 7za [...] [...] [<@listfiles...>] a: Add files to archive b: Benchmark d: Delete files from archive e: Extract files from archive (without using directory names) ==> I ever used this command to extract file l: List contents of archive t: Test integrity of archive u: Update files to archive x: eXtract files with full paths

2011年8月15日 星期一

Some abbreviations in the business

COB - Close of Business (Day, Business)
LOE - Level of Effort (Job Schedule Estimation)

2011年5月2日 星期一

Linux Service - SNMP

Compile netsnmp
./configure --prefix=install-path
make

SNMPGET
snmpget
./snmpget -v 2c -c public IP-Address SNMPv2-MIB::sysUpTime.0


SNMPWALK
# ./snmpwalk -v 2c -c public IP-Address 1.3.6.1.2.1.1.1
SNMPv2-MIB::sysDescr.0 = STRING: system-Descriptions
[root@localhost apps]# ./snmpwalk -v 2c -c public IP-Address 1.3.6.1.2.1.1
SNMPv2-MIB::sysDescr.0 = STRING: DOCSIS 3.0 Cable Modem <SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprisesOBJECTID
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1094660) 3:02:26.60
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING:
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 2
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-MIB::sysORDescr.1 = STRING:
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00

2011年4月27日 星期三

Adobe PDF

BookMark feature
Select View-> Guide-Board -> Bookmark
Then we can use the embedded bookmarks of the specific pdf document

2011年4月13日 星期三

Linux Command - git

checkout git project
$ git clone git://IP_or_Domain_address/projectName.git
>> Can also be http://IP_or_Domain_address/projectName.git
Cloning into ProjectName...
remote: Counting objects: 13867, done.
remote: Compressing objects: 100% (11779/11779), done.
remote: Total 13867 (delta 2090), reused 13699 (delta 1972)
Receiving objects: 100% (13867/13867), 43.95 MiB | 216 KiB/s, done.
Resolving deltas: 100% (2090/2090), done.

show all the branch/tag in the current repository
$ git ls-remote
From http://IP_or_Domain_address/projectName.git
a99c087c7998b75f8fc662e185b068b52d69b90b HEAD
a99c087c7998b75f8fc662e185b068b52d69b90b refs/heads/master


sync with the latest code from the repository
$ git pull
>> Q. Is there any other command to achieve this purpose?

2011年4月4日 星期一

Linux Command - vi, ctags, taglist

produce the ctags
# ctags -R ./*

Enable the taglist feature
:TlistOpen


my $HOME/.vimrc config file
"set Tlist_Ctags_Cmd=/root/vimfiles/plugin/taglist.vim
filetype plugin on
"let Tlist_Ctags_Cmd = "/usr/bin/ctags"
"let Tlist_WinWidth = 50
map :TlistOpen
map :TlistToggle ==> add the shortcut of taginfo to quickly jump to the taginfo window
map :!/usr/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .


taginfo howto document
http://vim-taglist.sourceforge.net/manual.html

Linux Command - vim, vimrc example

#將這個檔案放在$HOME/下即可以設定VIM的功能,
#如果你是root,就把它放在/root/.vimrc (命名為.vimrc)即可

set softtabstop=4
set shiftwidth=4
set autoindent

2011年2月21日 星期一

Linux Command - tr

1. translate upper case alphabets to lower case alphabets
# echo "ABCD" | tr [:upper:] [:lower:]
abcd

2. 如何將 dos 檔案格式轉換 unix ? (by using "tr" command)

unix或linux主機上會呈現^M的記號(於windows系統為跳行),

如何執行dos2unix的程序進行格式轉換?

# vi dosfile ==> extra characters in the tailing of each line
aaa^M
bbbb^M
ccccc^M
^Z

use "tr" command to delete the tailed characters


# tr -d "\015\032" <> unixfile



# vi unixfile ==> it is ok now
aaa
bbbb
ccccc


3.
去处^M的方法 tr -s "\015" "\n"
出去M Z的方法 tr -s "\015\032" "\n"

Linux Command - ln

Linux command - ln, create the hard-link or soft-link

standard usage includes the following syntaxs
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)

General Usage includes following

a. 1st command type example: create symblic link with specify-name in the specify directory (symbolic link name is differ with target)
# pwd
/tmp
# ln -sf ./mapping-root ./bbb
# ls -la
[omit]
[info-omit] 14 Feb 21 16:40 bbb -> ./mapping-root
[omit]

b. 3rd command type example: create symblic link with the same name with the target in the specify directory (symbolic link name is the same with target)

# ln -sf /tmp/aaa $HOME
# cd $HOME
# ls -la
[info-omit]
8 Feb 21 16:53 aaa -> /tmp/aaa ==>automatically generate the same name with the target in the specify directory ($HOME directory)
[omit]

2011年1月12日 星期三

CVS to SVN Crossover Guide, command comparison

CVS to SVN Crossover Guide

link from http://svn.apache.org/repos/asf/subversion/trunk/doc/user/cvs-crossover-guide.html

Purpose
This document provides an alternate method of learning Subversion. Many users dislike learning new technology via a theoretical "top down" approach, as provided by the Subversion Book. Instead, this document presents Subversion from the "bottom up": it shows a CVS command or task, and then shows the equivalent task in Subversion (along with relevant book links.) It's essentially a re-indexing of topics covered by the book, keyed on CVS tasks.

Table of Contents
Setup
Repository creation
Importing data
Installing a server
Authenticating to a server
Browsing a repository
Checking out a working copy
Basic Work Cycle
Seeing locally changed items
Seeing out-of-date items
Scheduling additions or deletions
Copying and moving
Undoing local changes
Updating and committing
Resolving conflicts
Adding a binary file
Using native line-endings
Examining history
Seeing history of an item
Comparing two versions of an item
Branching/Tagging/Merging
Creating a branch
Moving a working copy to a branch
Finding the beginning of a branch
Porting a single change
Merging a whole branch
Reverting a committed change
Resurrecting deleted items
Creating a tag
Tweaking a tag
Seeing all tags
Comparing two tags
Seeing logs between two tags
Other tasks
Using modules
Line endings and keywords
Repository creation
Create a new repository for holding versioned data.

CVS Subversion
Commands:
$ cvs -d /usr/local/repos init
Explanation:
Creates a new directory repos ready to hold RCS files and config scripts. Commands:
$ svnadmin create /usr/local/repos
Explanation:
Creates a new directory repos containing BerkeleyDB files and config scripts.

Book References:
Repository Creation and Configuration
Importing data
Populate a new repository with initial data. Assuming that you have a tree of code in the local directory myproj/, and you want to move this tree into the repository.

CVS Subversion
Commands:
$ cd myproj
$ cvs -d /usr/local/repos import myproj/ none start
Explanation:
This copies the contents of the current working directory to a new directory (myproj) in the CVS repository. The CVS repository now contains a directory /myproj/ at the top level. Commands:
$ svn mkdir file:///usr/local/repos/tags
$ svn mkdir file:///usr/local/repos/branches
$ svn import myproj/ file:///usr/local/repos/trunk
Explanation:
Though not strictly required, we deliberately create /tags and /branches top-level directories in the repository, to hold tags and branches later on. Then we import the contents of the local myproj/ directory into a newly created /trunk directory in the repository.

Book References:
Choosing a repository layout
svn import
Installing a server
Make the repository available to clients via a network.

CVS Subversion
Commands:
(too complex to demonstrate here)
Explanation:
Export the repository via the cvs pserver program. It can be launched by either inetd or a client's ssh remote request. Commands:
(too complex to demonstrate here)
Explanation:
Export the repository with the Apache 2.0.x server, or via the svnserve program. The latter can run as a standalone daemon, can be launched by inetd, or invoked by a client's ssh remote request.

Book References:
Server configuration
Authenticating to a server
Have a network client prove its identity to a version control server.

CVS Subversion
Commands:
$ cvs -d :pserver:user@host:/repos command…
Explanation:
When contacting a repository, the client pre-emptively "pushes" its authentication credentials at the server. Commands:
$ svn command URL…
Password for 'user': XXXXXXX
Explanation:
The client's authentication credentials are "pulled" from the user interactively, and only when the server deems that a challenge needs to be made. (And contrary to popular belief, the --username and --password options are merely values to be used if the server issues a challenge; they do not "push" the credentials at the server.)

Book References:
Network Model
Browsing a repository
Browse the repository as a filesystem, perusing file contents and history as well (older versions of files or trees.)

CVS Subversion
Commands:
(not possible with commandline client)
Explanation:
Not possible with commandline client. A third-party web server tool such as ViewCVS must be used. Commands:
$ svn list URL [-r rev] [-v]
$ svn cat URL [-r rev]
Explanation:
The svn list and svn cat commands allow interactive browsing of a repository (and all previous states of a repository) from the commandline. (The --verbose [-v] switch displays full listing information.) If Apache is being used as a Subversion server process (i.e. clients access via http://), then the latest version of the repository can be directly browsed by entering URL into any web browser. Additionally, a third-party web server tool (such as ViewCVS) can be used with Subversion.

Book References:
svn list
Checking out a working copy
Create a workspace on local disk which mirrors a directory in the repository.

CVS Subversion
Commands:
$ cvs -d /usr/local/repos checkout myproj
U myproj/foo.c
U myproj/bar.c

Explanation:
Creates a local directory myproj which is a mirror of the repository directory /myproj. Commands:
$ svn checkout file:///usr/local/repos/trunk myproj
A myproj/foo.c
A myproj/bar.c

Explanation:
Assuming that the original project data was imported into the repository /trunk directory, this creates a local directory myproj which is a mirror of the repository directory /trunk. Standard Subversion convention is to do "mainline" development in /trunk. See branching and tagging sections for more details.

Book References:
Initial Checkout
svn checkout
Seeing locally changed items
Discover which items in the working copy have local modifications or are scheduled for addition/deletion.

CVS Subversion
Commands:
$ cvs status

File: baz.c Status: Up-to-date

$ cvs update
M foo.c
U bar.c

Explanation:
The cvs status command shows whether a file is locally modified or out of date, including information about working revision and branch info. Unfortunately, because the output is so verbose and hard to read, many users run cvs update instead, which shows a more compact listing of modified files (and of course, it also causes the server to merge changes into your working copy.) Commands:
$ svn status
M foo.c

Explanation:
Shows modified files only. Very fast, as it does not use the network. Does not update your working copy, yet still shows a single-line display, much like svn update. To see working revision and branch information, run svn info.

Book References:
Examine Your Changes
svn status
Seeing out-of-date items
Discover which items in the working copy are out-of-date (i.e. newer versions exist in the repository.)

CVS Subversion
Commands:
$ cvs status

File: baz.c Status: Needs Patch

$ cvs -n update
M foo.c
U bar.c

Explanation:
The cvs status command shows whether a file is locally modified or out of date, including information about working revision and branch info. A less verbose option is to run cvs -n update instead, which shows a compact listing of both out-of-date and locally modified files, without actually updating the working copy. Commands:
$ svn status -u
M 46 foo.c
M * 46 bar.c
* 46 baz.c

Explanation:
Shows modified files (M) as well as out-of-date files (*). Contacts repository, but doesn't modify the working copy. To see working revision and branch information, run svn info.

Book References:
Examine Your Changes
svn status
Scheduling additions or deletions
Schedule a working-copy file or directory to be added or removed from the repository.

CVS Subversion
Commands:
$ touch foo.c
$ cvs add foo.c
cvs server: scheduling file `blah' for addition
cvs server: use 'cvs commit' to add this file permanently

$ mkdir new-dir
$ cvs add new-dir
Directory new-dir added to the repository

$ rm bar.c
$ cvs rm bar.c
cvs remove: scheduling `bar.c' for removal
cvs remove: use 'cvs commit' to remove this file permanently

$ rm -rf old-dir/*
$ cvs rm old-dir
cvs remove: Removing 3bits

Explanation:
Schedules a file or directory for addition or removal to/from the repository. The repository will not be changed until the user runs cvs commit, except for the case of adding a directory, which immediately changes the repository. Also, directories cannot be truly removed from the repository, just emptied out. (cvs update -P will prune empty directories from your working copy.) Commands:
$ touch foo.c
$ svn add foo.c
A foo.c

$ mkdir new-dir
$ svn add new-dir
A new-dir

$ svn rm bar.c
D bar.c

$ svn rm old-dir
D old-dir/file1
D old-dir/file2

Explanation:
Schedules a file or directory for addition or removal to/from the repository. The repository will not be changed until the user runs svn commit. The scheduled operations are shown as A or D by svn status, and svn revert can un-do the scheduling. Directories really can be deleted (though as with all deleted items, continues to exist in history.)

Book References:
Make Changes to Your Working Copy
svn add
svn delete
Copying and moving
Copy or move/rename a file or directory.

CVS Subversion
Commands:
(not possible.)
Explanation:
Not possible, unless an administrator directly mucks with RCS files in the repository. (And in that case, no history records the act of copying or renaming.) Commands:
$ svn copy foo.c foo2.c
A foo2.c

$ svn copy dir dir2
A dir2

$ svn move bar.c baz.c
A baz.c
D bar.c

$ svn move dirA dirB
A dirB
D dirA/file1
D dirA/file2

Explanation:
The svn copy command schedules a file or directory for addition to the repository, recording the "source" of the copy. After committing, svn log on the copied item will trace history back through the original copy-source. The svn move command is exactly equivalent to running svn copy, followed by an svn delete on the copy-source: the result is a new item scheduled for addition (with copy-history attached) and the original item scheduled for deletion.

Book References:
Make Changes to Your Working Copy
svn copy
svn move
Finding the beginning of a branch
If you're attempting to merge an entire branch into another, you need to compare the "root" and "tip" of the source branch, and then merge those differences into a working copy of the target branch. Obviously the "tip" of the branch can be represented by using the HEAD keyword. But how do you find the "birth" revision of the source branch?

The easiest solution is to run

$ svn log -v --stop-on-copy source-branch-URL


This command will display every change ever made to the branch, but --stop-on-copy option will cause the output to stop as soon as detects a copy operation in the branch's history. By definition, then, the very last log entry printed will show the copy being made. It will look something like:

r9189 | joe | 2004-03-22 10:10:47 -0600 (Mon, 22 Mar 2004) | 1 line
Changed paths:
A /branches/mybranch (from /trunk:9188)

In this case, you would then know to compare revisions 9189 and HEAD of the branch in order to perform the merge:

$ svn merge -r9189:HEAD source-branch-URL target-branch-WC


Seeing all of a project's tags
Assuming you've been following a consistent policy for creating tag-copies, then this is just a matter of running svn ls on a directory containing your tags. Typically you would run it on the /tags directory in your repository, although you're certainly free to organize this directory in a more complex way, or invent a different convention altogether.

As an example, you can see all of Subversion's tags by running:

$ svn ls --verbose http://svn.apache.org/repos/asf/subversion/tags

7739 kfogel Nov 13 22:05 0.33.0/
7796 josander Nov 18 12:15 0.33.1/
7932 josander Dec 03 17:54 0.34.0/
8045 josander Dec 19 15:13 0.35.0/
8063 josander Dec 20 11:20 0.35.1/
8282 josander Jan 13 14:15 0.36.0/
8512 josander Jan 24 17:31 0.37.0/
8810 kfogel Feb 23 03:44 1.0.0/


Seeing the differences between two tags
Just use svn diff in its fully expanded form, which compares any two URLs:

$ svn diff tagURL1 tagURL2


Seeing logs between two tags
This is a somewhat common practice in CVS, and is doable in Subversion, but requires a little bit more work. Assuming that you've made two tags of /trunk at different points in time, the ultimate goal here is to run

$ svn log -rX:Y trunkURL

…where X and Y are the revisions from which the two tags were copied. To discover X and Y, you can use the same technique described in the previous section ("finding the beginning of a branch".) Just use the --stop-on-copy option when logging the history of each tag. No commits happen on tag directories, so the following commands should each produce exactly one log entry:

$ svn log -v --stop-on-copy tag1-URL

r3520 | joe | 2004-03-12 15:28:43 -0600 (Fri, 12 Mar 2004) | 1 line


$ svn log -v --stop-on-copy tag2-URL
a
r4177 | joe | 2004-03-12 15:28:43 -0600 (Fri, 12 Mar 2004) | 1 line


So in this example, the values of X and Y are 3520 and 4177. Now you can view all /trunk changes between those two points in time:

$ svn log -r3520:4177 trunkURL


Fixing an incorrect tag
If your tag is a bit off, you can "adjust" it just as people often do in CVS. Simply check out a working copy of the tag directory, make any changes you wish, and commit.

Remember, because branches and tags are directories, they can also be deleted when they're no longer of any use to your project. They'll continue to exist in the repository's history.

Creating/using "modules"
Compare CVS Modules vs. svn:externals.

Linux Command - grep, egrep, fgrep

Use regular expression extension patten of grep to filter the text-string

--> Use "-E" to represent using the extended regular expression in the grep
# svn info ./* | grep -E "Last Changed Rev|Path"
or
--> Use twice "-e" to indicate the search pattern double times, means we search the two patterns in the source text string
# svn info ./* | grep -e "Last Changed Rev" -e "Path"
or
--> Directly use the egrep as the program to instead of the grep program
# svn info ./* | egrep "Last Changed Rev|Path"

various type from simplest to complicated one
fgrep -> grep -> egrep

2011年1月7日 星期五

Linux Command - chkconfig, service, boot service

If you want to have the NTP server start up automatically, you can use the checkconfig command as follows:

# chkconfig --level 345 ntpd on // In this example, we turn on runlevel 3,4,5 on
# chkconfig --level 0126 ntpd off // In this example, we turn off runlevel 0,1,2,6 off

# chkconfig --list | grep ntpd
ntpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

// Set vsftpd run on the boot time
# chkconfig vsftpd on
# chkconfig --list vsftpd // list which runlevel the vsftpd was turn on, here the runlevel 2,3,4,5 was turn on automatically
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off


// Do some experiments on the rc runlevels
# pwd
/etc/rc.d/rc3.d ==> Here we will show the runlevel 3 files

# chkconfig --list xinetd ==> list the xinetd runlevel on/off status
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off ==> run level 3 was "on"
# ls -la *xin* ==> show the file naming (it is always a linked file with different linked name). Here the name is S56xinetd. we find that the name was start with "S"
lrwxrwxrwx 1 root root 16 2009-11-30 16:11 S56xinetd -> ../init.d/xinetd

# chkconfig --list qemu
qemu 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# ls -la *qemu*
lrwxrwxrwx 1 root root 14 2008-04-16 03:13 S35qemu -> ../init.d/qemu ==> The same as above one. The linked file was started with "S".

# chkconfig --list ypbind
ypbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# ls -la *ypbin*
lrwxrwxrwx 1 root root 16 2008-04-16 03:31 K73ypbind -> ../init.d/ypbind ==> This time the ypbind was off. Here the linked file was started with "K".

# chkconfig --list psacct
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# ls -la *psacct*
lrwxrwxrwx 1 root root 16 2008-04-16 03:13 K10psacct -> ../init.d/psacct ==> The same as above one, the config was off. The linked file was started with "K".


// Again, we set the qemu config as off (before was on), and then the linked file was started with "K" as we think.
# chkconfig qemu off
# chkconfig --list qemu
qemu 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# ls -la *qemu*
lrwxrwxrwx 1 root root 14 2009-12-25 16:30 K98qemu -> ../init.d/qemu


Add a new service into chkconfig maintain list, this will add related symbolic link into /etc/rc.d/ folder
# chkconfig --add tscRC

# find ./* -name *tscRC* -print
./init.d/tscRC
./rc0.d/K92tscRC
./rc1.d/K92tscRC
./rc2.d/S08tscRC
./rc3.d/S08tscRC
./rc4.d/S08tscRC
./rc5.d/S08tscRC
./rc6.d/K92tscRC
# find ./* -name *tscRC* -exec file {} \;
./init.d/tscRC: Bourne shell script text executable
./rc0.d/K92tscRC: symbolic link to `../init.d/tscRC'
./rc1.d/K92tscRC: symbolic link to `../init.d/tscRC'
./rc2.d/S08tscRC: symbolic link to `../init.d/tscRC'
./rc3.d/S08tscRC: symbolic link to `../init.d/tscRC'
./rc4.d/S08tscRC: symbolic link to `../init.d/tscRC'
./rc5.d/S08tscRC: symbolic link to `../init.d/tscRC'
./rc6.d/K92tscRC: symbolic link to `../init.d/tscRC'


If you restart the network service, like following command
# service network restart

All the kernel profile about network settings will be reset to default. So you need to reconfigure those network setting of kernel. For example,

/sbin/sysctl -w net.ipv4.ip_forward=1

GUI service config command to set the boot service
text-mode
# ntsysv

X GUI system
# serviceconf

2011年1月3日 星期一

Check the Market Capitalization

Check the Market Capitalization from Yahoo! Finance

Apple Inc.
http://finance.yahoo.com/q?s=AAPL

Microsoft Inc.
http://finance.yahoo.com/q?s=msft