Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
labs
dns-collector
Commits
80b4b320
Commit
80b4b320
authored
Feb 03, 2018
by
Tomas Gavenciak
Browse files
Add simple CBOR-stream debugging utility
parent
bfa50b0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
dump_cbor_stream.py
0 → 100755
View file @
80b4b320
#!/usr/bin/env python3
"""
A simple debug utility to print all the CBOR-encoded items from the
standard input. Does not handle compression -- if your data is
compressed, use e.g. as:
cat data.cbor.gz | gzip -d | ./dump_cbor_stream.py
"""
import
sys
import
cbor
while
True
:
try
:
d
=
cbor
.
load
(
sys
.
stdin
.
buffer
)
except
EOFError
:
break
try
:
print
(
d
)
except
BrokenPipeError
:
break
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment