Skip to content

Instantly share code, notes, and snippets.

View j-white's full-sized avatar

Jesse White j-white

View GitHub Profile
@j-white
j-white / gist:a15f25576c4e9edfcd6b19a05b8b1332
Created June 21, 2022 01:01
Debugging Keycloak via CRS
apiVersion: keycloak.org/v1alpha1
kind: Keycloak
metadata:
labels:
app: mykeycloak
name: mykeycloak
spec:
externalAccess:
enabled: true
instances: 1
#!/bin/sh
RELEASE=`python3 -c "import xml.etree.ElementTree as ET; print(ET.parse(open('pom.xml')).getroot().find( '{http://maven.apache.org/POM/4.0.0}version').text)";`
ROOT=`pwd`
if [ ! -e $ROOT/rebuild.sh ]; then
echo "Invalid root" && exit 1
fi
SRC_HOME="/Users/jwhite/git/opennms"
export MAVEN_OPTS="$MAVEN_OPTS -Xmx8g -XX:ReservedCodeCacheSize=1g"
@j-white
j-white / ALEC.md
Last active January 12, 2022 15:37
ALEC Demo

Provision a new node 'n1' using the Quick Add workflow.

Create a link between 'localhost' and 'n1' with a POST to /api/v2/userdefinedlinks

{
  "node-id-a": 1,
  "node-id-z": 2,
  "component-label-a": "port-a",
  "component-label-z": "port-z",
 "link-id": "localhost:port-a->n1:port-z",
<!-- Spring 4.2.x support -->
<feature name="spring" description="Spring 4.2.x support" version="4.2.9.RELEASE_1">
<bundle dependency="true" start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/1.0_6</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core/4.2.9.RELEASE_1</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-expression/4.2.9.RELEASE_1</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-beans/4.2.9.RELEASE_1</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop/4.2.9.RELEASE_1</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context/4.2.9.RELEASE_1</bundle>
<bundle start-level="30">mvn:org.apache.servicemix.bundles/org.apache.s
<?xml version="1.0" encoding="UTF-8"?>
<features name="my-features" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0 http://karaf.apache.org/xmlns/features/v1.3.0">
<feature name="confd-telemetry-auto" version="1.0" install="auto">
<config name="org.opennms.features.telemetry.listeners-single-port-flows">
name=Single-Port-Flow-Listener
class-name=org.opennms.netmgt.telemetry.listeners.UdpListener
parameters.port=50000
parsers.1.name=Netflow-5
@j-white
j-white / App.java
Last active April 7, 2020 00:47
Replay PCAP data over a socket
package org.opennms;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.util.concurrent.TimeUnit;
@j-white
j-white / docker_hack.sh
Created March 17, 2020 13:21
UC18 docker hack
# HACK: Fix apparmor failures when running helloworld container
echo "Waiting for Docker..."
until { sudo docker ps > /dev/null; } 2>&1; do
sleep 1
done
echo "Docker is up."
sudo sed -i 's/overlay2/aufs/' /var/snap/docker/current/config/daemon.json
sudo snap restart docker
@j-white
j-white / alarmd-health-dash.json
Created November 22, 2019 18:00
Grafana dashboard for OpenNMS Alarmd KPIs (w/ Helm)
{
"__inputs": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.3.3"
},
{
Date/Time Collections
1573884000000 0.0052571911292841516
1573876800000 0.005149608262108262
1573869600000 0.005138924264796358
1573862400000 0.005683760920388827
1573855200000 0.006249147902054879
1573848000000 0.005983686855779879
1573840800000 0.008610720674674164
1573833600000 0.005406373342419854
1573826400000 0.004722293447293448
{
"type": "model",
"authority-id": "x",
"brand-id": "x",
"series": "16",
"model": "ubuntu-core-18-pi4-arm64",
"architecture": "arm64",
"base": "core18",
"gadget": "pi4-devel",
"kernel": "linux-raspberrypi-org",