Skip to content

Instantly share code, notes, and snippets.

View jeqo's full-sized avatar
🚶
vamos caminando

Jorge Esteban Quilcate Otoya jeqo

🚶
vamos caminando
View GitHub Profile
@jeqo
jeqo / kafka-active-segment-rotation.md
Last active March 21, 2024 06:39
[kafka] Active segment rotation
  1. Set retention check to shorter periods for more frequency (e.g. 10sec) on server.properties
log.retention.check.interval.ms=10000

and start zookeeper/kafka.

  1. Create a couple of topics
@jeqo
jeqo / logs-convert.sh
Last active September 25, 2022 01:15
sqlite-utils to load log4j log files into sqlite
# regex demo: https://regex101.com/r/2AxwfE/1
sqlite-utils insert /tmp/kafka-logs-test.db logs server.log.2022-09-24-21 --text --convert "
import re
r = re.compile(r'^\[(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})\]\s(?P<level>\w+)\s(?P<log>(.+(\n(?\!\[).+|)+))', re.MULTILINE)
def convert(text):
rows = [m.groupdict() for m in r.finditer(text)]
for row in rows:
row.update({'server': 'localhost'})
row.update({'component': 'broker'})
@jeqo
jeqo / kafka-client-reflection.json
Last active March 18, 2022 20:39
Kafka client reflection configurations for GraalVM
[
{
"name": "com.sun.security.sasl.ClientFactoryImpl",
"allDeclaredMethods": true,
"allDeclaredConstructors": true
},
{
"name": "org.apache.kafka.clients.consumer.RangeAssignor",
"allDeclaredMethods": true,
"allDeclaredConstructors": true
@jeqo
jeqo / KafkaStreamsTopologyGraphvizPrinter.java
Last active July 11, 2018 00:21
Generating Graphviz from Kafka Streams
import org.apache.kafka.streams.TopologyDescription;
import java.io.StringWriter;
import java.util.stream.Stream;
/**
*
*/
public class KafkaStreamsTopologyGraphvizPrinter {

Keybase proof

I hereby claim:

  • I am jeqo on github.
  • I am jeqo (https://keybase.io/jeqo) on keybase.
  • I have a public key ASCIm2UdVGVBKLX-DkhiL3voOQJsIBqNl_jold97uLKbZwo

To claim this, I am signing this object:

@jeqo
jeqo / Vagrantfile
Last active August 29, 2015 14:11
Running Oracle BPM 12c on AWS
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "yaml"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Load properties files
box_props = YAML.load_file("box.properties")
aws_props = YAML.load_file("aws.properties")
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#Path to new hard disk file
file_to_disk = './disk.vdi'
@jeqo
jeqo / stdin.conf
Created August 11, 2014 16:06
Logstash configuration for WLS logs
input {
file {
path => "C:/tmp/log/soa_server1.out"
start_position => beginning
}
}
filter {
if [path] =~ "soa_server1" {
mutate { replace => { type => "soa_server1-out" } }
multiline {
@jeqo
jeqo / extra
Last active August 29, 2015 14:03
Logstash Configuration File
WLS_ACCESS_MONTH \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?|jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|jun(?:e)?|jul(?:y)?|aug(?:ust)?|sep(?:tember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\b
WLS_ACCESS_HTTPDATE %{MONTHDAY}/%{WLS_ACCESS_MONTH}/%{YEAR}:%{TIME} %{INT}
WLS_ACCESS_COMMONAPACHELOG %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{WLS_ACCESS_HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)
WLS_SERVER_LOG ####<%{DATA:wls_timestamp}> <%{WORD:severity}> <%{DATA:wls_topic}> <%{HOST:hostname}> <(%{WORD:server})?> %{GREEDYDATA:logmessage}
package com.jeqo.htweb.view;
import com.oracle.xmlns.bpel.workflow.task.Humantask1PayloadType;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryService;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryService_Service;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.WorkflowErrorMessage;
import com.oracle.xmlns.bpel.workflow.taskservice.StaleObjectFaultMessage;
import com.oracle.xmlns.bpel.workflow.taskservice.TaskService;
import com.oracle.xmlns.bpel.workflow.taskservice.TaskServiceContextTaskBaseType;
import com.oracle.xmlns.bpel.workflow.taskservice.TaskService_Service;