2011年11月11日 星期五

如何在 GIT 跟 CVS 之間協同合作

主要可以參考這個網站 http://dabase.com/e/09017/

最近由於計畫需要跟別人做整合,但是計畫又是由別人主導的,
但是別人在版本控制系統用的是 CVS,自己本身已經使用 Git 習慣了,
只好開始找怎麼讓 Git 可以轉換成 CVS 的方法

在這邊就不贅述怎麼在 CVS 跟 GIT check out了

要在兩邊做同步,目前我嘗試出來的方法需要兩個目錄,
一個是專門給自己的Git用,一個專門用來給CVS commit用,

在這邊就用 proj.git 跟 proj.cvs 代稱兩個方法的目錄
首先用 git cvsimport 指令將 CVS import進來 proj.git 目錄內
指令大概是 git cvsimport -d :pserver:user@cvs_server:/cvs_root proj
在這之前可以先將cvs login,避免要一直輸入密碼

之後準備 CVS 用的目錄,這邊就照cvs自己的方法把目錄update或是checkout下來
指令大概是 cvs -d :pserver:user@cvs_server:/cvs_root checkout proj

之後就可以開始用git 把東西加進去了,commit之後我們要用
git cherry origin master 這個指令拿出等等要用來跟CVS commit用的一串編碼
理論上應該直接用最後一個就可以了,這邊我現在還沒做太多測試

再來要跟CVS commit之前,要先設定GIT_DIR變數到我們要跟哪個git資料夾同步的.git目錄
以這邊我們就要設定 export GIT_DIR="/home/user/proj.git/.git"
之後切換過去 proj.cvs目錄執行 git cvsexportcommit -v -c -w /home/user/proj.cvs/ ffceaad60e690600b2f56fd43755fe7e77da38ed
最後面那串就是剛剛我們用git cherry origin master拿出來的編碼
成功之後就被sync到CVS上面去囉

2011年6月20日 星期一

電腦的開機流程(轉載)

轉載自 http://ithelp.ithome.com.tw/question/10068591

--
回答:jeremy168( iT邦初學者10級 )
時間:2011-06-07 16:08:11

電腦主機板要完成開機需要PCR步驟才能才能開機
p為power c為clock r為reset復位
下面是酷皮網網友寫的精簡版開機流程
1.當主機板接上ATX電源部分.電路就開始工作.立刻在ATX第9腳輸出+5V的待命電壓.俗稱+5VSB.
同時在第14腳輸出約2.8-5V電壓.我們俗稱+5VPS-0V開機控制電壓.
2.當按下POWER-ON開機鈕時.主機板觸發電路立刻工作.首先將ATX第14腳+5VPS-ON電壓拉低至0V.ATX電源分別輸出+3.3V +5V -5V +12V -12V 供機板使用.
3.大約延遲50-500MS ATX電源內部控制IC.一但偵測到+3.3V +5V -5V +12V -12V能平穩輸出.就在ATX 第8腳輸出一個月5V的電壓信號.為PG信號.PG信號是機上復位RESET信號的源頭信號.
如果ATX電源偵測到+3.3V +5V -5V +12V -12V有對地短路或是漏電情況.則ATX電源立刻啟動自我保護切斷所有供電.
4.電源調整IC在+12V -12V正常情況下.以及PG信號正常情況下.便開始工作.輸出2個高頻脈衝開關
信號去控制一組MOS電路.導通後為CPU提供核心供電VCORE.
5.同時電源IC會輸出另一個控制電壓去控制另一MOS電路.輸出一個+2.5V的電壓.該電壓一般是時鐘IC
的供電組之一.並送給CPU作為參考電壓Vtt 2.5V
6.時鐘IC在供電PG正常清況下.內部分頻電路開始工作.將14.318M總頻OSC.經過分頻放大後給機板
各系統所需電路.
7.南橋在供電時鐘PG正常下.經過多重邏輯轉換而得來PG信號.自己內部復位電路加工後.送給各所需
電路復位.
8.北橋在供電時鐘.復位正常.將南橋送來的復位加工後給CPU.
9.CPU在電壓.頻率.復位正常下.CPU開始工作.首先開始尋找BIOS內部開機自檢程序.沿著地址線
發出尋址指令CPU-北橋-南橋-BIOS
10.CPU尋址過程中.指令到達南橋.就會在PCI A34槽位上產生一個波形信號.俗稱楨信號 FRAME#
11.CPU尋址到達BIOS.就在BIOS第22腳產生一波形信號.俗稱片選 CS# .就算取下BIOS一樣可以測到CS#這個信號.
12.CPU找到BIOS後讀取BIOS內部開機程序.並沿數據線送回CPU執行.BIOS-南橋-北橋-CPU
13.整個自檢過程中.透過插在PCI槽上的診斷卡以16進制代碼顯示出來.一但自檢完畢.CPU就將自檢
報告由螢幕顯示.
14.接著BIOS自檢程序將控制權移交操作系統引導.主機板開機完成..

