[Logo]
文章發表人是: andowson
討論區首頁 » 個人資料 andowson » 文章發表人是 andowson
內容
Xenu's Link Sleuth (TM) 可以用來檢查一個網站的失效連結(broken links),它可以安裝在微軟 Windows 作業系統上(包含Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7),安裝完成後,開始執行,介面非常簡單,只需輸入一個網址給它,它就會找出該網址所出現的每一個連結(包含圖片、CSS、JavaScript等),然後像Spider一樣不斷的遞迴下去,找出該連結的所有下一層連結。可以想見的,這個過程將非常吃系統資源,Xenu 利用多執行緒,所以跑起來非常快速,並且可以隨時暫停,然後將結果存檔,等下次有空時再接著跑。當完成連結分析後還可以(透過FTP方式)檢查有沒有已經沒再用的孤兒檔案(orphaned files),最後還可以匯出成Excel可以開啟的檔案格式並產生網頁式的報表。

對了,Xenu 還是免費的。趕快下載來用一下吧:
下載網址:
http://home.snafu.de/tilman/XENU.ZIP
使用說明:
http://members.chello.nl/f.visser3/xenu/index.html

這裡了解Sleuth的中文意思

參考連結:
http://paogray.com/1265
http://steachs.com/archives/1425
Apple 於1/27發表的新產品平板電腦iPad,看完應該會覺得這東西還真是令人驚艷阿!
個人覺得Apple iPad應該滿適合多讀少寫的應用情境,例如電子書閱讀器、數位相框、影片播放、上網瀏覽及電子郵件閱覽(長時間用那個螢幕鍵盤打字來發信不知道效果怎樣),不知道大家會想去買一台嗎?
hannibal0416您好:

我沒有這方面的經驗,不過我想您可以試著自己參考一下一些iText所附上的範例來找您要的資料,底下是幾個參考連結:
http://itextpdf.com/examples/index.php?page=toc&id=6
http://www.mactech.com/articles/mactech/Vol.15/15.09/PDFIntro/

另外,如果不受限於只能用iText的話,也可以考慮用Apache PDFBox試試看
http://pdfbox.apache.org/index.html

我是用java read data from pdf當關鍵字作搜尋,您可以參考看看。
今天在查詢「得罪了方丈還想走」時無意中找到了這個部落格,格主先利用漫畫再加上有趣的文字來解說一些觀念,滿適合有唸過或正在唸研究所的人來看。有打算要唸研究所的人應該也可以看一看。
http://www.wretch.cc/blog/gradlive
今天看到志凌數位學習網也有對SCJP 6.0這些題目的講解,大家可以參考看看:
http://www.yesgood.com.tw/contents/scjp6.aspx
今天逛了一下Apache Tomcat網站發現到Tomcat有出新版(6.0.24)了,消息來源請見底下。

http://mail-archives.apache.org/mod_mbox/www-announce/201001.mbox/%3C20100121155246.24306.qmail@minotaur.apache.org%3E

下載:
http://tomcat.apache.org/download-60.cgi

Release Notes:
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.24/RELEASE-NOTES
ChangeLog:
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html
A-man您好:
您可以參考這個網址下載相依性的jar檔
http://commons.apache.org/fileupload/dependencies.html
This is a post from email.
The receiver is test@andowson.com.
And the sender's email address should be the same as the registered one.
杜拜是用人類科技文明堆砌出來,極盡奢華能事的國度,連人工噴泉也不例外。
看完還真是讚嘆不已啊!

A-man wrote:
在網上找了一下, 找不到明確的方法,
所以想問問 安裝函式庫 該怎安裝 ?

我正使用eclipse + tomcat 4.1

在Apache Commons的網站我下載了
commons-io-1.4-src.zip & commons-fileupload-1.2.1-src.zip

解壓後 發現內有很多不同的檔案,

我是應該把以下兩個目錄個的檔案, 全部複製到我eclipse 的Project 內 ?
commons-fileupload-1.2.1-src\src\java\org

commons-io-1.4-src\src\java\org\


謝謝你 ^^

A-man您應該只需要放jar檔到lib目錄下就好,去下載binary的版本吧!
victer0327 wrote:請問板大,檔案上傳時的說明(filedesc)輸入中文會出現亂碼,這該如何解決呢??

試著自己找答案看看,一般通常就是編碼的問題,可以查查看API中有沒有和原來使用的method同樣名稱,但多了一個encoding之類的參數的method。
API的網址如下:
http://commons.apache.org/fileupload/apidocs/index.html

