Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Jammink2's full-sized avatar

John Hammink Jammink2

View GitHub Profile
{
"pipelineConfig" : {
"schemaVersion" : 6,
"version" : 16,
"pipelineId" : "LogsfromSSDCtoElasticsearch42654be3-3013-4bc0-b981-75e066aec41c",
"title" : "Logs_from_SSDC_to_Elasticsearch_and_Cassandra",
"description" : "Pipeline from tutorial 1",
"uuid" : "cbbbfff6-4a1a-4548-b623-3f452c816502",
"configuration" : [ {
"name" : "executionMode",
@Jammink2
Jammink2 / ibeacon_consumer.py
Last active May 25, 2019 23:31
iBeacon Consumer simulator for Aiven Kafka
# iBeacon Consumer simulator for Aiven Kafka
# This script receives messages from a Kafka topic
# usage: python ibeacon_consumer.py
# jammink@aiven.io
from kafka import KafkaConsumer
from time import sleep
# method that receives the message
# be sure to copy your ca.pem, service.cert and service.key to local directory from your Aiven Kafka instance.
@Jammink2
Jammink2 / ibeacon_producer.py
Last active May 25, 2019 23:32
iBeacon Producer simulator for Aiven Kafka
# iBeacon Producer simulator for Aiven Kafka
# This script takes, as an argument, the number of messages you want to iterate on.
# example usage: python ibeacon.py 50000
# to run continuously, try: clear && python ibeacon_producer.py 5000000
# jammink@aiven.io
from kafka import KafkaProducer
import sys, random, string, os
from time import sleep
# loads json files into Elasticsearch
# borrowed heavily from http://carrefax.com/new-blog/2018/3/12/load-json-files-into-elasticsearch
import requests, json, os
from elasticsearch import Elasticsearch
# specify a directory
directory = str(os.getcwd())
# connect to Elasticsearch; by default, ES listens on port 9200
@Jammink2
Jammink2 / gist:2c08f4697d1baf76a4d652c4d6d4030c
Created December 13, 2017 18:42
Asciinema Console Demo Script
*********************************
### Step one: bring up the cluster
asciinema rec
docker run --name Node_X -d scylladb/scylla
docker exec -it Node_X nodetool status
cqlsh> TRACING ON
Now Tracing is enabled
cqlsh> INSERT into keyspace1.standard1 (key, "C0") VALUES (0x12345679, bigintAsBlob(123456));
Tracing session: 227aff60-4f21-11e6-8835-000000000000
activity | timestamp | source | source_elapsed
-------------------------------------------------------------------------+----------------------------+-----------+----------------
Execute CQL3 query | 2016-07-21 11:57:21.238000 | 127.0.0.2 | 0
Parsing a statement [shard 1] | 2016-07-21 11:57:21.238335 | 127.0.0.2 | 1
cqlsh> TRACING ON
Now Tracing is enabled
cqlsh> INSERT into keyspace1.standard1 (key, "C0") VALUES (0x12345679, bigintAsBlob(123456));
Tracing session: 227aff60-4f21-11e6-8835-000000000000
activity | timestamp | source | source_elapsed
-------------------------------------------------------------------------+----------------------------+-----------+----------------
Execute CQL3 query | 2016-07-21 11:57:21.238000 | 127.0.0.2 | 0
Parsing a statement [shard 1] | 2016-07-21 11:57:21.238335 | 127.0.0.2 | 1
cqlsh> TRACING ON
Now Tracing is enabled
cqlsh> INSERT into keyspace1.standard1 (key, "C0") VALUES (0x12345679, bigintAsBlob(123456));
Tracing session: 227aff60-4f21-11e6-8835-000000000000
activity | timestamp | source | source_elapsed
-------------------------------------------------------------------------+----------------------------+-----------+----------------
Execute CQL3 query | 2016-07-21 11:57:21.238000 | 127.0.0.2 | 0
Parsing a statement [shard 1] | 2016-07-21 11:57:21.238335 | 127.0.0.2 | 1
cqlsh> select * from system_traces.sessions where session_id=227aff60-4f21-11e6-8835-000000000000;
session_id | client | command | coordinator | duration | parameters | request | started_at
--------------------------------------+-----------+---------+-------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+---------------------------------
227aff60-4f21-11e6-8835-000000000000 | 127.0.0.1 | QUERY | 127.0.0.2 | 639 | {'consistency_level': 'ONE', 'page_size': '100', 'query': 'INSERT into keyspace1.standard1 (key, "C0") VALUES (0x12345679
@Jammink2
Jammink2 / cp_transactions_2.sql
Created February 6, 2017 20:26
for Splice Machine Tutorial Video: Using Command Prompts for Transactions
-- second console
set schema CP;
select * from DOMAIN_DATA;
-- table doesn't exist in this session yet, therefore
-- ERROR 42X05: Table/View 'DOMAIN_DATA' does not exist.
-- switch to first console, commit changes