2012年6月28日 星期四

在XP上利用apache提供WebDAV服務

有天發現iPad似乎可以利用WebDAV的東西, 這樣就可以有超大的網路空間了 科科~

然後try了一下, 似乎是成功了, 只是我不知道要怎麼上傳檔案 -.-
下載, 讀取檔案的話倒是沒問題 = =+

1. 去安裝apache  ( 在 http://httpd.apache.org/download.cgi )
2. 進入apache的bin資料夾, 先建立你要的帳號, 以下為範例 (一行)
htdigest -c "C:/Program Files/Apache Software Foundation/Apache2.2/user.passwd" DAV-upload admin
(這個東西在 Apache2.2\cond\extra\httpd-dav.conf 有提到)

3. 進入apache安裝資料夾, 修改設定檔
( C:\Program Files\Apache Software Foundation\Apache2.2\conf )
需要修改 httpd.conf, 把裡面的這幾行前面的註解#刪掉

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule auth_digest_module modules/mod_auth_digest.so
Include conf/extra/httpd-dav.conf

4. 還要修改 extra資料夾下的httpd-dav.conf  (Apache2.2\cond\extra\httpd-dav.con)

設定你想要的資料夾, 以下也是一個範例 XD

Alias /upload "D:/dav_upload"


    Dav On

    Order Allow,Deny
    Allow from all

    AuthType Digest
    AuthName DAV-upload

    AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/user.passwd"
    AuthDigestProvider file

   
        require user admin
   


5. 最後去ipad找webdav的程式, 網址輸入http://xxxxxxxxx/upload
然後輸入自己的帳號密碼, 就可以看到本機電腦上的D:/dav_upload裡面的東西 = =+


在設定過程中有看了這幾個網頁:
http://herb123456.pixnet.net/blog/post/1009884-%E3%80%90apache%E3%80%91webdav-%E7%9B%B8%E9%97%9C%E8%A8%AD%E5%AE%9A
http://www.errorhelp.com/search/details/86393/invalid-command-authdigestprovider-perhaps-mis-spelled-or-defined-by-a-module-not-included-in-the-server-configuration
http://robert-linux.blogspot.tw/2009/10/ubuntu904-apache2-webdav.html
http://llls.cpshs.tyc.edu.tw/mediawiki/index.php?title=%E8%A8%AD%E5%AE%9A%E7%B5%A6Ipad%E7%9A%84WebDav&redirect=no

----

好像記的有點凌亂 XD

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

[2012.12.19 補充]
原本都一直無法上傳&刪除檔案, 在檢查設定檔有看到這句
DavLockDB "C:/Program Files/Apache Software Foundation/Apache2.2/var/DavLock"

當初安裝apache的時候並沒有var/DavLock這個資料夾, 建立這個資料夾後似乎一切都正常運作了!?

科科~~

2012年4月29日 星期日

ns: record: can't read "curq_": no such variable

又要去研究前人的code了 XD....

這次遇到的錯誤訊息是
ns: record: can't read "curq_": no such variable

後來, 照這個網頁的步驟, tcl就可以跑了 XD~
http://140.116.164.80/~smallko/ns2/BOOK2_FAQ.htm
F.問題描述:    如何觀察無線節點的佇列長度。


這個故事告訴我們, 要把對方的code複製完整一點,最好是整個資料夾+.tcl檔

(要改的bug太多了, 那就改天吧!? XD)

2012年3月29日 星期四

關閉影片的縮圖預覽

有的時候會因為正要顯示影片縮圖, 然後就當機 -.-
乾脆把這個功能關掉算了, 反正我也用不到 XD

關閉方式:
開始 -> 執行 -> regsvr32 /u shmedia.dll

2012年3月28日 星期三

把stderr丟到/dev/null (不顯示錯誤訊息)

打完指令之後最後再加上 2> /dev/null 就好了

ex:
sh xxxxx.sh 2> /dev/null

2012年3月13日 星期二

ns2 奇怪的安裝錯誤訊息

這幾天在重新安裝ns2 + cygwin

可是./install之後, 一直遇到一堆錯誤訊息, 像是:

2 [main] gcc 44368 fork_copy: linked dll data/bss pass 0 failed, 0x5CF000.
.0x5CF040, done 0, windows pid 44008, Win32 error 487
1327733 [main] gcc 44368 fork_copy: linked dll data/bss pass 0 failed, 0x5CF000.
.0x5CF040, done 0, windows pid 44792, Win32 error 487
3641693 [main] gcc 44368 fork_copy: linked dll data/bss pass 0 failed, 0x5CF000.
.0x5CF040, done 0, windows pid 42164, Win32 error 487
7962427 [main] gcc 44368 fork_copy: linked dll data/bss pass 0 failed, 0x5CF000.
.0x5CF040, done 0, windows pid 43792, Win32 error 487
gcc: fork: Resource temporarily unavailable


而且我還有把那個路徑加入沙盒的例外清單, 可是沒用 XD

後來把防毒軟體關掉(avast), 結果就沒有這個訊息了 -.-


linux & printscreen

http://tips.webdesign10.com/how-to-take-a-screenshot-with-ubuntu-linux

看了這篇才知道原來工具列那邊有個按鈕可以直接抓圖 XD

而且他還有提到一些指令來抓圖, 只是我懶得去試 科科~~

2012年3月6日 星期二

office錯誤訊息

忘了存錯誤訊息了 -.-
只記得有看到這些關鍵字: runtime error r6034

原本電腦的office是2003, 剛剛裝了新版的2010 (新舊版共存)

可是之後打開word的時候, 就會出現那個錯誤訊息 orz....

最後用這個指定就修好了 (重新登錄dll !?)

for %1 in (%windir%\system32\*.dll) do regsvr32.exe /s%1

後記: 重開機之後又會出現相同的錯誤訊息, 所以最後直接砍掉2010 -.-

2012年2月24日 星期五

拆筆電 XD

http://www.tim.id.au/blog/tims-laptop-service-manuals/

我的老舊TravelMate 240可以拆來玩玩看 XDD

(雖然說他只有螢幕壞掉 科科)

2012年1月11日 星期三

fedora 10 & rar檔

以前明明直接用yum就可以裝unrar, 可是剛剛卻發現不能安裝 (找不到套件)

所以要改成手動安裝了 科科~

直接打:
wget ftp://fr2.rpmfind.net/linux/rpmfusion/nonfree/fedora/releases/10/Everything/i386/os/unrar-3.7.8-3.fc10.i386.rpm

然後安裝:
rpm -ivh unrar-3.7.8-3.fc10.i386.rpm


就可以用unrar來解壓縮檔案了 XD
unrar x filename.rar

2012年1月5日 星期四

Fedora10 & ns-2.29

在安裝ns-allinone-2.29.2的時候, 會出現一些錯誤訊息

ex:
common/packet.h:231: warning: deprecated conversion from string constant to 'char*'
還有
'typedef' was ignored in this declaration

然後在這邊看到一些討論

改一下Makefile似乎就安裝成功了 = =+

簡單說:
先確定電腦上有gcc34和g++34, 沒有的話就用yum裝一下
yum install compat-gcc-34-c++

然後去修改ns-2.29/Makefile.in

把line 36, 37的
CC = @CC@
CPP = @CXX@

改成
CC = gcc34
CPP = g++34

再去./install就成功了 XD

20120314補充:
packet.h那個錯誤訊息, 可以在Makefile的CCOPT後面加上-Wno-write-strings這個參數解決.
http://nsnam.isi.edu/nsnam/index.php/Troubleshooting

================================================

補充: nam似乎安裝失敗, 可能也要改它的makefile吧 (我用不到, 沒差 XD)

以下是log:

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.11: /ns2/ns-allinone-2.29/{bin,include,lib}
tk8.4.11: /ns2/ns-allinone-2.29/{bin,include,lib}
otcl: /ns2/ns-allinone-2.29/otcl-1.11
tclcl: /ns2/ns-allinone-2.29/tclcl-1.17
ns: /ns2/ns-allinone-2.29/ns-2.29/ns
xgraph: /ns2/ns-allinone-2.29/xgraph-12.1
gt-itm: /ns2/ns-allinone-2.29/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

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

Please put /ns2/ns-allinone-2.29/bin:/ns2/ns-allinone-2.29/tcl8.4.11/unix:/ns2/ns-allinone-2.29/tk8.4.11/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /ns2/ns-allinone-2.29/otcl-1.11, /ns2/ns-allinone-2.29/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=

(2) You MUST put /ns2/ns-allinone-2.29/tcl8.4.11/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.11
and tk8.4.11. They are now installed under /ns2/ns-allinone-2.29/{bin,include,lib}

After these steps, you can now run the ns validation suite with
cd ns-2.29; ./validate