Skip to content

Instantly share code, notes, and snippets.


1. Generate an SSH key-pair

First up, generate yourself an SSH key pair - unless you already have one you can reuse, in which case skip this step.

Notes on this step:

  • Replace anything in block caps below with something meaningful - it's just a comment that gets stored with the key to help you tell what it's used for in the future.
  • It will ask you if you want to password-protect (i.e. encrypt) the private half of the key pair. If you're using a Mac, I recommend you set a password as Git integrates with the MacOS keychain really nicely. I'm not familiar with how to setup 'transparent' password-protected private keys on other operating systems, so best to just set no password unless you know what you're doing.
ssh-keygen -t rsa -b 4096 -C "YOUR_NAME github key YOUR_EMAIL_ADDRESS@DOMAIN.COM" -f ~/.ssh/id_rsa_github
robfraz /
Last active Apr 19, 2018
Example upload of Pandas DataFrame to Google BigQuery via temporary CSV file
from pathlib import Path
from tempfile import NamedTemporaryFile
import numpy as np
import pandas as pd
from import Client, SchemaField
def main():
View gist:7884543
[01:45:18][rob@Pestilence2] ~/cloudant/dbcore> cat rel/remsh
if [ -z $NODE ]; then
if [ -z $1 ]; then
robfraz / gist:5564935
Created May 12, 2013
check bulk insert
View gist:5564935
def check_bulk_insert(self, response):
# Some basic checks
assert_that(response.status_code, is_(accepted()),
"Bulk docs POST failed")
assert_that(response.json(), is_(instance_of(list)),
"Bulk docs insert didn't return a list")
# Now ensure that none of the individual document inserts had an error.
if type(response.json()) == list:
for insert_result in response.json():
import inspect
import sys
def src(obj):
"""Read the source of an object in the interpreter."""
def highlight(source):
import pygments