日常记录

apache重启:

/usr/local/apache/bin/httpd restart 重启
/usr/local/apache/bin/httpd -k start 启动
/usr/local/apache/bin/httpd stop 停止

///usr/local/apache2/bin/apachectl -k restart
///usr/local/apache2/bin/apachectl stop
///usr/local/apache2/bin/apachectl start

 

查看C++动态库中符号:

strings /usr/lib64/libstdc++.so.6|grep "GLIBC"

 

开启core权限:

ulimit -c unlimited

 

查看rpm文件
rpm -qpi xxx.rpm
rpm -qpl xxx.rpm

 

去掉文件中空行:
cat pinMoreWid3.txt |awk '!/^$/'
cat pinMoreWid3.txt |grep -v ^$
cat pinMoreWid3.txt |sed /^\s*$/d|sort|uniq
cat pinMoreWid3.txt |sed '/^$/d'

去掉空格:
cat test.txt | awk 'gsub(/^ *| *$/,"")'>>test1.txt

// 去空格去空行
cat pinMoreWid3*.txt |grep -v ^$|awk 'gsub(/^ *| *$/,"")'|sort|uniq

 

mysql去重排序sql例子:

select
 fdate_cd,
 count(case when fclient_agent =1001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_wpv,
 count(distinct case when fclient_agent =1001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_wuv,
 count(case when fclient_agent =2001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_spv,
 count(distinct case when fclient_agent =2001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_suv,
 count(case when fclient_agent =4001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_cpv,
 count(distinct case when fclient_agent =4001 and fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_cuv,
 count(case when fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_cpv,
 count(distinct case when fcurrent_url like '%wei.jd.com/shopv2/%' and frefer_url like '%mm.wanggou.com/item/jd.shtml%' then fvisit_key else null end) as item_cuv
 
from ecc_paipai_basic::daily_raw_paipai_wireless_pv where fdate_cd=20140903 group by fdate_cd

 

修改表操作:

ALTER TABLE t_compare_task MODIFY COLUMN uin bigint
 
 create table t_compare_nca(nca_id int,nva_name varchar(128),primary key(nca_id)); 
 alter table t_compare_task add ncaID int default 0 ,add nca_name varchar(128); 
 
 alter table yourtable add id int unsigned not Null auto_increment primary key

 

增加删除主键:
alter table t_compare_info_ex add primary key(uin);
alter table t_compare_info_ex drop primary key;

// 修改字段名
alter table tablename change old new char(10) not null;

 

Nginx命令:

nginx.conf
/usr/sbin/nginx -c /etc/nginx/nginx.conf -t // 检测配置文件

重启
nginx -s reload

查看端口号占用:

lsof -i :80

查看core目录:
cat /proc/sys/kernel/core_pattern

/sbin/sysctl kernel.core_pattern


 修改core dump文件路径:
 方法1:临时修改:修改/proc/sys/kernel/core_pattern文件,但/proc目录本身是动态加载的,每次系统重启都会重新加载,因此这种方法只能作为临时修改。
 /proc/sys/kernel/core_pattern
 例:echo ‘/var/log/%e.core.%p’ > /proc/sys/kernel/core_pattern
 
方法2:永久修改:使用sysctl -w name=value命令。
 例:/sbin/sysctl -w kernel.core_pattern=/var/log/%e.core.%p
 
为了更详尽的记录core dump当时的系统状态,可通过以下参数来丰富core文件的命名:
 %% 单个%字符
 %p 所dump进程的进程ID
 %u 所dump进程的实际用户ID
 %g 所dump进程的实际组ID
 %s 导致本次core dump的信号
 %t core dump的时间 (由1970年1月1日计起的秒数)
 %h 主机名
 %e 程序文件名

linux抓包:
/usr/sbin/tcpdump  -i any port 10888 -X -s0
tcpdump -iany tcp -s0 port 443 -c1000 -w a.pacp
IDC
sudo /usr/sbin/tcpdump  -i any port 10888 -X -s0

tcpdump -iany -s0 host  192.168.153.106 -c1000 -w b.pcap

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值