Skip to content

Instantly share code, notes, and snippets.

---
# Source: dlf-chart/templates/namespace.yaml
kind: Namespace
apiVersion: v1
metadata:
name: dlf
labels:
app.kubernetes.io/name: "dlf"
---
# Source: dlf-chart/charts/csi-h3-chart/templates/csi-controller-rbac.yaml
@gdubya
gdubya / drill_jdbc.py
Created October 26, 2020 09:08
An example of using the JayDeBeAPI for a JDBC connection to Apache Drill
import jaydebeapi
def ResultIter(cursor, arraysize=1000):
'An iterator that uses fetchmany to keep memory usage down'
while True:
results = cursor.fetchmany(arraysize)
if not results:
break
for result in results:
yield result
public class TenantIdentifierResolver implements CurrentTenantIdentifierResolver {
private static final Logger LOGGER = LoggerFactory.getLogger(TenantIdentifierResolver.class);
private final MyTenantNamingStrategy myTentantNamingStrategy;
/**
* Overrides the tenantIdentifier for this Thread.
* Only to be used by {@link #withTenantId(String, Runnable)}
*/
private final ThreadLocal<String> tenantIdOverride = new ThreadLocal<>();
@gdubya
gdubya / Dockerfile
Created November 21, 2019 20:00
Dockerfile for using Java 11 with SCDF
FROM springcloud/spring-cloud-dataflow-server:latest
RUN rm -rf /opt/openjdk && \
cd /opt && \
curl https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz | tar xz && \
mv /opt/jdk-11 /opt/openjdk
ENTRYPOINT ["java","-cp", "/maven/spring-cloud-dataflow-server.jar", "-Dloader.path=/opt/driver", "org.springframework.boot.loader.PropertiesLauncher"]
reproducible-maven-build on  master [?]
➜ mvn -q clean install && md5sum target/*.jar
299c436f70f9f0bd9c6fcd73201864f4 target/reproducible-maven-build-1.0-SNAPSHOT.jar
reproducible-maven-build on  master [?] took 2s
➜ mvn -q clean install && md5sum target/*.jar
79e015fa53a6bb8127aecfcd98fb8c11 target/reproducible-maven-build-1.0-SNAPSHOT.jar
FROM alpine:3.3
# Here we use several hacks collected from https://github.com/gliderlabs/docker-alpine/issues/11:
# # 1. install GLibc (which is not the cleanest solution at all)
# Build variables
ENV FILEBEAT_VERSION 5.1.1
ENV FILEBEAT_NAME filebeat-${FILEBEAT_VERSION}-linux-x86_64
ENV FILEBEAT_URL https://artifacts.elastic.co/downloads/beats/filebeat/${FILEBEAT_NAME}.tar.gz
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>

Keybase proof

I hereby claim:

  • I am gdubya on github.
  • I am gdubya (https://keybase.io/gdubya) on keybase.
  • I have a public key ASAx2yHJr9rCwnFz6DlvMuEcjQ-krOsGm7pqIgfzs0qN6wo

To claim this, I am signing this object:

@gdubya
gdubya / gist:bfe956d38296fa1d243b
Created May 11, 2015 20:49
Verifying I am +gareth_western on my passcard. https://onename.com/gareth_western
Verifying I am +gareth_western on my passcard. https://onename.com/gareth_western
@gdubya
gdubya / Entity.java
Last active September 15, 2017 22:59
Java 8 Annotation Reflection Problem
public class Entity {
private String name;
@MyAnnotation("test")
public String getName() {
return name;
}
}