Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en" style="">
<head>
<meta charset="utf-8">
<title>Paul Pearcy</title>
<meta name="description" content="I am a hands-on software architect that works at every level of the development lifecycle with a deep understanding of how to synergize design, development, deployment, and infrastructure to achieve quality, reliability, scalability, and affordability. The last few years I have been one of two lead Architects for the flagship Blackboard Learn LMS and have played a key role in evolving to a SaaS platform able to support our largest customers affordably and reliably.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap">
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Paul Pearcy",
"label": "Software / Cloud Architect",
"summary": "I am a hands-on software architect that works at every level of the development lifecycle with a deep understanding of how to synergize design, development, deployment, and infrastructure to achieve quality, reliability, scalability, and affordability. The last few years I have been one of two lead Architects for the flagship Blackboard Learn LMS and have played a key role in evolving to a SaaS platform able to support our largest customers affordably and reliably.",
"email": "ppearcy@gmail.com",
"location": {
@ppearcy
ppearcy / ParseLogger.scala
Created August 31, 2015 19:35
A body parser that will log failed parses
/**
* Loosely Based on info gleaned from this article: https://victorops.com/blog/capturing-raw-requests-play/
* Play really makes this harder than it should be (with some good reasons)
*/
trait ParseLoggerTrait {
val logger: LoggerLike = Logger(this.getClass)
def log[A](parser: BodyParser[A], maxLength: Int, enableBadRequestLogging: Boolean): BodyParser[A] = BodyParser("LoggingParser") { request =>
import play.api.libs.iteratee.Execution.Implicits.trampoline
package blackboard.cloud.telemetry.secor
import com.pinterest.secor.common.SecorConfig
import com.pinterest.secor.message.Message
import com.pinterest.secor.parser.MessageParser
import io.confluent.kafka.serializers.KafkaAvroDecoder
import org.apache.avro.generic.GenericRecord
import org.joda.time.{DateTimeZone, DateTime}
import org.joda.time.format.DateTimeFormat
import org.slf4j.LoggerFactory
@ppearcy
ppearcy / gist:39e40489ab709e58d9a3
Created July 21, 2015 06:48
Schema with logicalType that can cause maven avro compiler error
{
"namespace": "schema.common",
"type": "record",
"name": "Action",
"fields": [
{
"name": "name",
"type": "string"
},
{
@ppearcy
ppearcy / gist:c5d969326b9e6ace8046
Created October 27, 2014 06:34
Elasticsearch get bounded port
val nodeRequest = new NodesInfoRequestBuilder(testCluster.esClient.admin().cluster()).all()
val nodeResponse = nodeRequest.execute().get()
val remoteAddress = nodeResponse.remoteAddress()
val nodesInfo = nodeResponse.getNodes.toList.head
val inetString = nodesInfo.getTransport.address().publishAddress().toString
val pattern =
"""
|inet\[\/\d+\.\d+\.\d+\.\d+\:(\d+)\]
""".stripMargin.r
val finallyPort = pattern.findFirstMatchIn(inetString).get.group(1)
"aggregations": {
"user_activity": {
"buckets": [
{
"key": "c2c5b6cb-d33a-4e94-bd6a-982b25c986e0",
"doc_count": 205,
"weekly": {
"buckets": [
{
"key_as_string": "2014-08-04T00:00:00.000Z",
{
"query" : {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
{"term": {
@ppearcy
ppearcy / gist:8480777
Created January 17, 2014 20:26
Ansible error
2014-01-17 15:18:01,404 p=5873 u=ppearcy |
2014-01-17 15:18:01,404 p=5873 u=ppearcy | /usr/local/Cellar/ansible/1.4.4/libexec/bin/ansible saf-local -vvvv -i ../hosts -m service -a name=isim state=started
2014-01-17 15:18:01,404 p=5873 u=ppearcy |
2014-01-17 15:18:01,440 p=5873 u=ppearcy | <192.168.100.10> ESTABLISH CONNECTION FOR USER: ppearcy
2014-01-17 15:18:01,440 p=5873 u=ppearcy | <192.168.100.10> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/ppearcy/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '192.168.100.10', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1389989881.44-54951323270350 && chmod a+rx $HOME/.ansible/tmp/ansible-1389989881.44-54951323270350 && echo $HOME/.ansible/tmp/ansible-1389989881.44-549513
@ppearcy
ppearcy / gist:5349703
Last active December 16, 2015 00:39
It looks like there can be some implicit conflicts around index_name and multi-fields. This is likely an edge case, but could cause some very funky behavior.
curl -XDELETE 'http://localhost:9200/test/'
curl -XPOST localhost:9200/test/ -d '{
"mappings" : {
"test":{
"properties" : {
"multi_test" : {"type":"string", "index_name":"multi_test.string"}
}
}}
}