Skip to content

Instantly share code, notes, and snippets.

Avatar
🦍
so hard

Viktor Gamov gAmUssA

🦍
so hard
View GitHub Profile
View kuma.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: kuma-system
labels:
kuma.io/system-namespace: "true"
---
apiVersion: v1
View service_mesh_for_java_developers_prerequisites.adoc

Workshop: Service Mesh for Java Developers

Requirements for Attendees

To make the most out of the "Service Mesh for Java developers" workshop, attendees are expected to meet the following requirements:

  1. Basic knowledge of Java development: Attendees should be familiar with Java programming concepts and have experience working with Java-based frameworks such as Spring Boot and Micronaut.

  2. Familiarity with containerization:

View udp_with_bash.sh
#!/bin/bash
exec 3<>/dev/udp/"$1"/"$2"
echo -e "\n" >&3
cat <&3
exit
@gAmUssA
gAmUssA / gp.sh
Created November 2, 2020 16:21 — forked from sunsided/gp.sh
kubectl color output: finally you can tell Pending from Running
View gp.sh
# https://unix.stackexchange.com/a/10065
# if stdout is a terminal
if test -t 1; then
# see if it supports colors
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold="$(tput bold)"
underline="$(tput smul)"
standout="$(tput smso)"
normal="$(tput sgr0)"
@gAmUssA
gAmUssA / IqRestApplication.java
Created October 19, 2020 16:48
Kafka Streams interactive questy + Spring webflux
View IqRestApplication.java
package io.confluent.developer.iqrest;
import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StoreQueryParameters;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.kstream.Consumed;
import org.apache.kafka.streams.kstream.Materialized;
import org.apache.kafka.streams.state.QueryableStoreTypes;
@gAmUssA
gAmUssA / notes.md
Last active May 13, 2020 21:36
5/13 #LiveStreams notes
View notes.md

5/13 #LiveStreams notes

9:47 put link to prep episode

flow

2:06 show starts! 7:52 intro 10:03 NEWS! 10:35 [blog] smarter rebalances in Kafka 12:55 Introducing Meetup Hub

@gAmUssA
gAmUssA / 1.adoc
Created January 21, 2020 16:57
source with ----
View 1.adoc

Asciidoc code formatting

Example 01

-- SQL Code block
SELECT SOME_FIELD FROM FOO;

Example 02

@gAmUssA
gAmUssA / live_tweeting.sql
Created October 17, 2019 06:37
KSQL code from my NDC Sydney talk
View live_tweeting.sql
SET 'auto.offset.reset' = 'earliest';
CREATE STREAM twitter_raw ( \
CreatedAt bigint,Id bigint, Text VARCHAR, SOURCE VARCHAR, Truncated VARCHAR, InReplyToStatusId VARCHAR, InReplyToUserId VARCHAR, InReplyToScreenName VARCHAR, GeoLocation VARCHAR, Place VARCHAR, Favorited VARCHAR, Retweeted VARCHAR, FavoriteCount VARCHAR, User VARCHAR, Retweet VARCHAR, Contributors VARCHAR, RetweetCount VARCHAR, RetweetedByMe VARCHAR, CurrentUserRetweetId VARCHAR, PossiblySensitive VARCHAR, Lang VARCHAR, WithheldInCountries VARCHAR, HashtagEntities VARCHAR, UserMentionEntities VARCHAR, MediaEntities VARCHAR, SymbolEntities VARCHAR, URLEntities VARCHAR) \
WITH (KAFKA_TOPIC='twitter_json_01', partitions=12, VALUE_FORMAT='JSON');
CREATE STREAM twitter AS \
SELECT TIMESTAMPTOSTRING(CreatedAt, 'yyyy-MM-dd HH:mm:ss.SSS') AS CreatedAt,\
EXTRACTJSONFIELD(user,'$.Name') AS user_Name, \
EXTRACTJSONFIELD(user,'$.ScreenName') AS user_ScreenName, \
@gAmUssA
gAmUssA / CurrencyProcessing.kt
Last active October 13, 2019 00:56
CurrencyProcessing.kt
View CurrencyProcessing.kt
import org.apache.kafka.streams.kstream.KGroupedStream
import org.apache.kafka.streams.kstream.KStream
import org.springframework.stereotype.Component
import org.springframework.cloud.stream.annotation.StreamListener
@Component
class CurrencyProcessing {
@StreamListener
fun processCurrency(input: KStream<String, Double>) {
@gAmUssA
gAmUssA / benchmark-commands.txt
Created June 15, 2018 13:19 — forked from zodvik/benchmark-commands.txt
Kafka (1.0.0) Benchmark Commands
View benchmark-commands.txt
Producer
Setup
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-two --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance --print-metrics --topic test-rep-one --num-records 6000000 --throughput 100000 --record-size 100 --producer-props bootstrap.servers=kafka_host:9092 buffer.memory=67108864 batch.size=8196
Single-thread, async 3x replication