2011年5月17日 星期二

hadoop install in ubuntu

最近因為計畫的關係需要建立hadoop系統
就照著網路上的範本寫了一份自己的版本
希望能幫助到大家囉

位子放在這邊 http://goo.gl/XitzQ

有需要補充或是不完全的地方還請大家協助指正

2011年4月8日 星期五

[memo] syslog-ng match option

事情的起因是在我在 Gentoo 修改 syslog-ng.conf ,想把 sshd 的 分離出來,使用了match之後,重開服務卻出現

the match() filter without the use of the value() option is deprecated

拿去google之後找到這篇
https://lists.balabit.hu/pipermail/syslog-ng/2009-September/013372.html
in syslog-ng versions prior to 3.0, the complete message starting from the program name was stored internally as a single string, e.g. the $MSG macro was a simple variable reference, and the match() filter always matched against this string. In syslog-ng 3.0, this was changed (because of the new IETF protocol format), syslog-ng stores all bits found in the syslog message in separate fields, e.g. $PROGRAM, $PID and $MSG together make up the syslog message as you know it. Because of backwards compatibility, match() still mastches against the old "$PROGRAM[$PID]: $MSG" format (expressed in the new meanings of these macros), however since this is not a simple variable reference anymore, syslog-ng needs to construct this value for every match() invocation. The match() filter has been repurposed, and a new message() filter was also introduced. E.g. if you want to match against the message payload (without the program name and pid), you should use the message() filter.
The match() filter was extended to be able to match against any fields of a syslog message using this syntax: match("regexp" value("MESSAGE"));
This is equivalent to the message() filter. However now you can also match against custom fields that you can associate with the message using parsers, e.g. you are not limited to internal values, you can also add your own. -- Bazsi

可是看不懂Value要放啥,所以找到這篇
There's still some problems related to match() with the value() option present. For now it only works with the 'standard' syslog parts (host, program, msg) _and_ the dynamic values generated using the new parser framework. Generic macros (which do not fall into the previous categories) do not. This is basically a design error, but I think it is a bug and I intend to fix it.  The correct syntax is value("MESSAGE"), e.g. there's no dollar sign before the macro name. This is not fortunate as it differs from the normal template definition where the dollar sign indicates that a macro expansion needs to be done. The problem is that I originally didn't intend to support _any_ kind of macro expansion here. That's the design error, that I have to admit.  The solution is not that difficult, but as of now, the value() option for the match() filter is not very usable. Sorry for that.  
Here's a list of supported "values":
 "HOST", 
 "HOST_FROM", 
 "MESSAGE", 
 "PROGRAM", 
 "PID", 
 "MSGID", 
 "SOURCE",  
And any kind of values that you created with a parser. Hopefully I can come up with a solution that's compatible with the current 3.0.x behaviour and one that is more intuitive.  --  Bazsi

2011年1月11日 星期二

[memo] mkfs.ect4

有時後會用到superblock的備份資訊,放在這邊避免以後還要找很久

machine / # mkfs.ext4 /dev/tfm/database
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768000 inodes, 131072000 blocks
6553600 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.