Skip to content

Instantly share code, notes, and snippets.

View anseljh's full-sized avatar

Ansel Halliburton anseljh

  • SF Bay Area
View GitHub Profile
@anseljh
anseljh / gist:6026230
Created July 18, 2013 02:19
Code from Dropbox's "Using the Core API in Python" that's not working
import dropbox as db
DB_APP_KEY = '...'
DB_APP_SECRET = '...'
DB_APP_NAME = '...'
DB_FOLDER_NAME = '...'
DB_ACCESS_TYPE = 'app_folder'
# Setup Dropbox session
sess = db.session.DropboxSession(DB_APP_KEY, DB_APP_SECRET, DB_ACCESS_TYPE)
@anseljh
anseljh / keybase.md
Created October 10, 2014 22:37
keybase.md

Keybase proof

I hereby claim:

  • I am anseljh on github.
  • I am anseljh (https://keybase.io/anseljh) on keybase.
  • I have a public key whose fingerprint is 9D17 37DE EC56 3BDF BC10 CAAA 2948 2256 BE5D BD16

To claim this, I am signing this object:

@anseljh
anseljh / keybase.md
Created May 22, 2015 00:36
keybase.md

Keybase proof

I hereby claim:

  • I am anseljh on github.
  • I am anseljh (https://keybase.io/anseljh) on keybase.
  • I have a public key whose fingerprint is 6099 C6CA EBE5 627D A5D4 EDD2 1249 A230 FE3F 0BC3

To claim this, I am signing this object:

@anseljh
anseljh / gist:c5ceaca532643ac81f5a
Created September 4, 2015 23:42
Test failures
Using worker: worker-linux-docker-89b3c360.prod.travis-ci.org:travis-linux-1
Build system information
Build language: node_js
Build image provisioning date and time
Thu Feb 5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Using worker: worker-linux-docker-e364140a.prod.travis-ci.org:travis-linux-5
Build system information
Build language: node_js
Build image provisioning date and time
Thu Feb 5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
@anseljh
anseljh / erroneous.py
Created March 10, 2016 08:16
SSL error
>>> r = requests.get("https://www.krinternetlaw.com/", verify=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/requests/api.py", line 67, in get
return request('get', url, params=params, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 576, in send
@anseljh
anseljh / .bashrc
Created August 12, 2016 21:39
Grep colors that don't suck (too much)
# Grep colors!
# Colors: http://www.termsys.demon.co.uk/vtansi.htm#colors
# Parameters: http://blog.amit-agarwal.co.in/2011/03/06/grep_colors-change-the-colors-in-the-grep-output/
# export GREP_OPTIONS='--color=auto'
export GREP_COLORS="fn=32:ln=2;32:sl=37:mt=31:cx=2"
@anseljh
anseljh / Privacy-by-Design.md
Last active February 8, 2018 22:42
Enhancing Alert App User Privacy by Design

SMS and Privacy

There are a few problems with delivering alerts via SMS, but they mostly boil down to this: SMS is not very private.

For vulnerable audiences, it’s preferable to not collect any subscriber information at all. This isn’t possible with SMS, because you have to know the recipient’s phone number to deliver a message. Unless you’re talking about burners—which most people won’t have—that phone number is tied to a real identity. This is a vulnerability in at least these scenarios:

  • If the alerting app itself gets targeted (whether by LE or other malicious actors), user-identifying information could be leaked.
  • Phone companies cooperate with LE, through legal process (subpoenas) or otherwise, to find out which phone subscribers are receiving SMS alerts.
  • LE , IC, or well-resourced hackers snoop on the SMS network.
@anseljh
anseljh / opinion-annotations.csv
Created October 17, 2017 21:49
Potential annotations, mostly from Pro Publica reporting on Supreme Court errors (https://www.propublica.org/article/supreme-court-errors-are-not-hard-to-find)
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
Case title,CL opinion ID,Source name,Source URL,Concern Type,Concern Detail,Quotation,Notes
NASA v. Nelson,182990,ProPublica,https://www.propublica.org/article/supreme-court-errors-are-not-hard-to-find,Factual error,Relies on false fact from amicus brief,(“[M]ore than 88% of U. S. companies . . . perform background checks on their em ployees”),
Arizona v. U.S.,803270,ProPublica,https://www.propublica.org/article/supreme-court-errors-are-not-hard-to-find,Factual error,Relies on unsupported statistic in report by Center for Immigration Studies,"in the State’s most populous county, these aliens are reported to be responsible for a disproportionate share of serious crime",
U.S. v. Windsor,945737,ProPublica,https://www.propublica.org/article/supreme-court-errors-are-not-hard-to-find,Factual error,Understates number of states that prohibit marriages between first cousins,"Likewise the permissible degree of consanguinity can vary (most States permit first cousins to marry, but a handful—such as Iowa and Washington,

Code:

from os import environ
import certifi

def print_env():
    print(f"REQUESTS_CA_CERT is {environ.get('REQUESTS_CA_CERT')}")

def set_env():