2012年11月2日 星期五

Zend Framework 安裝 (在WAMP環境下)

範例環境:XP , WAMP 2.2 ,  PHP 5.3.13 ,

----------------------------
1.下載檔案並解壓縮

到ZendFramework官網下載 ZendFramework-1.12.0.zip

解壓縮到硬碟中,任意路徑即可,需記住路徑。
此處以C:\wamp\bin\php\ZendFramework\ZendFramework-1.12.0\為例。

------------------------------
2.新增環境變數

對[我的電腦]按右鍵選[內容],出現[系統內容]。點選[進階]標籤頁,點選[環境變數]
在[系統變數]的部分選擇[Path],按[編輯]。
新增以下這段路徑:
C:\wamp\bin\php\ZendFramework\ZendFramework-1.12.0\bin\;C:\wamp\bin\php\php5.3.13; 
按確定。

-------------------------------
3.新增php路徑

接著打開php.ini檔案,尋找「Paths and Directories」字串,新增以下路徑:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

include_path = ".;C:\wamp\bin\php\ZendFramework\ZendFramework-1.12.0\library"

--------------------------------
4.測試ZendFramework

打開cmd命令提示字元,
輸入:
zf

只要有出現一堆英文說明就表示成功。如果只出現一兩行、五六行字就是失敗。


----------------------------------
5.建立Zend Project

可自建資料夾來放網站檔案。
此處以C:\Workspace 資料夾為例,專案名稱設為ZTest

在命令提示字元,輸入:
cd c:\Workspace
zf create project ZTest

----------------------------------
6.設定Apache

開啟httpd.conf設定Apache
#LoadModule rewrite_module modules/mod_rewrite.so
(拿掉井字號)改為
LoadModule rewrite_module modules/mod_rewrite.so
接著,
找到以下字串:
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1

改為:
    Order Deny,Allow
#    Deny from all
    Allow from all
#    Allow from 127.0.0.1


---------------------------------
7.掛到apache


方法一:
對系統列的WAMP圖示按滑鼠左鍵,選擇[Apache]→[Alias目錄]→[添加一個Alias(A)]
跳出指令視窗,輸入:
ZTest
接著輸入:
C:/Workspace/ZTest/public

