Skip to content

Instantly share code, notes, and snippets.

package com.example.demo;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@skayikci
skayikci / DockerRedis_ExportImport_Dump.sh
Created December 21, 2020 11:27 — forked from alister/DockerRedis_ExportImport_Dump.sh
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis
@skayikci
skayikci / restart_bluetooth.sh
Created March 25, 2020 11:22 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@skayikci
skayikci / gist:a9f7b1bfafe18d532e5889f99bad8a76
Last active May 31, 2018 10:20
a bash script which pulls from master branch and creates a new tag with a given name, deletes existing upon request
#!/usr/bin/env bash
function quit {
exit
}
function createTag(){
echo "Changing to master branch for $1"
cd "/$1"
git status
@skayikci
skayikci / listBulkInsert.rb
Created April 3, 2014 13:37
(mysql2 - redis - ruby combo) for inserting bulk data into a redis list
require 'mysql2'
begin
# you should fill those empty places inorder to read from the database
db = Mysql2::Client.new(:host => "localhost", :username => "", :password => "", :database => "")
# update table_name with the table name you created
@results = db.query("SELECT * FROM table_name")
command ||= ""