<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    狼愛上貍

    我胡漢三又回來了

    #

    Tomcat: Error filterStart解決辦法

    現(xiàn)狀:

    把filter\SetCharacterEncodingFilter.class放在web-inf\classes目錄

    在web.xml中添加

        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
     
      <filter>
       <filter-name>Set Character Encoding</filter-name>
       <filter-class>filters.SetCharacterEncodingFilter</filter-class>
       <init-param>
        <param-name>encoding</param-name>
        <param-value>GBK</param-value>
       </init-param>
      </filter>

      <filter-mapping>
       <filter-name>Set Character Encoding</filter-name>
       <url-pattern>/*</url-pattern>
      </filter-mapping>


    后,啟動tomcat5.0.28,出現(xiàn)

    2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
    嚴重: Error filterStart
    2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
    嚴重: Context startup failed due to previous errors



    解決辦法:

    c:\> cd 主頁目錄\web-inf\classes

    c:\> jar cvf   filters.jar   filters

    形成filters.jar文件,把它放在 tomcat\common\lib下,重新啟動tomcat,問題解決!


    posted @ 2007-09-21 15:39 狼愛上貍 閱讀(7788) | 評論 (4)編輯 收藏

    jsp中文問題最終解決方案

    綜合了網上眾多方案后,最終從工具選項設置到編碼解決全部解決.感謝網上眾多分享者的無私.

    1)保持這2句的字符編碼一致:

     <%@ page contentType="text/html;charset=UTF-8" language="java"%>

    <%@ page language="java" import="java.util.*,hy.*" pageEncoding="UTF-8"%>

     

    2)數(shù)據(jù)庫

    在寫JSP時,里面面有涉及到數(shù)據(jù)庫操作,當保存時就會彈出

    save could not be completed

    原因是some characters could not be mapped using iso8859-1

    <%@ page language="java" pageEncoding="GBK"%>

    設成GBK或UTF-8就可以了,只要他里面的支持中文就ok了

    3)eclipse設置

    用eclipse 編寫jsp頁面或

    window-->preferences-->general-->editor-->text file encoding,

    我打開perferences還是沒有找到,狂暈~~~~~~~~~,

    接著看看別的地方有沒有設置編碼的地方,

    還是沒有找到..........

     又回到perferences,覺得還是在這里可以解決,呵呵,問題還是出在這里,

    我找到"General"--"Content Types",

    右邊有個樹形的text,

    展開找到"JSP",開始沒發(fā)現(xiàn),

    那家伙躲在最低下...........,

    大家不要像我粗心,

    最低下有個"Default encoding",

    里面默認的是"ISO-8859-1",

    終于找到了,

    刪掉"ISO-8859-1"填上"UTF-8",

    在點一下"update",

    OK。再保存,

    就沒有錯誤了..............

    4)tomcat中設置server.xml

    <Connector

                port="8080" maxHttpHeaderSize="8192"

                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

                enableLookups="false" redirectPort="8443" acceptCount="100"

                connectionTimeout="20000" disableUploadTimeout="true" 

                URIEncoding="GBK" useBodyEncodingForURI="true" />

    4)tomcat設置數(shù)據(jù)庫數(shù)據(jù)源

    <Context path="/roller" docBase="E:\MyWorks\Websites\4.5K\server\apache-tomcat\webapps\roller" debug="0">

      <Resource auth="Container"

          type="javax.sql.DataSource"

        driverClassName="com.mysql.jdbc.Driver"

        url="jdbc:mysql://localhost:3306/test?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;mysqlEncoding=utf8"

        username="root"

        password=""

        maxActive="20"

        maxIdle="3"

        removeAbandoned="true"

        maxWait="3000" />

      <!-- If you want e-mail features, un-comment the section below -->

      <!--

      <Resource auth="Container"

         type="javax.mail.Session"

         mail.smtp.host="mailhost.example.com" />

      -->

    </Context>

    5)提交表單

    1 表單提交的數(shù)據(jù),用request.getParameter(“xxx”)返回的字符串為亂碼或者??

    2 直接通過url如http://localhost/a.jsp?name=中國,這樣的get請求在服務端用request. getParameter(“name”)時返回的是亂碼;按tomcat4的做法設置Filter也沒有用或者用request.setCharacterEncoding("GBK");也不管用

    原因:

    1 tomcat的j2ee實現(xiàn)對表單提交即post方式提示時處理參數(shù)采用缺省的iso-8859-1來處理

    2 tomcat對get方式提交的請求對query-string 處理時采用了和post方法不一樣的處理方式。(與tomcat4不一樣,所以設置setCharacterEncoding(“gbk”))不起作用。

    解決辦法:

    首先所有的jsp文件都加上:

    1 實現(xiàn)一個Filter.設置處理字符集為GBK。(在tomcat的webapps/servlet-examples目錄有一個完整的例子。請參考web.xml和SetCharacterEncodingFilter的配置。)

    1)只要把%TOMCAT安裝目錄%/ webapps\servlets-examples\WEB-INF\classes\filters\SetCharacterEncodingFilter.class文件拷到你的webapp目錄/filters下,如果沒有filters目錄,就創(chuàng)建一個。

    2)在你的web.xml里加入如下幾行:

     <filter>

     <filter-name>Set Character Encoding</filter-name>

     <filter-class>filters.SetCharacterEncodingFilter</filter-class>

     <init-param>

     <param-name>encoding</param-name>

     <param-value>GBK</param-value>

     </init-param>

     </filter>

     

     <filter-mapping>

     <filter-name>Set Character Encoding</filter-name>

     <url-pattern>/*</url-pattern>

     </filter-mapping>

    3)完成.

    2 get方式的解決辦法

    1) 打開tomcat的server.xml文件,找到區(qū)塊,加入如下一行:

    URIEncoding=”GBK”

    完整的應如下:

    <Connector

    port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

     enableLookups="false" redirectPort="8443" acceptCount="100"

     debug="0" connectionTimeout="20000"

     disableUploadTimeout="true"

     URIEncoding="GBK"

    />

    2)重啟tomcat,一切OK。

    執(zhí)行如下jsp頁頁測試是否成功

    <%@ page contentType="text/html;charset=gb2312"%>

    <%@ page import="java.util.*"%>

    <%

     

     String q=request.getParameter("q");

     q = q == null? "沒有值" : q;

     

    %>

    <HTML>

    <HEAD><TITLE>新聞列表顯示</TITLE>

    <META http-equiv=Content-Type content="text/html; charset=gb2312">

    <META http-equiv=pragma content=no-cache>

    <body>

    你提交了:

    <%=q%>

    <br>

    <form action="tcnchar.jsp" method="post">

     輸入中文:<input type="text" ><input type="submit" value="確定">

     <br>

     <a href="tcnchar.jsp?q=中國">通過get方式提交</a>

     

    </form>

    </BODY></HTML>

    測試結果如果你輸入文本框或者點超鏈都會顯示:你提交了”中國”,說明成功!!!!!

    6) 一不小心看到一個非常好的辦法,可以讓我們不必寫

    new String(st.getBytes("ISO8859_1"),"GBK")

    詳細如下

    只要修改一個地方就行了,文件為: tomcat4/src/catalina/src/share/org/apache/catalina/connector/HttpReque stBase.java

     

     

    找到protected void parseParameters()方法,把

    if (encoding == null) encoding = "ISO-8859-1";

    改為

    if (encoding == null) encoding = "GBK";

    然后編譯

    javac HttpRequestBase.java生成兩個class文件.再然后用jar命令把它打包成原來的catalina.jar,覆蓋原來的,最后重新啟動tomcat就可以。

    posted @ 2007-09-20 10:56 狼愛上貍 閱讀(501) | 評論 (0)編輯 收藏

    ubuntu linux 命令大全

    查看軟件xxx安裝內容
    dpkg -L xxx

    查找軟件
    apt-cache search 正則表達式

    查找文件屬于哪個包
    dpkg -S filename apt-file search filename

    查詢軟件xxx依賴哪些包
    apt-cache depends xxx

    查詢軟件xxx被哪些包依賴
    apt-cache rdepends xxx

    增加一個光盤源
    sudo apt-cdrom add


    系統(tǒng)升級
    sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade

    清除所以刪除包的殘余配置文件
    dpkg -l |grep ^rc|awk '{print $2}' |tr ["\n"] [" "]|sudo xargs dpkg -P -

    編譯時缺少h文件的自動處理
    sudo auto-apt run ./configure

    查看安裝軟件時下載包的臨時存放目錄
    ls /var/cache/apt/archives

    備份當前系統(tǒng)安裝的所有包的列表
    dpkg --get-selections | grep -v deinstall > ~/somefile

    從上面?zhèn)浞莸陌惭b包的列表文件恢復所有包
    dpkg --set-selections < ~/somefile sudo dselect

    清理舊版本的軟件緩存
    sudo apt-get autoclean

    清理所有軟件緩存
    sudo apt-get clean

    刪除系統(tǒng)不再使用的孤立軟件
    sudo apt-get autoremove

    查看包在服務器上面的地址
    apt-get -qq --print-uris install ssh | cut -d\' -f2

    系統(tǒng)

    查看內核
    uname -a

    查看Ubuntu版本
    cat /etc/issue

    查看內核加載的模塊
    lsmod

    查看PCI設備
    lspci

    查看USB設備
    lsusb

    查看網卡狀態(tài)
    sudo ethtool eth0

    查看CPU信息
    cat /proc/cpuinfo

    顯示當前硬件信息
    lshw

    硬盤

    查看硬盤的分區(qū)
    sudo fdisk -l

    查看IDE硬盤信息
    sudo hdparm -i /dev/hda

    查看STAT硬盤信息
    sudo hdparm -I /dev/sda 或 sudo apt-get install blktool sudo blktool /dev/sda id

    查看硬盤剩余空間
    df -h df -H

    查看目錄占用空間
    du -hs 目錄名

    優(yōu)盤沒法卸載
    sync fuser -km /media/usbdisk

    內存

    查看當前的內存使用情況
    free -m

    進程

    查看當前有哪些進程
    ps -A

    中止一個進程
    kill 進程號(就是ps -A中的第一列的數(shù)字) 或者 killall 進程名

    強制中止一個進程(在上面進程中止不成功的時候使用)
    kill -9 進程號 或者 killall -9 進程名

    圖形方式中止一個程序
    xkill 出現(xiàn)骷髏標志的鼠標,點擊需要中止的程序即可

    查看當前進程的實時狀況
    top

    查看進程打開的文件
    lsof -p

    ADSL 配置 ADSL
    sudo pppoeconf

    ADSL手工撥號
    sudo pon dsl-provider

    激活 ADSL
    sudo /etc/ppp/pppoe_on_boot

    斷開 ADSL
    sudo poff

    查看撥號日志
    sudo plog

    如何設置動態(tài)域名
    #首先去http://www.3322.org申請一個動態(tài)域名 #然后修改 /etc/ppp/ip-up 增加撥號時更新域名指令 sudo vim /etc/ppp/ip-up #在最后增加如下行 w3m -no-cookie -dump 'http://username:password@members.3322.org/dyndns/update?system=dyndns&hostname=yourdns.3322.org'

    網絡

    根據(jù)IP查網卡地址
    arping IP地址

    查看當前IP地址
    ifconfig eth0 |awk '/inet/ {split($2,x,":");print x[2]}'

    查看當前外網的IP地址
    w3m -no-cookie -dumpwww.ip138.com|grep-o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' w3m -no-cookie -dumpwww.123cha.com|grep-o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' w3m -no-cookie -dump ip.loveroot.com|grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'

    查看當前監(jiān)聽80端口的程序
    lsof -i :80

    查看當前網卡的物理地址
    arp -a | awk '{print $4}' ifconfig eth0 | head -1 | awk '{print $5}'

    立即讓網絡支持nat
    sudo echo 1 > /proc/sys/net/ipv4/ip_forward sudo iptables -t nat -I POSTROUTING -j MASQUERADE

    查看路由信息
    netstat -rn sudo route -n

    手工增加刪除一條路由
    sudo route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 sudo route del -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1

    修改網卡MAC地址的方法
    sudo ifconfig eth0 down #關閉網卡 sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE #然后改地址 sudo ifconfig eth0 up #然后啟動網卡

    統(tǒng)計當前IP連接的個數(shù)
    netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r -n netstat -na|grep SYN|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r -n

    統(tǒng)計當前20000個IP包中大于100個IP包的IP地址
    tcpdump -tnn -c 20000 -i eth0 | awk -F "." '{print $1"."$2"."$3"."$4}' | sort | uniq -c | sort -nr | awk ' $1 > 100 '

    屏蔽IPV6
    echo "blacklist ipv6" | sudo tee /etc/modprobe.d/blacklist-ipv6

    服務

    添加一個服務
    sudo update-rc.d 服務名 defaults 99

    刪除一個服務
    sudo update-rc.d 服務名 remove

    臨時重啟一個服務
    /etc/init.d/服務名 restart

    臨時關閉一個服務
    /etc/init.d/服務名 stop

    臨時啟動一個服務
    /etc/init.d/服務名 start

    設置

    配置默認Java使用哪個
    sudo update-alternatives --config java

    修改用戶資料
    sudo chfn userid

    給apt設置代理
    export http_proxy=http://xx.xx.xx.xx:xxx

    修改系統(tǒng)登錄信息
    sudo vim /etc/motd

    中文

    轉換文件名由GBK為UTF8
    sudo apt-get install convmv convmv -r -f cp936 -t utf8 --notest --nosmart *

    批量轉換src目錄下的所有文件內容由GBK到UTF8
    find src -type d -exec mkdir -p utf8/{} \; find src -type f -exec iconv -f GBK -t UTF-8 {} -o utf8/{} \; mv utf8/* src rm -fr utf8

    轉換文件內容由GBK到UTF8
    iconv -f gbk -t utf8 $i > newfile

    轉換 mp3 標簽編碼
    sudo apt-get install python-mutagen find . -iname “*.mp3” -execdir mid3iconv -e GBK {} \;

    控制臺下顯示中文
    sudo apt-get install zhcon 使用時,輸入zhcon即可

    文件

    快速查找某個文件
    whereis filename
    find 目錄 -name 文件名

    查看文件類型
    file filename

    顯示xxx文件倒數(shù)6行的內容
    tail -n 6 xxx

    讓tail不停地讀地最新的內容
    tail -n 10 -f /var/log/apache2/access.log

    查看文件中間的第五行(含)到第10行(含)的內容
    sed -n '5,10p' /var/log/apache2/access.log

    查找包含xxx字符串的文件
    grep -l -r xxx .

    查找關于xxx的命令
    apropos xxx man -k xxx

    通過ssh傳輸文件
    scp -rp /path/filenameusername@remoteIP:/path#將本地文件拷貝到服務器上 scp -rpusername@remoteIP:/path/filename/path #將遠程文件從服務器下載到本地

    查看某個文件被哪些應用程序讀寫
    lsof 文件名

    把所有文件的后輟由rm改為rmvb
    rename 's/.rm$/.rmvb/' *

    把所有文件名中的大寫改為小寫
    rename 'tr/A-Z/a-z/' *

    刪除特殊文件名的文件,如文件名:--help.txt
    rm -- --help.txt 或者 rm ./--help.txt

    查看當前目錄的子目錄
    ls -d */. 或 echo */.

    將當前目錄下最近30天訪問過的文件移動到上級back目錄
    find . -type f -atime -30 -exec mv {} ../back \;

    將當前目錄下最近2小時到8小時之內的文件顯示出來
    find . -mmin +120 -mmin -480 -exec more {} \;

    刪除修改時間在30天之前的所有文件
    find . -type f -mtime +30 -mtime -3600 -exec rm {} \;

    查找guest用戶的以avi或者rm結尾的文件并刪除掉
    find . -name '*.avi' -o -name '*.rm' -user 'guest' -exec rm {} \;

    查找的不以java和xml結尾,并7天沒有使用的文件刪除掉
    find . ! -name *.java ! -name ‘*.xml’ -atime +7 -exec rm {} \;

    統(tǒng)計當前文件個數(shù)
    ls /usr/bin|wc -w

    統(tǒng)計當前目錄個數(shù)
    ls -l /usr/bin|grep ^d|wc -l

    顯示當前目錄下2006-01-01的文件名
    ls -l |grep 2006-01-01 |awk '{print $8}'

    壓縮

    解壓縮 xxx.tar.gz
    tar -zxvf xxx.tar.gz

    解壓縮 xxx.tar.bz2
    tar -jxvf xxx.tar.bz2

    壓縮aaa bbb目錄為xxx.tar.gz
    tar -zcvf xxx.tar.gz aaa bbb

    壓縮aaa bbb目錄為xxx.tar.bz2
    tar -jcvf xxx.tar.bz2 aaa bbb

    Nautilus

    顯示隱藏文件
    Ctrl+h

    顯示地址欄
    Ctrl+l

    特殊 URI 地址
    * computer:/// - 全部掛載的設備和網絡 * network:/// - 瀏覽可用的網絡 * burn:/// - 一個刻錄 CDs/DVDs 的數(shù)據(jù)虛擬目錄 * smb:/// - 可用的 windows/samba 網絡資源 * x-nautilus-desktop:/// - 桌面項目和圖標 *file:///- 本地文件 * trash:/// - 本地回收站目錄 * ftp:// - FTP 文件夾 * ssh:// - SSH 文件夾 * fonts:/// - 字體文件夾,可將字體文件拖到此處以完成安裝 * themes:/// - 系統(tǒng)主題文件夾

    查看已安裝字體
    在nautilus的地址欄里輸入”fonts:///“,就可以查看本機所有的fonts

    程序

    詳細顯示程序的運行信息
    strace -f -F -o outfile

    日期和時間

    設置日期
    #date -s mm/dd/yy

    設置時間
    #date -s HH:MM

    將時間寫入CMOS
    hwclock --systohc

    讀取CMOS時間
    hwclock --hctosys

    從服務器上同步時間
    sudo ntpdate time.nist.gov sudo ntpdate time.windows.com

    控制臺

    不同控制臺間切換
    Ctrl + ALT + ← Ctrl + ALT + →

    指定控制臺切換
    Ctrl + ALT + Fn(n:1~7)

    控制臺下滾屏
    SHIFT + pageUp/pageDown

    控制臺抓圖
    setterm -dump n(n:1~7)

    數(shù)據(jù)庫

    mysql的數(shù)據(jù)庫存放在地方
    /var/lib/mysql

    從mysql中導出和導入數(shù)據(jù)
    mysqldump 數(shù)據(jù)庫名 > 文件名 #導出數(shù)據(jù)庫 mysqladmin create 數(shù)據(jù)庫名 #建立數(shù)據(jù)庫 mysql 數(shù)據(jù)庫名 < 文件名 #導入數(shù)據(jù)庫

    忘了mysql的root口令怎么辦
    sudo /etc/init.d/mysql stop sudo mysqld_safe --skip-grant-tables & sudo mysqladmin -u user password 'newpassword'' sudo mysqladmin flush-privileges

    修改mysql的root口令
    sudo mysqladmin -uroot -p password '你的新密碼'

    其它

    下載網站文檔
    wget -r -p -np -khttp://www.21cn.com· -r:在本機建立服務器端目錄結構; · -p: 下載顯示HTML文件的所有圖片; · -np:只下載目標站點指定目錄及其子目錄的內容; · -k: 轉換非相對鏈接為相對鏈接。

    如何刪除Totem電影播放機的播放歷史記錄
    rm ~/.recently-used

    如何更換gnome程序的快捷鍵
    點擊菜單,鼠標停留在某條菜單上,鍵盤輸入任意你所需要的鍵,可以是組合鍵,會立即生效; 如果要清除該快捷鍵,請使用backspace

    vim 如何顯示彩色字符
    sudo cp /usr/share/vim/vimcurrent/vimrc_example.vim /usr/share/vim/vimrc

    如何在命令行刪除在會話設置的啟動程序
    cd ~/.config/autostart rm 需要刪除啟動程序

    如何提高wine的反應速度
    sudo sed -ie '/GBK/,/^}/d' /usr/share/X11/locale/zh_CN.UTF-8/XLC_LOCALE

    chgrp
    [語法]: chgrp [-R] 文件組 文件...
    [說明]: 文件的GID表示文件的文件組,文件組可用數(shù)字表示, 也可用一個有效的組名表示,此命令改變一個文件的GID,可參看chown。
    -R 遞歸地改變所有子目錄下所有文件的存取模式
    [例子]:
    chgrp group file 將文件 file 的文件組改為 group
    chmod

    [語法]: chmod [-R] 模式 文件...
    或 chmod [ugoa] {+|-|=} [rwxst] 文件...
    [說明]: 改變文件的存取模式,存取模式可表示為數(shù)字或符號串,例如:
    chmod nnnn file , n為0-7的數(shù)字,意義如下:
    4000 運行時可改變UID
    2000 運行時可改變GID
    1000 置粘著位
    0400 文件主可讀
    0200 文件主可寫
    0100 文件主可執(zhí)行
    0040 同組用戶可讀
    0020 同組用戶可寫
    0010 同組用戶可執(zhí)行
    0004 其他用戶可讀
    0002 其他用戶可寫
    0001 其他用戶可執(zhí)行
    nnnn 就是上列數(shù)字相加得到的,例如 chmod 0777 file 是指將文件 file 存取權限置為所有用戶可讀可寫可執(zhí)行。
    -R 遞歸地改變所有子目錄下所有文件的存取模式
    u 文件主
    g 同組用戶
    o 其他用戶
    a 所有用戶
    + 增加后列權限
    - 取消后列權限
    = 置成后列權限
    r 可讀
    w 可寫
    x 可執(zhí)行
    s 運行時可置UID
    t 運行時可置GID
    [例子]:
    chmod 0666 file1 file2 將文件 file1 及 file2 置為所有用戶可讀可寫
    chmod u+x file 對文件 file 增加文件主可執(zhí)行權限
    chmod o-rwx 對文件file 取消其他用戶的所有權限
    chown

    [語法]: chown [-R] 文件主 文件...
    [說明]: 文件的UID表示文件的文件主,文件主可用數(shù)字表示, 也可用一個有效的用戶名表示,此命令改變一個文件的UID,僅當此文件的文件主或超級用戶可使用。
    -R 遞歸地改變所有子目錄下所有文件的存取模式
    [例子]:
    chown mary file 將文件 file 的文件主改為 mary
    chown 150 file 將文件 file 的UID改為150


    http://zone.pemp.cn/?uid-3-action-viewspace-itemid-240

    posted @ 2007-08-12 12:32 狼愛上貍 閱讀(608) | 評論 (1)編輯 收藏

    ubuntu關于amule的安裝

    本來想要自己編譯,無奈總是不成功,后來還是安裝了現(xiàn)成的deb包。

    在新立得軟件包管理器搜索amule安裝,運行后,需要自己更改一下ed2k的服務器列表和kad的nodes。

    以下為ed2k的服務器列表文件地址:
    http://www.esel-paradies.de/server/all/server.met
    http://www.emule.org.cn/server.met
    或者到如下地址自己找:
    http://ed2k.2x4u.de/index.html

    以下為kad的nodes文件地址:
    http://www.emule-inside.net/nodes.dat
    http://renololo1.free.fr/e/nodes.dat

    如果想要在firefox中把ed2k關聯(lián)到amule,那么首先安裝amule-utils。

    在firefox地址欄中輸入about:config

    新建一個Boolean,名字為network.protocol-handler.external.ed2k,值為true
    新建一個String,名字為network.protocol-handler.app.ed2k,值為/usr/bin/ed2k.amule或者ed2k.amule或者ed2k(我的amule 2.1.3就是ed2k)

    這樣就OK了。這時候點擊一個ed2k鏈接將會出現(xiàn)一個啟動相應應用程序的提示。點擊啟動后, 這個ed2k鏈接將會被加入下載隊列。前提是amule必須是已經開啟著的。

    如果你想在點一個ed2k鏈接的時候不出現(xiàn)提示,那么新建一個Boolean,名字為network.protocol-handler.warn-external.ed2k,值為false

    剛剛又搜索了一下,發(fā)現(xiàn)自己編譯安裝amule,大概需要三步——wxBase、wxGTK和amule,今天太累了,等以后重裝系統(tǒng)的時候再自己作實驗吧。


    來自:http://hi.baidu.com/emlary/blog/item/e64fcf113c296312b8127bf6.html

    posted @ 2007-08-11 09:01 狼愛上貍 閱讀(1938) | 評論 (0)編輯 收藏

    Ubuntu7.04防火墻Friestarter的配置

    sudo apt-get install firestarter

    Firestarter的啟動腳本是/etc/init.d/firestarter,其中執(zhí)行了 /etc/firestarter/firestarter.sh來啟動防火墻,因此,其實Firestarter真正的啟動腳本是 /etc/firestarter/firestarter.sh。
    編輯/etc/firestarter/firestarter.sh
    根據(jù)本機ifconfig的輸出信息來修改以下幾行代碼:
    IP=`/sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \ -f 1`
    MASK=`/sbin/ifconfig $IF | grep Mas | cut -d : -f 4`
    BCAST=`/sbin/ifconfig $IF |grep Bcast: | cut -d : -f 3 | cut -d \ -f 1`
    例如,我的系統(tǒng)使用eth0上網,就執(zhí)行ifconfig eth0。其中IP地址依然可以通過以上代碼的第一行獲取,只是子網掩碼和廣播地址的獲取會有問題。于是保留第一行不做修改,將后兩行代碼中grep搜索的英文字符串改為相應中文字符串即可。
    IP=`/sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \ -f 1`
    MASK=`/sbin/ifconfig $IF | grep 掩碼: | cut -d : -f 4`
    BCAST=`/sbin/ifconfig $IF |grep 廣播: | cut -d : -f 3 | cut -d \ -f 1`
    保存文件后,啟動Firestarter。一切正常。
    (以上來來自http://sanhex.bloggerspaces.com/index.html)


    來自:http://dingwl.spaces.live.com/Blog/cns!ED2CFB949D04FD0F!220.entry

    posted @ 2007-08-07 22:43 狼愛上貍 閱讀(548) | 評論 (0)編輯 收藏

    ubuntu下設置shorewall防火墻

    服務器采用ubuntu作為操作系統(tǒng),兩塊網卡,一塊接外網(eth0),一塊接內網(eth1)。采用shorewall作為防火墻。
    配置網卡:
    sudo vi /etc/network/interfaces

    ubuntu下設置shorewall防火墻

    服務器采用ubuntu作為操作系統(tǒng),兩塊網卡,一塊接外網(eth0),一塊接內網(eth1)。采用shorewall作為防火墻。

    配置網卡:
    sudo vi /etc/network/interfaces
    ------------------------------------------------
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # This is a list of hotpluggable network interfaces.
    # They will be activated automatically by the hotplug subsystem.
    mapping hotplug
    script grep
    map eth0

    # The primary network interface
    iface eth0 inet static
    address 192.168.2.250
    netmask 255.255.255.0
    network 192.168.2.0
    broadcast 192.168.2.255
    gateway 192.168.2.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 202.96.209.6

    auto eth1
    iface eth1 inet static
    address 192.168.10.254
    netmask 255.255.255.0
    network 192.168.10.0
    broadcast 192.168.10.255

    -----------------------------------------------------

    1、安裝shorewall
    sudo apt-get install shorewall

    2、拷貝配置文件
    sudo cp /usr/share/shorewall/modules /etc/shorewall
    sudo cp /usr/share/doc/shorewall/default-config/policy /etc/shorewall/
    sudo cp /usr/share/doc/shorewall/default-config/nat /etc/shorewall/
    sudo cp /usr/share/doc/shorewall/default-config/zones /etc/shorewall/
    sudo cp /usr/share/doc/shorewall/default-config/maclist /etc/shorewall/
    sudo cp /usr/share/doc/shorewall/default-config/blacklist /etc/shorewall/
    sudo cp /usr/share/doc/shorewall/default-config/interfaces /etc/shorewall/interfaces
    sudo cp /usr/share/doc/shorewall/default-config/rules /etc/shorewall/rules
    sudo cp /usr/share/doc/shorewall/default-config/hosts /etc/shorewall/hosts
    sudo cp /usr/share/doc/shorewall/default-config/masq /etc/shorewall/masq

    3、配置網卡
    sudo vi /etc/shorewall/interfaces

    在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

    net eth0 detect
    loc eth1 detect

    4、配置網絡別名
    sudo vi /etc/shorewall/zones

    在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

    net Net Internet
    loc Local Local Networks

    5、配置IP偽裝,也就是透明代理

    sudo vi /etc/shorewall/masq

    在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

    eth0 eth1

    6、配置策略
    sudo vi /etc/shorewall/policy

    在#LAST LINE -- DO NOT REMOVE這一行最后加上:

    loc net ACCEPT
    net all DROP info
    all all REJECT info

    7、配置防火墻規(guī)則

    sudo vi /etc/shorewall/rules

    在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行后加上:

    #incoming traffic (由 internet 去 firewall)
    AllowSSH net fw
    AllowDNS net fw
    AllowWeb net fw
    AllowSMB net fw
    AllowNNTP net fw
    AllowNTP net fw
    AllowRdate net fw
    AllowSMTP net fw
    DropPing net fw

    #outgoing traffic (由 firewall 去 internet)
    AllowWeb fw net
    AllowDNS fw net
    AllowSMTP fw net
    AllowSMB fw net
    AllowSMTP fw net
    AllowNNTP fw net
    AllowNTP fw net
    AllowRdate fw net
    AllowSSH fw net

    #open special ports
    ACCEPT net fw tcp 9980

    8、修改 shorewall.conf 自動開啟 IP 轉發(fā)

    sudo gedit /etc/shorewall/shorewall.conf

    查找到:

    IP_FORWARDING=Keep

    修改為:

    IP_FORWARDING=On

    # 保存關閉文件

    9、修改 /etc/default/shorewall 自動運行防火墻

    sudo vi /etc/default/shorewall

    查找到:

    startup=0

    修改為:

    startup=1

    10、啟動防火墻

    sudo shorewall start

    11、至此防火墻配置完成。



    traceback:

    http://blog.chinaunix.net/u/11295/showart.php?id=60993


    posted @ 2007-08-07 22:03 狼愛上貍 閱讀(857) | 評論 (0)編輯 收藏

    Ubuntu7.04系統(tǒng)下安裝虛擬機VMware

    一、安裝依賴包

    sudo apt-get install libx11-6 libx11-dev libxtst6 xinetd

    sudo apt-get install linux-headers-`uname -r` build-essential

    二、從vmware官方網站下載最新版vmware-server for linux(ver:1.0.2)

    http://www.vmware.com/download/server/ 記得要注冊取得授權號碼喲

    三、解壓并安裝

    tar zxvf VMware-server-1.0.2-39867.tar.gz

    cd vmware-server-distrib

    sudo vmware-install.pl

    可以直接一路默認下去就好,但這不會安裝成功,會出現(xiàn)以下錯誤:

    Building the vmmon module.

    Using 2.6.x kernel build system.

    make: Entering directory `/tmp/vmware-config0/vmmon-only''

    make -C /lib/modules/2.6.20-15-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

    make[1]: Entering directory `/usr/src/linux-headers-2.6.20-15-generic''

    CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o

    In file included from /tmp/vmware-config0/vmmon-only/linux/driver.c:80:

    /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: 錯誤: expected declaration specifiers or ‘...’ before ‘compat_exit’

    /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: 錯誤: expected declaration specifiers or ‘...’ before ‘exit_code’

    /tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: 警告: 在 ‘_syscall1’ 的聲明中,類型默認為 ‘int’

    make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] 錯誤 1

    make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] 錯誤 2

    make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic''

    make: *** [vmmon.ko] 錯誤 2

    make: Leaving directory `/tmp/vmware-config0/vmmon-only''

    Unable to build the vmmon module.

    For more information on how to troubleshoot module-related problems, please

    visit our Web site at "http://www.vmware.com/download/modules/modules.html" and

    "http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

    Execution aborted.

    不要理它!我們去下載patch搞定

    四、下載并安裝patch包

    wget http://jaws.go2linux.org/archivos/vmware-any-any-update109.tar.gzcd vmware-any-any-update109sudo ./runme.pl

    接下來一路next就好(會出現(xiàn)一些警告錯誤,說有函數(shù)在使用前未初始化)

    (T002)


    traceback: http://linux.e800.com.cn/articles/2007/514/1179108976414775186_1.html


    posted @ 2007-07-29 19:21 狼愛上貍 閱讀(380) | 評論 (0)編輯 收藏

    web2.0的開源程序一覽

    diggclone-開源digg類程序
    官方:http://www.talkingpixels.org/diggclone/index.php
    演示:同digg.com類似,

    wodig-國內的開源digg類程序
    官方:http://www.wodig.com/

    pligg-開源digg類程序
    官方:http://www.pligg.com
    中文演示:http://pligg.yesxp.net

    aroundme-開源社會化網絡程序
    官方:https://savannah.nongnu.org/projects/aroundme/
    演示:http://www.barnraiser.org/demos/
    (社會化網絡程序通常都是收費的,相信這個是目前唯一免費的social netwokr項目啦)

    lilina–開源rss聚合器
    官方:http://lilina.sourceforge.net/
    演示:http://www.chedong.com/

    gregarius–開源rss聚合程序
    演示:http://rss.gregarius.net/
    官方:http://gregarius.net/
    插件:http://plugins.gregarius.net/
    風格:http://themes.gregarius.net/
    論壇:http://forums.gregarius.net/
    幫助:http://wiki.gregarius.net/

    sa.bros.us-開源網絡書簽(php)
    官方:https://sourceforge.net/projects/sabrosus/
    漢化演示:http://www.sluke.cn/demo/monousuario/

    freedmarks -開源網絡書簽(asp)(國內)
    官方:http://www.purewhite.cn/
    演示:http://www.freedmarks.com/

    scuttle -開源網絡書簽(php)
    官方:http://sourceforge.net/projects/scuttle
    演示:http://scuttle.org/

    yogurt-開源社會化網絡門戶
    官方:http://yogurt.sourceforge.net/

    eyeos---開元的webos,
    官方:http://www.eyeos.org
    演示:http://www.earn8.net
    有中文版本的。

    周博通個人門戶-開源個人門戶
    官方:http://www.potu.com/index/potu_opensource.php

    開源的維客系統(tǒng)
    mediawiki
    官方網站 https://secure.wikimedia.org/wikipedia/zh/wiki/
    下載 https://secure.wikimedia.org/wikipedia/zh/wiki/

    openwiki
    官方網站 http://www.openwiki.com/
    下載 http://www.openwiki.com/

    dokuwiki
    官方網站 http://xoops.org.cn/modules/dokuwiki/doku.php
    下載 http://xoops.org.cn/modules/dokuwiki/doku.php

    hoodongwiki-國內開源的維客系統(tǒng)
    官方:http://www.hoodong.com

    來自:http://forum.ubuntu.org.cn/about61395.html

    posted @ 2007-07-22 21:27 狼愛上貍 閱讀(319) | 評論 (0)編輯 收藏

    ubuntu 架設 helix server 流媒體筆記

    注:我是參考此文完成安裝的。感謝 andot。

    RealNetworks Helix Universal Mobile Server v10.0.9.2735 下載:

    helix for linux

    里面有三個文件。setup.bin 是安裝文件

    sudo chmod a+x setup.bin
    sudo ./setup.bin

    即可開始安裝。

    license.lic 是授權文件。安裝過程中需要給出它的完整地址。安裝時注意兩個問題:

    1.如果已有 www 服務,則將 helix server 的 www 裝在 8080(或者其它,你隨便)
    2.記住管理端口,這是隨機產生的。

    helix 是ubuntu 啟動腳本。注意修改這一句

    HELIX_HOME=/helix

    我的 helix server 直接裝在根下,所以寫成 /helix。把下載包里面的 helix(3K)這個文件拷貝到 init.d 下

    注意里面的helix 跟路徑,換成你安裝 helix 的路徑(我的是 /helix)

    HELIX_HOME=/helix

    加入 rc2.d 硬連接。命令如下(比如在 helix 文件所在目錄下開始):

    sudo cp helix /etc/init.d/helix
    sudo chmod 755 /etc/init.d/helix
    cd /etc/rc2.d/
    ln -s /etc/init.d/helix S95helix

    重啟 ubuntu 即可。

    手工控制 helix server 命令:

    /etc/init.d/helix start
    /etc/init.d/helix stop

    helix serer 啟動命令行:

    export LD_ASSUME_KERNEL=2.4
    進入 helix sever 安裝目錄
    Bin/rmserver rmserver.cfg

    即可啟動 helix。

    helix server 管理:

    打開 http://192.168.100.4:18202/admin/index.html

    注意你的端口和我不一樣。在 Server Setup - Mount Points 添加掛接點,Apply 應用。(我掛接的是一個完整的40G ext3分區(qū),專門放電影用的)


    來自:http://blog.guoshuang.com/showlog.asp?log_id=4584

    posted @ 2007-07-22 08:21 狼愛上貍 閱讀(1519) | 評論 (0)編輯 收藏

    也談ubuntu7.04intel聲卡檢測到無發(fā)聲問題

    本文參照:http://forum.ubuntu.org.cn/about50865-0-asc-0.html,感謝fifawqm和goodlucky。

    0.檢測聲卡

    # lspci | grep audio

    00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 02)

    1. sudo apt-get install build-essential ncurses-dev linux-headers-`uname -r`

    2.下載alsa

    a. http://www.alsa-project.org/alsa/ftp/driver/下載alsa-driver-1.0.14rc4.tar.bz2
    b. http://www.alsa-project.org/alsa/ftp/lib/ 下載alsa-lib-1.0.14rc4.tar.bz2
    c. http://www.alsa-project.org/alsa/ftp/utils/ 下載alsa-utils-1.0.14rc4.tar.bz2

    3.解壓

    sudo mkdir -p /usr/src/alsa
    cd /usr/src/alsa
    sudo cp /下載的三個壓縮包路徑/*   ./
    sudo tar xjf alsa-driver-1.0.14rc4.tar.bz2
    sudo tar xjf alsa-lib-1.0.14rc4.tar.bz2
    sudo tar xjf alsa-utils-1.0.14rc4.tar.bz2


    4. 裝備utilities
    #cd alsa-utils-1.0.14rc4
    #./configure && make && make install

    5.修改atiixp.c
    #cd ../alsa-driver-1.0.14rc4
    #sudo gedit  alsa-kernel/pci/atiixp.c
    在290行左右有一個結構
    static struct pci_device_id snd_atiixp_ids[] = {
    { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
    { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
    { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
    { 0, }
    };
    加一行,成如下
    static struct pci_device_id snd_atiixp_ids[] = {
    { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
    { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
    { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
    { 0x1002, 0x4382, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB600 */
    { 0, }
    };

    6.
    編譯,安裝
    #./configure && make && make install

    7.
    #modprobe snd-atiixp

    8.
    #alsamixer
    調節(jié)聲音(注意的是,聲卡是靜音的,要打開)

    posted @ 2007-07-22 07:47 狼愛上貍 閱讀(516) | 評論 (0)編輯 收藏

    僅列出標題
    共38頁: First 上一頁 23 24 25 26 27 28 29 30 31 下一頁 Last 
    主站蜘蛛池模板: 亚洲黄色高清视频| 伊人久久亚洲综合| 亚洲男人电影天堂| 成全视频免费观看在线看| 国产亚洲成人在线播放va| 美女羞羞免费视频网站| 国产麻豆剧传媒精品国产免费| 亚洲卡一卡2卡三卡4麻豆| 天天影视色香欲综合免费| 老色鬼久久亚洲AV综合| 免费精品无码AV片在线观看| 亚洲电影一区二区| 亚洲一区二区免费视频| 久久精品国产亚洲αv忘忧草| 成年网站免费视频A在线双飞| 亚洲字幕AV一区二区三区四区| 成年女人喷潮毛片免费播放| 亚洲色偷偷色噜噜狠狠99| 日本特黄特色aa大片免费| 国产亚洲精品2021自在线| 亚洲毛片网址在线观看中文字幕| 曰批免费视频播放在线看片二| 九月婷婷亚洲综合在线| 99re8这里有精品热视频免费| 国产亚洲精品无码拍拍拍色欲 | 亚洲精品无码午夜福利中文字幕| 中国黄色免费网站| 久久久亚洲欧洲日产国码aⅴ| 免费精品国产自产拍在| 亚洲国产综合AV在线观看| 亚洲精品无码AV中文字幕电影网站| 国产三级在线免费观看| 中文字幕亚洲精品| 日本高清免费中文字幕不卡| www成人免费观看网站| 久久青青草原亚洲av无码app | 337p日本欧洲亚洲大胆人人| 国产亚洲精品高清在线| 国产成人免费午夜在线观看| 毛片亚洲AV无码精品国产午夜 | 亚洲va在线va天堂va四虎|