Skip to content

Instantly share code, notes, and snippets.

View monodot's full-sized avatar
💭
I am working very hard

Tom Donohue monodot

💭
I am working very hard
View GitHub Profile
apiVersion: "kafka.strimzi.io/v1alpha1"
kind: KafkaConnector
metadata:
name: bd6-mongo-connector
labels:
strimzi.io/cluster: my-connect-cluster
spec:
class: io.debezium.connector.mongodb.MongoDbConnector
image: "quay.io/tdonohue/debenhams-mongo:latest"
config:
@monodot
monodot / 00-openshift-example-deploy-nginx.md
Last active December 19, 2024 15:01
Deploy nginx on OpenShift - example

OpenShift Example: Deploy nginx web server by creating resources from YAML files

Let's deploy nginx!

We'll create a Deployment, a Service and a Route. 🥔🥔

  1. We create a Deployment to run the nginx-unprivileged image (this Nginx image doesn't run nginx as root - because OpenShift doesn't like that!)
  2. We create a Service which load balances between the pods in the Deployment.
  3. We create a Route which forwards traffic onto the Service, and the Pods!
@monodot
monodot / GetAllBooksResponse.java
Created October 30, 2020 09:00
GetAllBooksResponse.java
package com.cleverbuilder.bookservice;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@monodot
monodot / ublock-filters.txt
Last active October 3, 2020 16:08
My custom filters for uBlock Origin
! 21/03/2020 https://twitter.com - remove annoyances/distractions
! Remove the annoying attention-sapping stuff: trending now, who to follow
twitter.com##div[aria-label='Timeline: Trending now']
twitter.com##aside[aria-label='Who to follow']
! 2020-10-03 Medium google login distraction
medium.com##div[id='credential_picker_container']
@monodot
monodot / che-plugin.yaml
Last active March 6, 2020 12:44
Theia Editor plugin definition for Eclipse Che (using quay.io as the image source)
version: 1.0.0-quayio
type: Che Editor
name: theia-ide
id: org.eclipse.che.editor.theia
title: Eclipse Theia for Eclipse Che
description: Eclipse Theia
icon: https://pbs.twimg.com/profile_images/929088242456190976/xjkS2L-0_400x400.jpg
endpoints:
- name: "theia"
public: true
@monodot
monodot / Application.java
Created January 28, 2020 17:25
Fuse/Camel - Wiring up AMQ (ActiveMQ) and Oracle AQ with JTA XA transactions (Narayana) on Spring Boot
package xyz.tomd.demos.fuse.springboot.amqxa;
import oracle.jdbc.xa.client.OracleXADataSource;
import oracle.jms.AQjmsFactory;
import org.apache.camel.component.jms.JmsComponent;
import org.messaginghub.pooled.jms.JmsPoolXAConnectionFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.jta.XAConnectionFactoryWrapper;
import org.springframework.context.annotation.Bean;
@monodot
monodot / get-fuse-fabric-profiles-and-containers.sh
Last active November 12, 2019 10:55
Extract profiles and containers from Fuse Fabric
# Gets a list of all profiles and containers from a Red Hat JBoss Fuse Fabric topology
# Note this is very rough and probably doesn't work :-)
cd $FUSE_HOME
export JAVA_HOME=/c/extdot/dev/java/jdk1.8.0_92
export FUSE_PASS=mypassword
/path/to/fuse/jboss-fuse-6.3.0.redhat-329/bin/client -a 8101 -h fuse.example.com -u adminmw fabric:container-list -p $FUSE_PASS > containerlist.txt
FIELDWIDTHS=$(head -1 containerlist.txt | grep -Po '.*? (?=\S|$)' | awk -v ORS=' ' '{printf length" "}')
awk -v FIELDWIDTHS="$FIELDWIDTHS" -v OFS=',' '{ print $1,$5 }' containerlist.txt | sed 's/ //' | awk '{$1=$1;print}'
awk -v FIELDWIDTHS="$FIELDWIDTHS" -v OFS=',' '{ print $1,$5 }' containerlist.txt | awk '{$1=$1;print}' | awk -F ',' '$1!="" {print "echo CONTAINER",$1; print "bin/client -a 8101 -h fuse.example.com -u adminmw -p $FUSE_PASS fabric:profile-display",$2} $1=="" { print "bin/client -a 8101 -h fuse.example.com -u adminmw -p $FUSE_PASS fabric:profile-display",$2 }'
@monodot
monodot / FileUploadRoute.java
Created July 2, 2019 08:28
Example Camel route for uploading some content with a filename
// Test using:
// curl -v -X PUT -H "filename: myfile.txt" -H "Content-Type: text/plain" -d "hello12345" http://localhost:8080/services/upload
rest("/upload")
.description("File upload service")
.consumes("text/plain")
.put().description("Upload a file")
.outType(String.class)
.param().name("filename")
@monodot
monodot / Jenkinsfile
Created May 29, 2019 16:55
Declarative Jenkins pipeline which reads a shared library from a private Git repo
/*
Firstly, you need to add a new Credential in Jenkins to access your Git.
Grab the ID of the Credential and use it in the credentialsId field below.
*/
library identifier: 'mylibraryname@master',
//'master' refers to a valid git-ref
//'mylibraryname' can be any name
retriever: modernSCM([
$class: 'GitSCMSource',
@monodot
monodot / DailyTimer-context.xml
Created September 12, 2018 09:20
Example Camel route which uses the Quartz2 component to fire every day at 12am
<?xml version="1.0" encoding="UTF-8"?>
<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://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<bean id="processor"
class="com.cleverbuilder.cameldemos.spring.scenarios.dailytimer.PrintDocuments"/>