Skip to content

Instantly share code, notes, and snippets.

View garrettr's full-sized avatar

Garrett Robinson garrettr

  • San Francisco, CA
View GitHub Profile
@garrettr
garrettr / gist:387a7f437610707db1d4
Created March 24, 2016 23:47
Building libu2f-host fails on Mac OS 10.10
$ make -f macosx.mk VERSION=0.0
rm -rf tmp && mkdir tmp && cd tmp && \
mkdir -p root/licenses && \
cp ../json-c-0.11.tar.gz . || \
curl -O -L https://s3.amazonaws.com/json-c_releases/releases/json-c-0.11.tar.gz && \
tar xfz json-c-0.11.tar.gz && \
cd json-c-0.11 && \
./configure --prefix=/Users/garrett/code/libu2f-host/tmp/root CFLAGS=-mmacosx-version-min=10.6 && \
make install check && \
cp COPYING /Users/garrett/code/libu2f-host/tmp/root/licenses/json-c.txt && \
@garrettr
garrettr / gist:355799fcfe9b0bd27381
Created January 27, 2016 16:55
vagrant up multimachine bug
$ vagrant status
Current machine states:
development aborted (virtualbox)
mon-staging not created (virtualbox)
app-staging not created (virtualbox)
mon-prod not created (virtualbox)
app-prod not created (virtualbox)
build not created (virtualbox)
snapci not created (virtualbox)
@garrettr
garrettr / test_document_query_command_supported.html
Created October 3, 2015 19:51
document.queryCommandSupport('copy') needs to be user-initiated in Chrome, but not in Firefox
<!doctype html>
<html>
<head>
<title>Test document.queryCommandSupported</title>
</head>
<body>
<p id="copySupportedNonUserInititated"><code>document.queryCommandSupported('copy')</code> (non user-initiated): <span id="copySupportedNonUserInitiatedResult"></span></p>
<p id="copySupportedUserInitiated"><code>document.queryCommandSupported('copy')</code> (user-initiated): <span id="copySupportedUserInitiatedResult"></span></p>
<button id="testCopySupportedUserInitiated">Click me to test user-initiated document.queryCommandSupported</button>
<script type="text/javascript">
@garrettr
garrettr / gist:59ad3112df829887caa4
Created May 7, 2015 19:13
Intermittent Travis Error in `crypto_util.encrypt`
tests/test_unit_integration.py ....Exception in thread Thread-156:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/gnupg/_meta.py", line 541, in _read_response
result._handle_status(keyword, value)
File "/usr/local/lib/python2.7/dist-packages/gnupg/_parsers.py", line 860, in _handle_status
raise ValueError("Unknown status message: %r" % key)
@garrettr
garrettr / gist:90c2ffb142f3ee69da20
Created March 31, 2015 00:04
Example shutil.rmtree test failure
=================================== FAILURES ===================================
____________________ TestIntegration.test_delete_collection ____________________
self = <tests.test_unit_integration.TestIntegration testMethod=test_delete_collection>
def tearDown(self):
> common.shared_teardown()
@garrettr
garrettr / gist:28f00ae6a2f45d44692a
Created February 24, 2015 02:19
Travis test failure in test_regenerate_valid_lengths
=================================== FAILURES ===================================
___________________ TestSource.test_regenerate_valid_lengths ___________________
self = <tests.test_unit_source.TestSource testMethod=test_regenerate_valid_lengths>
def test_regenerate_valid_lengths(self):
"""Make sure we can regenerate all valid length codenames"""
for codename_len in xrange(7, 11):
response = self.client.post('/generate', data={
'number-words': str(codename_len),
})
self.assertEqual(response.status_code, 200)
@garrettr
garrettr / gist:3b778b308213f19c8e3b
Created February 5, 2015 17:26
Another rmtree-related test failure
________________________ TestIntegration.test_filenames ________________________
self = <tests.test_unit_integration.TestIntegration testMethod=test_filenames>
def tearDown(self):
> common.shared_teardown()
tests/test_unit_integration.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/common.py:74: in shared_teardown
clean_root()
tests/common.py:13: in clean_root
shutil.rmtree(config.SECUREDROP_DATA_ROOT)
@garrettr
garrettr / gist:ad6c791748abc310d267
Created February 5, 2015 16:02
Another rmtree-related test failure
=================================== FAILURES ===================================
________________________ TestIntegration.test_filenames ________________________
self = <tests.test_unit_integration.TestIntegration testMethod=test_filenames>
def tearDown(self):
> common.shared_teardown()
tests/test_unit_integration.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/common.py:74: in shared_teardown
clean_root()
tests/common.py:13: in clean_root
@garrettr
garrettr / gist:dbe8e77b91fa6db1c4f9
Created January 30, 2015 22:18
Intermittent Travis failure #4 (flaky Pip)
TASK: [app-test | install pip dependencies for running the unit and functional tests] ***
failed: [localhost] => {"cmd": "/usr/local/bin/pip install -r /home/travis/build/freedomofpress/securedrop/securedrop/requirements/test-requirements.txt", "failed": true}
msg: stdout: Downloading/unpacking Flask-Testing==0.4.2 (from -r /home/travis/build/freedomofpress/securedrop/securedrop/requirements/test-requirements.txt (line 1))
Running setup.py (path:/tmp/pip_build_root/Flask-Testing/setup.py) egg_info for package Flask-Testing
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
no previously-included directories found matching 'docs/_build'