2010年5月29日 星期六

Makefile

:= 立即展開
=
以上不取env值

?= 會從env先取變數
內部=定值<env變數<make參數

2010年5月28日 星期五

[Firstrade/ETRADE] Dividend Reinvestment Plan (DRIP)

Free Dividend Reinvestment Plan
http://www.firstrade.com/public/en_us/productsservices/investmentchoices/dividendreinvestment/


Help Center: Learn about Dividend Reinvestment Programs (DRIPs)
https://us.etrade.com/e/t/estation/help?id=1301060000

Step 1: Reinvest your Dividends
https://us.etrade.com/e/t/estation/ESDivEnroll

https://us.etrade.com/e/t/estation/contexthelp?id=1203011000#q

What securities are eligible for DRIP enrollment?
For a security to be eligible for a DRIP, it must meet the following criteria:
  1. The security must be held in your E*TRADE Securities account.
  2. The value of the security must be $5 or greater.
  3. The security must be currently paying a dividend.
Mutual funds, bonds, options, and foreign securities are not eligible for DRIP enrollment.


For securities with DRIP, you will get fraction part of shares. You can sell them by filling the following request:
Liquidate my DRIP fractional shares
https://us.etrade.com/e/t/estation/ESFract
Upon selling all whole shares of a position, any remaining fractional shares will be sold automatically the next business day at the whole quantity executed price.


gcc -l 的位置....很重要...T_T

Using the GNU Compiler Collection (GCC) - 3.13 Options for Linking
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

-llibrary
-l library

(..................)

It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, `foo.o -lz bar.o' searches library `z' after file foo.o but before bar.o. If bar.o refers to functions in `z', those functions may not be loaded.



[筆記] gcc參數指令(轉錄)

http://aikosenoo.pixnet.net/blog/post/23038692
-lLIBRARY
連結時尋找 LIBRARY.a程式庫作為程式庫來源,本參數所指的程式庫為附加方式,即標準程式庫仍會用來作連結,不管本參數有設定,而相關的目錄路徑則為標準路徑加上-L所指定的路徑;如果參數列中有兩個以上的目的檔,本參數的位置有很大的影響,如在 "foo.o -lz bar.o"中 -lz只對 foo.o有效,即 bar.z無法連結到 z.a中的特定函數。

2010年5月26日 星期三

可否扶養父母之一人,另一人單獨報稅?

扶養父母之一人,另一人單獨報稅 應該是可以的,只是又發現新的問題:
這裡的順序是必須強制的順序,還是可擇一?

我(女婿) 扶養 老婆 與 老婆的媽,可以嗎?


民法親屬篇 第五章 扶養
http://soc.miaoli.gov.tw/web/one-parent/law3-1-05.php
1115扶養義務人順序
1.負扶養義務者有數人時,應依左列順序定其履行義務之人:
(1)直系血親卑親屬。(夫妻)
(2)直系血親尊親屬。
(3)家長。
(4)兄弟姊妹。
(5)家屬。
(6)子婦、女婿
(7)夫妻之父母。
2.同係直系尊親屬或直系卑親屬者,以親等近者為先。
3.負扶養義務者有數人而其親等同一時,應各依其經濟能力,分擔義務。

(........................)

1116-1夫妻間扶養權益順序
夫妻互負扶養之義務,其負扶養義務之順序與直系血親親屬同,其受扶養權利之順序與直系血親親屬同


特殊情況夫妻可分開申報綜所稅
http://n.yam.com/lihpao/garden/201005/20100517708087.html
夫或妻年滿60歲或未滿60歲但無謀生能力,可由子女申報扶養,此時夫妻可以一方單獨申報,另一方列報為他戶受扶養親屬,或夫妻雙方列為不同申報戶的受扶養親屬。


夫妻分由子女列扶養 可節稅
http://marboblog.pixnet.net/blog/post/17345874
但銀髮族們如果其中一人由子女列報扶養,或是分別由不同的子女列報扶養,因為受扶養人的所得必須併入納稅義務人所得合併申報,效果形同夫妻分開申報。

(.......................)

同時,因為老先生已經給兒子列報為扶養親屬,老太太就得單獨報稅,她的年度利息所得20萬元,也不到27萬元的報稅門檻;原本兩人合併申報必須報繳的3萬元利息所得,也就這樣省下來了。


http://www2.wunan.com.tw/download/preview/1S27.PDF
血親

* 直系血親:己身所從出,或從己身所出之血親(民法第九六七條第一項)
o 例如父母與子女、祖父母與孫子等
o 長輩稱為直系血親尊親屬,晚輩稱為直系血親卑親屬

* 旁系血親:非直系血親,但與己身出於同源之血親(民法第九六七條第二項)
o 例如兄弟姊妹、姑叔姨舅等
o 長輩稱為旁系血親尊親屬,晚輩稱為旁系血親卑親屬


親等的計算

* 直系血親:從自己往上或往下數,一世為一親等。
* 旁系血親:從自己往上數至同源的直系血親,再往下數至該旁系血親,以其總世數為其親等



免稅額篇: 3.1 免稅額列報條件!
http://www.etax.nat.gov.tw/wSite/ct?xItem=21201&ctNode=11175

Ubuntu update-manager

#update-manager -d

2010年5月25日 星期二

ssh-keygen

SSH1: RSA1
SSH2: RSA2, DSA

Updated:

user=user
server=server
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub $user@$server:~
ssh $user@$server "mkdir -p ~/.ssh/ ; cat ~/id_rsa.pub >> ~/.ssh/authorized_keys; rm -v ~/id_rsa.pub"
  1. Generate key
    ssh-keygen -t dsa
    ssh-keygen -t rsa1
    ssh-keygen -t rsa2 (unknown key type on Ubuntu 8.04)
  2. Upload to server
    scp ~/.ssh/*.pub <server>:~/.ssh/
  3. Import the public key to authorized_keys on Server
    cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys



ssh keygen 免輸入密碼
http://plog.longwin.com.tw/post/1/293

SSH 免密碼登入
http://josephjiang.com/article/understand-ssh-key/

[Linux] SSH Key 更換作業...
http://antontw.blogspot.com/2008/05/linux-ssh-key.html

免安裝 Office 即可檢視、列印 Word、Excel、PowerPoint 文件

免安裝 Office 即可檢視、列印 Word、Excel、PowerPoint 文件
http://blog.joaoko.net/archives/2907?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+joaoko+%280%E8%88%871%E7%9A%84%E9%82%82%E9%80%85%29&utm_content=Google+Reader

Word Viewer(繁體中文版)
http://download.microsoft.com/download/4/c/5/4c579a36-0f30-4b0c-887e-76ee652717aa/wordview_zh-tw.exe

Excel Viewer(繁體中文版)
http://download.microsoft.com/download/8/B/A/8BABAC20-AA0B-431B-8D60-1B8D3E171EA1/ExcelViewer.exe

PowerPoint Viewer(英文版)
http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe

2010年5月23日 星期日

Howto: Boot Linux with a USB Flash Drive as the RootFS

usb-storage.delay_use=1

reduces the settle time for a usb device from 5 seconds to 1 second. This is a workaround to get the USB devices ready in time for the raid detection.
rootflags=data=writeback
forces the kernel to mount the drive in data writeback mode. Without this option booting will fail when it tries to remount the partition read-write.
rootdelay=5
delay root to allow the usb drivers to pop on



Howto: Boot Linux with a USB Flash Drive Raid as the RootFS
http://analogbit.com/node/13

How can I boot from a USB hard drive without BIOS support and no HDD?
http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/how-can-i-boot-from-a-usb-hard-drive-without-bios-support-and-no-hdd-774268/

2010年5月20日 星期四

Open With 用其它瀏覽器開啟目前檢視的網頁 [Firefox]

Open With 用其它瀏覽器開啟目前檢視的網頁 [Firefox]
http://blog.joaoko.net/archives/2880?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+joaoko+%280%E8%88%871%E7%9A%84%E9%82%82%E9%80%85%29&utm_content=Google+Reader

Open With 4.0
https://addons.mozilla.org/zh-TW/firefox/addon/11097/

Spliting commits, and filter-branch

http://progit.org/book/ch6-4.html
Splitting a Commit

git rebase -i HEAD~3
(change the commit to edit)

(now we are at the commit, commited, which we want to change)
git reset HEAD^

(change, commit, whatever is needed)
git add -p
git ci
git add -p
git ci
(...)

git rebase --continue


The Nuclear Option: filter-branch
Removing a File from Every Commit (slower)
git filter-branch --tree-filter 'rm -f passwords.txt' HEAD

Removing a File/Directory from Every Commit (faster)
git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD


Making a Subdirectory the New Root
git filter-branch --subdirectory-filter trunk HEAD

Changing E-Mail Addresses Globally
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "schacon@localhost" ];
then
GIT_AUTHOR_NAME="Scott Chacon";
GIT_AUTHOR_EMAIL="schacon@example.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD

All commit (HEAD), or last part of commit XXXXX..HEAD is valid.


git-filter-branch(1): Rewrite branches - Linux man page
http://linux.die.net/man/1/git-filter-branch

Extracting a subdirectory from git as a new git repository
http://www.pither.com/articles/2009/02/04/extracting-a-subdirectory-from-git-as-a-new-git-repository

Checkout subdirectories in Git?
http://stackoverflow.com/questions/180052/checkout-subdirectories-in-git

Splitting a subpath out into a new repo
http://help.github.com/splitting-a-subpath-to-a-new-repo/

2010年5月19日 星期三

git submodule

At git super project root directory:

git submodule add <git repo> path/to/put/the/repo;
git commit(always remember to checkin the submodule changes)

For first checkout superproject, or for any reason submodule directory is removed and needed to recover again:
git submodule init;
git submodule update;

To make changes in submodule, note that submodule are in (no branch) state initially:
cd <submodule>
git branch;(in submodule, always remember to check the branch state before commit)
git co <branch> (in submodule, if in (no branch) state)
git commit (in submodule)
git push (in submodule, if needed)
cd .. (go to superproject)
git add <submodule> (in superproject, note not "git add <submodule>/", it means a totally different thing)
git commit (in super project, to update the superproject to reference the new commit)




GitSubmoduleTutorial
https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial

Git submodules in N easy steps
http://johnleach.co.uk/words/archives/2008/10/12/323

Submodules
http://book.git-scm.com/5_submodules.html

git-submodule(1) Manual Page
http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html

git submodule
http://blogger.godfat.org/2009/02/git-submodule.html

git submodule
http://www.manic.tw/blog/post/23876945
Re: git-status and git-diff now very slow in project with a submodule
http://www.spinics.net/lists/git/msg131654.html
git config status.submodulesummary false

it doesn't work!!??

tw.archive.ubuntu.com apt-get掛站處理方法

Ubuntu Linux 挑選最佳的 Mirror Site (APT Repository) - Tsung's Blog
http://blog.longwin.com.tw/2011/02/ubuntu-mirror-site-repository-2011/

Mirrors : Ubuntu
https://launchpad.net/ubuntu/+cdmirrors

http://ericbbs.blogspot.com/2009/08/twarchiveubuntucom-apt-get.html

## source.list 將tw.archive.ubuntu.com取代為mirror.nttu.edu.tw

#vim /etc/apt/sources.list
:1,$s/tw.archive.ubuntu.com/mirror.nttu.edu.tw/g


VIM字串搜尋與取代
s(substitute)指令可搜尋某行列範圍。
g(global)指令則可搜尋整個編輯緩衝區的資料。
s指令以第一個滿足該條件的字串為其取代的對象,若該行有數個滿足該條
件的字串,也僅能取代第一個,若想取代所有的字串則需加上g參數。
:1,$s/old/new/g 將檔案中所有的『old』改成『new』。
:10,20s/^/ / 將第10行至第20行資料的最前面插入5個空白。
:%s/old/new/g 將編輯緩衝區中所有的『old』改成『new』。

2010年5月18日 星期二

CVS - Keyword substitution

Keyword substitution
http://ximbiot.com/cvs/manual/cvs-1.11.6/cvs_12.html
http://www.cs.utah.edu/dept/old/texinfo/cvs/cvs_16.html

GNU Autoconf, Automake, and Libtool

http://sourceware.org/autobook/
http://sourceware.org/autobook/autobook/autobook_toc.html

false positive vs false negative

http://www.csie.nctu.edu.tw/~chlo/web/docs/doc/data/cs/9.htm

http://en.wikipedia.org/wiki/False_positive
A false positive, also called a Type I error, exists when a test
incorrectly reports that it has found a result where none really
exists.

http://en.wikipedia.org/wiki/False_negative
In statistics, a false negative, also called a Type II error or miss,
exists when a test incorrectly reports that a result was not
detected, when it was really present.



用網路安全來看

誤報: 明明沒有漏洞卻說有 -> false positive

漏報: 明明有漏洞卻說沒有 -> false negative


false positive: 明明沒有卻說有

false negative: 明明有卻說沒有

example:

"芭樂消息"
-> false positive

"此地無銀三百兩"
-> false negative

"嘴巴說不要, 身體到是挺老實的嘛"
-> false negative

Building ipsec-tools-0.6.5

./configure --host=arm-linux --with-openssl=/path/to/openssl --prefix=/path/to/install
if [ ! -e mkinstalldir ] ; then ln -s /usr/share/automake-1.7/mkinstalldirs;fi
make;make install

http://page.dj-inod.com/thirdyear/s5/projet/report/report_linux.pdf

ERROR: sockmisc.c: In function 'saddr2str':
sockmisc.c:824: error: the address of 'addr' will always evaluate as 'true'
sockmisc.c:824: error: the address of 'port' will always evaluate as 'true'
sockmisc.c: In function 'saddrwop2str':
sockmisc.c:841: error: the address of 'addr' will always evaluate as 'true'

This is a complex one. The addresses of local variables are always non-NULL, as required by the C/C++ standards (and common sense). And its often the case expliciting testing in code indicates potential logic error, "assert(&hwparams)" instead of "assert(hwparams)" for example. However, in this particular case, because of the use of a macro, it does apear to be an annoying false negative. The solution was to add -Werror -Wall -Wno-always-true to CFLAGS in corresponding makefiles. Remove Werror flag in corresponding makefiles.


Or change the configure directly
diff --git a/cpl/ipsec-tools-0.6.5/configure b/cpl/ipsec-tools-0.6.5/configure
index a5fffd2..cdfd983 100755
--- a/cpl/ipsec-tools-0.6.5/configure
+++ b/cpl/ipsec-tools-0.6.5/configure
@@ -20752,7 +20752,8 @@ echo "${ECHO_T}$ac_cv_prog_egrep" >&6



-CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+#CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+CFLAGS_ADD="$CFLAGS_ADD -Wall -Wno-unused"

case $host in
*netbsd*)


ERROR : ipsec-tools-0.6.7/src/setkey/token.c:1821: undefined reference to `yywrap'

1. Install flex and bison,
2. If you are cross compiling, your lib might not have libfl. Cross-compile flex.

This problem was easily solvedm due to prior experience with flex and bison. Flex is a lexical analyzer and bison a parser, and yywrap a function automatically created by flex when executed. Although it couldn't be found were the compilation used flex and bison, the installation of both fixed the problem.


isakmp.c: In function ‘isakmp_open’:
isakmp.c:1579: error: ‘IPV6_RECVDSTADDR’ undeclared (first use in this function)
isakmp.c:1579: error: (Each undeclared identifier is reported only once
isakmp.c:1579: error: for each function it appears in.)

Re: make failed on fedora 10 GCC 4.3.2
http://www.racoon2.wide.ad.jp/ml/racoon2-users/200903/msg609.html

After configure, patch config.h with following:
--- bak 2010-12-23 16:40:23.482675177 +0800
+++ config.h 2010-12-23 16:40:36.482175342 +0800
@@ -191,7 +191,7 @@
#define INET6

/* Use advanced IPv6 API */
-/* #undef INET6_ADVAPI */
+#define INET6_ADVAPI 1

/* Name of package */
#define PACKAGE "ipsec-tools"


Above fix to config.h or configure could be void for they could be regenerated.
diff --git a/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac b/cpl/nitrox-ipsec/
index b99c4a1..8d9e3ea 100644
--- a/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac
+++ b/cpl/nitrox-ipsec/ipsec-tools-0.6.5/configure.ac
@@ -19,7 +19,7 @@ AM_PROG_LEX
AC_SUBST(LEXLIB)
AC_PROG_EGREP

-CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused"
+CFLAGS_ADD="$CFLAGS_ADD -Wall -Wno-unused"

case $host in
*netbsd*)
@@ -471,17 +471,7 @@ main()
))

if test "$ipv6" = "yes"; then
- AC_DEFINE([INET6], [], [Support IPv6])
- AC_MSG_CHECKING(for advanced API support)
- AC_TRY_COMPILE([#ifndef INET6
-#define INET6
-#endif
-#include
-#include ],
- [struct in6_pktinfo a;],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([INET6_ADVAPI], [], [Use advanced IPv6 API])],
- [AC_MSG_RESULT(no)])
+AC_DEFINE([INET6_ADVAPI], [], [Use advanced IPv6 API])],
fi

RACOON_CHECK_BUGGY_GETADDRINFO

2010年5月17日 星期一

