- 12月 04 週二 201214:01
【PHP】Google、Yahoo、Bing Web Search API
- 10月 21 週五 201110:47
Proftpd + MySQL authentication + Quotas
proftpd-1.3.0
=> ./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/local/mysql/include --with-libraries=/usr/local/mysql/lib
mv /usr/sbin/proftpd /usr/sbin/proftpd.rpmsave
ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd
建立 user && group
groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
MYSQL
create database proftpd;
grant select, insert, update on proftpd.* to proftpd@localhost identified by 'password';
CREATE TABLE ftpgroup (
groupname varchar(16) NOT NULL default '',
gid smallint(6) NOT NULL default '5500',
members varchar(16) NOT NULL default '',
KEY groupname (groupname)
) TYPE=MyISAM COMMENT='ProFTP group table';
#
# Dumping data for table `ftpgroup`
#
INSERT INTO `ftpgroup` VALUES ('ftpgroup', 5500, 'ftpuser');
INSERT INTO `ftpgroup` VALUES ('ftpgroup', 5500, 'ftpguest');
# --------------------------------------------------------
#
# Table structure for table `ftpquotalimits`
#
CREATE TABLE ftpquotalimits (
name varchar(30) default NULL,
quota_type enum('user','group','class','all') NOT NULL default 'user',
per_session enum('false','true') NOT NULL default 'false',
limit_type enum('soft','hard') NOT NULL default 'soft',
bytes_in_avail int(10) unsigned NOT NULL default '0',
bytes_out_avail int(10) unsigned NOT NULL default '0',
bytes_xfer_avail int(10) unsigned NOT NULL default '0',
files_in_avail int(10) unsigned NOT NULL default '0',
files_out_avail int(10) unsigned NOT NULL default '0',
files_xfer_avail int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
- 10月 21 週五 201110:45
VirtualBox By Linux + no-ip
之前遇到一個瓶頸, 希望有自己寫程式的測試機. 但又不可能在家用一台 Server (口袋沒有麥可!!)..
有時寫 code 時. 習慣用 vi 來寫code 的我.. 用 UltraEdit 來寫.. 真的是十分不方便
(雖說 UltraEdit 功能很強大, 可能是寫的 FU 不對吧....
)
只好用自己的筆電. 灌上 VirtualBox.. 然而我的用意是. 可以對外連線.. 爬了一些文..
終於知道如何設定
... 真是太感動了
安裝步驟
1. 安裝 VirtualBox + 並安裝 CentOS
2. Virtual Box 的網路設成 NAT 模式
4. 將所灌的 OS (範例: CentOS) IP 設為 DHCP
3. 開啟windows 中的 [命令提示字元]
設上對外可以指到 Virtual Box
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 22
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 80
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 80
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/Protocol" TCP
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/GuestPort" 21
VBoxManage setextradata Server "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ftp/HostPort" 21
Server 則是Virtual Box 的 名稱..
:D 醬就大功告成了呀....... 
- 10月 13 週四 201114:37
Sphinx + Mmseg (分詞)
今天在寫公司的code 時. 突然發現!! 原來我沒有把 Sphinx 的相關文件留存下來耶!!
所以就補一下文件
Sphinx: 目前來看 以php 來說. 做全文檢索 效能是不錯的.. 之前有用 lucene 的 solr + 庖丁解牛 (很帥的名字吧)
但一直產生 lock 的情況. 所以就改用了 sphinx
- 7月 05 週二 201114:26
Jquery Uploadify 之 IO error
好像很象沒有寫一些文章. 最近在寫所謂的 爬文程式.. 四處去爬別人的文章.. 而且還要限時寫完.. 搞的超久的
最近公司也給我一個新的案子. 然而有用到 jquery.uploadify . (http://www.uploadify.com/)
然而遇到了一個問題. 在 upload 時. 一直出現 IO Error .. 搞了老半天.. folder 的目錄權限也有設. 但卻一直不行
後來終於找到問題. 原來是 apache 的問題呀. 若有用 jquery.uploadify 的朋友們!!
在 apache 需要設定
- 4月 21 週四 201116:58
Red Hat EL5 Yum Install
之前有發佈過 EL4 但自從有了 EL5 後. 就沒有裝 EL4 的 server 嘍!! 真是太 「ㄏ一ㄥˋ 新」了
安裝的元件如下:
libxml2-2.6.26-2.1.2.8.i386.rpm
libxml2-python-2.6.26-2.1.2.8.i386.rpm
m2crypto-0.16-6.el5.6.i386.rpm
readline-5.1-3.el5.i386.rpm
yum-3.2.22-26.el5.centos.noarch.rpm
yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
最後!! 再裝上 rpmforge-release-0.5.1-1.el5.rf.i386.rpm
- 4月 08 週五 201111:03
Yahoo Connect
【Authentication and Authorization with Yahoo】- Authorization with OAuth
用到最後!! 覺得 Yahoo 的 API 好像滿多問題的內!! 跟 Google Apis 比較起來!! Google 的文件寫的清楚多了
當然!! 一開始一定要有 Yahoo 的帳號嘍!!
應用程式頁: https://developer.apps.yahoo.com/projects
- 4月 08 週五 201111:03
Facebook Connect
【FaceBook Connect】
感覺 Facebook Connect 一下子就可以使用了,也不知是不是之前有玩過。
登入 Facebook 之後
到 http://www.facebook.com/developers/apps.php 建立一個應用程式
- 4月 08 週五 201111:03
Google Oauth2
【Authentication and Authorization for Google APIs】- Using OAuth 2.0 to Access Google APIs
一開始在看 Google apis 時,還真的有些搞不懂。 但 Google 寫的文件,還真的都滿清楚的。
當然要做 Google 登入,一開始是要建立 API 的 Key (當然 Yahoo 也是如此!!)
先決條件!! Google 的帳號一定要有的呀.
- 3月 02 週三 201112:17
MongoDB Part Ⅲ
Coding By PHP
自己本身是寫 PHP 的,當然要使用 MongoDB 也是使用 PHP 嘍。
PHP Lib 下載: http://www.mongodb.org/display/DOCS/PHP+Libraries,+Frameworks,+and+Tools
之前從 Smarty 改用 Codeigniter 之後, Coding 就一直是用 Codeigniter (CI)。
Alexbilbie 大大寫的 Codeigniter with MongoDB