2013年11月12日

php数据排序---array_multisort

摘要: PHP代码 结果:array(4) { [0]=> int(0) [1]=> int(10) [2]=> int(100) [3]=> int(100)}array(4) { [0]=> int(4) [1]=> int(1) [2]=> int(2) [3]=> int(3)}array_multisort在这个例子中,自动将第一个参数的值排好序,第二个参数中对应着也就排好序了。 阅读全文

posted @ 2013-11-12 21:06 awildfish 阅读(212) 评论(0) 推荐(0) 编辑

2013年11月8日

nginx相关

摘要: 检查nginx配置是否有语法错误:sudo /usr/local/nginx/sbin/nginx -t不带sudo的检查会有错误 阅读全文

posted @ 2013-11-08 17:57 awildfish 阅读(122) 评论(0) 推荐(0) 编辑

2013年10月30日

mongo细节

摘要: mongo创建表db.createCollection(name, {capped: , autoIndexId: , size: , max: } )db.createCollection(name, {capped: , autoIndexId: , size: , max: } )name: collection名称,相当于mysql中的tablecapped:如果为true,则如果表的大小超过指定的上限时,新增的记录会覆盖old记录,且,如果为true,则必须指定size大小;如果为false,那么新建的collection是一个普通的collection;autoIndexID:为t 阅读全文

posted @ 2013-10-30 10:48 awildfish 阅读(263) 评论(0) 推荐(0) 编辑

2013年10月29日

Apache的最小配置

摘要: 以下配置是Apache的最小配置,路径为/usr/local/apache2/conf/include/lww.xhprof.conf ServerName lww.xhprof.com DocumentRoot /home/luwenwei/www/xhprof/xhprof_html/ CustomLog "/usr/local/apache2/logs/access_lww" common ErrorLog logs/error_lww重启apache命令:sudo /usr/local/apache2/bin/apachectl -k restart重启apac.. 阅读全文

posted @ 2013-10-29 21:24 awildfish 阅读(195) 评论(0) 推荐(0) 编辑

2013年10月23日

svn revert

摘要: 本地开发环境出现一个问题,用revert完美解决。 问题描述: 文件static/image/common/jiqiaodaren.png已经被提交到svn上,但是我的开发环境因未与svn同步,所以没有这个文件。 而且我没有确认这个文件是否已存在svn上,错误地认为这个文件是个新文件。 我做了以下操 阅读全文

posted @ 2013-10-23 16:00 awildfish 阅读(594) 评论(0) 推荐(0) 编辑

2013年10月17日

初识mongo

摘要: 进入mongo/usr/local/mongodb/bin/mongo --host 10.1.1.111:27017查看所有dbshow dbs查看当前进入的dbdb 查看当前db的所有collectionshow collections创建collection(table)db... 阅读全文

posted @ 2013-10-17 19:33 awildfish 阅读(618) 评论(1) 推荐(1) 编辑

2013年10月8日

mysql -- 备忘

摘要: select distinct(authorid),author from forum_post where tid=1; 阅读全文

posted @ 2013-10-08 17:31 awildfish 阅读(103) 评论(0) 推荐(0) 编辑

2013年9月26日

Linux基础命令---压缩与打包

摘要: GZIP:普通文件打包成gzip文件:gzip filename(问题:如何测试一个文件是否是gzip文件?)gzip文件解压成普通文件:gzip -d filename(副作用:原始gz文件会被删除)tar:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tartar -cvf /tmp/etc.tar /etc 打包但不压缩将 /tmp/etc.tar.gz 文件解压缩在 /usr/local/src 底下[root@linux ~]# cd /usr/local/src[root@linux src]# tar -zxvf /tmp/etc.tar.gz参考http://w 阅读全文

posted @ 2013-09-26 18:13 awildfish 阅读(188) 评论(0) 推荐(0) 编辑

2013年9月24日

nginx rewrite

摘要: 要解决的问题是:所有http://www.test.com/forum.php 均跳转到http://www.test.com/forum.php?mod=thread其它请求仍然保持原始地址。方法1:原理:配置nginx rewrite来实现操作1:rewrite ^/forum.php$ /forum.php?mod=thread last;操作2:重启nginx现象:能够实现跳转,但对于http://www.test.com/forum.php?gid=10这样的请求,nginx也会匹配并跳转到http://www.test.com/forum.php?mod=thread结论是:rew 阅读全文

posted @ 2013-09-24 15:15 awildfish 阅读(332) 评论(0) 推荐(0) 编辑

2013年9月16日

重启php-fpm

摘要: php 5.3.3以后 的php-fpm 不再支持 php-fpm 以前具有的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令,需要使用信号控制:master进程可以理解以下信号INT, TERM立刻终止QUIT平滑终止USR1重新打开日志文件USR2平滑重载所有worker进程并重新载入配置和二进制模块示例如下:php-fpm 关闭:kill -INT `cat /usr/local/php/var/run/php-fpm.pid`php-fpm 重启:kill -USR2 `cat /usr/local/php/var/run/php- 阅读全文

posted @ 2013-09-16 10:00 awildfish 阅读(455) 评论(0) 推荐(0) 编辑

导航