Skip to content

Instantly share code, notes, and snippets.

View eslick's full-sized avatar

Ian Eslick eslick

View GitHub Profile
@eslick
eslick / gist:855663
Created March 4, 2011 20:34
An example custom HBase Sink for Flume written in Clojure
;;
;; Flume HBase User Sink
;;
(gen-class
:name compass.flume.UserSink
:extends "com.cloudera.flume.core.EventSink$Base"
:prefix "sink-"
:main false
:constructors {[String] []
@eslick
eslick / election.clj
Created October 30, 2012 06:27
A simple election mechanism for Datomic peers
;; This is a relatively simple election mechanism for a set of
;; processes or datomic peers where a processing step requires a
;; global master. The elector entity is used to connect a set of peer
;; entities labeled as :election/master. Using the algorithm,
;; there will only ever be one :election/master in the :election/peer
;; group defined on the elector.
;;
;; The user API is simple a guarded transaction which calls a txn-fn
;; if the entity is the current master. If not it holds an election
;; if the timeout has expired.
@eslick
eslick / reserve.clj
Created November 21, 2012 02:05
Simple reservation for multiple worker peers using Datomic
(ns experiment.infra.election
(:use [datomic.api :only [q] :as d])
(:require [experiment.system :as sys]
[experiment.infra.data :as data]
[experiment.infra.protocols :as p]))
;;
;; Reserve - Simple peer coordination mechanism
;;
;; Reservations support multiple peers trying to distribution operations
@eslick
eslick / profiles.clj
Last active December 17, 2015 09:48
ritz middleware in profiles.clj
{:user {:plugins [[lein-ritz "0.7.0"]]
:dependencies [[nrepl-inspect "0.3.0"]
[ritz/ritz-nrepl-middleware "0.7.0"]]
:repl-options
{:nrepl-middleware
[inspector.middleware/wrap-inspect
ritz.nrepl.middleware.javadoc/wrap-javadoc
ritz.nrepl.middleware.apropos/wrap-apropos]}}}
@eslick
eslick / Vagrantfile
Created May 20, 2013 18:00
Vagrant file for a test Ubuntu Box
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "Ubuntu64vb"
config.vm.boot_mode = :gui
config.vm.network :bridged
end
@eslick
eslick / Ansible Environment
Created June 21, 2013 00:36
Ansible Setup for AWS
cd ansible # run in the ansible directory
export AWS_ACCESS_KEY_ID='<aws_accesskey_id>'
export AWS_SECRET_ACCESS_KEY='<aws_secret_key>'
export ANSIBLE_HOSTS=$(pwd)/plugins/inventory/ec2.py
# use the following only if you're using ssh as transport (typical)
export ANSIBLE_SSH_ARGS="-o ForwardAgent=yes"
# Run ssh-agent and add your AWS pem key
@eslick
eslick / gist:6886353
Created October 8, 2013 15:17
Stacktrace from maven: mvn -e -s support/settings.xml install
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Immutant App Bootstrap Module 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-java-version) @ immutant-bootstrap-module ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven-version) @ immutant-bootstrap-module ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.2:create-timestamp (get-build-timestamp) @ immutant-bootstrap-module ---
@eslick
eslick / gist:6909886
Created October 9, 2013 22:50
Immutant test application fails to startup when co-deployed with Immutant 'dummy' application for nrepl use
15:44:58,546 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "dummy.clj" (runtime-name : "dummy.clj")
15:48:29,055 INFO [org.jboss.as.repository] (HttpManagementService-threads - 3) JBAS014900: Content added at location /Users/eslick/.immutant/current/jboss/standalone/data/content/46/a044e91a04105e22e3cbb90a36cea84c7bcdac/content
15:48:29,062 INFO [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015876: Starting deployment of "switchboard.clj" (runtime-name: "switchboard.clj")
15:48:35,024 WARN [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015960: Class Path entry apache-cassandra-clientutil-1.2.6.jar in /Users/eslick/Work/vital/projects/switchboard/switchboard/tmp_mounts/switchboard.clj/cassandra-all-1.2.6.jar does not point to a valid jar for a Class-Path reference.
15:48:35,047 WARN [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015960: Class Path entry apache-cassandra-thrift-1.2.6.jar in /Users/eslick/Work/vital/projects/sw
@eslick
eslick / gist:7086815
Created October 21, 2013 16:34
Immutant logging profile
<subsystem xmlns="urn:jboss:domain:logging:1.2">
<console-handler name="CONSOLE">
<level name="DEBUG"/>
<formatter>
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE" autoflush="true">
<level name="TRACE"/>
<formatter>
@eslick
eslick / gist:7086897
Created October 21, 2013 16:42
Lein deps tree for pedestal-based immutant app
Bacon:switchboard eslick$ lein deps :tree
WARNING!!! possible confusing dependencies found:
[io.pedestal/pedestal.service "0.2.1"] -> [org.slf4j/slf4j-api "1.7.2"]
overrides
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/jul-to-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]
and
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/log4j-over-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]
and
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/jcl-over-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]