Skip to content

Instantly share code, notes, and snippets.

View spaceshipoperator's full-sized avatar

Brian Muckian spaceshipoperator

View GitHub Profile
@spaceshipoperator
spaceshipoperator / pyspark_interactive_with_datastax_connector.py
Last active November 25, 2016 07:10
after successfully doing this http://planetcassandra.org/blog/kindling-an-introduction-to-spark-with-cassandra/ with spark-shell, one might reasonably think that the following would work....though I may be missing something trivial.
## invoking pyspark as follows: ##
# /path/to/spark-1.2.0-bin-hadoop2.4/bin/pyspark --jars /path/to/spark-1.2.0-bin-hadoop2.4/jars/spark-cassandra-connector-assembly-1.2.0-SNAPSHOT.jar
# first, stop the spark context launched by pyspark to avoid the conflict
sc.stop()
from py4j.java_gateway import java_import
from pyspark import SparkConf
conf = (SparkConf()
.setMaster("local")
@spaceshipoperator
spaceshipoperator / pg_spanish_errors
Created January 8, 2014 14:39
why is postgres speaking Spanish to me?
[root@fabrica ~]# cat /var/lib/postgres/data/postgresql.conf | grep -v '^\s*#' | grep .
max_connections = 100 # (change requires restart)
shared_buffers = 128MB # min 128kB
log_timezone = 'US/Pacific'
datestyle = 'iso, mdy'
timezone = 'US/Pacific'
lc_messages = 'en_US.UTF-8' # locale for system error message
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting
require 'sinatra/base'
require 'rack/flash'
require 'warden'
require 'slim'
require 'sequel'
require 'sqlite3'
DB = Sequel.sqlite
DB.create_table :users do
primary_key :id