Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2014 lb
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/**
* Copyright 2005-2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@lburgazzoli
lburgazzoli / SystemdWatchdog.java
Created November 11, 2015 14:23
Systemd Watchdog
import jnr.constants.platform.Signal;
import jnr.ffi.LibraryLoader;
import jnr.posix.POSIX;
import jnr.posix.POSIXFactory;
import jnr.posix.SignalHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@lburgazzoli
lburgazzoli / karaf-maven-plugin.md
Last active November 30, 2015 12:24
karaf-maven-plugin
  • build.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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <packaging>bundle</packaging>
@lburgazzoli
lburgazzoli / camel-braintree.blueprint.xml
Created January 8, 2016 10:31
camel-braintree.blueprint.xml
<?xml version="1.0"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xsi:schemaLocation="
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<cm:property-placeholder id="placeholder" persistent-id="org.jboss.quickstarts.fuse.camel.braintree">
@lburgazzoli
lburgazzoli / FileSystemUtils.java
Last active January 12, 2016 07:55
FileSystemUtils.java
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class FileSystemUtils {
private static Object FS;
private static Method GET_ATTRIBUTES;
static {
try {
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.14')
@Grab(group='org.apache.camel', module='camel-core', version='2.16.0')
@Grab(group='org.apache.camel', module='camel-infinispan', version='2.16.0')
import org.apache.camel.impl.DefaultCamelContext
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository
import org.infinispan.client.hotrod.RemoteCacheManager
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.14')
@Grab(group='org.apache.camel', module='camel-core', version='2.17.0')

import org.apache.camel.impl.*
import org.apache.camel.builder.RouteBuilder

def ctx = new DefaultCamelContext()
ctx.addRoutes(new RouteBuilder() {
    void configure() {
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.14')
@Grab(group='io.fabric8', module='kubernetes-client', version='1.3.100')
import org.slf4j.*
import io.fabric8.kubernetes.client.*
def logger = LoggerFactory.getLogger("k8s")
def config = new ConfigBuilder().withMasterUrl("https://172.28.128.4:8443").build()
new DefaultKubernetesClient(config).withCloseable {

Keybase proof

I hereby claim:

  • I am lburgazzoli on github.
  • I am lburgazzoli (https://keybase.io/lburgazzoli) on keybase.
  • I have a public key ASDz19rLTb69UxVi4NOwnv4tLBbuHYl7_zQNaKlTidjc6Qo

To claim this, I am signing this object: