<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1646378019723749424</id><updated>2011-11-22T16:05:39.507+08:00</updated><category term='Mail Client Problem'/><category term='Linux Operation'/><category term='MySQL'/><category term='Linux Programing'/><category term='感想'/><category term='Linux System'/><title type='text'>老師說：學術研究的路是孤單的</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-3245946819109997445</id><published>2011-05-25T15:43:00.001+08:00</published><updated>2011-05-25T15:47:33.530+08:00</updated><title type='text'>500 Internal Server Error</title><content type='html'>今天在Youtube上看影片，突然出現下面這個畫面&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-aTL_fsqdsCg/Tdyzyi-m8pI/AAAAAAAAA1o/TNWBf_eq_l0/s1600/%25E5%25BF%25AB%25E7%2585%25A73.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 247px;" src="http://3.bp.blogspot.com/-aTL_fsqdsCg/Tdyzyi-m8pI/AAAAAAAAA1o/TNWBf_eq_l0/s320/%25E5%25BF%25AB%25E7%2585%25A73.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5610556916761031314" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-aTL_fsqdsCg/Tdyzyi-m8pI/AAAAAAAAA1o/TNWBf_eq_l0/s1600/%25E5%25BF%25AB%25E7%2585%25A73.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;/a&gt;原來YouTube是一群猴子在維護的。&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-3245946819109997445?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/3245946819109997445/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=3245946819109997445' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3245946819109997445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3245946819109997445'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2011/05/500-internal-server-error.html' title='500 Internal Server Error'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-aTL_fsqdsCg/Tdyzyi-m8pI/AAAAAAAAA1o/TNWBf_eq_l0/s72-c/%25E5%25BF%25AB%25E7%2585%25A73.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-629454991511075808</id><published>2011-05-03T22:56:00.001+08:00</published><updated>2011-05-03T22:58:40.235+08:00</updated><title type='text'>T1/E1 Pinout (RJ-48C)</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 17px; "&gt;T1/E1 wiring may use either a RJ45, DB15 or BNC connectors. The pinout shown uses RJ45 connectors - its formal name is USOC RJ-48C and is defined in ANSI T1-403-1989. T1 is a North America (primarily) digital service providing 1.544 Mbps. E1 is a European/Rest of World standard providing digital service at 2.048 Mbps. CATegory 5(e) cabling is used to provide balanced pairs. The color coding for Cat 5(e) cabling may be &lt;a href="http://www.zytrax.com/tech/layer_1/cables/tech_lan.htm#color" class="t-db" style="text-decoration: none; color: blue; "&gt;568A or 568B&lt;/a&gt;.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 17px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 17px; "&gt;&lt;table border="1" cellspacing="0" cellpadding="4" class="p-m-s" align="center" style="font: normal normal normal 8pt/normal Verdana, Helvetica, Arial, sans-serif; "&gt;&lt;tbody&gt;&lt;tr valign="top" class="g-h-s" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(51, 51, 102); color: white; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; font-size: 8pt; font-weight: bold; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;td width="50"&gt;RJ45 Pin&lt;/td&gt;&lt;td width="150"&gt;Signal&lt;/td&gt;&lt;td&gt;Notes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;RX1 (Ring - negative)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;RX2 (TIP - positive)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;FGND (RX GND)&lt;/td&gt;&lt;td&gt;Ground/Shield&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;TX1 (Ring - negative)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;TX2 (TIP - positive)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;FGND (TX GND)&lt;/td&gt;&lt;td&gt;Ground/Shield&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;NC&lt;/td&gt;&lt;td&gt;Unused&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;NC&lt;/td&gt;&lt;td&gt;Unused&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-629454991511075808?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/629454991511075808/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=629454991511075808' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/629454991511075808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/629454991511075808'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2011/05/t1e1-pinout-rj-45.html' title='T1/E1 Pinout (RJ-48C)'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-918039703142134819</id><published>2010-10-13T15:52:00.004+08:00</published><updated>2010-10-13T16:23:01.256+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mail Client Problem'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux Operation'/><title type='text'>收到附件檔名為winmail.dat檔時的處理方法</title><content type='html'>&lt;span&gt;我想有在收信的網友們應該對 "winmail.dat" 檔案不陌生吧？當對方是使用outlook寄信時，往往會收到這個附加檔案，但是這個檔案應該怎麼轉換成Linux能處理的檔案類型呢？Linux裡面有一隻小程式名叫 "tnef"，利用這隻小程式就可以把原始的附加檔案給還原回來了。&lt;/span&gt;&lt;div&gt;&lt;span&gt;原來winmail.dat的檔案格式是 Transport Neutral Encapsulation Format 。&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-918039703142134819?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/918039703142134819/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=918039703142134819' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/918039703142134819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/918039703142134819'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2010/10/winmaildat.html' title='收到附件檔名為winmail.dat檔時的處理方法'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-3775137995155581166</id><published>2009-10-05T15:14:00.002+08:00</published><updated>2009-10-05T15:20:38.511+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux Programing'/><title type='text'>Cisco Config Class</title><content type='html'>最近在忙ISMS的事情，對於每週要備份一次全校的Switch Configure總覺得很不耐煩，在萬般無奈下寫了一個Class，之後就可以透過這個Class來自動備份了，有興趣的人也可以到OpenFoundry去下載下來玩玩。內含範例程式及文件說明。&lt;br /&gt;&lt;br /&gt;&lt;b&gt;svn co http://svn.openfoundry.org/ciscoconfig ciscoconfig&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-3775137995155581166?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/3775137995155581166/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=3775137995155581166' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3775137995155581166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3775137995155581166'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2009/10/cisco-config-class.html' title='Cisco Config Class'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-2275816557832403201</id><published>2008-12-08T16:24:00.005+08:00</published><updated>2008-12-08T16:37:57.660+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux Operation'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux System'/><title type='text'>DHCP OPTION 43 for Lightweight Cisco Aironet Access Points Configuration Example</title><content type='html'>authoritative;&lt;br /&gt;ddns-update-style none;&lt;br /&gt;&lt;br /&gt;option time-offset 28800;&lt;br /&gt;option domain-name-servers 140.127.198.1;&lt;br /&gt;&lt;br /&gt;#Define Space&lt;br /&gt;option space Cisco_LWAPP_AP;&lt;br /&gt;option Cisco_LWAPP_AP.server-address code 43 = string;&lt;br /&gt;&lt;br /&gt;class "Vendor-Identifier" {&lt;br /&gt;        match option vendor-class-identifier;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;subnet 172.17.0.0 netmask 255.255.255.0 {&lt;br /&gt;&lt;br /&gt;               option routers 172.17.0.254;&lt;br /&gt;               option subnet-mask 255.255.255.0;&lt;br /&gt;               option domain-name "AP.Example.com";&lt;br /&gt;               option broadcast-address 172.17.0.255;&lt;br /&gt;&lt;br /&gt;              #Wireless Controler IP Address Configure Option&lt;br /&gt;               subclass "Vendor-Identifier" "Airespace.AP1200" {&lt;br /&gt;                               option vendor-class-identifier "Airespace 1200";&lt;br /&gt;                               vendor-option-space Cisco_LWAPP_AP;&lt;br /&gt;                               option Cisco_LWAPP_AP.server-address "172.17.10.1";&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               subclass "Vendor-Identifier" "Cisco AP c1500" {&lt;br /&gt;                               option vendor-class-identifier "Cisco AP c1500";&lt;br /&gt;                               vendor-option-space Cisco_LWAPP_AP;&lt;br /&gt;                               option Cisco_LWAPP_AP.server-address "172.17.10.2";&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               subclass "Vendor-Identifier" "Cisco AP c1200" {&lt;br /&gt;                               option vendor-class-identifier "Cisco AP c1200";&lt;br /&gt;                               vendor-option-space Cisco_LWAPP_AP;&lt;br /&gt;                               option Cisco_LWAPP_AP.server-address "172.17.10.3";&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               range dynamic-bootp 172.17.0.1 172.17.0.200;&lt;br /&gt;&lt;br /&gt;               default-lease-time 43200;&lt;br /&gt;               max-lease-time 86400;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-2275816557832403201?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/2275816557832403201/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=2275816557832403201' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/2275816557832403201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/2275816557832403201'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2008/12/dhcp-option-43-for-lightweight-cisco.html' title='DHCP OPTION 43 for Lightweight Cisco Aironet Access Points Configuration Example'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-6685876587349658457</id><published>2008-12-02T16:02:00.027+08:00</published><updated>2009-05-15T01:15:41.489+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux System'/><title type='text'>Install Two HP FC1142SR 4Gb PCI-e HBA Card Using QLogic Fibre Channel HBA Driver (qla2xxx-8.02.21) in Ubuntu 8.04.1</title><content type='html'>&lt;span style="font-weight: bold;font-family:verdana;" &gt;Make Provision Driver Building Environment&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;apt-get install build-essential&lt;/li&gt;&lt;li&gt;apt-get install kernel-package&lt;/li&gt;&lt;li&gt;make sure that can find linux-source tarball (ex: &lt;span style="font-weight: bold;"&gt;linux-source-2.6.24.tar.bz2&lt;/span&gt;) in path: /usr/src&lt;/li&gt;&lt;li&gt;extract and decompress linux-source tarball (ex:&lt;span style="font-weight: bold; font-style: italic;"&gt; tar -xvjf linux-source-2.6.24.tar.bz2&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;change directory to /lib/modules/{kernel version} (ex: &lt;span style="font-style: italic; font-weight: bold;"&gt;cd /lib/modules/`uname -r`&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;create a link to linux-headers path with the name build. (ex:&lt;span style="font-weight: bold; font-style: italic;"&gt; ln -s /usr/src/`uname -r` build&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;create a link to linux-source path with the name build. (ex: &lt;span style="font-weight: bold; font-style: italic;"&gt;ln -s /usr/src/linux-source-2.6.24 source&lt;/span&gt;)&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Download QLogic Fibre Channel HBA Driver Source Code&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;change to your home directory&lt;/li&gt;&lt;li&gt;wget ftp://ftp.qlogic.com/outgoing/linux/beta/8.x/&lt;span style="font-weight: bold;"&gt;qla2xxx-src-v8.02.21.tar.gz&lt;/span&gt;&lt;/li&gt;&lt;li&gt;extract and decompress source code tarball file (ex: &lt;span style="font-weight: bold; font-style: italic;"&gt;tar -xvzf qla2xxx-src-v8.02.21.tar.gz&lt;/span&gt;)&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Modify The Driver Source Code&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;edit file &lt;span style="font-weight: bold;"&gt;extras/build.sh&lt;/span&gt; at first line "&lt;span style="font-weight: bold; font-style: italic;"&gt;#!/bin/sh&lt;/span&gt;" to "&lt;span style="font-weight: bold; font-style: italic;"&gt;#!/bin/bash&lt;/span&gt;"&lt;br /&gt;in Ubuntu Linux the default "&lt;span style="font-style: italic; font-weight: bold;"&gt;sh&lt;/span&gt;" had been symbolic linking to "&lt;span style="font-style: italic; font-weight: bold;"&gt;dash&lt;/span&gt;", there are some functions can't be executable in build.sh scrip.&lt;/li&gt;&lt;li&gt;edit file &lt;span style="font-weight: bold;"&gt;qla_def.h&lt;/span&gt;, remark line 33 ~ 35.&lt;/li&gt;&lt;li&gt;edit file &lt;span style="font-weight: bold;"&gt;qla_isr.c&lt;/span&gt;,. replace "&lt;span style="font-weight: bold;"&gt;SA_INTERRUPT|SA_SHIRQ&lt;/span&gt;" with "&lt;span style="font-weight: bold;"&gt;IRQF_DISABLED|IRQF_SHARED&lt;/span&gt;"  at line 2100.&lt;/li&gt;&lt;li&gt;edit file &lt;span style="font-weight: bold;"&gt;qla_os.c&lt;/span&gt;, add "&lt;span style="font-weight: bold;"&gt;struct&lt;/span&gt;" in front of "&lt;span style="font-style: italic; font-weight: bold;"&gt;kmem_cache *srb_cachep;&lt;/span&gt;" at line 40.&lt;/li&gt;&lt;li&gt;remove ones of &lt;span style="font-weight: bold;"&gt;NULL&lt;/span&gt; at line 5723 in file &lt;span style="font-weight: bold;"&gt;qla_os.c&lt;/span&gt;&lt;/li&gt;&lt;li&gt;replace "&lt;span style="font-weight: bold;"&gt;pci_module_init&lt;/span&gt;" with "&lt;span style="font-weight: bold;"&gt;pci_register_driver&lt;/span&gt;" at line 5759 in file &lt;span style="font-weight: bold;"&gt;qla_os.c&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Get ready to build Driver&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;change user to &lt;span style="font-weight: bold;"&gt;root&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;execute "&lt;span style="font-weight: bold; font-style: italic;"&gt;extras/build.sh&lt;/span&gt;" in &lt;span style="font-weight: bold; font-style: italic;"&gt;qla2xxx-8.02.21&lt;/span&gt; directory.&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Now You Can Install this Driver, If Everything is O Kay&lt;/span&gt;.&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;execute "&lt;span style="font-weight: bold; font-style: italic;"&gt;extras/build.sh install&lt;/span&gt;" to install Driver.&lt;/li&gt;&lt;li&gt;execute "&lt;span style="font-weight: bold; font-style: italic;"&gt;update-initramfs -v -u -k `uname -r`&lt;/span&gt;" to update initramfs image.&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Reboot System to Test New &lt;/span&gt;&lt;b&gt;Initial Ramdisk&lt;/b&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt; and Pray It Can Work.....&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:verdana;" &gt; &lt;/span&gt;&lt;span style="font-family:verdana;"&gt;just kindling &lt;/span&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;^_^&lt;/span&gt;&lt;br /&gt;&lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;&lt;br /&gt;&lt;input name="cmd" value="_s-xclick" type="hidden"&gt;&lt;input name="hosted_button_id" value="5437594" type="hidden"&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" &gt;If this Document can help you,&lt;br /&gt;Please &lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);font-size:130%;" &gt;&lt;input style="font-weight: bold;" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" type="image" border="0"&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" &gt; me. Thanks a lot.&lt;/span&gt;&lt;br /&gt;&lt;/form&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-6685876587349658457?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/6685876587349658457/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=6685876587349658457' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/6685876587349658457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/6685876587349658457'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2008/12/install-two-hp-fc1142sr-4gb-pci-e-hba.html' title='Install Two HP FC1142SR 4Gb PCI-e HBA Card Using QLogic Fibre Channel HBA Driver (qla2xxx-8.02.21) in Ubuntu 8.04.1'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-3251289143590783346</id><published>2008-09-26T10:41:00.002+08:00</published><updated>2008-09-26T10:45:26.047+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Resetting MySQL Root Password on Unix Systems</title><content type='html'>&lt;p&gt;             Use the following procedure for resetting the password for             any MySQL &lt;code class="literal"&gt;root&lt;/code&gt; accounts on Unix. The             instructions assume that you will start the server so that             it runs using the Unix login account that you normally use             for running the server. For example, if you run the server             using the &lt;code class="literal"&gt;mysql&lt;/code&gt; login account, you should             log in as &lt;code class="literal"&gt;mysql&lt;/code&gt; before using the             instructions. (Alternatively, you can log in as             &lt;code class="literal"&gt;root&lt;/code&gt;, but in this case you             &lt;span class="emphasis"&gt;&lt;em&gt;must&lt;/em&gt;&lt;/span&gt; start start             &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; with the             &lt;code class="option"&gt;--user=mysql&lt;/code&gt; option. If you start the             server as &lt;code class="literal"&gt;root&lt;/code&gt; without using             &lt;code class="option"&gt;--user=mysql&lt;/code&gt;, the server may create             &lt;code class="literal"&gt;root&lt;/code&gt;-owned files in the data directory,             such as log files, and these may cause permission-related             problems for future server startups. If that happens, you             will need to either change the ownership of the files to             &lt;code class="literal"&gt;mysql&lt;/code&gt; or remove them.)           &lt;/p&gt; &lt;div class="orderedlist"&gt;&lt;ol type="1"&gt;&lt;li&gt;&lt;p&gt;                 Log on to your system as the Unix                 &lt;code class="literal"&gt;mysql&lt;/code&gt; user that the                 &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; server runs as.               &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;                 Locate the &lt;code class="filename"&gt;.pid&lt;/code&gt; file that contains                 the server's process ID. The exact location and name of                 this file depend on your distribution, hostname, and                 configuration. Common locations are                 &lt;code class="filename"&gt;/var/lib/mysql/&lt;/code&gt;,                 &lt;code class="filename"&gt;/var/run/mysqld/&lt;/code&gt;, and                 &lt;code class="filename"&gt;/usr/local/mysql/data/&lt;/code&gt;. Generally,                 the filename has an extension of                 &lt;code class="filename"&gt;.pid&lt;/code&gt; and begins with either                 &lt;code class="filename"&gt;mysqld&lt;/code&gt; or your system's hostname.               &lt;/p&gt; &lt;p&gt;                 You can stop the MySQL server by sending a normal                 &lt;code class="literal"&gt;kill&lt;/code&gt; (not &lt;code class="literal"&gt;kill -9&lt;/code&gt;)                 to the &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; process, using the                 pathname of the &lt;code class="filename"&gt;.pid&lt;/code&gt; file in the                 following command:               &lt;/p&gt; &lt;pre class="programlisting"&gt;shell&gt; &lt;strong class="userinput"&gt;&lt;code&gt;kill `cat /mysql-data-directory/host_name.pid`&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;                 Note the use of backticks rather than forward quotes                 with the &lt;code class="literal"&gt;cat&lt;/code&gt; command; these cause the                 output of &lt;code class="literal"&gt;cat&lt;/code&gt; to be substituted into                 the &lt;code class="literal"&gt;kill&lt;/code&gt; command.               &lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;                 Create a text file and place the following statements in                 it. Replace the password with the password that you want                 to use.               &lt;/p&gt; &lt;pre class="programlisting"&gt;UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;                 The &lt;code class="literal"&gt;UPDATE&lt;/code&gt; and                 &lt;code class="literal"&gt;FLUSH&lt;/code&gt; statements each must be written                 on a single line. The &lt;code class="literal"&gt;UPDATE&lt;/code&gt;                 statement resets the password for all existing                 &lt;code class="literal"&gt;root&lt;/code&gt; accounts, and the                 &lt;code class="literal"&gt;FLUSH&lt;/code&gt; statement tells the server to                 reload the grant tables into memory.               &lt;/p&gt; &lt;/li&gt;&lt;li&gt;&lt;p&gt;                 Save the file. For this example, the file will be named                 &lt;code class="filename"&gt;/home/me/mysql-init&lt;/code&gt;. The file                 contains the password, so it should not be saved where                 it can be read by other users.               &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;                 Start the MySQL server with the special                 &lt;code class="option"&gt;--init-file&lt;/code&gt; option:               &lt;/p&gt; &lt;pre class="programlisting"&gt;shell&gt; &lt;strong class="userinput"&gt;&lt;code&gt;mysqld_safe --init-file=/home/me/mysql-init &amp;amp;&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;                 The server executes the contents of the file named by                 the &lt;code class="option"&gt;--init-file&lt;/code&gt; option at startup,                 changing each &lt;code class="literal"&gt;root&lt;/code&gt; account password.               &lt;/p&gt; &lt;/li&gt;&lt;li&gt;&lt;p&gt;                 After the server has started successfully, delete                 &lt;code class="filename"&gt;/home/me/mysql-init&lt;/code&gt;.               &lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt; &lt;p&gt;             You should now be able to connect to MySQL as             &lt;code class="literal"&gt;root&lt;/code&gt; using the new password.           &lt;/p&gt; &lt;p&gt;             Alternatively, on any platform, you can set the new password             using the &lt;span&gt;&lt;strong class="command"&gt;mysql&lt;/strong&gt;&lt;/span&gt; client (but this approach             is less secure):           &lt;/p&gt; &lt;div class="orderedlist"&gt;&lt;ol type="1"&gt;&lt;li&gt;&lt;p&gt;                 Stop &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; and restart it with the                 &lt;code class="option"&gt;--skip-grant-tables&lt;/code&gt; option.               &lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;                 Connect to the &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; server with                 this command:               &lt;/p&gt; &lt;pre class="programlisting"&gt;shell&gt; &lt;strong class="userinput"&gt;&lt;code&gt;mysql&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;                 Issue the following statements in the                 &lt;span&gt;&lt;strong class="command"&gt;mysql&lt;/strong&gt;&lt;/span&gt; client. Replace the password                 with the password that you want to use.               &lt;/p&gt; &lt;pre class="programlisting"&gt;mysql&gt; &lt;strong class="userinput"&gt;&lt;code&gt;UPDATE mysql.user SET Password=PASSWORD('MyNewPass')&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;   -&gt;                   &lt;strong class="userinput"&gt;&lt;code&gt;WHERE User='root';&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;mysql&gt; &lt;strong class="userinput"&gt;&lt;code&gt;FLUSH PRIVILEGES;&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;/ol&gt;&lt;/div&gt; &lt;p&gt;             You should now be able to connect to MySQL as             &lt;code class="literal"&gt;root&lt;/code&gt; using the new password.           &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-3251289143590783346?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/3251289143590783346/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=3251289143590783346' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3251289143590783346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/3251289143590783346'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2008/09/resetting-mysql-root-password-on-unix.html' title='Resetting MySQL Root Password on Unix Systems'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-7808711397761792323</id><published>2008-01-10T13:32:00.000+08:00</published><updated>2008-01-13T12:20:48.625+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux System'/><title type='text'>在Ubuntu上安裝兩張HP FC1142SR 4Gb PCI-e HBA Card實現Failover的功能</title><content type='html'>原本在Ubuntu 7.10上所提供的HBA (Fibre Channel Host Bus Adapter) module並不支援Failover的功能，所以只好Download HP官方的Package下來試試看，沒想到HP的RPM Package只支援RedHat及SuSe。與RPM Package裡的Install Scripts奮鬥了許多天及經歷了無數次的失敗，自尊心備受打擊的我只好放棄HP的RPM Package，轉而去尋找新的解決辦法，正巧看到QLogic的官方網站所提供的原始碼可以在別的平台上編譯，下載下來後試著編譯看看，發現感覺還不賴，裡面提供的Install Scripts不會讓我已經很脆弱的自尊心再次受到打擊，Readme檔案裡寫的安裝步驟也是屬於Monkey等級 (只要是Monkey看的懂，照著做就一定會成功的等級)很適合禁不起任何打擊的我，但是愉快的過程總是短暫的，在編譯的時候居然跳出了錯誤的訊息，說找不到Linux的Source Code，仔細看了一下錯誤的訊息，發現Install Scripts去找Linux Source Code的路徑不對，但是我也懶的改了，所以就只單純建了一個symbolic link想騙過Install Scripts，沒想到還真的騙過去了 (真不愧是Monkey Level)，最後編譯完成後也同時更新了initrd的image就懷著滿心的期待把系統Reboot了，沒想到開機完成後SAN的設備居然告訴我Link Failure，還好這時我的自尊心已經恢復的差不多了，看一下開機時的訊息(使用&lt;span style="font-style: italic; font-weight: bold;"&gt;dmesg&lt;/span&gt;的指令)發現HBA的Module 在initalize時發生了錯誤，無法被載入到Kernel裡，發生錯誤的Function為&lt;span&gt;"&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;pci_module_init()&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;，請示過Google大神後，Google大神回覆說可以把&lt;span style="font-weight: bold;"&gt;pci_module_init()&lt;/span&gt;&lt;span&gt;以&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;pci_register_driver()&lt;/span&gt;&lt;span&gt;置換就可以了，所以我又回到放有原始碼的QLogic目錄裡尋找Source Code裡有使用到&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;pci_module_init()&lt;/span&gt;&lt;span&gt;的檔案(用&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;grep -r pci_module_init *.c&lt;/span&gt;的指令&lt;span&gt;)發現有5的檔案，分別是&lt;span style="font-weight: bold; font-style: italic;"&gt;ql2100.c&lt;/span&gt;、&lt;span style="font-weight: bold; font-style: italic;"&gt;ql2200.c&lt;/span&gt;、&lt;span style="font-weight: bold; font-style: italic;"&gt;ql2300.c&lt;/span&gt;、&lt;span style="font-weight: bold; font-style: italic;"&gt;ql2322.c&lt;/span&gt;以及&lt;span style="font-weight: bold; font-style: italic;"&gt;ql2400.c&lt;/span&gt;。將這些檔案修改後從新再編譯一次，之後再從新更新一次initrd image。更新完initrd image後重新開機後就發現可以將SAN給掛在上了&lt;/span&gt;，真是可喜可賀啊，差點就要開香檳慶祝了。以下是我的步驟：&lt;br /&gt;&lt;blockquote&gt;&lt;ol&gt;&lt;li&gt;先變身成Super User (sudo su -)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;安裝&lt;span style="font-weight: bold;"&gt;build-essential &lt;/span&gt;&lt;span&gt;(apt-get install build-essential)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;安裝&lt;span style="font-weight: bold;"&gt;linux-headers-2.6.22-14-generic &lt;/span&gt;&lt;span&gt;(apt-get install linux-headers-2.6.22-14-generic)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;安裝&lt;span style="font-weight: bold;"&gt;linux-source-2.6.22 &lt;/span&gt;&lt;span&gt;(apt-get install linux-source-2.6.22)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;解開在/usr/src/linux-source的Package (tar -xvjf linux-source-2.6.22.tar.bz2)&lt;/li&gt;&lt;li&gt;在&lt;span style="font-weight: bold;"&gt;/lib/modules/2.6.22-14-generic&lt;/span&gt;目錄裡建立一個symbolic link名稱為&lt;span style="font-weight: bold;"&gt;source&lt;/span&gt;，連結指到&lt;span style="font-weight: bold;"&gt;/usr/src/linux-source-2.6.22 &lt;/span&gt;&lt;span&gt;(ln -s /usr/src/linux-source-2.6.22 /lib/modules/2.6.22-14-generic/source)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;在QLogic的官方網站下載&lt;span style="font-weight: bold;"&gt;qla2xxx-v8.01.07.15-2-dist.tgz &lt;/span&gt;&lt;span&gt;(wget http://download.qlogic.com/drivers/60471/qla2xxx-v8.01.07.15-2-dist.tgz)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;解開&lt;span style="font-weight: bold;"&gt;qla2xxx-v8.01.07.15-2-dist.tgz &lt;/span&gt;&lt;span&gt;(tar -xvzf &lt;/span&gt;&lt;span&gt;qla2xxx-v8.01.07.15-2-dist.tgz&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;解開後進入到目錄裡 (cd qlogic)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;執行&lt;span style="font-weight: bold;"&gt;./drvrsetup&lt;/span&gt;&lt;/li&gt;&lt;li&gt;執行完畢後會產生名稱為&lt;span style="font-weight: bold;"&gt;qla2xxx-8.01.07.15&lt;/span&gt;的目錄&lt;/li&gt;&lt;li&gt;切換到&lt;span style="font-weight: bold;"&gt;qla2xxx-8.01.07.15&lt;/span&gt;目錄裡 (cd qla2xxx-8.01.07.15)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;因原先寫的原始碼在載入module時所使用的function並不適用於目前的kernel，所以要修正一下，先執行&lt;span style="font-weight: bold;"&gt;grep -r pci_module_init *&lt;/span&gt;將不符合的檔案列出，並修改列出的檔案，把&lt;span style="font-weight: bold;"&gt;pci_module_init&lt;/span&gt;置換成&lt;span style="font-weight: bold;"&gt;pci_register_driver&lt;/span&gt;&lt;/li&gt;&lt;li&gt;執行&lt;span style="font-weight: bold;"&gt;extras/build.sh new&lt;/span&gt;進行編譯module的動作&lt;/li&gt;&lt;li&gt;若編譯的過程中沒有錯誤的話，就可以執行&lt;span style="font-weight: bold;"&gt;extras/build.sh install&lt;/span&gt;來安裝module&lt;/li&gt;&lt;li&gt;安裝完後要執行&lt;span style="font-weight: bold;"&gt;update-initramfs -c&lt;/span&gt;建立新的initrd影像檔&lt;/li&gt;&lt;li&gt;reboot來啟用新的initrd&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;以上是我安裝的過程，可能並不適合所有環境。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-7808711397761792323?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/7808711397761792323/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=7808711397761792323' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/7808711397761792323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/7808711397761792323'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2008/01/ubuntuhp-fc1142sr-4gb-pci-e-hba.html' title='在Ubuntu上安裝兩張HP FC1142SR 4Gb PCI-e HBA Card實現Failover的功能'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-5521517791377294450</id><published>2007-10-19T16:24:00.000+08:00</published><updated>2007-10-19T17:55:41.219+08:00</updated><title type='text'>Postfix With SMTP-AUTH And TLS (Mandriva)</title><content type='html'>Install the required packages (Postfix, cyrus-sasl, imap, etc.) like this:&lt;br /&gt;&lt;br /&gt;urpmi cyrus-sasl libsasl2 libsasl2-devel libsasl2-plug-plain libsasl2-plug-anonymous libsasl2-plug-crammd5 libsasl2-plug-digestmd5 libsasl2-plug-gssapi libsasl2-plug-login postfix imap&lt;br /&gt;&lt;br /&gt;Then run (make sure that you use the correct values for mydomain, myhostname, and mydestination):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;postconf -e 'mydomain = example.com'&lt;br /&gt;postconf -e 'myhostname = server1.$mydomain'&lt;br /&gt;postconf -e 'mydestination = /etc/postfix/local-host-names, localhost.example.com'&lt;br /&gt;postconf -e 'smtpd_sasl_local_domain ='&lt;br /&gt;postconf -e 'smtpd_sasl_auth_enable = yes'&lt;br /&gt;postconf -e 'smtpd_sasl_security_options = noanonymous'&lt;br /&gt;postconf -e 'broken_sasl_auth_clients = yes'&lt;br /&gt;postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'&lt;br /&gt;postconf -e 'inet_interfaces = all'&lt;br /&gt;postconf -e 'mynetworks = 127.0.0.0/8'&lt;br /&gt;touch /etc/postfix/local-host-names&lt;br /&gt;touch /var/lib/mailman/data/aliases&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Edit /etc/sasl2/smtpd.conf. It should look like this:&lt;br /&gt;&lt;br /&gt;vi /etc/sasl2/smtpd.conf&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;# SASL library configuration file for postfix&lt;br /&gt;# all parameters are documented into:&lt;br /&gt;# /usr/share/doc/cyrus-sasl/options.html&lt;br /&gt;&lt;br /&gt;# The mech_list parameters list the sasl mechanisms to use,&lt;br /&gt;# default being all mechs found.&lt;br /&gt;mech_list:         plain login&lt;br /&gt;&lt;br /&gt;# To authenticate using the separate saslauthd daemon, (e.g. for&lt;br /&gt;# system or ldap users). Also see /etc/sysconfig/saslauthd.&lt;br /&gt;pwcheck_method:    saslauthd&lt;br /&gt;saslauthd_path:    /var/lib/sasl2/mux&lt;br /&gt;&lt;br /&gt;# To authenticate against users stored in sasldb.&lt;br /&gt;#pwcheck_method:    auxprop&lt;br /&gt;#auxprop_plugin:    sasldb&lt;br /&gt;#sasldb_path:       /var/lib/sasl2/sasl.db&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create the SSL certificate needed for TLS:&lt;br /&gt;&lt;br /&gt;mkdir /etc/postfix/ssl&lt;br /&gt;cd /etc/postfix/ssl/&lt;br /&gt;openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024&lt;br /&gt;&lt;br /&gt;chmod 600 smtpd.key&lt;br /&gt;openssl req -new -key smtpd.key -out smtpd.csr&lt;br /&gt;&lt;br /&gt;openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt&lt;br /&gt;&lt;br /&gt;openssl rsa -in smtpd.key -out smtpd.key.unencrypted&lt;br /&gt;&lt;br /&gt;mv -f smtpd.key.unencrypted smtpd.key&lt;br /&gt;openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650&lt;br /&gt;&lt;br /&gt;and configure Postfix for TLS:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;postconf -e 'smtpd_tls_auth_only = no'&lt;br /&gt;postconf -e 'smtp_use_tls = yes'&lt;br /&gt;postconf -e 'smtpd_use_tls = yes'&lt;br /&gt;postconf -e 'smtp_tls_note_starttls_offer = yes'&lt;br /&gt;postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'&lt;br /&gt;postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'&lt;br /&gt;postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'&lt;br /&gt;postconf -e 'smtpd_tls_loglevel = 1'&lt;br /&gt;postconf -e 'smtpd_tls_received_header = yes'&lt;br /&gt;postconf -e 'smtpd_tls_session_cache_timeout = 3600s'&lt;br /&gt;postconf -e 'tls_random_source = dev:/dev/urandom'&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now start Postfix, saslauthd, imap and pop3:&lt;br /&gt;&lt;br /&gt;chkconfig imap on&lt;br /&gt;chkconfig imaps on&lt;br /&gt;chkconfig ipop3 on&lt;br /&gt;chkconfig pop3s on&lt;br /&gt;/etc/init.d/postfix restart&lt;br /&gt;/etc/init.d/saslauthd restart&lt;br /&gt;/etc/init.d/xinetd restart&lt;br /&gt;&lt;br /&gt;To see if SMTP-AUTH and TLS work properly now run the following command:&lt;br /&gt;&lt;br /&gt;telnet localhost 25&lt;br /&gt;&lt;br /&gt;After you have established the connection to your Postfix mail server type&lt;br /&gt;&lt;br /&gt;ehlo localhost&lt;br /&gt;&lt;br /&gt;If you see the lines&lt;br /&gt;&lt;br /&gt;250-STARTTLS&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;250-AUTH PLAIN LOGIN&lt;br /&gt;&lt;br /&gt;everything is fine:&lt;br /&gt;&lt;br /&gt;[root@server1 ssl]# telnet localhost 25&lt;br /&gt;Trying 127.0.0.1...&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Connected to localhost.localdomain (127.0.0.1).&lt;br /&gt;Escape character is '^]'.&lt;br /&gt;220 server1.example.com ESMTP Postfix (2.4.5) (Mandriva Linux)&lt;br /&gt;ehlo localhost&lt;br /&gt;250-server1.example.com&lt;br /&gt;250-PIPELINING&lt;br /&gt;250-SIZE 10240000&lt;br /&gt;250-VRFY&lt;br /&gt;250-ETRN&lt;br /&gt;250-STARTTLS&lt;br /&gt;250-AUTH PLAIN LOGIN&lt;br /&gt;250-AUTH=PLAIN LOGIN&lt;br /&gt;250-ENHANCEDSTATUSCODES&lt;br /&gt;250-8BITMIME&lt;br /&gt;250 DSN&lt;br /&gt;quit&lt;br /&gt;221 2.0.0 Bye&lt;br /&gt;Connection closed by foreign host.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;[root@server1 ssl]#&lt;br /&gt;&lt;br /&gt;Type&lt;br /&gt;&lt;br /&gt;quit&lt;br /&gt;&lt;br /&gt;to return to the system's shell.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-5521517791377294450?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/5521517791377294450/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=5521517791377294450' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/5521517791377294450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/5521517791377294450'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2007/10/postfix-with-smtp-auth-and-tls-mandriva.html' title='Postfix With SMTP-AUTH And TLS (Mandriva)'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-6139767500278775169</id><published>2007-08-27T12:01:00.000+08:00</published><updated>2007-08-30T10:06:11.309+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='感想'/><title type='text'>科研沒挑戰 引進人才也白搭</title><content type='html'>轉貼李家同教授所寫的文章：&lt;br /&gt;&lt;blockquote&gt;       報載行政院認為我國缺乏科技人才，決定將從國外輸入一百萬的科技人才。看了以後，我十分困惑。       &lt;p&gt;  我有很多從台清交名校畢業的學生，在科技界服務，薪水不錯，但他們總有一個牢騷：工作太簡單了一點，挑戰性不夠。       &lt;/p&gt;       &lt;p&gt;         在台灣，大多數工程師是非常優秀的，他們畢業時，和歐美明星大學畢業生，沒有什麼差別。可是進入職場以後，慢慢地差距就拉大了。       &lt;/p&gt;       &lt;p&gt;         在歐美，工程師常有機會做非常難的工作。他們真正的成長，是在這些公司裡開始的。       &lt;/p&gt;       &lt;p&gt;         我有一位清大電機系的學生，畢業後進入「類比電路設計」的行業，多年來一直在設計同樣的線路，但是難度越來越高，經驗也越來越豐富。每次完成了一個線路，然後他們會將規格提高一點，他總能達成任務，又設計出了一個非常高規格的線路。       &lt;/p&gt;       &lt;p&gt;         我相信，像他這種人，台灣有的是。我們缺乏的是非常有挑戰性的研究計畫。這位同學在研究所裡根本沒有學過這種技術，就靠一點一滴地努力，終於成了專家。       &lt;/p&gt;       &lt;p&gt;         我們國家，如果需要這種線路，十有八九會去向外國購買，我們的工程師只能將之當成黑盒子般地使用。我們的工程師用了別人的線路長達十年之久，另外一位工程師設計線路長達十年之久，誰比較厲害呢？       &lt;/p&gt;       &lt;p&gt; 韓國工業界在十年前，和我們平起平坐，為什麼現在已經超過了我們？因為他們已經在基礎科技上，打下了很好的基礎。他們不斷在挑戰高難度的技術發展，一定要 擁有獨立自主的技術，而儘量地不依靠外國。他們在經歷如此高難度的挑戰以後，已經變成了世界頂尖的工程師。 &lt;/p&gt;       &lt;p&gt;         韓國會有這種研究計畫，是因為有野心，也有耐心。他們如果朝野上下都在想短時間內看到成效，一定只會引進外國技術，永遠不能獨立自主。       &lt;/p&gt;       &lt;p&gt;         我們要引進國外的科技人才，在國內要先營造一個有高挑戰性工作的環境。如果研發工作沒有挑戰性，過了一陣子，科技人才就不是人才；反過來說，如果我們有很多極難的研究計畫，外國的科技人材會不請自來的。       &lt;/p&gt;       &lt;p&gt; 我建議政府策畫幾個難度較高的計畫，責成政府或民間單位在不依賴外國技術的原則之下完成這些計畫。舉例來說，我們可以要求設計一些通訊工業上所需要的積體 電路，十分精準的步進馬達，或者一個高規格的控制器。如此不僅在很多技術上可以獨立自主，最重要的是國家會多了一大批十分有競爭力的工程師。 &lt;/p&gt;       &lt;p&gt;         工程師都是磨練出來的，我們有時過份地強調創意，而忽略了經驗的重要性。很多有創意的科技人才，其實是因為他在這個領域裡工作了很久，才會有好的創意。       &lt;/p&gt;       &lt;p&gt;         我不反對引進外國科技人才，但培養本土的科技人才一樣重要。培養科技人才，唯一的辦法就是請他從事他不會做的工作。等到有一天他達成任務，他就是人才了。&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;我的心也有戚戚焉。感覺台灣產官學界大部分要的是速成不是長久；想要什麼都用錢去砸；沒想到要如何培養人才；把人才當庸才用，把庸才當人才用。把不切實際只會空彈的人視為人才，把腳踏實地，苦幹實幹的人視為庸才，甚至視為敝屣；這真是讓我痛心之處。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-6139767500278775169?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/6139767500278775169/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=6139767500278775169' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/6139767500278775169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/6139767500278775169'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2007/08/blog-post.html' title='科研沒挑戰 引進人才也白搭'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-132727833577343219</id><published>2007-08-09T13:29:00.000+08:00</published><updated>2007-08-30T10:16:04.924+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux Programing'/><title type='text'>PHP的STDIN(標準輸入)、STDOUT(標準輸出)及STDERR(標準錯誤輸出)</title><content type='html'>有管理過Unix like的作業系統或是有在撰寫Unix like程式的人往往會使用到標準輸入(STDIN)、輸出(STDOUT)及錯誤輸出(STDERR)的管線來完成一些訊息的輸入、輸出及錯誤訊息的表達。&lt;br /&gt;但是若要用php來完成同樣的事情時，則未免有些遺憾，沒有現成的系統錯誤輸出及系統輸入函數(像是scanf)可以使用，但是可以利用一些簡單的fopen()、fprintf()及fscanf()的檔案I/O函數來組合成類似的功能。以下為簡單的程式範例：&lt;br /&gt;&lt;br /&gt;1).使用fopen()及fscanf()的函數組合出類似scanf()的功能：&lt;br /&gt;&lt;pre&gt;&lt;blockquote&gt;&amp;lt;?&lt;br /&gt;/* 判斷STDIN是否已經預先被定義了 */&lt;br /&gt;if(!defined("STDIN")) {&lt;br /&gt;      define("STDIN", fopen('php://stdin','r'));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* 透過標準格式化輸出函數將字串印出 */&lt;br /&gt;printf("Please Input some thing:\n");&lt;br /&gt;&lt;br /&gt;/* 利用fscanf()的函數來讀取預先定義好的STDIN，並將其直傳入$input的變數中 */&lt;br /&gt;fscanf(STDIN, "%s", $input);&lt;br /&gt;&lt;br /&gt;/* 透過標準格式化輸出函數將$input變數的值印出 */&lt;br /&gt;printf("Your input data is \"%s\"\n", $input);&lt;br /&gt;?&amp;gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;br /&gt;---------------------------------------------------------------------------&lt;br /&gt;2).使用fopen()及fprintf()的函數將訊息列印到標準錯誤輸出：&lt;br /&gt;&lt;pre&gt;&lt;blockquote&gt;&amp;lt;?&lt;br /&gt;/* 判斷STDERR是否已經預先被定義了 */&lt;br /&gt;if(!defined("STDERR")) {&lt;br /&gt;      define("STDERR", fopen('php://stderr','w'));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* 透過標準格式化輸出函數將字串印出 */&lt;br /&gt;printf("Standard Message Output\n");&lt;br /&gt;&lt;br /&gt;/* 利用fprintf()的函數將訊息寫入預先定義好的STDERR */&lt;br /&gt;fprintf(STDERR, "Standard Error Message Output\n");&lt;br /&gt;?&amp;gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;br /&gt;續待.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-132727833577343219?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/132727833577343219/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=132727833577343219' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/132727833577343219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/132727833577343219'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2007/08/phpstdinstdoutstderr.html' title='PHP的STDIN(標準輸入)、STDOUT(標準輸出)及STDERR(標準錯誤輸出)'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-5521059940892584069</id><published>2007-07-23T17:08:00.000+08:00</published><updated>2007-07-23T17:24:01.919+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux System'/><title type='text'>如何掛載initrd的影像檔</title><content type='html'>&lt;span id="ctl00_MainContentPlaceholder_ctl00_ctl00_lblEntry"&gt;initrd的檔案格式在kernel 2.4及kernel 2.6是不一樣的&lt;br /&gt;kernel 2.4的掛載方式:&lt;br /&gt;&lt;/span&gt;&lt;span id="ctl00_MainContentPlaceholder_ctl00_ctl00_lblEntry"&gt;&lt;ol&gt;&lt;li&gt;mkdir initrd&lt;br /&gt;&lt;/li&gt;&lt;li&gt;cp /boot/inirtd.img ./initrd.img.gz&lt;/li&gt;&lt;li&gt;gunzip initrd.img.gz&lt;/li&gt;&lt;li&gt;mount -t ext -o loop initrd.img ./initrd&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;kernel 2.6的目前還沒研究出掛載的方式，但可以用cpio把整個影像檔解開來:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;mkdir initrd&lt;/li&gt;&lt;li&gt;cp /boot/inirtd.img ./initrd.img.gz&lt;/li&gt;&lt;li&gt;gunzip initrd.img.gz&lt;/li&gt;&lt;li&gt;cp initrd.img initrd/&lt;/li&gt;&lt;li&gt;cd initrd/&lt;br /&gt;&lt;/li&gt;&lt;li style="color: rgb(255, 0, 0);"&gt;cpio -i --make-directories &lt; initrd.ing&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-5521059940892584069?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/5521059940892584069/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=5521059940892584069' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/5521059940892584069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/5521059940892584069'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2007/07/initrd.html' title='如何掛載initrd的影像檔'/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1646378019723749424.post-4952534541555681561</id><published>2007-07-20T15:24:00.000+08:00</published><updated>2007-07-23T13:16:59.923+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux Operation'/><title type='text'></title><content type='html'>      &lt;span class="postbody"&gt; $ setterm -dump 3 -----&amp;gt; 錄 tty3 的東東 , 產生 screen.dump&lt;br&gt; $ setterm -append -----&amp;gt; 錄 目前 tty 加在 screen.dump 的尾巴&lt;br&gt; $ setterm -h | less -----&amp;gt; 看看 它的功能&lt;br&gt; &lt;br&gt; &lt;/span&gt;&lt;span class="postbody"&gt; 我們為別人也為自己找到解決問題的方法，真的好高興，沒有白努力！&lt;br&gt; 下面是我自己找到的方法：原來在Linux下拍下tty畫面也很簡單&lt;br&gt; 因為我預設的畫面是25X80&lt;br&gt; &lt;br&gt; dd if=/dev/tty1 of=capture_filename bs=2000 count=1&lt;br&gt; vi capture_filename 即可看到剛才tty1上的&lt;b style="color: rgb(255, 163, 79);"&gt;螢幕&lt;/b&gt;內容&lt;br&gt; &lt;br&gt; 如果是&lt;br&gt; dd if=/dev/tty1 of=capture_filename bs=4004 count=1&lt;br&gt; vi capture_filename 可看到剛才tty1上的&lt;b style="color: rgb(255, 163, 79);"&gt;螢幕&lt;/b&gt;內容及色彩編碼&lt;br&gt; 結構是&lt;br&gt; 前四個字元值 列數 每列字元數 游標位置列 游標水平位置&lt;br&gt; 後面則是色彩字元前文字字元後的雙字元結構&lt;br&gt; 只要 cat capture_filename &amp;gt; /dev/tty3&lt;br&gt; 就可把剛才抓下的畫面秀在tty3上面，好玩吧！&lt;br&gt;&lt;br&gt; &lt;/span&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1646378019723749424-4952534541555681561?l=tzerming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tzerming.blogspot.com/feeds/4952534541555681561/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1646378019723749424&amp;postID=4952534541555681561' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/4952534541555681561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1646378019723749424/posts/default/4952534541555681561'/><link rel='alternate' type='text/html' href='http://tzerming.blogspot.com/2007/07/setterm-dump-3-tty3-screen.html' title=''/><author><name>Tzer-Ming, Liu</name><uri>http://www.blogger.com/profile/03104702103355999326</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_J82NkqiE3Aw/TLcxmLn5LWI/AAAAAAAAA0M/g3CFTWdA7u0/S220/DSCN5474.JPG'/></author><thr:total>0</thr:total></entry></feed>
