Skip to content

Instantly share code, notes, and snippets.

View christian-posta's full-sized avatar

Christian Posta christian-posta

View GitHub Profile
@christian-posta
christian-posta / f8binarys2i.txt
Last active February 16, 2017 23:09
Using f8 s2i-java for binary builds
so... first make a dir $ROOT_DIR
then make $ROOT_DIR/deployments
copy spring-boot.jar to $ROOT_DIR/deployments
then from $ROOT_DIR run this:
oc import-image --from=fabric8/s2i-java:1.3 s2i-java --confirm
oc new-build --binary=true --strategy=source --image-stream=s2i-java --name=sample-foo
oc start-build sample-foo --from-dir=.
#!/bin/bash
MINIKUBE_VERSION=0.8.0
KUBECTL_VERSION=1.3.4
GOFABRIC8_VERSION=0.4.45
MAVEN_VERTSION=3.3.9
QUICKSTART_VERSION=2.2.164
function getMinikube {
if [[ "$OSTYPE" == "linux-gnu" ]]; then
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v$MINIKUBE_VERSION/minikube-linux-amd64
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.serialization.ByteArrayDeserializer;
import java.util.*;
@christian-posta
christian-posta / kafka.md
Created February 29, 2016 20:52 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@maxim
maxim / gh-dl-release
Last active May 13, 2025 00:14
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@ericandrewlewis
ericandrewlewis / index.md
Last active June 6, 2024 01:43
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@cmoulliard
cmoulliard / gist:0dc9a0981ad9099bb4e6
Created May 27, 2015 07:40
Apache Camel with DSL
package org.jboss.fuse.camel;
import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@cmoulliard
cmoulliard / gist:b8ecd0b24526117e5186
Created May 27, 2015 07:39
Using Apache Camel Without DSL
package org.jboss.fuse.camel;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
import org.apache.camel.LoggingLevel;
import org.apache.camel.Processor;
@chernjie
chernjie / logrotate.d-docker
Created April 17, 2015 17:31
Logrotate docker logs, copy this file to /etc/logrotate.d/docker
/var/lib/docker/containers/*/*-json.log {
dateext
daily
rotate 365
compress
delaycompress
missingok
}

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname