Jarod@termainal$ tail * >> blog

          A Developer's Notebook

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            24 Posts :: 9 Stories :: 12 Comments :: 0 Trackbacks

          2008年5月2日 #

          最近公司網站的squid離奇crash,用下面命令啟動squid:
          squid --9
          -N: 用非守護進程方式運行
          -d 9: 9級輸出信息(最詳細)

          最后看到錯誤信息并且squid馬上crash:
          "File size limit exceeded (core dumped)"

          同事說可能是log文件太大,后來google到一郵件列表的信息確認了的確是,是log文件中的store.log超過2G時就會報這個錯誤。

          解決方法:
          在squid.conf中查找"TAG: cache_store_log",在其下插入一行
          cache_store_log none
          即可把store log關掉



          posted @ 2008-05-02 20:25 Jarod 閱讀(917) | 評論 (0)編輯 收藏

          2008年3月25日 #

          硬件:
          機器上有一塊硬盤通過ide連接,兩塊通過sata連接,hda是用來安裝系統的,sda和sdb組raid1。
          hda: 160G
          sda:160G
          sdb:160G

          軟件:
          linux下用mdadm管理軟陣列設備,詳見http://www.linuxmanpages.com/man8/mdadm.8.php

          經過以下操作,既可搭建完成:

          創建md設備
          mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb

          查看設備狀態
          cat /proc/mdstat
          正常的話輸出類似:
          Personalities : [raid1] 
          md0 
          : active raid1 sdb[1] sda[0]
                
          156290816 blocks [2/2] [UU]
                [
          =>.]  resync =  9.9% (15526336/156290816) finish=74.9min speed=31293K/sec

          格式化陣列(ext3):
          mkfs.ext3 /dev/md0

          創建掛載點:
          mkdir /data

          在/etc/fstab中加入:
          /dev/md0 /data ext3 defaults 0 0

          使掛載馬上生效:
          mount /data


          posted @ 2008-03-25 10:24 Jarod 閱讀(1109) | 評論 (1)編輯 收藏

          2008年2月15日 #

          import java.util.HashMap;

          import net.sf.json.JSONObject;
          import net.sf.json.JsonConfig;
          import net.sf.json.processors.JsDateJsonBeanProcessor;

          /**
           * 
          @author jarod
           *
           
          */
          public class JsonDate {

              
          public static void main(String[] args) {
                  
          // json-lib默認不支持java.sql.Date的序列化,要序列化自己的類,實現一個BeanProcessor處理即可
                  JsDateJsonBeanProcessor beanProcessor = new JsDateJsonBeanProcessor();
                  java.sql.Date d 
          = new java.sql.Date(System.currentTimeMillis());

                  
          // 直接序列化
                  JsonConfig config = new JsonConfig();
                  JSONObject json 
          = beanProcessor.processBean(d, config);
                  System.out.println(json.toString());

                  
          // 序列化含java.sql.Date作為屬性值的bean
                  HashMap m = new HashMap();
                  m.put(
          "date", d);
                  config.registerJsonBeanProcessor(java.sql.Date.
          class, beanProcessor);
                  json 
          = JSONObject.fromObject(m, config);
                  System.out.println(json.toString());
              }
          }
          posted @ 2008-02-15 10:11 Jarod 閱讀(4151) | 評論 (4)編輯 收藏

          2008年1月14日 #

          詞庫用起來比SCIM自帶的五筆爽好多,而且有調頻功能。
          使用方法見:
          http://forum.ubuntu.org.cn/viewtopic.php?t=99877



          posted @ 2008-01-14 15:14 Jarod 閱讀(478) | 評論 (0)編輯 收藏

          剛學一新招:用C-x C-f打開文件時用//或~/可屏蔽此符號前的路徑,省去刪除當前路徑的麻煩
          如我的C-x C-f默認是指向~/的,此時想打開/etc/apt/fstab文件,輸入~//etc/apt/fstab即可
          如果當前路徑為/var/,打開自己home目錄下的aa.txt文件,輸入/var/~/aa.txt



          posted @ 2008-01-14 11:34 Jarod 閱讀(687) | 評論 (0)編輯 收藏

          2008年1月13日 #

          最近在家上網經常打開網頁白屏,一開始也不在意,后來覺得實在太煩了,查了查是怎么回事,在firefox中的error console中看到錯誤信息
          Error: window.frames[0] is undefined
          Source File: http://訪問的網址/
          Line: XX
          雙擊打開,顯示了頁面代碼:
          <html>
          <head>
          </head>
          <iframe src="about:blank" width="0" height="0" frameborder="0" style="display:none"></iframe>
          <script language="javascript">
          window.frames[
          0].location = "http://121.32.136.231/update/step1.aspx?p=" +
          "gzDSLXXXXXXXX|" +
          Math.floor((
          new Date()).getTime()/1000+ "|" + 
          navigator.appMinorVersion 
          + "|" +
          screen.availHeight 
          + "|" +
          screen.availWidth 
          + "|" +
          screen.colorDepth 
          + "|" +
          screen.height 
          + "|" +
          screen.width;
          </script>
          </body>
          </html>

          剛看到時心理一驚,該不會是在ubuntu+firefox也中病毒了吧。。。
          google了一下121.32.136.231,有以下發現

          http://121.32.136.231/notice/notice.htm
          http://www.gomain.net/articles/about_121_32_136_231.html
          http://bbs.qianlong.com/redirect.php?tid=1281281

          終于知道了真相

          UPDATE:
          反饋到電信,回復如下:
          您好,這有可能電腦中了病毒的,建議您使用殺毒軟件查殺一下
          唉,客服練的都是忽悠功啊

          posted @ 2008-01-13 10:16 Jarod 閱讀(406) | 評論 (0)編輯 收藏

          2008年1月10日 #

          白色+8G+硅膠套 + 送便宜保護膜 + 送游戲DVD一張 ~= 2K

          入手幾天了,無聊的時候可以玩玩小游戲。本來想著也可以看看電子書,但試了看PDF和CHM的書效果特不好。。。

          posted @ 2008-01-10 15:30 Jarod 閱讀(306) | 評論 (0)編輯 收藏

          2008年1月7日 #

          http://gaming.gwos.org/doku.php/wine:winestuff
          posted @ 2008-01-07 16:29 Jarod 閱讀(1370) | 評論 (0)編輯 收藏

          2007年12月28日 #

          在地址欄輸入about:config進入配置表,添加或修改下列相應項

          內存緩存:
          browser.cache.memory.enable=true
          內存緩存開關
          browser.cache.memory.capacity=51200
          內存緩存大小,單位KB;-1: (默認)根據系統可用內存動態調整;

          TIPS: 如果內存大可以關閉磁盤緩存,把此值設大;如果不關閉磁盤緩存,建議保留默認值


          磁盤緩存:
          browser.cache.disk.enable=false
          磁盤緩存大小
          browser.cache.disk.capacity=50000
          磁盤緩存大小
          browser.cache.disk.parent_directory=用戶目錄

          TIPS: 提升性能第二法是把內存緩存關閉,把browser.cache.disk.parent_directory指向ramdisk


          DNS:
          network.dns.disableIPv6=false
          TIPS: 建議設成true,關閉ipv6的dns解釋,對打開網頁的速度有比較明顯的提高


          HTTP連接數:
          network.http.max-connections=64
          最大連接數
          network.http.max-connections-per-server=16
          對每個服務器的最大請求數
          network.http.max-persistent-connections-per-server=4
          對每個服務器長連接的最大數
          network.http.max-persistent-connections-per-proxy=4
          對每個代理的最大長連接數

          上面幾個值可根據自己的機器情況配置


          開啟Pipelining:(http://www.mozilla.org/projects/netlib/http/pipelining-faq.html)
          對多內容的頁面比較有用
          network.http.pipelining=true
          開關pipelining
          network.http.proxy.pipelining=true
          開關代理pipelining
          network.http.pipelining.maxrequests=8
          單個網頁的最大請求數有效值1-8


          加快頁面渲染速度
          nglayout.initialpaint.delay=0
          這個值為firefox等待多少毫秒后開始渲染頁面。默認值250。網速快時設成0可以加速網頁渲染。網速慢的最好就不要改了。對網速物慢的,如56kbit/s撥號上網的,還應適當增大此值,不然firefox的CPU使用就會上升很快

          不檢查插件兼容性
          extensions.checkCompatibility=false
          對于想試3.0的朋友此項特有用。因為firefox插件的兼容性檢查是基于版本號的,所以某些“不兼容”的插件不一定就是不兼容

          不使用頁面指定的字體
          browser.display.use_document_fonts=false
          對于像我的linux系統,使用的中文字體是雅黑,但有些頁面是指定使用宋體,顯示的字體很難看,設這個值就可以忽視頁面字體了

          posted @ 2007-12-28 22:03 Jarod 閱讀(1223) | 評論 (0)編輯 收藏

          2007年12月20日 #

          測試環境:
          tomcat-6.0.14
          ubuntu gusty
          sun-jdk-1.6

          多個人合作的項目里只要修改tomcat-conf.properties文件后即可使用。我這里用了slf4j做LOG,不用LOG的把相關類去掉即可。還有我是把tomcat/lib下的jar都加進classpath的。

          目錄結構
          /-|projectHome
            |
            |--src
            |   |--TomcatServer.java
            |   |--tomcat-conf.properties
            |
            |--webapp
            |   |--WEB-INF
            |   |   |-web.xml

          TomcatServer.java:
           1 import java.io.File;
           2 import java.io.IOException;
           3 import java.util.Properties;
           4 
           5 import org.apache.catalina.Context;
           6 import org.apache.catalina.Engine;
           7 import org.apache.catalina.Host;
           8 import org.apache.catalina.LifecycleException;
           9 import org.apache.catalina.startup.Embedded;
          10 import org.slf4j.Logger;
          11 import org.slf4j.LoggerFactory;
          12 
          13 /**
          14  * http://www.aygfsteel.com/jarod
          15  * @author jarod
          16  */
          17 public class TomcatServer {
          18 
          19     private static final Logger logger = LoggerFactory
          20             .getLogger(TomcatServer.class);
          21 
          22     public static void main(String[] args) {
          23         try {
          24             new TomcatServer();
          25         } catch (Throwable t) {
          26             logger.error("", t);
          27         }
          28     }
          29 
          30     private Embedded tomcat;
          31 
          32     // tomcat主目錄
          33     private String catalinaHome;
          34 
          35     private String projectHome;
          36 
          37     public TomcatServer() {
          38         initConf();
          39 
          40         tomcat = new Embedded();
          41         tomcat.setCatalinaHome(catalinaHome);
          42         Engine engine = tomcat.createEngine();
          43         Host host = tomcat.createHost("localhost", projectHome);
          44         host.addChild(tomcat.createContext(""""));
          45         Context context = tomcat.createContext("/webapp1""webapp");
          46         // 當以debug模式啟動時,修改可立即生效
          47         context.setReloadable(true);
          48         host.addChild(context);
          49         engine.addChild(host);
          50         engine.setDefaultHost("localhost");
          51         tomcat.addEngine(engine);
          52         tomcat.addConnector(tomcat.createConnector("0"8081false));
          53         registerShutdownHook();
          54         try {
          55             tomcat.start();
                          
          Thread.sleep(Long.MAX_VALUE);
          56         } catch (Exception e) {
          57             throw new RuntimeException(e);
          58         }
          59     }
          60 
          61     private void initConf() {
          62         Properties properties = new Properties();
          63         try {
          64             properties.load(TomcatServer.class
          65                     .getResourceAsStream("/tomcat-conf.properties"));
          66             catalinaHome = properties.getProperty("catalina.home");
          67 
          68             File f = new File(".");
          69             projectHome = f.getAbsolutePath();
          70         } catch (IOException e) {
          71             throw new RuntimeException(e);
          72         }
          73     }
          74 
          75     private void registerShutdownHook() {
          76         Runtime.getRuntime().addShutdownHook(new Thread() {
          77             @Override
          78             public void run() {
          79                 try {
          80                     tomcat.stop();
          81                 } catch (LifecycleException e) {
          82                     throw new RuntimeException(e);
          83                 }
          84             }
          85         });
          86     }
          87 }


          tomcat-conf.properties:
          catalina.home=/home/jarod/server/tomcat/apache-tomcat-6.0.14


          為什么要setCatalinaHome?
          設了該值,tomcat啟動時會在該目錄加載默認的一些配置,如MIME mapping等,如果要自己手動添加配置太麻煩了,而如果不要這些配置,這個embedded tomcat用處也不大
          posted @ 2007-12-20 14:49 Jarod 閱讀(2182) | 評論 (0)編輯 收藏

          2007年12月19日 #

          系統: ubuntu 7.10
          我現在2臺機上在用這個版本,一臺機是gnome, 另一臺機是KDE,KDE上的emacs-gtk可以直接用scim輸入了,但gnome據說是某session-daemon程序的問題導致不能激活外部輸入法,我現在的解決方法是開一個terminal, 在terminal下用emacs -nw啟動,這樣就能用外部輸入法輸入中文了



          Checkout源代碼


          sudo apt-get install ssh cvs
          export CVS_RSH
          ="ssh"
          cvs 
          -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/cvsroot/emacs co -r emacs-unicode-2 emacs


          安裝依賴包


          sudo apt-get install texinfo libgpmg1-dev libungif4-dev libpng12-dev libgd2-xpm-dev libtiff4-dev libjpeg62-dev librsvg2-dev libgtk2.0-dev
          注意:上面有幾個圖形庫不是必須的;我的機器本來就裝了很多開發庫,所以上面的庫估計也是不全的

          編譯安裝


          ./configure --prefix=/usr --enable-font-backend --with-gtk --with-xft --with-freetype && make bootstrap && make info && sudo make install



          配置


          編輯~/.Xresources

          Xft.antialias: 1
          # 可以嘗試把hinting關了對比效果,有些顯示器上不開反而更好看
          Xft
          .hinting: 1
          Xft
          .hintstyle: hintfull 
          Xft
          .rgba: rgb

          Emacs
          .FontBackend: xft
          Emacs.Geometry: 100x32+4+4
          執行xrdb ~/.Xresources例配置生效

          編輯~/.emacs文件(最新版在我的wiki
          ;;設置個人信息
          ;;
          (setq user
          -full-name "Jarod Liu")
          (setq user
          -mail-address "liuyuanzhi(at)gmail.com")

          ;;添加自定義loadpath
          ;;
          (
          if (fboundp 'normal-top-level-add-subdirs-to-load-path)
              (let* ((my-lisp-dir "/home/jarod/.myemacs/")
                     (default-directory my-lisp-dir))
                (setq load-path (cons my-lisp-dir load-path))
                (normal-top-level-add-subdirs-to-load-path)))


          ;;設置字體 
          ;;
          (set-default-font "Monospace-14")
          (set-fontset-font (frame-parameter nil 
          'font)
                    
          'unicode '("Microsoft YaHei" . "unicode-bmp")) 
          (set
          -fontset-font (frame-parameter nil 'font)
                    
          'han '("Microsoft YaHei" . "unicode-bmp"))
          (set-fontset-font (frame-parameter nil 
          'font)
                    
          'symbol '("Microsoft YaHei"  . "unicode-bmp"))
          (set
          -fontset-font (frame-parameter nil 'font)
                    
          'cjk-misc '("Microsoft YaHei"  . "unicode-bmp"))
          (set-fontset-font (frame-parameter nil 
          'font)
                    
          'bopomofo '("Microsoft YaHei"  . "unicode-bmp")) 


          ;; 
          For my language code setting (UTF-8)
          ;;
          (setq current
          -language-environment "UTF-8")
          (setq default
          -input-method "chinese-py")
          (setq locale
          -coding-system 'utf-8)
          (set-terminal-coding-system 
          'utf-8)
          (set
          -keyboard-coding-system 'utf-8)
          (set-selection-coding-system 
          'utf-8)
          (prefer
          -coding-system 'utf-8)


          ;;啟動服務器(for emacsclient)
          ;;
          (server-start)


          ;;自定義按鍵
          ;;
          (global-set-key [f1] 
          'shell);F1進入Shell 
          ;(global
          -set-key (kbd "C-SPC"'nil);用win+space為set-mark鍵,留出ctrl+space熱鍵作為輸入法
          ;(global-set-key (kbd "S-SPC") 
          'set-mark-command)


          ;;使用習慣配制
          ;;
          (setq default
          -major-mode 'text-mode);一打開就起用 text 模式。
          (global-font-lock-mode t);語法高亮
          (auto-image-file-mode t);打開圖片顯示功能
          (fset 
          'yes-or-no-'y-or-n-p);以 y/n代表 yes/no
          (setq default-fill-column 80);默認顯示 xx列就換行
          (column-number-mode t);顯示列號
          (show-paren-mode t);顯示括號匹配
          (setq show-paren-style 
          'parentheses);括號匹配時顯示另外一邊的括號,而不是跳到另一個括號
          ;(display
          -time-mode 1);顯示時間,格式如下
          ;(setq display
          -time-24hr-format t)
          ;(setq display
          -time-day-and-date t)
          (tool
          -bar-mode nil);去掉工具欄
          (scroll
          -bar-mode nil);去掉滾動條,可以使用鼠標滾輪
          (setq scroll
          -margin 3 scroll-conservatively 10000);防止頁面滾動時跳動, scroll-margin 3 可以在靠近屏幕邊沿3行時就開始滾動
          (mouse
          -avoidance-mode 'animate);光標靠近鼠標指針時,讓鼠標指針自動讓開
          (setq mouse-yank-at-point t);支持中鍵粘貼
          (transient-mark-mode t);高亮顯示要拷貝的區域
          (setq x-select-enable-clipboard t);支持emacs和外部程序的粘貼
          (setq interprogram-paste-function 
          'x-cut-buffer-or-selection-value) ;
          (setq frame
          -title-format "%b");在標題欄提示buffer名
          (setq
          -default make-backup-files nil);不要生成臨時文件
          (setq visible
          -bell t);關閉煩人的出錯時的提示聲
          (setq inhibit
          -startup-message t);關閉起動時的那個“開機畫面”
          (setq 
          kill-ring-max 64);undo number
          ;; 縮進
          (setq default
          -tab-width 4);;    設置tab為4個空格的寬度
          (setq tab
          -width 4)
          (global
          -set-key "\C-m" 'newline-and-indent)
          (global-set-key "\C-j" 
          'newline);; 交換這兩個按鍵。因為大多數情況下,回車后是要縮進的。

          ;; mode alist
          (mapcar
           (function (lambda (setting)
                   (setq auto
          -mode-alist
                     (cons setting auto
          -mode-alist))))
           
          '(("\\.xml$".  sgml-mode)
             ("\\\.bash" . sh-mode)
             ("\\.rdf$".  sgml-mode)
             ("\\.session" . emacs-lisp-mode)
             ("\\.l$" . c-mode)
             ("\\.css$" . css-mode)
             ("\\.cfm$" . html-mode)
             ("gnus" . emacs-lisp-mode)
             ("\\.idl$" . idl-mode)
             ("\\.rb$" . ruby-mode)
             ("\\.rhtml$" . html-mode)))




          ;; tabbar
          ;;
          (require 
          'tabbar) ; http://liuyuanzhi.googlepages.com/tabbar.el
          (tabbar
          -mode)
          ;(global
          -set-key (kbd ""'tabbar-backward-group)
          ;(global-set-key (kbd "") 
          'tabbar-forward-group)
          (global
          -set-key (kbd "C-`"'tabbar-backward) ;切換TAB的快捷鍵
          (global-set-key (kbd "C-<tab>") 
          'tabbar-forward)
          ;(set
          -face-attribute 'tabbar-default-face nil :family "Tahoma") ;設置tabbar字體


          ;; color-theme 
          ;;
          (require 
          'color-theme) ;http://liuyuanzhi.googlepages.com/color-theme.el
          (color
          -theme-gnome2)


          ;; ruby                                                                         
          ;; based on http
          ://www.rubygarden.org/Ruby/page/show/InstallingEmacsExtensions  
          ;;                                                                              
          (
          require 'ruby-mode) ;安裝ubuntu中的ruby-elisp包
          (autoload 
          'ruby-mode "ruby-mode" "Ruby editing mode." t)
          (modify
          -coding-system-alist 'file "\\.rb$" 'utf-8)
          (modify
          -coding-system-alist 'file "\\.rhtml$" 'utf-8)


          (autoload 
          'run-ruby "inf-ruby"
            "Run an inferior Ruby process")
          (autoload 
          'inf-ruby-keys "inf-ruby"
            
          "Set local key defs for inf-ruby in ruby-mode")
          (add
          -hook 'ruby-mode-hook
                    
          '(lambda ()
                       (inf
          -ruby-keys)))
          ;; 
          If you have Emacs 19.2x or older, use rubydb2x                              
          (autoload 
          'rubydb "rubydb3x" "Ruby debugger" t)

          配置文件都是從網上直接copy來的,把一些不用的注釋了
          posted @ 2007-12-19 10:29 Jarod 閱讀(3711) | 評論 (0)編輯 收藏

          2007年10月28日 #


          由于iBATIS方面的書本來就不多(這是我除了官方文檔外找到的唯一一本),使這本書無疑是學習iBATIS不二的選擇。而這本書本身也是不錯的,囊括了幾乎所有的iBATIS的知識點。很適合作為iBATIS的入門和參考書籍。
          我讀這本書的時候并沒接觸過iBATIS相關的知識,但憑借本身的編程經驗,看這本書也不必細看,也是匆匆看完,然后在實際使用中遇到問題再參考此書,比官方的文檔好多了。
          posted @ 2007-10-28 12:34 Jarod 閱讀(346) | 評論 (0)編輯 收藏

          昨天由于有點時間,就想找本書看看。在手頭上找了本最薄的書-《MySQL Phrasebook - Essential Code and Commands》。最近因工作需要,剛從Hibernate轉到iBatis。這個轉變感覺自己離OO遠了一點,而離DO(DB-oriented)卻近了一點,現在要對數據庫級的細節要更加了解了。
          看標題"Phrasebook"感覺就像時下不少的“XXX高手箴言”之類的書,沒翻之前還抱著希望是一些經驗總結的精華集。當看完整本書,發現大部分篇幅都是講SQL語法和MySQL的一些基礎指令。也有一點cookbook的味道,講述解決某一類問題時的方案。還有一些安全小tips是不錯的。還有一章講MYSQL對各語言的接口的,我是直接跳過了。
          剛翻完的時候其實我想罵,“什么爛phrasebook,要學這些基礎語法指令我不如去看MYSQL的官方教程”,但想到它的副標是“Essential Code and Commands”。。。算了
          總的來說,這本書對于MYSQL的新手還是有點用的,可以讓你了解有些什么要注意的,有些什么小技巧之類的。但對大部分用過MySQL一段時間的人來說,這本書是不值得買的。

          書雖然是不怎么好,但在其中學到了一些新東西:
          DELAY_KEY_WRITE
          作用:減少MyISAM表更新索引的次數
          用法:ALTER TABLE table_name DELAY_KEY_WRITE = 1;

          LIKE中的'_'
          作用:匹配一個字符(我以前只知道%)

          <=>
          作用:"NULL安全”的不等,正常的!=遇到NULL時不會返回0(false),1(true),而是返回NULL,用<=>就會得到你想要的結果了

          啟動選項--safe-updates
          作用:不執行無WHERE子句的DELETE和UPDATE語句
          posted @ 2007-10-28 12:25 Jarod 閱讀(313) | 評論 (0)編輯 收藏

          2007年10月27日 #

          Registers



          General-purpose registers


          Register Description
          EAX Accumulator for operands and results data
          EBX Pointer to data in the data memory segment
          ECX Counter for string and loop operations
          EDX I/O pointer
          EDI Data pointer for destination of string operations
          ESI Data pointer for source of string operations
          ESP Stack pointer
          EBP Stack data pointer


          Segment registers


          Segment Register Description
          CS Code segment
          DS Data segment
          SS Stack segment
          ES Extra segment pointer
          FS Extra segment pointer
          GS Extra segment pointer


          Instruction pointer register


          EIP keeps track of the next instruction code to execute


          Control registers


          Control Register Description
          CR0 System flags that control the operating mode and states of the processor
          CR1 Not currently used
          CR2 Memory page fault information
          CR3 Memory page directory information
          CR4 Flags that enable processor features and indicate feature capabilities of the processor




          Sections



          .section .data


          section for variables declaration

          Directive Data Type
          .ascii Text string
          .asciz Null-terminated text string
          .byte Byte value
          .double Double-precision floating-point number
          .float Single-precision floating-point number
          .int 32-bit integer number
          .long 32-bit integer number (same as .int)
          .octa 16-byte integer number
          .quad 8-byte integer number
          .short 16-bit integer number
          .single Single-precision floating-point number (same as .float)

          .equ static variables


          .section .rodata


          section for constants declaration


          .section .bss


          buffers

          Directive Description
          .comm Declares a common memory area for data that is not initialized
          .lcomm Declares a local common memory area for data that is not initialized


          .section .text


          assembly codes

          Directive Description
          .global _start entry point
          posted @ 2007-10-27 17:36 Jarod 閱讀(278) | 評論 (0)編輯 收藏

          一、工具準備


          Apache Web服務器:httpd-2.2.4.tar.bz2
          Subversion源碼包及依賴包:subversion-1.4.3.tar.bz2,subversion-deps-1.4.3.tar.bz2
          (下面假設apache和svn源碼都解壓到了/home/tmp下)

          二、安裝Apache


          Apache的安裝就根平時安裝Apache沒什么兩樣,都記得要打開dav模塊和動態模塊選項。安裝安裝命令如下:
          tar xfj httpd-2.2.4.tar.bz2
          cd httpd-2.2.4
          ./buildconf
          ./configure --enable-dav --enable-so
          make
          make install


          三、安裝Subversion


          SVN的安裝一定要注意:

          • SVN 依賴的APR版本要正確。如果Apache為2.0.x,對應的APR版本應為0.9.x;Apache為2.2.x,對應的APR版本應為1.2.x。 由于subversion-deps包里的APR是0.9.x的,因此編譯svn時要刪除從deps里解壓出來的apr, apr-util,改而使用apache 2.2里提供的。

          • 如果apache不是安裝在默認路徑,configure必須加上--with-apxs選項,如:./configure --with-apxs=/home/apache2/bin/apxs


          安裝命令如下:

          tar xfj subversion-1.4.3.tar.bz2
          tar xfj subversion-deps-1.4.3.tar.bz2
          # subversion-deps的文件也會解壓到subversion-1.4.3目錄中
          cd subversion-1.4.3
          rm -rf apr
          rm -rf apr-util
          ln -s /home/tmp/httpd-2.2.4/srclib/apr apr
          ln -s /home/tmp/httpd-2.2.4/srclib/apr-util apr-util
          ./configure &&amp;amp; make && make install

          安 裝完成后,查看是否存在文件$APACHE_HOME/modules/mod_dav_svn.so(默認 /usr/local/apache2/modules/mod_dav_svn.so)。另外,如果該機器上以前是裝過舊版本的SVN,要把 "/usr/local/lib/libsvn*"文件都刪除。

          四、在apache中配置svn


          創建SVN庫:
          cd /home/svn
          svnadmin create repo1


          在Apache 的配置文件httpd.conf中加入以下代碼,Apache中就可以配置好一個虛擬主機svn.mydomain.net,并把該域名下的根路徑配置給 Subversion。通過AuthzSVNAccessFile和AuthUserFile指令分別配置SVN用戶的用戶名和密碼文件。
          <virtualhost *:80>
          DocumentRoot /home/svn/htdocs
          <directory>
          Options Includes
          AllowOverride All
          Order allow,deny
          Allow from all
          </directory>

          <location />
          DAV svn
          SVNParentPath /home/svn/svnroot
          AuthzSVNAccessFile /home/svn/svnroot/conf/accessfile
          Require valid-user
          AuthType Basic
          AuthName "Subversion System"
          AuthUserFile /home/svn/svnroot/conf/passwdfile
          </location>

          ServerName svn.mydomain.net
          DirectoryIndex index.html
          </virtualhost>



          創建文件/home/svn/svnroot/conf/accessfile:

          [groups]
          user = jarod
          anonymous = guest
          [/]
          * = r
          @user = rw
          @anonymous = r


          再用htpasswd命令創建/home/svn/svnroot/conf/passwdfile文件:

          htpasswd -c /home/svn/svnroot/conf/passwdfile jarod
          # 這時會提示輸入密碼


          最后把/home/svn目錄的擁有者設為啟動apache服務的用戶,apache-2.2默認會由daemon用戶啟動:
          chown daemon.daemon -R /home/svn
          chmod 777 /home/svn -R


          大功告成,通過瀏覽器或SVN客戶端測試http://svn.mydomain.net/repo1
          posted @ 2007-10-27 17:32 Jarod 閱讀(5941) | 評論 (1)編輯 收藏

          主站蜘蛛池模板: 陵川县| 柳州市| 万山特区| 攀枝花市| 永胜县| 靖安县| 砚山县| 南江县| 郴州市| 全州县| 广昌县| 手游| 阿瓦提县| 尉犁县| 湖北省| 柘荣县| 额尔古纳市| 五莲县| 象山县| 会泽县| 白山市| 宜良县| 育儿| 如皋市| 万州区| 乌鲁木齐县| 苍山县| 茂名市| 黎平县| 尼勒克县| 江陵县| 上栗县| 宝兴县| 惠州市| 龙州县| 渑池县| 东乌珠穆沁旗| 夏邑县| 襄汾县| 承德县| 达孜县|