對系統列的WAMP圖示按滑鼠左鍵,選擇[Apache]→[Alias目錄]→[http://localhost/ZTest]→[Edit alias]
Alias /ZTest "c:/Workspace/ZTest/public" 

<Directory "c:/Workspace/ZTest/public">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Allow from all
  
</Directory>
修改重點:
1.第一行的最後一個斜線要刪掉。「Alias /ZTest/ "c:/Workspace/ZTest/public/"」→「Alias /ZTest "c:/Workspace/ZTest/public"」
2.第二行的最後一個斜線要刪掉。「<Directory "c:/Workspace/ZTest/public/">」→「<Directory "c:/Workspace/ZTest/public">」
3.要「Allow from all」
關掉記事本,WAMP會自動重新啟動。如果沒有重新啟動擇手動重新啟動。

開啟瀏覽器  http://localhost/ZTest
(網址後面的資料夾部分,要分大小寫。)


方法二:
開啟httpd.conf設定Apache

將DocumentRoot改為
DocumentRoot "C:\Workspace\ZTest\public"

將<Directory "C:\wamp\www">
改為
<Directory "C:\Workspace\ZTest\public">

重新啟動apache

開啟瀏覽器  http://localhost

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


設定瀏覽器可以直接瀏覽新建的controller的子資料夾:
在C:\Workspace\ZTest\public 之下有個.htaccess檔案
在裡面加上這一行:
RewriteBase /ZTest

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








2012年10月4日 星期四

Intent懶人包


ysl 的程式天堂 - Android 應用開發

http://ysl-paradise.blogspot.tw/2008/12/intent.html


在Eclipse中觀看Android元件的原始碼

※以版本2.3.3為例

1.Download sources:
https://code.google.com/p/lizongbo/downloads/list
下載 : android_gingerbread_javasrc.zip
並儲存在 C:/android_gingerbread_javasrc.zip

2.
選一個 2.3.3 的專案>Properties --> Java Build Path --> Libraries (選擇此標籤)

3.
展開 Android 2.3.3

4.
展開  android.jar

5.
點選Source attachment
點選右側Button [Edit]

6.
選擇下方 External location
點選右側Button [External File...] ==> 選擇檔案 -- > C:/android_gingerbread_javasrc.zip

7.
重新啟動 Ecplise

8.
按下 Ctrl 會出現"鼠標手指"即可按下滑鼠"右鍵"觀看原始碼 !

2012年7月23日 星期一

包含帳號密碼的ftp網址寫法

包含帳號密碼的ftp網址寫法:
ftp://帳號:密碼@網址

查詢IP位址的網域擁有單位

查詢IP的網域擁有單位:
http://rms.twnic.net.tw/twnic/login.jsp

關閉XP自動播放功能


關閉光碟自動啟動功能
每次放入光碟時, 電腦會自動執行開啟光碟功能, 都會頓一下, 有時後還停蠻久的, 以下
方法可以把 自動執行開啟光碟 的功能關閉.

執行 → 輸入 gpedit.msc
出現 "群組原則" 視窗, 依序選左邊 電腦設定 → 系統管理範本 → 系統
找到右邊視窗的 → 關閉自動播放 點兩下左鍵
出現 "關閉自動播放內容" 對話窗, 點選 "已啟用"
再下來在 "停用自動播放在" 的下拉選單, 選擇 "CDROM光碟機"
完成, 光碟放入 就不會再自動執行了~

簡易流程:
執行 → gpedit.msc → 電腦設定 → 系統管理範本 → 系統 →
關閉自動播放 → 已啟用 → CDROM光碟機 → 完成

以上 for Windows XP

2011年12月9日 星期五

DD-WRT Repeater Bridge 設定筆記WL-500g

DD-WRT Repeater Bridge 設定筆記WL-500g

Broadcom的CPU才有支援Repeater Bridge。

http://www.dd-wrt.com/wiki/index.php/Repeater_Bridge

http://digiland.tw/viewtopic.php?id=886


這個步驟最清楚:
http://www.dd-wrt.com/wiki/images/9/9b/Repeater_Bridge.jpg

1.恢復DD-WRT原廠設定
save > apply
2.Wireless -> Basic Settings
* Physical Interface Section
o Wireless Mode : Repeater Bridge
o Wireless Network Mode : Must Match Primary Router
o Wireless Network Name(SSID) : Must Match Primary Router - Make
sure you spell this correctly
o Wireless Channel : Must Match Primary Router (This will disappear
once you put it in RB mode, and isn't needed)
o Wireless SSID Broadcast : Enable
o Network Configuration : Bridged
o Save
* Virtual Interfaces Section
o Add
o Wireless Network Name(SSID) : Different from Primary Router
+ [NOTE] - You CAN try using the same SSID but it usually
will not work properly. Many have had random disconnects and/or no connection
if the SSID's are the same. If using the same ssid doesn't work for you, use
a different ssid from the primary router
o Wireless SSID Broadcast : Enable
o AP Isolation : Disable
o Network Configuration : Bridged
o Save

3.
Open the Wireless -> Wireless Security tab

* Physical Interface Section
o Security Mode : Must Match Primary Router and DD-wrt only works
reliably with WEP or WPA2-AES
o WPA Algorithms : Must Match Primary Router
o WPA Shared Key : Must Match Primary Router
o Key Renewal Interval (in seconds) : Leave default
* Virtual Interfaces Section (note if you don't see this section your
firmware should be atleast v24-sp2)
o Security Mode : Must Match Physical Interface
o WPA Algorithms : Must Match Physical Interface
o WPA Shared Key : Must Match Physical Interface
o Key Renewal Interval (in seconds) : Leave default
o Save

# Open the Setup -> Basic Setup tab

* Connection Type will be: Disabled
* Set STP for Disabled (Enabled sometimes can cause connection problems)
redhawk
* IP Address : 192.168.1.2 (Assuming Primary Router IP is 192.168.1.1)
* Mask : 255.255.255.0
* Gateway: 192.168.1.1 (again assuming Primary Router IP is 192.168.1.1)
* DHCP Server: Disable
* Local DNS: 192.168.1.1 (if IP of Primary Router is 192.168.1.1)
* Assign WAN Port to Switch : Optionally enable this to use the WAN port
as another LAN port.
* Save

# Log back into the router at it's new IP address of http://192.168.1.2

* Open Setup -> Advanced Routing tab
* Set Operating mode to "Router"
* Save

# Open Services

* Disable Dnsmasq
* Save

# Open the Security -> Firewall tab

* Uncheck all boxes...except Filter Multicast
* Disable SPI firewall
* APPLY Settings


2011年12月3日 星期六

DD-WRT Client Bridge 設定筆記DIR-300


D-Link DIR-300 A1 刷DD-WRT

由於不是Broadcom的晶片,所以無法使用Repeater Bridge。

Repeater Bridge:AP1可連上網路。AP2用無線網路接上AP1,然後其他裝置可用無線網路
連上AP2來上網。

Client Bridge:AP1可連上網路。AP2用無線網路接上AP1,然後其他裝置可用網路線連上
AP2來上網。


=====================================================
DIR-300 A1的Client Bridge設定:

0.首先,DD-WRT要是v24 SP2的版本。SP1會有問題。
0.再來,來源AP1的加密設定不能用WEP的Open,要用WEP的Shared Key或其他。
我是用WPA Personal的TKIP成功。

1.回複DD-WRT原始設定:[Administration] > [Factory Defaults]
存檔
2.[WIRELESS > BASIC SETUP] Wireless Mode : Client Bridge
Wireless Network Name (SSID)要設為來源AP的SSID。
存檔

3.[WIRELESS > WIRELESS SECURITY] 依照來源AP的設定來做設定,讓DD-WRT可以連上來
源AP。
存檔

4.[SECURITY > FIREWALL]
Block WAN Requests 全部取消
存檔
SPI Firewall > Disable
存檔

5.[STATUS > WIRELESS] > Site Survey
選取來源AP,按下join。

6.[Setup > Basic Setup > Network Setup ] 設為和來源AP相同網域不同ip。
假如來源AP是192.168.11.1/255.255.255.0,則這裡設為192.168.11.2/255.255.255.0

Gateway和DNS不填。


存檔 > Apply重啟