Skip to content

Instantly share code, notes, and snippets.

View buremba's full-sized avatar
🤖
at LiveRamp

Burak Emre Kabakcı buremba

🤖
at LiveRamp
  • LiveRamp
  • London
  • 18:50 (UTC)
  • X @bu7emba
View GitHub Profile
store.adapter=presto
presto.address=http://0.0.0.0:8080
presto.cold-storage-connector=rakam_raptor
presto.metastore.jdbc.url=jdbc:mysql://127.0.0.1:3306/presto
presto.metastore.jdbc.username=root
presto.metastore.jdbc.password=
presto.streaming.port=5466
event.store=kinesis
<html>
<head></head>
<body>
{"status": ::CLOUDFLARE_ERROR_500S_BOX::, "message": "The server is not available, please try again later"}
</body>
</html>
@buremba
buremba / create-table.sql
Last active December 25, 2017 15:53
Raptor metadata queries
-- CREATE TABLE rakam_raptor.demo.demotable (_device_id VARCHAR, _time TIMESTAMP) WITH(temporal_column = '_time', bucketed_on=ARRAY['_device_id'], bucket_count = 10, distribution_name='test');
// Check if table exists
SELECT t.table_id, t.distribution_id, d.distribution_name, d.bucket_count, t.temporal_column_id, t.organization_enabled
FROM tables t
LEFT JOIN distributions d ON (t.distribution_id = d.distribution_id)
WHERE t.schema_name = ?
AND t.table_name = ?
// Check if distribution exists exists
@buremba
buremba / rakam-presto.template
Last active December 12, 2017 07:47
rakam.presto.cloudformation
---
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
LockKey:
Description: Rakam lock key for creating projects
NoEcho: 'true'
MinLength: '8'
MaxLength: '41'
Type: String
MetadataDBPassword:
<form rakam-event-form="collection_name">
<input type="text" name="attribute_name">
<input type="hidden" rakam-event-extra='{"another_field": 1}'>
<input type="submit" name="Send">
</form>
import requests
import json
from pymongo import MongoClient
url = "[YOUR_RAKAM_API]/event/collect"
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client.test_database
posts = db.posts
@buremba
buremba / crawler.py
Created October 2, 2012 22:16
python web crawler
import urllib
import urllib2
import MySQLdb
import re
db = MySQLdb.connect(host="localhost",user="root",passwd="[PASS]",db="python")
cursor = db.cursor()
def finda(L, value):
try:
var https = require('https');
var data = __REPLACE_JSON__;
var counter = data.length;
var result = {data: {}, error: {}};
data.forEach(function (keyword) {
var options = {
host: 'trends.google.com',
port: 443,
FROM maven:3-jdk-8
MAINTAINER Burak Emre Kabakci "emre@rakam.io"
WORKDIR /var/app
RUN git clone https://github.com/rakam-io/rakam.git
RUN cd rakam && mvn install -DskipTests
RUN echo 'org.rakam=INFO\n\
io.netty=INFO' > log.properties
{ method: 'POST',
url: 'https://app.rakam.io//continuous-query/create',
httpVersion: 'HTTP/1.1',
headersSize: -1,
bodySize: -1,
cookies: [],
headers: [],
queryString: [],
comment: 'Creates a new continuous query for specified SQL query.\nRakam will process data in batches keep the result of query in-memory all the time.\nCompared to reports, continuous queries continuously aggregate the data on the fly and the result is always available either in-memory or disk.',
postData: