Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
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"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
>
@paoloantinori
paoloantinori / features.xml
Last active October 11, 2016 08:10
miniman harmless karaf features file
<?xml version="1.0" encoding="UTF-8"?>
<features name="sample.features">
<feature name="weld" resolver="(obr)" version="2.3.2.Final">
<bundle>mvn:org.codehaus.groovy/groovy-all/2.4.5</bundle>
</feature>
</features>
@paoloantinori
paoloantinori / bp.xml
Created October 11, 2016 07:59
minimal blue print camel route
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="myRoute">
var f = function(x){
var g = function(prev, x){
if(typeof x !== 'undefined'){
return prev + "l";
} else{
return g.bind(this, prev + "o");
}
}
return g("f", x);
}
@paoloantinori
paoloantinori / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@paoloantinori
paoloantinori / git.sh
Last active December 2, 2015 10:58
/usr/share/bash-completion/completions/git - Fedora 23
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@paoloantinori
paoloantinori / maven_install_artifact_locally.sh
Last active September 2, 2015 07:08
Helper function to automatically install manually downloaded Maven artifacts to local Maven repo.
#!/bin/bash
#
# Automates installation of manually downloaded artifacts in local Maven repo
# NOTE: works only if artifact contains its own metadata files
#
# Ex. 1
# maven_install_artifact_locally.sh fabric-core-1.2.0.redhat-133.jar
# Ex. 2
# find -name *.jar | xargs -n1 maven_install_artifact_locally.sh
#
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
Bundle[] bundles = context.getBundles();
try{
for(Bundle b : bundles){
if(b.getSymbolicName().toLowerCase().contains("ibm"))
b.start();
}
@paoloantinori
paoloantinori / XML.tmLanguage
Created August 13, 2015 09:57
Tweaked XML.tmLanguage for Sublime Text 3 to highlight correctly ELEMENTS that use DOT symbol. Files lives inside `Packages/XML.sublime-package`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>xml</string>
<string>tld</string>
<string>jsp</string>
<string>pt</string>
@paoloantinori
paoloantinori / hush.py
Last active August 29, 2015 14:14 — forked from awood/hush.py
#! /usr/bin/env python
# Copyright 2014 Alex Wood
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,