在Streams類別中有個asString 的method,描述如下:
static java.lang.String asString(java.io.InputStream pStream, java.lang.String pEncoding)
This convenience method allows to read a FileItemStream's content into a string, using the given character encoding.

試著把原來的程式中的
String value = Streams.asString(stream);  

改為
String encoding = "UTF-8";
String value = Streams.asString(stream, encoding);  

看看,如果不行再依序調整encoding的值為"Big5", "MS950", "ISO-8859-1", ...
如果一次上傳多個檔案,然後要分別儲存上傳的檔案名稱和說明欄資料,可以參考這個範例。
程式碼:
fileupload_streaming.html:
<html>
<head>
<title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<p><font size="5"color="#FF0000"><b>檔案上傳</b></font></p>

<form name="upload" enctype="multipart/form-data" method="post" action="fileupload_streaming.jsp"> 
<p>上傳檔案: <input type="file" name="file" size="20" maxlength="20"> </p>
<p>檔案說明: <input type="text" name="filedesc" size="30" maxlength="50"> </p>
<p>上傳檔案: <input type="file" name="file" size="20" maxlength="20"> </p>
<p>檔案說明: <input type="text" name="filedesc" size="30" maxlength="50"> </p>
<p> <input type="submit"value="上傳"> <input type="reset" value="清除"> </p>
</form>

</body>
</html>


fileupload_streaming.jsp:
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@ page import="org.apache.commons.fileupload.util.Streams"%>
<%@ page import="org.apache.commons.io.FilenameUtils"%>
<%
    String saveDirectory = application.getRealPath("/upload");
    
    // Check that we have a file upload request
    boolean isMultipart = ServletFileUpload.isMultipartContent(request);
    out.println("isMultipart="+isMultipart+"<br>");
    
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload();

    //Create a progress listener
    ProgressListener progressListener = new ProgressListener(){
       private long megaBytes = -1;
       public void update(long pBytesRead, long pContentLength, int pItems) {
           long mBytes = pBytesRead / 1000000;
           if (megaBytes == mBytes) {
               return;
           }
           megaBytes = mBytes;
           System.out.println("We are currently reading item " + pItems);
           if (pContentLength == -1) {
               System.out.println("So far, " + pBytesRead + " bytes have been read.");
           } else {
               System.out.println("So far, " + pBytesRead + " of " + pContentLength
                                  + " bytes have been read.");
           }
       }
    };
    upload.setProgressListener(progressListener);

    // Parse the request
    List<String> fileDescList = new ArrayList<String>();
    List<String> fileNameList = new ArrayList<String>();
    FileItemIterator iter = upload.getItemIterator(request);
    while (iter.hasNext()) {
        FileItemStream item = iter.next();
        String name = item.getFieldName();
        InputStream stream = item.openStream();
        if (item.isFormField()) {
            String value = Streams.asString(stream);
            out.println(name + "=" + value+"<br>");
            if ("filedesc".equals(name)) {
                fileDescList.add(value);
            } 
        } else {
            System.out.println("File field " + name + " with file name "
                + item.getName() + " detected.");
            // Process the input stream
            String fieldName = item.getFieldName();
            String fileName = item.getName();
            String contentType = item.getContentType();
            out.println("fieldName="+fieldName+"<br>");
            out.println("fileName="+fileName+"<br>");
            out.println("contentType="+contentType+"<br>");
            if (fileName != null && !"".equals(fileName)) {
                fileName= FilenameUtils.getName(fileName);
                out.println("fileName saved="+fileName+"<br>");
                fileNameList.add(fileName);
                File uploadedFile = new File(saveDirectory, fileName);
                FileOutputStream uploadedFileStream = 
                    new FileOutputStream(uploadedFile);
                Streams.copy(stream, uploadedFileStream, true);
            }
        }
    }
    for (int i = 0; i < fileDescList.size(); i++) {
    	String fileDesc = fileDescList.get(i);
    	String fileName = fileNameList.get(i);
    	out.println(fileName+":"+fileDesc+"<br>");
    	// save to database for future use
    }
%>
由於有網友在問哪段可以取到上傳網頁的檔案說明的欄位的值?簡單說明如下:

上傳網頁的檔案說明的欄位,包在第一個if內,註解有註明是regular form field那段,可以透過欄位名稱比對取得其值:

