Skip to content

Instantly share code, notes, and snippets.

View tristantarrant's full-sized avatar
🏠
Working from home

Tristan Tarrant tristantarrant

🏠
Working from home
  • Red Hat
  • Italy
View GitHub Profile
@tristantarrant
tristantarrant / infinispan-cli-cheatsheet.adoc
Last active October 11, 2019 19:03
Infinispan CLI Cheat Sheet

Create a cache using a template

create cache --template=org.infinispan.DIST_SYNC dcache

Create a permanent cache using a template

@tristantarrant
tristantarrant / hotrod-kerberos-authentication.adoc
Created October 9, 2019 07:46
Hot Rod authentication GSSAPI/Kerberos

GSSAPI/Kerberos Authentication for Hot Rod

krb5.conf

Prepare a krb5.conf file which describes your Kerberos environment (domain, KDC, etc.)

krb5.conf

<infinispan>
<jgroups>
<stack name="xsite" extends="udp">
<relay.RELAY2 site="LON" xmlns="urn:org:jgroups"/>
<remote-sites default-stack="tcp">
<remote-site name="NYC"/>
</remote-sites>
</stack>
</jgroups>
<infinispan>
<cache-container name="clustered">
<!-- Use the default udp stack -->
<transport cluster="cluster" stack="udp"/>
...
</cache-container>
</infinispan>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:10.0 http://www.infinispan.org/schemas/infinispan-config-10.0.xsd
urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.0.xsd"
xmlns="urn:infinispan:config:10.0"
xmlns:ispn="urn:infinispan:config:10.0">
<jgroups>
<!-- Inline our own JGroups stack -->
<stack name="mping">
<TCP bind_port="7800" port_range="30" recv_buf_size="20000000" send_buf_size="640000"
<infinispan>
<jgroups>
<!-- Use the "tcp" stack but replace the discovery -->
<stack name="tcpgossip" extends="tcp">
<MPING ispn:stack.combine="REMOVE" xmlns="urn:org:jgroups"/>
<TCPGOSSIP initial_hosts="${jgroups.tunnel.gossip_router_hosts:localhost[12001]}" ispn:stack.combine="INSERT_AFTER" ispn:stack.position="TCP" xmlns="urn:org:jgroups"/>
</stack>
</jgroups>
<cache-container name="clustered">
<infinispan>
<jgroups>
<!-- Load external JGroups stacks -->
<stack-file name="jgroups-udp" path="jgroups-udp.xml"/>
</jgroups>
<cache-container name="clustered">
<!-- Use the stack -->
<transport cluster="cluster" stack="jgroups-udp"/>
...
@tristantarrant
tristantarrant / github_pull_request.sh
Created October 26, 2018 15:25
GitHub Pull Request script
#!/bin/bash
#
# This script can be set as a git alias (I alias it to `pr`)
# It will force push the current branch to your fork (github.userfork) and open your browser to the PR creation page already
# compiled with a link to the corresponding Jira (assuming the local branch begins with the Jira issue name)
#
# Configure the variables below for your environment
ORIGIN_REMOTE=`git config --get github.upstream`
if [ -z "$ORIGIN_REMOTE" ]; then
echo "Missing git config property 'github.upstream'. Set it to the name of the remote repository which represents upstream"
@tristantarrant
tristantarrant / HotRodDecoder.java
Created July 9, 2018 15:36
Generated HotRodDecoder.java
package org.infinispan.server.hotrod;
import java.util.List;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.time.ZonedDateTime;
import java.time.temporal.Temporal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@tristantarrant
tristantarrant / zulip-custom.css
Created April 26, 2018 13:31
Custom Zulip CSS
div.message_content {
font-family: 'Cantarell';
font-size: 16px;
}
textarea.new_message_textarea {
font-family: 'Cantarell';
font-size: 16px;
}