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:d8f58f481c44f100615653e2b62d4566
Created July 31, 2018 17:56
icloud.com certificate failing CT check
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 805352261826810658 (0xb2d2f9d7d3e9322)
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN=Apple IST CA 8 - G1, OU=Certification Authority, O=Apple Inc., C=US
Validity
Not Before: Jun 2 00:31:36 2018 GMT
Not After : Jul 2 00:31:36 2019 GMT
Subject: CN=icloud.com, OU=management:idms.group.665035, O=Apple Inc., ST=California, C=US
@garrettr
garrettr / gist:35946649722143851f06f4bfd06130e3
Created July 19, 2018 22:06
brave-browser "could not find object file symbol" warnings from Mac Release build (full traceback)
garrettr@Garretts-MacBook-Pro ~/brave> yarn build Release
yarn run v1.7.0
$ node ./scripts/commands.js build Release
touch original files overridden by chromium_src...
update branding...
building brave...
gn gen /Users/garrettr/brave/src/out/Release --args="safe_browsing_mode=1 root_extra_deps=[\"//brave\"] is_component_build=false proprietary_codecs=true ffmpeg_branding=\"Chrome\" enable_nacl=false enable_widevine=true target_cpu=\"x64\" is_official_build=true is_debug=false dcheck_always_on=false brave_channel=\"\" google_api_key=\"AIzaSyAH90V94EcZBP5oH7oc-mXQrSKgASVxER8\" brave_google_api_key=\"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q\" brave_google_api_endpoint=\"https://www.googleapis.com/geolocation/v1/geolocate?key=\" brave_product_name=\"Brave\" brave_project_name=\"brave\" brave_version_major=\"0\" brave_version_minor=\"50\" brave_version_build=\"13\" safebrowsing_api_endpoint=\"safebrowsing.brave.com\" mac_signing_identifier=\"\" mac_signing_keychain=\"login\" cc_wrapper=\"/Users/garrettr/brave/src/b
@garrettr
garrettr / gist:460dab0df552caa71d4c90244206b68b
Created July 17, 2018 19:50
Brave browser-laptop: 13 crashing browser tests (full traceback)
garrettr@Garretts-MacBook-Pro ~/brave> yarn test brave_browser_tests
yarn run v1.7.0
$ node ./scripts/commands.js test brave_browser_tests
ninja -C /Users/garrettr/brave/src/out/Debug brave_browser_tests
ninja: Entering directory `/Users/garrettr/brave/src/out/Debug'
[169/169] LINK ./brave_browser_tests
/Users/garrettr/brave/src/out/Debug/brave_browser_tests --enable-logging --v=0
IMPORTANT DEBUGGING NOTE: each test is run inside its own process.
For debugging a test inside a debugger, use the
--gtest_filter=<your_test_name> flag along with either
@garrettr
garrettr / gist:2461c60f3a2699790a7ca09d63929b41
Created June 2, 2017 01:09
./testinfra/test.py app-staging
(securedrop) securedrop ~> ./testinfra/test.py app-staging
Running Testinfra suite against 'app-staging'...
Target roles:
- testinfra/app
- testinfra/app-code
- testinfra/common
- testinfra/development/test_xvfb.py
==================================================================== test session starts =====================================================================
platform darwin -- Python 2.7.13, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 -- /Users/garrett/.virtualenvs/securedrop/bin/python2.7
cachedir: .cache
@garrettr
garrettr / specific-securedrop-tests.markdown
Created August 16, 2016 00:04
Running specific unit tests in SecureDrop 0.3.x

You need to recreate the environment and run a test rqworker, as is done in manage.py test.

The important thing to remember is that the rqworker needs to run with SECUREDROP_ENV=test because it loads the config and runs some Python code independently of the test runner.

My preferred way to do this is:

vagrant up development
vagrant ssh
tmux # so you can monitor the output of rqworker for errors. You could also run it in the background.
@garrettr
garrettr / .mozconfig
Created July 13, 2016 18:49
Garrett's .mozconfig
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
# -s makes builds quieter by default
# -j4 allows 4 tasks to run in parallel. Set the number to be the amount of
# cores in your machine. 4 is a good number.
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
mk_add_options AUTOCLOBBER=1
@garrettr
garrettr / gist:4e1f54fd5b9f20a365b400441a27b1d7
Last active May 10, 2016 21:39
C: What's wrong with this code?
static char* webfp_logfile_path = NULL;
static char*
get_logfile_path()
{
if (!webfp_logfile_path) {
char *home_path = getenv("HOME");
char* logfile_path = "/FingerprintSecureDrop/logging/tor_cell_seq.log";
int x = strlen(home_path) + strlen(logfile_path) + 1;
char abs_logfile_path[x];
@garrettr
garrettr / gist:842ae53082b2d6920113e59ccf75fbcc
Created May 10, 2016 01:51
Words found in proposed new SecureDrop wordlist that are not in the old wordlist
abacus
abalone
abandon
abby
abduct
abdul
abhor
aboard
abraham
absent
@garrettr
garrettr / gist:11c79bfb2f8bae3173b18511482213ef
Created April 27, 2016 02:38
SecretShare: npm run lint
➜ secretshare git:(master) npm run lint
> secret-share@0.0.1 lint /Users/garrett/code/freedomofpress/secretshare
> eslint app test *.js
/Users/garrett/code/freedomofpress/secretshare/app/components/ShareInput.js
41:27 warning Unexpected console statement no-console
/Users/garrett/code/freedomofpress/secretshare/app/containers/RecoverScreen.js
@garrettr
garrettr / gist:1f808770d692f51b1e1a0059c336df5f
Created April 26, 2016 16:42
SecureDrop: Large Restore over Tor
➜ securedrop git:(improve-backup-and-restore) ✗ SECUREDROP_SSH_OVER_TOR=1 vagrant provision app-staging
==> app-staging: Running provisioner: ansible...
app-staging: Running ansible-playbook...
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit='all' --inventory-file=/Users/garrett/code/freedomofpress/securedrop/.vagrant/provisioners/ansible/inventory -v --tags=backup install_files/ansible-base/securedrop-staging.yml
PLAY [app-staging] ************************************************************
GATHERING FACTS ***************************************************************
ok: [app-staging]