String fileDesc = null;
...
if (item.isFormField()) {  
    // Process a regular form field  
    //processFormField(item);  
    String name = item.getFieldName();  
    String value = item.getString("UTF-8");  
    out.println(name + "=" + value+"<br>"); 
    if ("filedesc".equals(name)) {
       fileDesc = value;
   } 
} else {
...


另外如果有需要刪除檔案時,可以參考下列的範例(例如要刪除已上傳的檔案)
        // Delete a file
        public static boolean deleteFile(String filename) {          
			File f = new File(filename);
			boolean result = false;
			if (f.exists()) {
				result = f.delete();
				if (result != true) {
					System.out.println("Delete file failed: " + f.getName());
				}
			}
			return result;
        }
網路設備管理分類下新增防火牆版面,有管理硬體式防火牆(例如NetScreen)的網友們可以分享一些您們的經驗或心得喔!
最近接了防火牆管理的工作,由於每個月至少都要作一次備份,就想找個方便的便份方法,找到了這篇不錯的文章,分享給大家。有關TFTP Server軟體的取得可以參考這一篇Free TFTP Server for Windows

歸納起來就是這四個指令
save software from flash to tftp x.x.x.x filename
save config from flash to tftp x.x.x.x filename
save software from tftp x.x.x.x filename to flash
save config from tftp x.x.x.x filename to flash
其中x.x.x.x是您TFTP Server的IP Address,filename是您自訂的檔案名稱,例如screenos-5.4.img, ns500.cfg等,其他指令就都是照key即可。

本文作者是clif
原始網址是 http://clif.pixnet.net/blog/post/23795602

Juniper防火牆配置備份

一、設備重啟動:

Juniper防火牆在工作期間出現運行異常時,如需進行系統重開機,可通過console使用reset命令對防火牆重開機,重開機期間可以在終端機上查看防火牆相關啟動資訊。


二、作業系統備份:

日常維護期間可將防火牆作業系統ScreenOS備份到本地設備,操作方式為:啟動tftp 伺服器並在命令行下執行:save software from flash to tftp x.x.x.x filename。


三、 作業系統恢復:

當防火牆工作發生異常時,可通過兩種方式快速恢復防火牆作業系統,

命令行方式:save software from tftp x.x.x.x filename to flash

web方式:Configuration > Update > ScreenOS/Keys下選中Firmware Update (ScreenOS)選項,並在Load File欄選中保存在本地的ScreenOS檔,然後點擊apply按鈕,上傳ScreenOS後防火牆將自動進行重開機。


四、設定檔備份:

日常維護期間可將防火牆配置資訊備份到本地以便於故障時的恢復,操作方式有三種:

1、啟動tftp 伺服器並在命令行下執行:save config from flash to tftp x.x.x.x filename。

2、通過超級終端遠端telnet/ssh到防火牆,通過log記錄方式將get config配置資訊記錄到本地。

3、通過web頁面進行設定檔備份:Configuration > Update > Config File,點擊save to file。


五、設定檔恢復:

防火牆當前配置資訊若存在錯誤,需進行配置資訊快速恢復,操作方式有三種:

1、啟動tftp 伺服器並在命令行下執行:save config from tftp x.x.x.x filename to flash,設定檔上傳後需執行reset命令進行重開機。

2、 通過web頁面進行配置檔恢復:Configuration > Update > Config File,選中Replace Current Configuration,並從本地設備中選中供恢復的備份配置檔,點擊apply後系統將進行重啟動使新配置生效。

3、通過超級終端遠端telnet/ssh到防火牆,通過unset all 命令清除防火牆配置,並進行重啟,重啟後將備份的配置命令粘貼到防火牆中。


六、恢復出廠預設值:

console線連接到防火牆,通過reset命令對防火牆進行重啟,並使用防火牆的16位序號作為帳號/口令進行登陸,可將防火牆配置快速恢復為出廠值。

 
討論區首頁 » 個人資料 andowson » 文章發表人是 andowson
前往:   

交換連結乌托邦博客 
在本站刊登廣告
練功房推薦書單
這一生,至少當一次傻瓜─木村阿公的奇蹟蘋果 Learning jQuery中文版 SCJP Java 6專業認證手冊 Java認證SCJP 6.0/5.0--猛虎出閘 人月神話:軟體專案管理之道(20週年紀念版) SCWCD專業認證手冊 Head First Servlets and JSP
[版權說明] 歡迎部分引用本站文章但不歡迎全文轉載,請遵守本站授權方式:創用CC 姓名標示-非商業性-相同方式分享 3.0 台灣 授權條款。換句話說,您可以轉載、轉寄、引用本站文章,但請附上作者、出處與原文的超連結。除個人收藏外,請勿全文轉載,感謝大家!
Creative Commons License
Powered by JForum 2.1.9 © JForum Team