Speculative prefetching on ARM processor

ARM: dma-mapping: fix for speculative prefetching
http://kerneltrap.org/mailarchive/git-commits-head/2010/3/1/25335
(Russell's patch regarding speculative prefetching)

Cortex-A9 Technical Reference Manual: 6.5.2. Data prefetching and monitoring
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0388e/CHDIGCEB.html

The Cortex-A9 data cache implements an automatic prefetcher that monitors cache misses done by the processor. This unit can monitor and prefetch two independent data streams. It can be activated in software using a CP15 Auxiliary Control Register bit. See Auxiliary Control Register.

When the software issues a PLD instruction the PLD prefetch unit always takes precedence over requests from the data prefetch mechanism. Prefetched lines in the speculative prefetcher can be dropped before they are allocated. PLD instructions are always executed and never dropped.

PLD, PLDW, and PLI
http://www.keil.com/support/man/docs/armasm/armasm_cjadcfdc.htm

MPlayer在ARM开发板的移植
http://blog.chinaunix.net/u3/105675/showart_2148571.html
(seems on armv4l, not related to speculative prefetching)

2010年5月5日 星期三

拆屈柄工具(Crank and Peg Tools)

IceToolz / Crank and Peg Tools
http://www.icetoolz.biz/icetoolz/index_pro3.php?parent=3&id=10

Contains 14x15mm sockets & 8mm hex key for crank bolts and crank arms removal. Patented interchangeable adaptor fits both squared & hollow axles.


大盤曲柄怎麼拆? 爬了文還是看不懂
http://www.mobile01.com/topicdetail.php?f=315&t=888883&m=f&r=1600&p=3#
套筒一定要鎖牢 不然曲柄滑牙大盤要拆下來可能會動用到破壞的方式才能解決!
套筒確實鎖好後再將工具的軸心鎖進去 大盤就可以退下來!

(.........)



$250






2010年5月4日 星期二

Git working flow

A successful Git branching model
http://nvie.com/git-model

A description of the maintainer workflow for git itself:
http://www.kernel.org/pub/software/scm/git/docs/howto/maintain-git.txt

To be a maintainer:

An overview of some workflows.
- the gitworkflows(7) page
http://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html

The kernel does not follow all of these practices, but maybe similar
projects could benefit from some. :)



