Skip to content

Instantly share code, notes, and snippets.

View aboudreault's full-sized avatar

Alan Boudreault aboudreault

View GitHub Profile
from cassandra.cluster import Cluster
from cassandra.concurrent import execute_concurrent, query_by_keys
from cassandra.policies import TokenAwarePolicy, DCAwareRoundRobinPolicy
from itertools import repeat, cycle
from collections import defaultdict
import time
import six
from bokeh.plotting import figure, output_file, show
cluster = Cluster(load_balancing_policy=TokenAwarePolicy(DCAwareRoundRobinPolicy(), shuffle_replicas=False))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hyperlink JIRA ticket numbers for DataStax projects
;;
;; For example, all of these tickets should be clickable when
;; bug-reference-prog-mode or bug-reference-mode are enabled :
;;
;; CASSANDRA-8099
;; PYTHON-363
;; TESTINF-386
;; DSP-6091
@jimmycuadra
jimmycuadra / cloud-config.yml
Last active April 19, 2021 03:04
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
export [email protected]
export DEBFULLNAME="Jürgen E. Fischer"
export PPA=${1:-qgis-unstable-ubuntugis-jef}
export T=$(mktemp)
cp debian/changelog $T
trap "cp $T debian/changelog && rm -f $T" EXIT
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@rosskarchner
rosskarchner / export.py
Created February 21, 2011 22:48
extract tiles from an mbtiles file
import sqlite3, os
conn = sqlite3.connect('Mills1860.mbtiles')
results=conn.execute('select * from tiles').fetchall()
for result in results:
zoom, column, row, png= result
try:
os.makedirs('%s/%s/' % (zoom, row))