我一直在尝试根据数据包长度过滤tcpdump输出.但我没有运气.
这是命令的简单输出;
tcpdump -n -i eth0 dst port 443 -A
17:03:30.866890 IP 192.168.0.149.45104 > 62.75.148.60.443: Flags [S], seq 2685064927, win 14600, options [mss 1460,sackOK,TS val 7028787 ecr 0,nop,wscale 4], length 0
E..<..@.@.......>K.<.0...
........9............
.k@3........
17:03:30.867658 IP 192.168.0.149.45104 > 62.75.148.60.443: Flags [.], ack 2285019097, win 913, options [nop,nop,TS val 7028787 ecr 974439509], length 0
E..4..@.@.......>K.<.0...
...2.............
.k@3:..U
17:03:30.867928 IP 192.168.0.149.45104 > 62.75.148.60.443: Flags [P.], seq 0:171, ack 1, win 913, options [nop,nop,TS val 7028787 ecr 974439509], length 171
E.....@.@..f....>K.<.0...
...2.............
.k@3:..U...........Opw2.....l..".T.7.q.]h..8W..%.....H... …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个使用python的多处理模块的脚本.脚本(让我们称之为myscript.py)将从另一个带有管道的脚本获取输入.
假设我像这样调用脚本;
$ python writer.py | python myscript.py
Run Code Online (Sandbox Code Playgroud)
这是代码;
// writer.py
import time, sys
def main():
while True:
print "test"
sys.stdout.flush()
time.sleep(1)
main()
//myscript.py
def get_input():
while True:
text = sys.stdin.readline()
print "hello " + text
time.sleep(3)
if __name__ == '__main__':
p1 = Process(target=get_input, args=())
p1.start()
Run Code Online (Sandbox Code Playgroud)
这显然不起作用,因为sys.stdin对象对于主进程和p1是不同的.所以我试过这个解决它,
//myscript.py
def get_input(temp):
while True:
text = temp.readline()
print "hello " + text
time.sleep(3)
if __name__ == '__main__':
p1 = Process(target=get_input, args=(sys.stdin,))
p1.start()
Run Code Online (Sandbox Code Playgroud)
但我遇到了这个错误;
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", …Run Code Online (Sandbox Code Playgroud) 我使用 AWS Amplify 创建 GraphQL API。在 DynamoDB 中,字段createdAt、updatedAt 和owner 是自动创建的。我无法开箱即用地获取该字段的值。现在,当我将这些字段添加到带注释的架构中时,我将能够获取这些值,但具有写入权限的每个人都可以覆盖它们,这对于时间字段来说很烦人,并且对于所有者字段来说存在安全风险。
那么我如何获得这些值呢?
这是一个 AWS-Amplify 特定问题。这不是关于如何使用通用 GraphQL 来做到这一点。它非常具体地介绍了如何使用 AWS-Amplify 的 API 模块及其(遗憾的是非常有限的)指令来执行此操作(https://aws-amplify.github.io/docs/js/api#using-graphql-transformers)。
我正在尝试在jinja模板引擎上解压缩多个变量.我怎样才能做到这一点?
我正在努力实现这样的目标;
{% for item1, item2, item3 in items %}
<div class="row">
<div class="four columns">
<img src="static{{ item1.pics.0 }}" class="picitem" alt=""/>
</div>
<div class="four columns">
<img src="static{{ item2.pics.0 }}" class="picitem" alt="" />
</div>
<div class="four columns">
<img src="static{{ item3.pics.0 }}" class="picitem" alt=""/>
</div>
</div>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
这显然不适用于给予;
ValueError: too many values to unpack
Run Code Online (Sandbox Code Playgroud)
任何想法,将不胜感激.
我一直试图在我的网页上用jQuery显示随机引用.但是这种while(true) { }方法并没有解决我的问题,但是当我稍微搜索一下时,我发现不建议这样做.
我有一个包含一些字符串的JavaScript数组.
var quotes = new Array();
quotes[0] = "string 1";
quotes[1] = "string 2";
quotes[2] = "string 3";
quotes[3] = "string 4";
Run Code Online (Sandbox Code Playgroud)
这段代码效果很好:
$(function() {
var random_quote = quotes[Math.floor(Math.random() * quotes.length)];
var $rand = $('div#randomQuote');
$rand.append(random_quote);
$rand.hide();
$rand.fadeIn("500");
});
Run Code Online (Sandbox Code Playgroud)
但是,我试图每隔15秒运行一次以更新报价.
正如我所说的,我尝试了一段时间的真循环和睡眠功能,但它没有用.
我怎样才能做到这一点?
python ×2
aws-amplify ×1
aws-appsync ×1
filtering ×1
graphql ×1
javascript ×1
jinja2 ×1
jquery ×1
loops ×1
stdin ×1
tcpdump ×1