To be a “leaf” contributor (does not require git):

- the Linux wireless git guide
http://wireless.kernel.org/en/developers/Documentation/git-guide
- submitting patches to linux-wireless.git
http://wireless.kernel.org/en/developers/Documentation/SubmittingPatches
- guide to tip.git (Linux’s x86 architecture support subsystem)
http://people.redhat.com/mingo/tip.git/readme.txt

To build a throw-away integration branch:

- Stephen Rothwell’s linux-next tree
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=tree;f=Next

To be, well, anyone:

- “everyday git in 20 commands or so”
http://www.kernel.org/pub/software/scm/git/docs/everyday.html

Patch flow:
- for Linux wireless
http://wireless.kernel.org/en/developers/process
- for git
https://git.wiki.kernel.org/index.php/MaintNotes

Separate “internal use” and “public” trees:

- nouveau/linux-2.6
http://lists.freedesktop.org/archives/nouveau/2009-March/002765.html


http://cgit.freedesktop.org/nouveau/linux-2.6/
‘git rebase’ is the main tool here.



Re: newbie: need concrete examples for how the linux-kernel project uses git
http://www.spinics.net/lists/git/msg130643.html

Re: newbie: need concrete examples for how the linux-kernel project uses git
http://www.spinics.net/lists/git/msg130642.html