This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ooni)~ooni - [evilmerge●] » ./bin/ooniprobe nettests/blocking/http_body_length.py -u http://google.com | |
INFO:ooniprobe:Log opened. | |
INFO:ooniprobe:No test deck detected | |
DEBUG:ooniprobe:processing options | |
DEBUG:ooniprobe:Running [(<class 'http_body_length.HTTPBodyLength'>, 'test_get')] | |
DEBUG:ooniprobe:Options {'inputs': [None], 'version': '0.1', 'name': 'HTTP Body length test'} | |
DEBUG:ooniprobe:cmd_line_options {'pcapfile': None, 'help': 0, 'subargs': ('-u', 'http://google.com'), 'resume': 0, 'test': 'nettests/blocking/http_body_length.py', 'logfile': None, 'collector': None, 'reportfile': None} | |
DEBUG:ooniprobe:Creating report_http_body_length_29_November_2012_10-09-28.yamloo | |
DEBUG:ooniprobe:Writing report with YAML reporter | |
INFO:ooniprobe:Reporting to file report_http_body_length_29_November_2012_10-09-28.yamloo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the configuration file for OONIProbe | |
# This file follows the YAML markup format: http://yaml.org/spec/1.2/spec.html | |
# Keep in mind that indentation matters. | |
basic: | |
# Where OONIProbe should be writing it's log file | |
logfile: ooniprobe.log | |
privacy: | |
# Should we include the IP address of the probe in the report? | |
includeip: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsley | |
does_not_work = """foo = :x ?(x == '\x00') -> x""" | |
works = """foo = :x ?(x == '\x01') -> x""" | |
try: | |
parsley.makeGrammar(does_not_work, {}) | |
except TypeError, e: | |
print e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsley | |
does_not_work = """foo = :x ?(x == '\x00') -> x""" | |
works = """foo = :x ?(x == '\x01') -> x""" | |
try: | |
parsley.makeGrammar(does_not_work, {}) | |
except TypeError, e: | |
print e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(foo): | |
return foo | |
example = """ | |
foo = f('spam') | |
""" | |
g = parsley.makeGrammar(example, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsley | |
works = """ | |
bar = token('\x01') -> 'spam' | |
| token('\x02') -> 'eggs' | |
""" | |
not_works = """ | |
bar = token('\x00') -> 'foo' | |
| token('\x01') -> 'spam' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsley | |
grammar = """ | |
byte = anything:b | |
-> ord(b) | |
data = byte:len <byte{len}> | |
""" | |
x = parsley.makeGrammar(grammar, {}) | |
print x("\x09ninechars").data() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet import defer | |
from unittest import TestCase | |
from globaleaks.models.base import TXModel | |
class DummyModel(TXModel): | |
some_attribute = 'fooo' | |
other_attribute = 'bar' | |
def get_something_else(self): | |
return {'antanisblinda': 12345} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example of how to parse ooniprobe reports | |
import yaml | |
import sys | |
import os | |
import shutil | |
from glob import glob | |
from tempfile import mkstemp | |
import pygeoip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
class BaseTask(object): | |
def __init__(self): | |
self.running = False | |
self.failures = 0 | |
def _failed(self, failure): | |
self.failures += 1 | |
self.failed(failure) |