随笔分类 -  shell

摘要:0. 性能分析之一个简单 Java 线程 dump 分析示例 - 掘金 (juejin.cn) 1.top -c 2.查看具体线程 ps -m -p 30997 -o tid,%cpu,%mem > threads.log 3.printf %x 31865 其次将需要的线程ID转换为16进制格式: 阅读全文
posted @ 2019-01-17 16:35 littlevigra 阅读(257) 评论(2) 推荐(0) 编辑
摘要:p12转keystorekeytool -v -importkeystore -srckeystore temp.p12 -srcstoretype PKCS12 -destkeystore temp.keystore -deststoretype JKSpem转p12openssl pkcs12  阅读全文
posted @ 2019-01-04 18:26 littlevigra 阅读(171) 评论(0) 推荐(0) 编辑
摘要:1.多行注释: 1. 首先按esc进入命令行模式下,按下Ctrl + v,进入列(也叫区块)模式; 2. 在行首使用上下键选择需要注释的多行; 3. 按下键盘(大写)“I”键,进入插入模式; 4. 然后输入注释符(“//”、“#”等); 5. 最后按下“Esc”键。注:在按下esc键后,会稍等一会才 阅读全文
posted @ 2018-12-27 16:02 littlevigra 阅读(218) 评论(0) 推荐(0) 编辑
摘要:JAVA_HOME=/usr/local/java/jdk1.8.0_181 PATH=$JAVA_HOME/bin:$PATH JAVA_BINDIR=/usr/local/java/jdk1.8.0_181/binJRE_HOME=/usr/local/java/jdk1.8.0_181/jre 阅读全文
posted @ 2018-12-24 15:35 littlevigra 阅读(213) 评论(1) 推荐(0) 编辑
摘要:更换apt-get官方源为163源 1.# mv /etc/apt/sources.list /etc/apt/sources.list.bak 2.覆盖原来源文件 tee /etc/apt/sources.list <<-'EOF'deb http://mirrors.163.com/debian 阅读全文
posted @ 2018-12-16 17:26 littlevigra 阅读(2300) 评论(0) 推荐(0) 编辑
摘要:1.云主机被拿去挖矿,cpu暴涨,tcp连接突增 2.现象:top -c 3.然后我再查看pstree进程树 4.查找文件来源 ind / -name '*suppoie*' 5. 然后删除 suppoie , supsplk,config.json 文件 然后过了一会suppoie进程又起来了,那 阅读全文
posted @ 2018-11-15 11:45 littlevigra 阅读(1013) 评论(4) 推荐(0) 编辑
摘要:1.监控虚拟机跟外部的tcp连接,如果连接数超过阈值,就在FORWARD把ip DROP ,并且发送邮件 root@InternetGateway:~# cat /root/scripts/check_conntrack.sh#!/bin/bashscript_home=`dirname $0`sc 阅读全文
posted @ 2018-11-15 11:36 littlevigra 阅读(422) 评论(0) 推荐(0) 编辑
摘要:1.215 R(172.16.0.1) < gw(61.146.164.109) | | | | (不能上网) 1.215 < 6.46 (被109访问的虚拟机) (可以上网) /usr/sbin/route add -host 61.146.164.109 gw 172.16.0.1 有两块网卡i 阅读全文
posted @ 2018-11-07 15:06 littlevigra 阅读(4458) 评论(2) 推荐(0) 编辑
摘要:1.如果不关闭swap,就会在kubeadm初始化Kubernetes的时候报错,如下图: $ ansible -i inventory/inventory.cfg all -a "swapoff -a"$ ansible -i inventory/inventory.cfg all -a "sud 阅读全文
posted @ 2018-11-01 11:18 littlevigra 阅读(8997) 评论(0) 推荐(0) 编辑
摘要:[clouder@server10-13 onecloud]$ cat test_push.sh #!/bin/bash#to test the connectity to gateway.push.apple.com 2195#test 10 time if > 5 ,critical;if >1 阅读全文
posted @ 2018-10-31 19:45 littlevigra 阅读(398) 评论(0) 推荐(0) 编辑
摘要:其中:id_rsa为私钥文件,id_rsa.pub为公钥文件 ssh-copy-id -i ~/.ssh/id_rsa.pub "-p 2122 root@IP " 我的:ssh-copy-id "-p 10173 clouder@62.136.164.130" rsync 同步远程机器的文件到本地 阅读全文
posted @ 2018-10-17 12:03 littlevigra 阅读(639) 评论(3) 推荐(0) 编辑
摘要:1. ansible 10.0.0.1 -m raw -a "date" -u www 2.在ansible的主机配置文件中指定ssh_uservi/etc/ansible/hosts10.0.0.1 ansible_ssh_user=www 3.特殊符号- 用shell模块 ansible tes 阅读全文
posted @ 2018-10-05 15:44 littlevigra 阅读(7245) 评论(0) 推荐(0) 编辑
摘要:(二) Grep AND 操作 1. 使用 -E 'pattern1.*pattern2' grep命令本身不提供AND功能。但是,使用 -E 选项可以实现AND操作。 grep -E 'pattern1.*pattern2' filename grep -E 'pattern1.*pattern2 阅读全文
posted @ 2018-08-24 17:25 littlevigra 阅读(8272) 评论(0) 推荐(0) 编辑
摘要:sudo -E -u clouder /home/clouder/vs/program/chatserver/bin/startup.sh -E 加载用户环境变量 阅读全文
posted @ 2018-08-20 16:57 littlevigra 阅读(541) 评论(0) 推荐(0) 编辑
摘要:sleep 1|telnet 127.0.0.1 223 nmap 127.0.0.1 -p 223 -PN (对禁ping IP) iftop -P -n -B -B 按字节显示 -N 切换 端口或者服务 右下方显示的时间:过去2秒,10秒,40秒的数据 一般重点关注本地服务端口,这有利于查找对应 阅读全文
posted @ 2018-07-13 12:01 littlevigra 阅读(605) 评论(0) 推荐(0) 编辑
摘要:[root@python ~]# cat testcount.txt a 1.1.1.1b 2.2.2.2c 3.3.3.3a 1.1.1.1d 4.4.4.4e 5.5.5.5f 6.6.6.6 1.去重: awk '!a[$1]++ {print}' testcount.txt a 1.1.1. 阅读全文
posted @ 2018-06-13 15:44 littlevigra 阅读(503) 评论(6) 推荐(0) 编辑
摘要:linux神器strace - youxin - 博客园https://www.cnblogs.com/youxin/p/8837771.html 某个进程突然占用了很多CPU? 或者某个进程看起来像hanging了? 找到对应的pid,然后 hang: [cpp] view plain copy 阅读全文
posted @ 2018-06-06 00:26 littlevigra 阅读(243) 评论(4) 推荐(0) 编辑
摘要:1.rsync -avz 172.16.2.61:~/vs/program/elasticsearch-5.0.0 --exclude=elasticsearch-5.0.0/data/* ./ 从其他节点的机器拷贝elasticsearch目录并忽略data目录 2、备份后直接压缩写入磁盘 备份m 阅读全文
posted @ 2018-05-23 15:10 littlevigra 阅读(160) 评论(2) 推荐(0) 编辑
摘要:让内网机器访问不通机房的机器,架构如下 (172.16.10.5) (172.17.9.109 可以出外网,开启路由转发) (内网 192.168.36.19 能ping 同9.109,但不能ping 通10.5) SNAT: iptables -t nat -I POSTROUTING -d 17 阅读全文
posted @ 2018-05-18 12:20 littlevigra 阅读(186) 评论(1) 推荐(0) 编辑
摘要:chmod +x /etc/rc.d/rc.localsystemctl enable rc-local.service Note: rc.local is obsolete. OR append commands to /etc/bashrc https://blog.csdn.net/ztgua 阅读全文
posted @ 2018-05-15 10:07 littlevigra 阅读(150) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示