ITeye博客

Get my world,break free!

raojl · 共 185 篇文章

SSH sessions terminate abruptly with message: Corrupted MAC on input. Disconnect

http://serverfault.com/questions/338439/ssh-sessions-terminate-abruptly-with-mes On-the wire level errors should be eliminated by the Ethernet and TCP checksums. It is possible that corrupted Ethernet frame / IP packet could slip now and then up to the higher levels of the networking stack, but it …

2014-09-23 20:11 · 评论(0)

服务端口快扫shell

#set -x var_start=8000 array=() index=0 while [ 1 ] do array=$(curl -s "http://*.*.*.*:8080/disk_info/storeunit_ip") for ip in ${array[@]} do result=$(sudo nmap -sS -P0 -n -p8001-8036 $ip | grep open| wc -l | grep -v ssh | grep -v Failed |sed 's/\r//'); if [ "$result" = "0" ] ; then echo curl curl …

2014-08-25 11:50 · 代码 · linux笔记 · 评论(0)

reset 报文

转自:http://www.vants.org/?post=22 TCP异常终止的常见情形 我们在实际的工作环境中,导致某一方发送reset报文的情形主要有以下几种: 1,客户端尝试与服务器未对外提供服务的端口建立TCP连接,服务器将会直接向客户端发送reset报文。 2,客户端和服务器的某一方在交互的过程中发生异常(如程序崩溃等),该方系统将向对端发送TCP reset报文,告之对方释放相关的TCP连接,如下图所示: 3,接收端收到TCP报文,但是发现该TCP的报文,并不在其已建立的TCP连接列表内,则其直接向对端发送reset报文,如下图所示: 4,在交互的双方中的某一方长期未收到来自对…

2014-08-20 14:11 · 原理笔记 · 评论(0)

任务调度分配原理

1、rand 2、round-robin 3、hash 4、weight

2014-08-06 23:22 · 原理笔记 · 评论(0)

构建epoll网络库设计

--------------------------------------我们需要一些组件--------------------------- 1、EpollEventPoller-- 实现Poll、 add 、set 、clear 原语 2、线程---Transport ---实现pollLoop、timeoutLoop 3、context ( listenContext 、ConnectionConext)--send queue! 4、EventHandler --实现in 、out、 timeout 、close 、connected等

2014-07-29 12:20 · 原理笔记 · 评论(0)

远程批量部署

#!/usr/bin/expect -- if { [llength $argv] != 2} { puts "usage: $argv0 ip \"command \[params\]\"" exit 1 } set maxRetry 1 for {set retryNum 0} {$retryNum<$maxRetry} {incr retryNum} { spawn /usr/bin/ssh [lindex $argv 0] [lindex $argv 1] set timeout 60 expect { "yes/no)?" { send "yes\r" expect eof bre…

2014-07-29 11:50 · 代码 · 评论(0)

版本写入服务程序

SvnRevision.h: @if [ -d .svn ]; then \ ( \ echo "//////////////////////////////////////////////////////////////////////////////"; \ echo "//"; \ echo "//////////////////////////////////////////////////////////////////////////////"; \ echo ""; \ echo "#ifndef _SVN_REVISION_H_"; \ echo "#define _SVN_…

2014-07-28 15:08 · 版本管理 · 评论(0)

运维监控产品

1、数据采集、分析(坏盘、服务质量、处理与响应) 2、报警收敛:系统(网络、内存、磁盘、宕机),应用(异常日志), 一级展示、二级邮件汇聚、三级短信、四级电话。 3、通讯录、值班通告、简易FAQ知识库 4、report (定时简报、日报)、人工周汇报 ======================================= 解决什么问题,从简!

2014-07-24 21:03 · 评论(0)

获取硬盘和网卡流量

#include <sys/vfs.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <string> #include <assert.h> using std::string; string DiskCapacity(const string &path) { assert(path.size() > 0); char disk_capacity[128]; struct statfs st; int ret = statfs(path.c_str(), &s…

2014-07-24 17:04 · 评论(0)

架构与产品

1、可适配用户需求的分层分块架构 2、找到核心用户是最大的痛点

2014-05-30 14:21 · 生活 · 评论(1)

linux 下建立异步链接

int32_t SockEndPoint::connect_server() { struct sockaddr_in client_addr; int sock_ret = 0; bzero(&client_addr, sizeof(client_addr) ); client_addr.sin_family = AF_INET; client_addr.sin_addr.s_addr = htons(INADDR_ANY); client_addr.sin_port = htons(0); client_socket_ = socket( AF_INET, SOCK_STREAM, 0)…

2014-05-07 11:59 · 代码 · 评论(0)

atomic笔记

inline void ice_atomic_set(ice_atomic_t* v, int i) { v->counter = i; } /* * ice_atomic_inc - increment ice_atomic variable * @v: pointer of type ice_atomic_t * * Atomically increments @v by 1. Note that the guaranteed useful * range of an ice_atomic_t is only 24 bits. * * Inlined because this opera…

2013-12-11 11:43 · 代码 · 评论(0)

北京租房心得总结

1、房间窗户最好坐北朝南、东南,不要租10~13扬灰层,家具不要太多,床、衣柜、一椅即可。 注意公共设备,洗澡、洗衣服等设备,如果已经有人住进去了就最好了,毕竟他们可能 已经帮你扫清了大部分问题。 2、租房交定金,100~200元最佳,最好留业务员名片,留存收据拍照,确认联系方式无误,或者跟随去门店。 3、签订合同时,最好要求查阅业主产权证,并在门店或总店完成合同签订,交房租。 4、按期交房租且一定要按期交房租。不要相信所谓可以晚点交也可以,到时候会产生很多滞纳金,财务和业务是分开的。 5、交接房屋时,记得拍照燃气表、水表、房间等。留存最后一次水和燃气费用单据! 6、选择正点上班去中介公司谈…

2013-10-09 18:14 · 生活 · 租房 · 评论(0)

呼叫中心数据分析

1、按地区分类、日报、月报、年报 满意量、话务量、成单量 2、按节点分类、日报、月报、年报 话务量、成单量、通话时长 3、按班组分类、日报、月报、年报 满意量、话务量、成单量、通话时长 4、按技能分类、日报、月报、年报 满意量、话务量、成单量、排队量、服务效率、通话时长 5、按接入客户分类、日报、月报、年报 话务量、成单量、通话时长 6、按坐席分类、日报、月报、年报 通话时长、非班时、在线工作等

2013-08-17 13:15 · 头脑风暴 · 评论(0)

求最大公共子串

#include <stdio.h> #include <stdlib.h> #include <string> using namespace std; struct stringtag { string value; int tag; }; int stringcompare(const void* A,const void* B) { struct stringtag* AA = (struct stringtag*)A; struct stringtag* BB = (struct stringtag*)B; return (*AA).value.compare( (*BB).val…

2013-07-15 11:21 · 代码 · 评论(0)