
个人总结
文章平均质量分 64
拖拉机拖拉机
这个作者很懒,什么都没留下…
展开
-
TCP 算法总结
1.TCP Tahoe1.new ack: if (cwnd < sstresh) cwnd += 1 else cwnd += 1/cwnd2.timeout/3rd dup ack: retransmit all unacked ssthresh = cwnd/2cwnd = 1 jump to 1原创 2015-10-10 10:13:38 · 1551 阅读 · 0 评论 -
fail2ban 使用
1.安装简单,yum install fail2bin原创 2014-09-15 21:56:54 · 1253 阅读 · 0 评论 -
linux 各种后台运行
1. nohub sh run.sh &nohup 无疑是我们首先想到的办法。顾名思义,nohup 的用途就是让提交的命令忽略 hangup 信号2.sh run.sh原创 2014-09-16 13:38:48 · 719 阅读 · 0 评论 -
magent ---- memcached的代理
1.安装中的问题原创 2014-09-14 21:58:30 · 2148 阅读 · 0 评论 -
为KVM客户机添加virsh console支持
为KVM客户机添加virsh console支持在KVM中安装了一个RHEL6.1,启动virsh命令想通过console命令连接至客户机的终端,结果输入命令后终端卡在这个状态:virsh # console testConnected to domain testEscape character is ^]敲任何键都没反应,求助万能的Google。原来想通过console转载 2014-09-01 21:55:34 · 1043 阅读 · 0 评论 -
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.在linux下的虚拟机出现了这个问题,转载 2014-09-01 21:53:45 · 22197 阅读 · 2 评论 -
supervise程序进行程序管理监控
Supervise是daemontools的一个工具,可以用来监控管理unix下的应用程序运行情况,在应用程序出现异常时,supervise可以重新启动指定程序。1.anzhua原创 2014-09-14 21:27:09 · 6130 阅读 · 0 评论 -
memcached 相关
memcached 简单易用,但是坑也不少,考验使用者的能力。内部分享,讲了最近几年出现的一个memcached的坑,ting原创 2014-09-14 00:30:00 · 831 阅读 · 0 评论 -
strace example
rying to run a program but facing weird errors? Well, most of the Linux users might have faced this situation. Many of us either spend hours searching on internet about the problem or wait for days on转载 2014-09-22 18:16:00 · 839 阅读 · 0 评论 -
vim 快捷键
Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。和 Emacs 并列成为类 Unix 系统用户最喜欢的编辑器。这里收录了130+程序员必备的 vim 命令,帮助你提高开发效率。Basics:e filenameOpen filename for edition:wSave file转载 2014-08-27 10:13:19 · 912 阅读 · 0 评论 -
dup、dup2、fcntl
看了bier本节目标:1,文件共享打开文件内核数据结构一个进程两次打开同一个文件两个进程打开同一个文件2,复制文件描述符(dup、dup2、fcntl) 一,文件共享1,一个进程打开两个文件内核数据结构说明:文件描述符表:每个进程都有一张,彼此独立,每个文件描述符表项都指向一个文件表,文件描述符0(STDIN_FILE转载 2014-09-21 22:31:01 · 819 阅读 · 0 评论 -
awk 传递参数
今下午要写一个变态的数据统计脚本,yuong原创 2014-09-21 22:21:26 · 3969 阅读 · 0 评论 -
nginx lvs ha 对比
声明:yPS:Nginx/LVS/HAProxy是目前使用最广泛的三种负载均衡软件,本人都在多个项目中实施过,参考了一些资料,结合自己的一些使用经验,总结一下。一般对负载均衡的使用是随着网站规模的提升根据不同的阶段来使用不同的技术。具体的应用需求还得具体分析,如果是中小型的Web应用,比如日PV小于1000万,用Nginx就完全可以了;如果机器不少,可以用DNS轮询,LVS所耗费的转载 2014-09-09 10:46:50 · 4482 阅读 · 0 评论 -
kvm 复制
EXAMPLES Clone the guest called "demo" which has a single disk to copy # virt-clone \ --original demo \ --name newdemo \ --file /var/lib/xen转载 2014-08-13 20:58:32 · 1076 阅读 · 0 评论 -
Haproxy 配置片段记录
1.haproxy 介绍http://www.oschina.net/question/17_87852.haproxy配置实例原创 2014-09-08 18:18:14 · 6790 阅读 · 0 评论 -
运维工具整理
磁盘检测工具smartctl原创 2014-10-20 23:24:03 · 2627 阅读 · 0 评论 -
free 中的buffer 和 cached
微博上有人谈到free命令的每个输出的含义是什么?woka转载 2014-11-09 20:55:49 · 853 阅读 · 0 评论 -
python 线程的同步和互斥
先从一个简单的demo开始说起:原创 2014-11-10 13:33:20 · 9114 阅读 · 1 评论 -
Python 总结
1.如何实现自己的iter2.如何实现自己的range3.如何实现一个dict4.如何实现一个list5.如何实现类似ruby的open clas6.如何实现原创 2015-05-01 20:30:42 · 677 阅读 · 0 评论 -
zabbix mysql 迁移总结
之前的zabbix,item已经达到了27w,nvps达到了3.5K,高峰可以达到5K+,但是手里还有200台机器没有添加,还有若干个模板没有添加。面对如此情况,不得不对zabbix,做点啥了,zabbix的瓶颈在于mysql,首先的要点是mysql,我们的计划是mysql从sas迁移到ssd,顺便把主从同步,partition都做了。2015年4月27日下午决定做这件事,整体流程和大原创 2015-04-28 15:42:38 · 5550 阅读 · 5 评论 -
saltstack cheatsheet summary (key && compound matcher)
Salt key management Listing all Salt key registration requests1.salt-key -LAccepting all Salt key requests:1.salt-key -AAccepting a single Salt key request, where minion_id is the name of th原创 2015-04-18 23:44:52 · 889 阅读 · 0 评论 -
Python Built-in Functions
Difference Between __init__ and __call____init__ would be treated as Constructor where as __call__ methods can be called with objects any number of times. Both __init__ and __call__ functions do tak原创 2015-04-03 14:47:03 · 786 阅读 · 0 评论 -
python的cls,self,classmethod,staticmethod
python类里会出现这三个单词,self和cls都可以用别的单词代替,类的方法有三种,一是通过def定义的 普通的一般的,需要至少传递一个参数,一般用self,这样的方法必须通过一个类的实例去访问,类似于c++中通过对象去访问;二是在def前面加上@classmethod,这种类方法的一个特点就是可以通过类名去调用,但是也必须传递一个参数,一般用cls表示class,表示可以通过类直接调原创 2013-06-25 11:39:01 · 28797 阅读 · 0 评论 -
docker command cheatsheat
1.One liner to stop / remove all of Docker containers:docker stop $(docker ps -a -q)docker rm $(docker ps -a -q)原创 2015-03-01 19:24:18 · 667 阅读 · 0 评论 -
#glusterfs error
GlusterFS: {path} or a prefix of it is already part of a volumeStarting with GlusterFS 3.3, one change has been the check to see if a directory (or any of it's ancestors) is already part of a转载 2015-01-25 17:09:24 · 2824 阅读 · 0 评论 -
mysql 有可能的优化方式
mysql 优化1.版本的更换测试一般来说新版本要优于老版本,比如5.7vs5.52.分支版本的考虑MariaDB,percona server 等分支的考虑3.根据场景尝试不同的引擎tokudb,innodb等在不同场景下的尝试使用4.内存分配方式jemalloc,tcmalloc5.读写分离6.partition的使用7.分库分表8.针对不同的业原创 2015-01-15 10:59:21 · 707 阅读 · 0 评论 -
lua实现sleep
解决方案1.在一个死循环中设置一个跳出条件,但是这样的做法会占用大量CPU资源代码:[xluren@test time_sleep]$ cat demo.lua local old_time=os.time()function demo() new_time=os.time() while true do if new_time - o原创 2014-12-07 15:39:52 · 3933 阅读 · 0 评论 -
那些年,我踩过的坑,而后人绝不要再踩
1.(pyenv)xluren@xluren:~/python/project$ ../pyenv/bin/pip install flask Downloading/unpacking flask Cannot fetch index base URL https://pypi.python.org/si原创 2014-11-06 20:34:57 · 2802 阅读 · 1 评论 -
nmon 介绍和使用
nmon最早产生在IBM 用来分析AIX系统的性能和状态,后移植到了linux。1.安装: 1016 wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm 1017 ll 1018 yum install rpmforge-release-0.5.2-2.el原创 2014-11-29 18:03:43 · 1577 阅读 · 0 评论 -
Python time datetime 模块梳理
time是Python底层的模块,datetime是基于time的实现time相关的数据类型 float ,原创 2014-10-19 19:32:07 · 1057 阅读 · 0 评论 -
Python gevent vs thread vs sequence
Core Solo原创 2014-11-04 12:03:32 · 1553 阅读 · 0 评论 -
use bt to distribute file or software
download url:wget http://sourcecodes.afterdawn.com/download/547e42631a2a208d2804501c9d92a8fd/54637e2a/source_codes/BitTorrent-5.0.9.tar.gz原创 2014-11-12 23:51:54 · 748 阅读 · 0 评论 -
logrotate 做日志收集处理
logrotate是一个日志文件管理工具。用来把旧文件轮转、压缩、删除,并且创建新的日志文件。原创 2014-09-20 17:04:21 · 4532 阅读 · 0 评论 -
flask cache with memcache
一开始 flask的cache type是 simple,然后在生产环境 可不能这么用吧,然后开始研究用memcached,然后一直出错。出错的原因是 libmemcache原创 2014-08-07 17:12:04 · 4040 阅读 · 3 评论 -
unix时间互转
妈蛋的,老是忘,猪脑子,zaijiyici转载 2014-08-06 18:09:06 · 1024 阅读 · 0 评论 -
python中的类
类的私有属性:__private_attrs 两个下划线开头,声明该属性为私有,不能在类地外部被使用或直接访问在类内部的方法中使用时 self.__private_attrs类的方法在类地内部,使用def关键字可以为类定义一个方法,与一般函数定义不同,类方法必须包含参数self,且为第一个参数私有的类方法__private_method 两个下划线开头,声明该方法为私有方原创 2013-06-25 11:16:06 · 4006 阅读 · 0 评论 -
sqlalchemy的安装及学习使用
安装超级简单,只需要你的python版本在2.5以上即可。安装的代码是: wget http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py sudo easy_install sqlalchemy sudo easy_install ipythonsqlalchemy的作者Michael原创 2013-06-25 15:33:51 · 4141 阅读 · 0 评论 -
secureCRT下vim是下划线,不高亮问题
在~/.vimrc下已经开启高亮 syntax on但是在secureCRT始终显示下划线,不显示高亮,在putty下显示高亮解决方法: 使用vi打开/etc/profile添加 export TERM=xterm-color然后执行 source /etc/profileOK!原创 2013-06-25 11:04:09 · 6269 阅读 · 0 评论 -
git 创建远程分支
在使用github的时候,想建个分支select 存放添加了select功能的,但是在提交远程的时候总是出现错误,大体的错误有两大类第一类neusoft@neusoft-vm:~/http_server$ git push origin select:select error: The requested URL returned error: 403 while accessing原创 2013-06-06 19:54:13 · 4862 阅读 · 0 评论 -
“换行”和“回车”
声明:这边文章转自别人的博客 http://www.ruanyifeng.com/blog/2006/04/post_213.html 我看着真心的感觉太好了,所以就转载了下。作者: 阮一峰日期: 2006年4月30日今天,我总算搞清楚"回车"(carriage return)和"换行"(line feed)这两个概念的来历和区别了。在计算机还没有出现之前,转载 2013-05-28 20:15:01 · 1047 阅读 · 0 评论