Skip to content

Instantly share code, notes, and snippets.

View dmarrazzo's full-sized avatar

Donato dmarrazzo

View GitHub Profile
@dmarrazzo
dmarrazzo / fingerprint-auto.md
Created May 2, 2025 08:23
How to dynamically disable fingerprint reader when the laptop is plugged in the thunderbold docking station

How to dynamically disable fingerprint reader when the laptop is plugged in the thunderbold docking station

Create the script handler

Create and edit the script:

sudo vi /usr/local/bin/thunderbolt-handler.sh

Add the following content:

@dmarrazzo
dmarrazzo / MAD_Roadshow_Kafka_hands_on_experience.md
Last active July 3, 2023 17:50
MAD Roadshow Kafka hands on experience

Project

  1. Open the OpenShift Console
  2. From project drop down list, select Create Project
  3. In the name field type userX-kafka, then Create

Create Kafka custom resource

  1. Select the + icon in the top bar (top right)
  2. Copy the following yaml file:
@dmarrazzo
dmarrazzo / Total Bonus.dmn
Last active February 9, 2023 11:58
Tutorial
<?xml version="1.0" encoding="UTF-8"?>
<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/" xmlns="https://kiegroup.org/dmn/_1634073F-9433-44F1-B575-097FB410FEF2" xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/" xmlns:kie="http://www.drools.org/kie/dmn/1.2" xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="_D5CE1E36-CAA0-47FC-B04F-069AD65FC89E" name="Total Bonus" typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" namespace="https://kiegroup.org/dmn/_1634073F-9433-44F1-B575-097FB410FEF2">
<dmn:extensionElements/>
<dmn:itemDefinition id="_BDA79392-0FB5-4C68-AA46-83165F211051" name="tStringList" isCollection="true">
<dmn:typeRef>string</dmn:typeRef>
</dmn:itemDefinition>
<dmn:inputData id="_C15FB2B5-BF6B-43B9-B919-5AEBF6D1BC33" name="Products">
<dmn:extensionElements/>
<dmn:variable id="_DE6FB57C-10AF-4842-A748-A848132D5F0C" name="Products" type
@dmarrazzo
dmarrazzo / mirror-rh-doc.md
Created March 12, 2021 09:29
How to mirror the rhpam doc

How to mirror the doc

Download the first page and extract the links:

curl https://access.redhat.com/documentation/en-us/red_hat_process_automation_manager/7.8/ | sed -n 's/.*href="\([^"]*html-single[^"]*\).*/\1/p' | awk '{print "https://access.redhat.com"$1}' > links.txt

Create the mirror site:

@dmarrazzo
dmarrazzo / update.sh
Created March 12, 2021 09:27
mirror of upstream project documentation
#!/bin/bash
declare -a links=( "https://docs.jboss.org/drools/release/7.49.0.Final/drools-docs/html_single/index.html" \
"https://docs.optaplanner.org/7.49.0.Final/optaplanner-docs/html_single/index.html" \
"https://docs.jboss.org/jbpm/release/7.49.0.Final/jbpm-docs/html_single/" )
rm -rf docs*
for link in ${links[*]}; do
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $link
done
@dmarrazzo
dmarrazzo / EnvInfo.java
Created August 25, 2017 08:48
utility class to load endpoint and wsdl URL from system props
package utils;
public class EnvInfo {
private static String MOCK = "http://mas460:8088/mockPecManagerWsPortBinding";
public static String wsdl(String name){
return System.getProperty(name+"-wsdl", endpoint(name)+"?WSDL");
}
public static String endpoint(String name){
@dmarrazzo
dmarrazzo / kmodule.xml
Last active August 18, 2017 12:51
Knowledge Deplyment Descriptor
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<kbase name="kbase">
<ksession name="ksession" default="true" />
</kbase>
</kmodule>
@dmarrazzo
dmarrazzo / dmn.java
Last active August 18, 2017 06:42
drools dmn execution
KieServices kieServices = KieServices.Factory.get();
KieContainer kieContainer = kieServices.getKieClasspathContainer();
DMNRuntime dmnRuntime = kieContainer.newKieSession().getKieRuntime( DMNRuntime.class );
DMNModel dmnModel = dmnRuntime.getModel("http://www.trisotech.com/definitions/_90a17b17-c884-4fa9-ba59-7a47899d89b2", "driving-eligibility");
DMNContext dmnContext = dmnRuntime.newContext();
Map<String, Object> person = new HashMap<>();
person.put("name", "Donato");
person.put("age", 17);
@dmarrazzo
dmarrazzo / dmn pom.xml
Created August 17, 2017 09:05
libraries for DMN execution in Drools
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<version>7.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-core</artifactId>
<version>7.1.0.Final</version>
</dependency>
@dmarrazzo
dmarrazzo / loose-rules.wid
Created July 8, 2017 19:12
Work Item Handler definition
import org.drools.core.process.core.datatype.impl.type.StringDataType;
import org.drools.core.process.core.datatype.impl.type.ObjectDataType;
[
[
"name" : "loose-rules",
"description" : "invoke rules from an independent rule project",
"parameters" : [
"kbaseName" : new StringDataType(),
"fact" : new ObjectDataType()
],