Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Tzolov tzolov

View GitHub Profile
@tzolov
tzolov / build.gradle
Last active May 12, 2020
sample-gradle
View build.gradle
plugins {
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
// id 'java'
id 'java-library'
id 'eclipse'
id 'maven-publish'
}
group = 'com.example'
View sample-docker-manifest.json
{ "schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"digest": "sha256:4bc51a5f5f5e48a2c152c545d391f15d74a549bf7e4c1a9af32b4d1746a66a3b",
"size": 4458 },
"layers": [
{ "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 26689544,
"digest": "sha256:2746a4a261c9e18bfd7ff0429c18fd7522acc14fa4c7ec8ab37ba5ebaadbc584"},
@tzolov
tzolov / ContainerImageMetadataPOM.xml
Created Jan 31, 2020
Generate Docker Images with Boot Metadata Configuration labels
View ContainerImageMetadataPOM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
View JibDockerImageLabelsReader.java
import java.io.Closeable;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Map;
import java.util.concurrent.Executors;
import javax.annotation.Nullable;
import com.google.cloud.tools.jib.api.Credential;
import com.google.cloud.tools.jib.api.DescriptorDigest;
@tzolov
tzolov / ContainerImageLabelReader.java
Last active Jan 29, 2020
Read Container Image Labels
View ContainerImageLabelReader.java
package org.springframework.cloud.dataflow.registry;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.codec.binary.Base64;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
View TfParseExampleSample.java
package io.mindmodel.services.image.recognition;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.BiFunction;
@tzolov
tzolov / CdcDemoApplication.java
Last active Jan 9, 2019
Use cdc-spring-boot-starter to bootstrap embedded Debezium engine in any Spring Boot application
View CdcDemoApplication.java
// For further information follow the instructions at:
// https://github.com/tzolov/cdc-debezium/tree/master/spring-cloud-starter-stream-common-cdc/cdc-spring-boot-starter
@SpringBootApplication
@AutoConfigureBefore(CdcAutoConfiguration.class)
public class CdcDemoApplication {
public static void main(String[] args) {
SpringApplication.run(CdcDemoApplication.class, args);
}
View SCDF twitter-sentiment
mkdir /tmp/twitter-sentiment
cd /tmp/twitter-sentiment
# Download SCDF 1.5.0.RC1 server and shell
wget https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-dataflow-server-local/1.5.0.RC1/spring-cloud-dataflow-server-local-1.5.0.RC1.jar
wget https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-dataflow-shell/1.5.0.RC1/spring-cloud-dataflow-shell-1.5.0.RC1.jar
# Download the pre-build twitter-sentiment-processor-rabbit-2.0.0.BUILD-SNAPSHOT.jar and twitter-sentiment-processor-rabbit-2.0.0.BUILD-SNAPSHOT-metadata.jar
wget https://www.dropbox.com/s/0praocvbwhqk6uq/twitter-sentiment-processor-rabbit-2.0.0.BUILD-SNAPSHOT.jar
wget https://www.dropbox.com/s/qewy9zwx1743w6z/twitter-sentiment-processor-rabbit-2.0.0.BUILD-SNAPSHOT-metadata.jar
View MyTableScanRule3.java
public class MyTableScanRule3 extends RelOptRule {
public MyTableScanRule3() {
super(operand(JdbcTableScan.class, any()));
}
@Override
public boolean matches(RelOptRuleCall call) {
JdbcTableScan jdbcTableScan = call.rel(0);
return super.matches(call);
@tzolov
tzolov / gitsubtree.sh
Created Aug 19, 2015
Create GIT Subtree
View gitsubtree.sh
git branch
develop
* feature/GEODE-131
master
git remote add -f ambari-gemfire https://github.com/Shangguan/ambari-gemfire
git subtree add --prefix=geode-ambari-plugin/src/main/resources/services/GEODE ambari-gemfire/master
git log --graph
You can’t perform that action at this time.