Skip to content

Instantly share code, notes, and snippets.

View untoldone's full-sized avatar

Michael Wasser untoldone

View GitHub Profile
import 'dart:io';
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import 'package:http/http.dart' as http;
// Upload
// 1MB
@untoldone
untoldone / handle-migration.py
Last active July 22, 2018 02:39
Script to handle live migrations on GCP with Cockroach on a Debian 9 machine
import time
import requests
from subprocess import call
METADATA_URL = 'http://metadata.google.internal/computeMetadata/v1/'
METADATA_HEADERS = {'Metadata-Flavor': 'Google'}
### Keybase proof
I hereby claim:
* I am untoldone on github.
* I am mmw (https://keybase.io/mmw) on keybase.
* I have a public key whose fingerprint is 7EEE 868D 86E5 687B E225 2C96 7EAA AD55 5CD4 711F
To claim this, I am signing this object:
@untoldone
untoldone / export.js
Last active December 31, 2015 19:39
Export NPIs as json objects. Run it from the root of the bloomapi directory while the bloom server is running on port 3000 on the same machine.
var pg = require('./lib/sources/pg'),
http = require('http'),
fs = require('fs'),
Q = require('q'),
path = './dump.json',
fileStream = fs.createWriteStream(path, {flags: 'w'}),
p;
fileStream.write("[\n");