Skip to content

Instantly share code, notes, and snippets.

View kgorman's full-sized avatar

Kenny Gorman kgorman

View GitHub Profile
@kgorman
kgorman / foo.sql
Created June 7, 2019 19:07
foo.sql
SELECT * FROM FOO ORDER BY 'baz' limit 9;
SELECT * FROM FOO ORDER BY BAZ;
@kgorman
kgorman / test.md
Last active January 24, 2019 20:14

hello world

this is a code snippet

  • a list item
  • another item
@kgorman
kgorman / brewery_example.py
Last active November 14, 2018 16:18
Example Python Producer - Eventador.io
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import random
import time
import sys
from kafka import KafkaProducer
@kgorman
kgorman / apache-flink.rb
Last active December 19, 2017 16:33 — forked from thirteen37/apache-flink.rb
Apache Flink 1.4 Homebrew formula
@kgorman
kgorman / georoutes.py
Last active February 22, 2017 16:26
georoutes.py
def build_routes():
""" return a geojson object with flight paths over last day """
conn = database_connect()
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
output = cur.execute(
"""
SELECT DISTINCT(tail)
AS tail
FROM planedemo_routes
WHERE lat != ''
Jun 21 20:54:52 vapipeline01 kernel: [2239310.896998] Out of memory: Kill process 1056 (pipelinedb) score 506 or sacrifice child
Jun 21 20:54:52 vapipeline01 kernel: [2239310.903418] Killed process 1056 (pipelinedb) total-vm:12751636kB, anon-rss:8306604kB, file-rss:128kB
Jun 21 20:54:52 vapipeline01 pipeline[15284]: [342-1] LOG: autovacuum launcher process (PID 1056) was terminated by signal 9: Killed
Jun 21 20:54:52 vapipeline01 pipeline[15284]: [343-1] LOG: terminating any other active server processes
Jun 21 20:54:52 vapipeline01 pipeline[1060]: [295-1] WARNING: terminating connection because of crash of another server process
Jun 21 20:54:52 vapipeline01 pipeline[1191]: [294-1] WARNING: terminating connection because of crash of another server process
Jun 21 20:54:52 vapipeline01 pipeline[1059]: [310-1] WARNING: terminating connection because of crash of another server process
Jun 21 20:54:52 vapipeline01 pipeline[1162]: [294-1] WARNING: terminating connection because of crash of another server proc
@kgorman
kgorman / pyscript.py
Created April 13, 2016 21:29 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
import os
import sys
import argparse
-- here is my stream
drop stream test_stream cascade;
create stream test_stream (speed int, ts int, tail char(10));
create continuous view v1 as select ts, tail, speed from test_stream;
create continuous view v2 as select tail, keyed_max(ts, speed) from test_stream group by tail;
-- put some data into it
insert into test_stream values (100, 1, 'YY');
@kgorman
kgorman / setup_kafka.sh
Created October 14, 2015 16:40 — forked from ekampf/setup_kafka.sh
Setup Kafka (0.8.0) on OSX
brew install sbt
cd /tmp
wget http://apache.spd.co.il/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz
tar -zxvf kafka_2.8.0-0.8.0.tar.gz -C /usr/local/
cd /usr/local/kafka_2.8.0-0.8.0
sbt update
sbt package