上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 55 下一页
摘要: Linux find运行机制详解 - 骏马金龙 - 博客园 (cnblogs.com) find与sed结合 find . -type f -exec sed -i "s/std=c++11/std=c++14/g" {} \; 删除特殊文件 ll -i # 查找inode find . -inum 阅读全文
posted @ 2020-09-27 11:42 ascertain 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 网络环境 ME设备作为LAC,其它厂商设备作为LNS。隧道参数由RADIUS服务器下发,用户设备首先发起PPPOE拨号,验证成功后LAC开始与LNS尝试建立隧道。 图1 LNS设备处理速度慢导致L2TP隧道无法建立组网图 配置完成后,用户反馈L2TP业务不通。执行命令display l2tp tun 阅读全文
posted @ 2020-09-27 10:34 ascertain 阅读(1208) 评论(0) 推荐(0) 编辑
摘要: ps: ps在默认情况下,仅会列出与目前所在的bash shell有关的PID 排序 ps aux --sort=-pcpu # pcpu降序排列ps aux --sort=+pmem # pmem升序排列 定制显示选项 ps -e -o pid,user,pcpu,pmem,rss ps ax - 阅读全文
posted @ 2020-09-26 21:44 ascertain 阅读(192) 评论(0) 推荐(0) 编辑
摘要: log='''10.1.1.95 - e800 [18/Mar/2005:12:21:42 +0800] \ "GET /stats/awstats.pl?config=e800 HTTP/1.1" 200 899 "http://10.1.1.1/pv/" \ "Mozilla/4.0 (comp 阅读全文
posted @ 2020-09-26 15:22 ascertain 阅读(137) 评论(0) 推荐(0) 编辑
摘要: What is the difference between java and javaw? That's because Windows has this annoying habit of starting an actual Terminal (which should not even be 阅读全文
posted @ 2020-09-26 13:44 ascertain 阅读(385) 评论(0) 推荐(0) 编辑
摘要: from collections import defaultdict import re d=defaultdict(lambda :0) with open(r'e:/bb.txt',mode='rt+',encoding='utf8') as f: for line in f: for sub 阅读全文
posted @ 2020-09-25 23:48 ascertain 阅读(191) 评论(0) 推荐(0) 编辑
摘要: bash有三种输入重定向 < : 用于文件 << : here-documents <<< : here-strings here-documents: 语法格式: command <<[-]MARKER Here Document MARKER 这个操作符指示bash从标准输入读取输入内容,知道读 阅读全文
posted @ 2020-09-25 18:44 ascertain 阅读(444) 评论(0) 推荐(0) 编辑
摘要: $# 传递到脚本的参数个数 $$ 脚本运行的当前进程PID $! 最后一个运行的后台进程PID $- 当前Shell选项 #!/bin/sh echo "Num of arguments: $#" echo "Current PID: $$" echo "The last deforegroud P 阅读全文
posted @ 2020-09-24 19:34 ascertain 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 访问api查询数据,返回的json中有中文,利用json.tool格式化,发现中文以'\u4e09'这种Unicode编码显示 查找json的tool模块 find / -iname tool.py json.dump方法增加参数,即让json.tool模块不强行保证json的内容都转为ASCII编 阅读全文
posted @ 2020-09-24 16:25 ascertain 阅读(1088) 评论(0) 推荐(0) 编辑
摘要: 引用数组中所有元素时${arr[*]}和${arr[@]}是有细微区别的 Example: #!/bin/sh function showarr(){ arr=$1 for b in ${arr[*]};do echo $b done return 0 } regions=('aa pp' 'bb' 阅读全文
posted @ 2020-09-24 14:43 ascertain 阅读(3636) 评论(0) 推荐(0) 编辑
摘要: Example: 电信IP:1.1.1.2 Gateway:1.1.1.1 联通IP:2.2.2.2 Gateway:2.2.2.1 移动IP:3.3.3.2 Gateway:3.3.3.1 配置路由表字段 vim /etc/iproute2/rt_tables # # reserved value 阅读全文
posted @ 2020-09-23 20:35 ascertain 阅读(718) 评论(0) 推荐(0) 编辑
摘要: Linux 中"-"有特殊的含义,比如在命令的后面加"-"表示后面跟的是选项。但是如何新建带名字中有"-",下面介绍三种方法,比如要新建 文件 "-a": 1、cd .>-a 2、vi -- -a 3、echo"">-a 上面三种方法都可以在当前目录下新建一个"-a" 文件 ,当然还可以有别的方法新 阅读全文
posted @ 2020-09-23 20:13 ascertain 阅读(4777) 评论(0) 推荐(0) 编辑
摘要: 使用dd命令截取/dev/urandom dd if=/dev/urandom bs=1 count=20 2>/dev/null|base64|rev|cut --bytes 3-|rev 生成10个小写字母 < /dev/urandom tr -dc [a-z] | head --bytes 1 阅读全文
posted @ 2020-09-23 14:05 ascertain 阅读(826) 评论(0) 推荐(0) 编辑
摘要: tcp.port==8080 and ip.dst==172.16.1.1 and ip.src==172.16.1.2 阅读全文
posted @ 2020-09-23 11:45 ascertain 阅读(299) 评论(0) 推荐(0) 编辑
摘要: systemd提供自己的日志文件系统(logging system),成为journal,使用systemd日志,无需额外安装日志服务(rsyslog) 配置文件/etc/systemd/journald.conf 默认情况下(当Storage=auto,配置文件/etc/systemd/journ 阅读全文
posted @ 2020-09-22 20:23 ascertain 阅读(880) 评论(0) 推荐(0) 编辑
摘要: C语言中我们经常使用DEBUG宏来控制是否输出调试信息,在shell脚本中,同样可以使用相同机制 if [[ "$DEBUG" == true ]];then echo 'DEBUGGING' fi 这样的代码块称之为 "调试钩子" 或 "调试块",在调试钩子内部可以输出调试信息,使用调试钩子的好处 阅读全文
posted @ 2020-09-22 18:27 ascertain 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 判断变量是否相等,最好使用 != == ,而 -ne -eq -gt -lt -ge -le 适用于int类型比较 int和float使用-ne发生错误 int和float使用 != 没有问题当变量不存在时的情况 [ ]进行判断时,报错 替换成 != 和 == 正确[[ ]]的情况: 没有报错,但是 阅读全文
posted @ 2020-09-22 17:33 ascertain 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 服务器有公网IP开启ssh,需要做防暴力破解,pam中有个模块可以帮助我们限定用户登录的失败次数,达到指定阈值,锁定用户 一:ssh远程登录限制 在/etc/pam.d/sshd文件中添加配置 auth required pam_tally2.so deny=3 unlock_time=3600 e 阅读全文
posted @ 2020-09-22 16:27 ascertain 阅读(10102) 评论(1) 推荐(1) 编辑
摘要: cut Usage: cut OPTION [FILE] Print selected parts of lines from each FILE to standard output -b --bytes=LIST 以字节为单位进行分割。这些字节位置将忽略多字节字符边界,除非也指定了 -n 标志。 阅读全文
posted @ 2020-09-22 15:41 ascertain 阅读(166) 评论(0) 推荐(0) 编辑
摘要: fore-end 分发器: #!/bin/env bash host=$1 interval=$2 project=$3 echo $host echo $interval for b in `IFS=$',';echo $project`;do echo $b #echo "$IFS"|xxd - 阅读全文
posted @ 2020-09-22 15:07 ascertain 阅读(479) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 55 下一页