Skip to content

Instantly share code, notes, and snippets.

@zmarcantel
zmarcantel / OnLoad.js
Last active December 16, 2015 22:09
Quick but good way to "interrupt" the existing onload function
(function(){
var old;
if( window.onload ) {
old = window.onload;
}
window.onload = function () {
// initialization code here
input {
zeromq {
mode => "server"
address => ["tcp://*:12000"]
codec => "json"
#type => "log.%{[owner]}"
#tags => ["%{[owner]}.%{[log_level]}", "%{[log_level]}"]
topology => "pubsub"
}
@zmarcantel
zmarcantel / gist:7159455
Last active December 26, 2015 13:39
pip install wheel
Installed using
pip install -U -f /srv/wheelhouse --use-wheel --no-index {{mod_name}}
Directory Structure
{{mod_name}}
{{mod_name}}
__init__.py
easy_setup.py
setup.py
{
'web': {
'hosts': ['web.0.local', 'web.1.local']
},
'workers': {
'hosts': ['worker.0.local', 'worker.1.local', 'worker.2.local']
},
'other': {
---
app:
etcd_hosts: >
{% for host in groups.divvy %}
{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}
{%- if not loop.last -%}
,
{%- endif -%}
{% endfor %}
addr = "127.0.0.1:1900"
bind_addr = "0.0.0.0:1900"
ca_file = ""
cert_file = ""
cors_origins = []
cpu_profile_file = ""
data_dir = "machines/Dock"
key_file = ""
peers = [192.168.50.100:1890,192.168.50.10:1890]
peers_file = ""
PROBLEM
-------
I'm trying to get two peers to connect to each other.
It seems, however, that the machines are only listening on the client port?
Looking at netstat, the only port being bound is my client port (4600) and each machine is saying the connection to the other was refused.
Any ideas, help, or obvious oversights?
PEER TOPOLOGY
@zmarcantel
zmarcantel / gist:8508830
Created January 19, 2014 18:23
DataStax Java driver issues
//
// My class constructor
//
public CassandraDataModel() {
this.cluster = Cluster.builder()
.addContactPoint("127.0.0.1")
// .withSSL() // Uncomment if using client to node encryption
.build();
Metadata metadata = this.cluster.getMetadata();
Trying to run a simple hadoop job, but hadoop is throwing a NoClassDef on "org/w3c/dom/Document"
I'm trying to run the basic examples from the "Mahout In Action" book (https://github.com/tdunning/MiA).
I do this using nearly the same maven setup but tooled for cassandra use rather than a file data model.
But, when I try to run the *-job.jar, it spits a NoClassDef from the datastax/hadoop end.
I'm using 1.0.5-dse of the driver as that's the only one that supports the current DSE version of Cassandra(1.2.1) if that helps at all though the issue seems to be deeper.
Usage
=====
result, err = json.MarshalIndent(someStruct, "", " ")
where someStruct is of type
type ColumnDescriptor struct {
Name string
Type string