Skip to content

Instantly share code, notes, and snippets.

View droxer's full-sized avatar
:octocat:
Building

Fei He droxer

:octocat:
Building
  • Internet
View GitHub Profile
# Setup KRaft
$CONFLUENT_HOME/bin/kafka-storage random-uuid
$CONFLUENT_HOME/bin/kafka-storage format -t <uuid> -c ./etc/kafka/kraft/server.properties
# Start Kafka
$CONFLUENT_HOME/bin/kafka-server-start ./etc/kafka/kraft/server.properties
# Start Kafka Schema Registry
$CONFLUENT_HOME/bin/schema-registry-start ./etc/schema-registry/schema-registry.properties
{
"name": "test-mysql-connector01",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"tasks.max": "1",
"database.hostname": "127.0.0.1",
"database.port": "3306",
"database.user": "root",
"database.password": "",
"database.include.list": "test-src01",
{
"name": "test-mysql-sink",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"group.id": "test-mysql-sink",
"topics": "post,comment",
"connection.url": "jdbc:mysql://localhost:3306/test-des?user=root&nullCatalogMeansCurrent=true",
"auto.create": "true",
"auto.evolve": "true",
@droxer
droxer / ffmpeg-cheatsheet.md
Created March 29, 2018 14:31 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@droxer
droxer / nginx.conf
Created July 24, 2017 09:55 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
public abstract class TypeReference<T> {
private final Type type;
@droxer
droxer / go-embedded.go
Created November 30, 2015 02:25
Go embedded example.
package main
import (
"fmt"
)
type Pinger interface {
Ping()
}
@droxer
droxer / introrx.md
Last active August 29, 2015 14:26 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@droxer
droxer / rx-example.java
Created July 15, 2015 05:55
RxJava example.
package rxexamples;
import rx.schedulers.Schedulers;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@droxer
droxer / data-container.sh
Created June 10, 2015 01:07
Docker data only container backup/restore
# backup
docker run --volumes-from mongodata -v $(pwd):/backup busybox tar cvf /backup/backup.tar /data/db
# restore
docker run --volumes-from mongodata -v $(pwd):/backup busybox tar xvf /backup/backup.tar
# Dockerfile
FROM centos