- 博客(21)
- 收藏
- 关注
原创 日志统计分析-Shell/Goaccess
对Nginx或其他日志进行简单的统计分析 Shell对某一列进行统计,可以分析Statu Code,URL等# cat access.log | awk '{print $9}'|sort|uniq -c | sort -r -n > stat.log或#cat access.log |grep "200" | awk '{print $7}'|sort|uniq -...
2013-08-01 18:58:11
207
原创 MySql:优化工具
脚本优化tuning-primer.sh#cd /etc/ (my.conf所在目录)#wget http://www.day32.com/MySQL/tuning-primer.sh#chmod +x tuning-primer.sh #./tuning-primer.sh 运行报错which: no bc in (/usr/local/sbin:/usr/l...
2013-07-10 10:30:31
324
原创 SVN:安装/配置/WEB自动部署及相关问题
1.系统Centos 6.42.安装svn#yum install subversion3.建立版本库#mkdir /mnt/svndata启动服务#svnserve -d -r /mnt/svndata#svnadmin create /mnt/svndata/svn4.修改配置#cd /mnt/svndata/svn/conf#vi svnserve.con...
2013-06-17 16:24:49
216
原创 Centos:Memcache安装配置【转】
原文:http://www.bootf.com/442.html本教程将介绍如何在CentOS中安装Memcache缓存服务。Memcache是一个与php兼容的内存高速缓存插件,不仅可以缓存变量等对象,而且可以与MySQL配合,缓存数据查询。由于Memcache在内存中缓存数据,因此它的读取写入速度非常之快,能为大容量快速变化的动态数据提供高速缓存。由于编译安装Memcache步骤相...
2013-06-17 15:43:22
217
原创 MySql:常用命令
登入mysql -h192.168.1.110 -uroot -ppassword 登出quit/exit 查看数据库show databases; 用户权限添加grant select on db.table to 'user'@'host';grant select,update on *.* to 'test'@'%';撤销rev...
2013-06-17 15:37:41
222
原创 Centos:PHPAPC
详细信息:http://www.php.net/manual/zh/book.apc.php 安装#yum install php-pear#yum install php-devel#pecl install apc 配置#vi /etc/php.iniextension="/usr/lib64/php/modules/apc.so"apc.enabled...
2013-06-17 14:40:38
156
原创 Cocos2D:gleRunVertexSubmitARM EXC_BAD_ACCESS
版本:cocos2d-iphone v2.1-rc1 EXC_BAD_ACCESS0 gleRunVertexSubmitARM1 gleSetVertexArrayFunc2 gleDrawArraysOrElements_ExecCore3 glDrawElements_ACC_ES2Exec4 draw_elements 修复方式:CC_ENABLE_GL...
2013-04-25 16:42:13
614
原创 Ruby On Rails:Mac系统配置
折腾一天终于把Ruby on rails弄上了,搜了不少教程帮助,最后推荐这两个我直接用到的http://tecparatodos.com/2011/07/24/installing-ruby-on-rails-on-mac-os-x-lion/http://stackoverflow.com/questions/7575023/problem-with-upgrading-rubyg...
2013-04-11 08:53:53
198
原创 ThinkPhp:多表事务
$db = M();$db->startTrans();$result1 = $db->Table('db_a')->setInc('field_1', 120);$result2 = $db->Table('db_b')->setDec('field_1', 110);if($result1 && $result2)...
2013-03-30 16:22:06
185
原创 iPhone:本地打开设置链接列表
prefs:root=General&path=Aboutprefs:root=General&path=ACCESSIBILITYprefs:root=AIRPLANE_MODEprefs:root=General&path=AUTOLOCKprefs:root=General&path=USAGE/CELLULAR_USAGEpre...
2013-03-30 16:14:23
228
Mac:常用命令行备忘
User Libiary 的显隐:chflags nohidden ~/Library/chflags hidden ~/Library Finder里面显示隐藏文件defaults write com.apple.finder AppleShowAllFiles -bool true 统计代码行数,Classses为代码文件夹grep -d recurse "...
2012-07-11 15:27:11
157
原创 iOS:UITextView中return key点击事件的监听方法
可以这样解决,在- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text中监听replacementText,如果为回车则将键盘收起 - (BOOL)textView:(UITextView *)textView s...
2012-05-19 11:23:48
395
原创 iOS:NSString生成UIImage
-(UIImage *)imageFromText:(NSString *)text width:(float)width height:(float)height { // set the font type and size UIFont *font = [UIFont systemFontOfSize:12.0]; CGSize size = CGSizeMak...
2011-07-12 16:04:38
258
iOS:等比压缩截图
将一幅图片按着需要的尺寸进行等比的压缩和放大,最后再截取需要尺寸部分,不知道说清楚没,反正就那意思吧!+(UIImage *)compressImageWith:(UIImage *)image width:(float)width height:(float)height { float imageWidth = image.size.width; float image...
2011-06-24 18:07:49
194
iOS:使用腾讯的SDK将新浪微薄嵌入到应用中
最近在做应用中添加SNS分享功能,只需要分享功能,腾讯的SDK和Demo还是挺直观的,看了下基本上就能用了,而新浪的Oauth认证看了个例子是跳出程序到Web上去认证的,体验很不好。不过Oauth认证这个过程都差不多,所以就直接将QQ的做了写修改,使用比较方便。 1:把Delegate中下的key和secret改成自己的,如果你喜欢在模拟器中输入可以不写 ! 2:把Q...
2011-05-13 17:51:37
178
原创 iOS:几个实用方法:点间距离、点间角度、线间角度
#include <math.h> #define pi 3.14159265358979323846 #define degreesToRadian(x) (pi * x / 180.0) #define radiansToDegrees(x) (180.0 * x / pi) CGFloat distanceBetweenPoints (CGPoint first, CGPoi...
2011-04-22 21:40:17
502
原创 iOS:NSData年、月、星期、日、时、分、秒获取及NSDataToNSString方法
在 NSDate中获得时间信息,年、月、星期、日、时、分和秒: NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *now; NSDateComponents *comps = [[NSDateComponents alloc...
2011-04-22 20:34:23
247
原创 Cocos2D:滚动滚屏黑边问题
为Sprite添加下面的方法:[[sprite texture] setAliasTexParameters];
2011-04-22 20:28:29
227
原创 iOS:横向使用iPhone默认的翻页效果
大致思路使用两层辅助UIView的旋转来实现添加后的View的横向翻页效果 CATransform3D transformA = CATransform3DRotate(CATransform3DIdentity, degreesToRadian(90), 0, 0, 1.0f); CATransform3D transformB = CATransform3DRotate(...
2011-04-20 22:21:36
313
原创 iOS:转一个UITableView中异步加载图片方法
先说使用,再给定义使用方法:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ImageCell"; UITab...
2011-04-20 21:28:45
170
XCode:Couldn't register XX with the bootstrap server. Error: unknown error code.
Log:Couldn't register com.${appname}.xxx with the bootstrap server. Error: unknown error code.This generally means that another instance of this process was already running or is hung in...
2011-04-20 11:15:14
225
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