Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View omnifroodle's full-sized avatar

Matt Overstreet omnifroodle

  • DataStax
  • Richmond, VA
View GitHub Profile
@omnifroodle
omnifroodle / gist:cd82691c4a0b02117b46c41b9e4c196b
Last active October 30, 2020 14:27
Connecting to Astra with Older Python libs

Working backwards with Astra and Python/Flask/Django

So you heard about this awesome new hosted Cassandra and wanted to kick the tires? But after setting up your favorite stack you realize that the secure connect bundle from Astra doesn’t seem to plug in anywhere. Suddenly easy doesn’t seem so easy anymore.

I’m going to walk you through one example of how you can connect an older CQL library to Astra. In this case we’ll be using Flask and CQLAlchemy. CQLAlchemy has something of a following in the Flask/Cassandra world but hasn’t seen an update in a while.

First, unzip the secure bundle you downloaded from Astra. You should see something like this:

$ ls secure-connect
@omnifroodle
omnifroodle / kafka-kubernetes.md
Last active February 10, 2019 23:15
Kafka and kubernetes example
  1. Get the Kubernetes manifests you’ll need for Kafka
git clone https://github.com/Yolean/kubernetes-kafka.git
cd kubernetes-kafka
  1. Register a couple storage classes in the cluster (note, these probably already exist)
kubectl apply -f ./configure/docker-storageclass-broker.yml
@omnifroodle
omnifroodle / cassandra_test.py
Created September 7, 2018 21:33
simple Cassandra testing with Locust framework
from cassandra.cluster import Cluster
from cassandra.policies import RoundRobinPolicy
from locust import Locust, events, task, TaskSet
import time
class CassandraClient(object):
def __init__(self, host):

Keybase proof

I hereby claim:

  • I am omnifroodle on github.
  • I am omnifroodle (https://keybase.io/omnifroodle) on keybase.
  • I have a public key ASB6s7c05WNgmytiCcEfmGgyH3p2A3OG05X2U8PKdr4Dowo

To claim this, I am signing this object:

# Fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch yellow
# Status Chars
set __fish_git_prompt_char_dirtystate '✎ '
set __fish_git_prompt_char_stagedstate '☑ '
set __fish_git_prompt_char_stashstate '☄ '
@omnifroodle
omnifroodle / .vimrc
Last active December 20, 2015 00:09
My fish ~/.config/fish/config.fish with rbenv, go, custom git status icons, and aws ec2/cfn tools
set shell=bash
@omnifroodle
omnifroodle / schema.xml
Created March 29, 2012 11:16
hybrid ckan/drupal schema
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
For more information, on how to customize this file, please see
http://wiki.apache.org/solr/SchemaXml
@omnifroodle
omnifroodle / gist:1990889
Created March 7, 2012 04:12
server spinner
for INSTANCE in `cat ~/instance_addr_list`
do
echo '------------'
echo $INSTANCE
echo '------------'
for i in 1 2
do
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=false $INSTANCE "nohup sh ~/bin/image-node/do-task.sh &> /dev/null &"
done
done
@omnifroodle
omnifroodle / install_homebrew.rb
Created August 8, 2011 05:46 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
@omnifroodle
omnifroodle / die.rb
Created May 27, 2011 01:26
Earthdawn Dice
class Die
attr_reader :d, :face, :bonus, :modifier
def initialize(d)
parse_d(d)
@face = roll
if @d == @face
@bonus = Die.new(d)
end
end