• Linux 三剑客 at January 25, 2019
    awk '/ 404 | 500 /' /tmp/nginx.log | awk '{print $7}' | sort -nr | uniq -c| sort -nr | head -5


  • 老师 装到这里就卡在这里了

  • grep -B 10 "500 " /tmp/nginx.log

  • cat /tmp/nginx.log | grep -o "404|500"

  • 加油&共勉

  • 老师 可以提供python代码吗?

  • appium :app 无非启动 at January 12, 2019

    有遇到过同样问题的同学吗?请指点一下的

  • 1、测试用例:

    from xpinyin import Pinyin
    import pytest

    p = Pinyin()


    @pytest.mark.parametrize("x,y", [

    (p.get_pinyin(u"上海", tone_marks='marks'), 'shàng-hǎi'),
    (p.get_pinyin(u"啊", tone_marks='marks'), 'a'),
    (p.get_pinyin(u"a", tone_marks='marks'), 'a'),
    (p.get_pinyin(u"aa", tone_marks='marks'), 'aa'),
    (p.get_pinyin(u"上海", tone_marks='numbers'), 'shang4-hai3'),
    (p.get_pinyin(u"上海", tone_marks='aa'), 'shang4-hai3'),
    (p.get_pinyin(u'上海'), "shang-hai"),
    (p.get_pinyin(u'上海', convert='capitalize'), "Shang-Hai"),
    (p.get_pinyin(u'上海', convert='upper'), "SHANG-HAI"),
    (p.get_pinyin(u'上海'), "shang hai"),
    (p.get_pinyin(u'上海'), "shanghai"),

    (p.get_initial(u'你'), "N"),
    (p.get_initial(u'x'), "x"),
    (p.get_initials(u'你好'), "N-H"),
    (p.get_initials(u'你好a'), "N-H-a"),

    (p.get_initials(u"上海"), 'S-H'),
    (p.get_initials(u"上海", u' '), 'S H')

    ])
    def test_xpinyin(x, y):
    assert x == y

    2、执行命令

    pytest --cov=src/xpinyin/ --cov-report=html

    3、测试结果

  • 迷茫->动荡->报班学习,打算花半年的时间,再拼一把

  • 第一题:

    netstat -ant | awk '{print $6}'|sed 1,2d|sort|uniq|sort

    第二题:

    精华帖的回复数:
    curl -s https://testerhome.com/topics/excellent |grep "reply"|awk -F ">" '{print $2}'|awk -F "<" '{print $1}'|sed 1,2d
    回复的点赞数:
    curl -s https://testerhome.com/topics/17292 |grep 'data-type="Reply"'|awk -F "<span>" '{print $2}'|awk -F "<" 'BEGIN{count=0}{zan[count]=$1;count++}END{for(i=0;i<NR;i++)print i,zan[i]}''