![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
server
robert_zhai
Life is short, cherish what we have owned !
My github is https://robertzhai.github.io 。
展开
-
expect 实现 自动打包和提交代码到github
问题:web项目用gulp压缩处理之后,提交到github 需要2次执行命令,想把这个流程合并解决:expect交互式命令提交build_push.sh#!/usr/bin/bashgulprsync -avr build/* .git add *git ci -am 'update this repo'echo "start push .."expect ~/.acc原创 2016-11-13 18:03:28 · 1131 阅读 · 0 评论 -
lsof | grep deleted
UNIX 大量使用了文件。作为系统管理员,lsof 允许您对核心内存进行查看,以找出系统当前如何使用这些文件。lsof 最简单的用法可以告诉您哪些进程打开了哪些文件,以及哪些文件由哪些进程打开。在收集关于应用程序工作情况的信息时,或在进行某些可能损坏数据的操作前确保文件未被使用时,这一点特别重要lsof 更高级的用法可以帮助您查找删除的文件,并获得关于网络连接的信息。这是一个功能强大的工具,它几乎转载 2013-10-11 11:33:44 · 8467 阅读 · 1 评论 -
centos rar安装
wget http://www.rarsoft.com/rar/rarlinux-3.9.3.tar.gztar -xvf rarlinux-3.9.3.tar.gzcd rarmake看见下面这些信息就是安装成功了mkdir -p /usr/local/binmkdir -p /usr/local/libcp rar unrar /usr/local/binc转载 2013-09-20 18:04:01 · 1559 阅读 · 0 评论 -
清理/var/account/pacct
【转】清理/var/account/pacct转自:laoyao512http://blog.sina.com.cn/s/blog_9a4d43d80100zqxa.html如果你进入了这个页面,说明你的Linux磁盘多半已经因为空间不足报警了,而且是/var/account/pacct这个文件导致的var挂载点空间不足。 这个文件的意思:Linux转载 2013-09-16 13:49:41 · 4238 阅读 · 0 评论 -
安装lrzsz(zmodem)
安装lrzsz(zmodem)对于CentOS系统:1[root@www ~]# yum install lrzsz对于debian系统:1[root@www ~]#apt-get install lrzsz安装完成后就可以使用Se转载 2013-09-15 22:24:30 · 2273 阅读 · 0 评论 -
mysql char varchar
CHAR和VARCHAR类型声明的长度表示你想要保存的最大字符数。例如,CHAR(30)可以占用30个字符。CHAR列的长度固定为创建表时声明的长度。长度可以为从0到255的任何值。当保存CHAR值时,在它们的右边填充空格以达到指定的长度。当检索到CHAR值时,尾部的空格被删除掉。在存储或检索过程中不进行大小写转换。VARCHAR列中的值为可变长字符串。长度可以指定为0到65,535之间的转载 2013-09-12 16:27:51 · 500 阅读 · 0 评论 -
【转】php工作原理
【转】php工作原理php,apache和mysql组合的工作过程:PHP的所有应用程序都是通过WEB服务器(如IIS或Apache)和PHP引擎程序解释执行完成的,工作过程:(1)当用户在浏览器地址中输入要访问的PHP页面文件名,然后回车就会触发这个PHP请求,并将请求传送化支持PHP的WEB服务器。(2)WEB服务器接受这个请求,并根据其后缀进行判断如果转载 2013-08-30 22:38:50 · 693 阅读 · 0 评论 -
centos install redis phpredis
安装redis和phpredis模块安装redis模块wget http://download.redis.io/redis-stable.tar.gztar -zxvf redis-stable.tar.gzcd redis-stablemake && make installcp redis.conf /usr/l原创 2013-08-29 14:55:35 · 494 阅读 · 0 评论 -
OAuth(开放授权)
http://zh.wikipedia.org/zh/OAuth认证和授权过程在认证和授权的过程中涉及的三方包括:服务提供方,用户使用服务提供方来存储受保护的资源,如照片,视频,联系人列表。用户 ,存放在服务提供方的受保护的资源的拥有者。客户端 ,要访问服务提供方资源的第三方应用。在认证过程之前,客户端要向服务提供者申请客户端标识。使用OAuth进行认证转载 2013-07-25 08:39:15 · 405 阅读 · 0 评论 -
[nginx] Linux下多路复用IO接口 epoll select poll 的区别
我们先来介绍下nginx nginx :支持高并发连接.官方测试的是5w并发连接但在实际生产中可制成2-4w并发连接数,得益于nginx使用最新的epoll(linux 2.6内核)和kqueue(freebsd)网络I/O模型.而apache使用的则是传统的select模型,其比较稳定的prefork模式为多进程模式,需要经常派生子进程,所消耗的CPU等服务器资源要比nginx高的多.转载 2013-07-25 08:28:28 · 1299 阅读 · 0 评论 -
mysql change password
1.创建用户create user 'testtest'@'%' identified by '123';2. 修改密码mysql -u root -puse mysql;update user set password=password('234') where user='testtest'; flush privilegesexit;原创 2013-05-26 22:24:36 · 1229 阅读 · 0 评论 -
Long Polling与Polling概述
perfgeekslinux . bash . php . python . cPHP服务端推送技术Long PollingLong Polling与Polling概述服务端推送技术应用越来越普遍,应用范围也越来越宽广,技术解决方案也越来越成熟且丰富。很多SNS网站的chat功能就有用到了Long Polling技术。比如fackebook, kaixin001转载 2013-06-25 23:11:43 · 716 阅读 · 0 评论 -
sql的简洁写法
$sql="SELECT * FROM ".DB_TABLEPRE."gift WHERE 1=1 ";if($title){$sql=$sql." AND title LIKE '%{$title}%' ";}//起始搜索价钱 0 可以通过if($startprice !== ''){$sql=$sql." AND credit BETWEEN $startprice原创 2013-06-08 11:00:15 · 622 阅读 · 0 评论 -
用 Python 实现的线程池
用 Python 实现的线程池[Python]用 Python 实现的线程池软件技术lhwork 发表于 2007-2-1 8:53:26为了提高程序的效率,经常要用到多线程,尤其是IO等需要等待外部响应的部分。线程的创建、销毁和调度本身是有代价的,如果一个线程的任务相对简单,那这些时间和空间开销就不容忽视了,此时用线程池转载 2013-06-17 18:50:06 · 501 阅读 · 0 评论 -
http_load
http_load 压测工具 http://acme.com/software/http_load/原创 2013-06-06 16:48:20 · 475 阅读 · 0 评论 -
vim 打开文件乱码解决方法
# cat ~/.vimrc set fileencoding=utf-8 set encoding=utf-8 set number set tabstop=4 set shiftwidth=4 set expandtab set autoindent set smartindent然后#source ~/.vimrc 再打开就正常原创 2013-06-06 13:58:06 · 711 阅读 · 0 评论 -
centos install redis
wget http://download.redis.io/redis-stable.tar.gztar -zxvf redis-stable.tar.gz cd redis-stablemake && make installcp redis.conf /usr/local/etc/vim ../etc/redis.conf timeout 300maxmemor原创 2013-06-05 18:13:43 · 418 阅读 · 0 评论 -
由浅入深探究mysql索引结构原理、性能分析与优化
http://ourmysql.com/archives/1171?fowx转载 2013-11-13 22:45:06 · 398 阅读 · 0 评论 -
python HTTPServer
'''Created on 2013-12-3@author: Administrator'''from BaseHTTPServer import HTTPServer, \ BaseHTTPRequestHandlerclass RequestHandler(BaseHTTPRequestHandler): def _writeheade原创 2013-12-03 09:09:52 · 2243 阅读 · 0 评论 -
MemcacheQ 安装和测试
1.安装参考>http://memcachedb.org/memcacheq/ >http://www.lmyw.net.cn/?p=729>berkeley: wget http://download.oracle.com/berkeley-db/db-5.1.25.tar.gz 2.启动memcacheq:memcacheq -d -uroot -原创 2016-11-08 17:15:17 · 408 阅读 · 0 评论 -
git clone error setting certificate verify locations
git clone https://github.com/google/protobuf.git 直接报错,修改成下面的即可。env GIT_SSL_NO_VERIFY=true git clone https://github.com/google/protobuf.git原创 2016-09-06 16:14:57 · 973 阅读 · 0 评论 -
Why is epoll faster than select?
A typical server might be dealing with, say, 200 connections. It will service every connection that needs to have data written or read and then it will need to wait until there's more work to do. Whil转载 2016-08-24 14:15:10 · 466 阅读 · 0 评论 -
异步编程和事件模型
网络编程其实很大一部分的内容就是处理各种IO,对IO模型的理解,能使我们对UB模型机制更深一层的理解。特别是下面会说到的异步编程和事件模型。1. 同步阻塞IO同步阻塞IO模型如下图。Read,write这些操作,其实都是应用程序通过内核的系统调用完成的。为了执行read操作,应用程序会调用相应的一个系统调用(system call),此时系统控制权就交给内核,应用程转载 2016-08-22 19:49:44 · 1705 阅读 · 0 评论 -
nfs原理
原创 2015-09-18 14:10:46 · 349 阅读 · 0 评论 -
mac install tomcat8
1. vim ~/.bash_profileadd export JAVA_HOME=$(/usr/libexec/java_home)2. download tomcat8 binaryhttp://tomcat.apache.org/download-80.cgi#8.0.263.start tomcatchmod +x tomcat/bin/*.shbi原创 2015-09-09 21:05:57 · 613 阅读 · 0 评论 -
ssh 登录不了解决方案
使用SSH登录某台机器,有时因为机器重新安装系统,会出现以下信息:bash-3.2# ssh user@x.x.x.x@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@@@@@@@@@@@@@原创 2015-04-16 11:06:34 · 1248 阅读 · 0 评论 -
server no password by public key
ssh-keygen -t rsa输入路径/Users/shiwei/.ssh/nopwd_rsachmod 700 nopwd_rsassh-add -K nopwd_rsascp nopwd_rsa.pub root@123.57.45.183:/root/.sshchmod 700 /root/.sshcd /root/.sshmv nopwd_rsa.pu原创 2014-10-26 14:52:49 · 488 阅读 · 0 评论 -
web httperf test tool
http://www.comlore.com/httperf.htmlusage:httperf --hog --server=demo.com --num-conns=200 --rate=100 --timeout=5 --uri /index.php转载 2014-09-01 12:03:58 · 460 阅读 · 0 评论 -
nignx 405
error_page 405 =200 @405; location ~ (.*\.html){ error_page 405 =200 $1; root /data/wwwroot; }原创 2014-08-04 16:42:32 · 433 阅读 · 0 评论 -
kohana nginx config
root /nginx/html/kohana/kohana ; location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?kohana_uri=/$原创 2014-07-10 19:29:04 · 1081 阅读 · 0 评论 -
mac mysql quit without updating PID
ps aux | grep mysql | grep -v grepkill -9 mysqlpidmysql.server start原创 2014-06-12 14:25:47 · 498 阅读 · 0 评论 -
git xcrun: error
git statusxcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use xcode-select to change原创 2014-05-09 15:32:05 · 916 阅读 · 0 评论 -
淘宝网络框架tbnet源码分析
http://blog.yunnotes.net/index.php/read_tbnet_code_again/转载 2013-12-06 19:30:53 · 2353 阅读 · 0 评论 -
TCP,IP,HTTP,SOCKET区别和联系
TCP,IP,HTTP,SOCKET区别和联系网络由下往上分为: 对应物理层-- 数据链路层--网络层-- IP协议传输层-- TCP协议会话层--表示层和应用层-- HTTP协议socket则是对TCP转载 2013-12-05 08:49:59 · 584 阅读 · 0 评论 -
http://www.cn360cn.com/ 抓取分类爬虫
include "../../config/common.php";define( "PREG_HREF_CAT", "/(.*?)/is" );$proxy = new Proxy();for($page=1; $page$base = 'http://www.cn360cn.com/';$url = "http://www.c原创 2013-12-03 14:40:03 · 2595 阅读 · 0 评论 -
ip、号码归属地查询开发接口
天气接口气象局接口:http://m.weather.com.cn/data/101010100.html 解析音乐接口虾米接口http://kuang.xiami.com/app/nineteen/search/key/歌曲名称/diandian/1/page/歌曲当前页?_=当前毫秒&callback=getXiamiDataQQ空间收藏音乐接口转载 2013-06-04 19:55:34 · 2391 阅读 · 0 评论 -
webbench tools
http://home.tiscali.cz/cz210552/webbench.htmlwebbench -hwebbench [option]... URL -f|--force Don't wait for reply from server. -r|--reload Send reload request - Pra原创 2013-06-05 10:11:50 · 520 阅读 · 0 评论 -
分布式缓存服务器 memcachedb
memcachedb是 一个由新浪网的开发人员开放出来的开源项目,给memcached分布式缓存服务器添加了Berkeley DB的持久化存储机制和异步主辅复制机制,让memcached具备了事务恢复能力、持久化能力和分布式复制能力,非常适合于需要超高性能读写速度,但是 不需要严格事务约束,能够被持久化保存的应用场景,例如memcachedb被应用在新浪博客上面。转载 2013-01-08 15:19:00 · 351 阅读 · 0 评论 -
nginx basic command
1. start/usr/local/nginx/sbin/nginx2.stop/usr/local/nginx/sbin/nginx -s stop2.restart/usr/local/nginx/sbin/nginx -s reload3.server block ,like apache vhost The HTTP-block, the serv原创 2013-01-08 23:19:28 · 235 阅读 · 0 评论 -
OpenWebSpider 爬虫建索引并检索
1 OpenWebSpider 安装,放到apache目录里,导入sql语句建表,用了两个db,然后建个vhost ,hosts加上127.0.0.1 openwebspider.local2.抓取baidu等网站信息 OpenWebSpiderCS.exe -i www.music.baidu.com --images --mp33 .访问http://openweb原创 2013-01-06 12:25:39 · 2646 阅读 · 0 评论