作者:dadait
发布时间:December 1, 2011
分类:学习
No Comments
工作中,你可能经常会遇到使用HTTP状态,但又要现去问度娘,谷爹神马的。很多找的还不全。现在分享出一份HTTPD状态码,摘自Lighttpd 1.4.28源码中。大家可以收藏或者COPY下来备用。
static keyvalue http_status[] = {
{ 100, "Continue" },
{ 101, "Switching Protocols" },
{ 102, "Processing" }, /** WebDAV */
{ 200, "OK" },
{ 201, "Created" },
{ 202, "Accepted" },
{ 203, "Non-Authoritative Information" },
{ 204, "No Content" },
{ 205, "Reset Content" },
{ 206, "Partial Content" },
{ 207, "Multi-status" }, /** WebDAV */
{ 300, "Multiple Choices" },
{ 301, "Moved Permanently" },
{ 302, "Found" },
{ 303, "See Other" },
{ 304, "Not Modified" },
{ 305, "Use Proxy" },
{ 306, "(Unused)" },
{ 307, "Temporary Redirect" },
{ 400, "Bad Request" },
{ 401, "Unauthorized" },
{ 402, "Payment Required" },
{ 403, "Forbidden" },
{ 404, "Not Found" },
{ 405, "Method Not Allowed" },
{ 406, "Not Acceptable" },
{ 407, "Proxy Authentication Required" },
{ 408, "Request Timeout" },
{ 409, "Conflict" },
{ 410, "Gone" },
{ 411, "Length Required" },
{ 412, "Precondition Failed" },
{ 413, "Request Entity Too Large" },
{ 414, "Request-URI Too Long" },
{ 415, "Unsupported Media Type" },
{ 416, "Requested Range Not Satisfiable" },
{ 417, "Expectation Failed" },
{ 422, "Unprocessable Entity" }, /** WebDAV */
{ 423, "Locked" }, /** WebDAV */
{ 424, "Failed Dependency" }, /** WebDAV */
{ 426, "Upgrade Required" }, /** TLS */
{ 500, "Internal Server Error" },
{ 501, "Not Implemented" },
{ 502, "Bad Gateway" },
{ 503, "Service Not Available" },
{ 504, "Gateway Timeout" },
{ 505, "HTTP Version Not Supported" },
{ 507, "Insufficient Storage" }, /** WebDAV */
{ -1, NULL }
};
作者:dadait
发布时间:November 17, 2011
分类:学习
No Comments
工作需要,在CCTV的网站里分析出了CCTV各频道及卫视频道的XML节目列表,分享出来供大家使用。其中URL中有日期部分动态的,大家自己写段脚本动态生成一下URL就行了。
CCTV-1 综合频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv1.xml
CCTV-2 经济频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv2.xml
CCTV-3 综艺频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv3.xml
CCTV-4 亚洲 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv4.xml
CCTV-5 体育频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv5.xml
CCTV-6 电影频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv6.xml
CCTV-7 军事农业频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv7.xml
CCTV-8 电视剧频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv8.xml
CCTV-9 记录频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv9d.xml
CCTV-10 科教频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv10.xml
CCTV-11 戏曲频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv11.xml
CCTV-12 社会与法 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv12.xml
CCTV-13 新闻频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv13.xml
CCTV 少儿频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctvchildren.xml
CCTV 音乐频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctvmusic.xml
北京卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/btv1.xml
天津卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/tianjin.xml
河北卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hebei.xml
山西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanxi1.xml
内蒙古卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/neimenggu.xml
辽宁卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/liaoning.xml
吉林卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jilin.xml
黑龙江卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/heilongjiang.xml
东方卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanghai.xml
江苏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jiangsu.xml
浙江卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/zhejiang.xml
安徽卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/anhui.xml
东南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/dongnan.xml
江西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jiangxi.xml
山东卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shandong.xml
河南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/henan.xml
湖北卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hubei.xml
湖南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hunan.xml
广东卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guangdong.xml
广西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guangxi.xml
旅游卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/luyou.xml
重庆卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/chongqing.xml
四川卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/sichuan.xml
贵州卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guizhou.xml
云南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/yunnan.xml
西藏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/xizang.xml
陕西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanxi2.xml
甘肃卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/gansu.xml
青海卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/qinghai.xml
宁夏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/ningxia.xml
新疆卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/xinjiang.xml
作者:dadait
发布时间:October 27, 2011
分类:学习
No Comments
安装前准备,在确定你已经安装了以下支持 gcc、libevent-devel
如果没有安装请先执行以下命令
yum install gcc libevent libevent-devel
在一切准备就绪后开始安装
wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure
make && make test
sudo make install
如果想支持SASL,请
./configure --enable-sasl
作者:dadait
发布时间:October 12, 2011
分类:学习
No Comments
较老的版本就不写了。只写最近几个版本质安装方法。为了节省时间,本方法不是从源代码编译安装直接从RPM Fusion下载安装。
本方法适应用于Fedora 11 (Leonidas), Fedora 12 (Constantine), Fedora 13 (Goddard), Fedora 14 (Laughlin), Fedora 15(Lovelock) and Fedora 16(Verne)。包含(x86, x86_64, ppc and ppc64版本)
$> su -
#> rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
#> yum install vlc
#> yum install mozilla-vlc (可选)注意:
1:最后一行括号内内容不要当作命令去执行。
2:较旧版本请去官方网站参考安装方法。http://www.videolan.org/vlc/download-fedora.html
3:其他Linux发行版,Mac OS,BSD等,源代码请去此下载:http://www.videolan.org/vlc/
作者:dadait
发布时间:September 15, 2011
分类:学习
No Comments
因工作需要做一个对图像进行处理的程序,随想起了大名鼎鼎的ImageMagick。以前也只是知道,但没实际在项目当中用过,今天在服务器上编译了一下,并且安装了PHP的imagick扩展。以下是方法和步骤。
1:下载ImageMagick的unix源码包编译安装。
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar zxvf ImageMagick.tar.gz
cd ImageMagick
./configure
make
make install
cd ../
安装完成后可以用convert --version查看版本信息
2:下载PHP的imagick扩展源代码包编译安装。
wget http://pecl.php.net/get/imagick-3.1.0RC1.tgz
tar zxvf imagick-3.1.0RC1.tgz
cd imagick-3.1.0RC1
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
make
make install
3:编辑php.ini
vi /etc/php.ini
添加如下一行
extension = "imagick.so"
4:重启apache即可
httpd restart
ldconfig
完毕,因为时间关系就不再细写了,有问题的童鞋可以留言直接问我。