`
splayx
  • 浏览: 82629 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

开发笔记

阅读更多

17、

__attribute__ ((packed))

取消对齐优化

 

16、

(time ./a.out 0 12) 2>&1 | awk '$1=="diff"{print $3} $1=="real"{split($2, x, "m");split(x[2], y, "s");print y[1]}' | awk '{a[++i]=$1}END{print a[1]/a[2]}' >> data0-12

cat data0-2 | awk '{sum+=$1}END{print sum/NR;print NR}'

 

15、

set noignorecase

set hlsearch

set noshowmatch

 

14、addr2line -e test1 400506

400506 是dmesg中的ip值

 

13、ps -o min_flt,maj_flt xxxx (xxxx是进程ID),查看大小缺页

 

12、crontab file时,file中的命令不用加user

 

11、client和server都在本地,端口(65535)有可能被很快占用完,例如短连qps很高,

当tcp_tw*qps > 65535时,将触发connection refused

 

10、扫描端口

nmap ip

 

9、列求和

cat * | awk 'BEGIN{total=0}{total+=$1}END{print total}'

 

8、远程执行命令,注意host和cat之间只能有一个空格,除非有双引号引起来。

ssh host cat /path/to/file 

 

7、查看子进程运行时间

ps -eo pid,user,comm,stime,etime | grep nginx  

 

6、查看TCP RECV-Q堆积

sudo netstat -nap | awk '{if ($2 > 0) print $0}' | grep tcp

 

5、valgrind使用

sudo valgrind --tool=memcheck --trace-children=yes ./nginx -c conf/nginx-proxy.conf.spdy

 

4、

sudo chown root:admin nginx

sudo chmod 4755 nginx

 

3、sudo -u admin -H

HOME environment variable to the homedir of the target user

 

2、sudo cat /proc/109387/environ 

查看某个进程继承的环境

 

1、man alarm man setitimer

内核不断向进程发中断,可以利用这个更新计时器

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics