Skip to content

Instantly share code, notes, and snippets.

View jasonm's full-sized avatar

Jason Morrison jasonm

View GitHub Profile
@jasonm
jasonm / 00-README.md
Last active February 7, 2018 07:19
Salesforce API TLS "Verify return code: 20 (unable to get local issuer certificate)"

Starting at Tue 2018-02-06 6:23pmPT we noticed a regular background job which connects to the Salesforce Bulk API via Python client started failing with the following message:

SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

I am able to reproduce the failure to verify (and therefore connect to the API) from outside Python, using the openssl s_client command.

@jasonm
jasonm / 0_reuse_code.js
Created January 20, 2016 02:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Term based tool to view *colored*, *incremental* diff in a *Git/Mercurial/Svn*
workspace or from stdin, with *side by side* and *auto pager* support. Requires
python (>= 2.5.0) and ``less``.
"""
META_INFO = {
~/dev/es6exp $ ./node_modules/babel/bin/babel-node
> var { op: a } = { op: 5 };
undefined
> a
5 // this makes sense to me
> var [a=1] = [];
undefined
> a
{ op: 5 } // where did this come from?
>
[~] cat ~/.ipython/profile_default/ipython_notebook_config.py
c = get_config()
c.NotebookApp.webapp_settings = {
"headers": {
"Access-Control-Allow-Origin": "*"
}
}
/tmp $ curl -O https://pypi.python.org/packages/source/s/selenium/selenium-2.42.1.tar.gz
/tmp $ tar xvfz selenium-2.42.1.tar.gz
x selenium-2.42.1/
x selenium-2.42.1/MANIFEST.in
x selenium-2.42.1/PKG-INFO
x selenium-2.42.1/py/
x selenium-2.42.1/py/CHANGES
# (...snip...)
(master) ~/dev/pgpitter $ curl -i -d@data localhost:7000/statuses -H "Content-Type: application/json"
HTTP/1.1 500 Internal Server Error
Date: Tue, 04 Mar 2014 04:21:00 GMT
Status: 500 Internal Server Error
Connection: close
Content-Type: text/plain; charset=utf-8
X-Request-Id: 2b7084b6-5eed-48c9-82dd-110f580a5c54
X-Runtime: 0.023212
Transfer-Encoding: chunked
foo
baz
blat
this is a test
whee
this is a test
whee