Skip to content

Instantly share code, notes, and snippets.

View nddipiazza's full-sized avatar

Nicholas DiPiazza nddipiazza

View GitHub Profile
@nddipiazza
nddipiazza / KafkaTest.java
Created July 18, 2022 19:16
Test with Kafka + TestContainers
import java.time.Duration;
import java.util.Collections;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
@nddipiazza
nddipiazza / TikaPipesKafkaTest.java
Created July 11, 2022 14:55
Kafka with Testcontainers
package org.apache.tika.pipes.kafka.tests;
import java.io.File;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="14.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="33" ObjectPathId="32"/><Query Id="34" ObjectPathId="32"><Query SelectAllProperties="false"><Properties/></Query><ChildItemQuery SelectAllProperties="false"><Properties><Property Name="Users" SelectAll="true"><Query SelectAllProperties="false"><Properties/></Query></Property><Property Name="Id" ScalarProperty="true"/><Property Name="LoginName" ScalarProperty="true"/><Property Name="PrincipalType" ScalarProperty="true"/><Property Name="Title" ScalarProperty="true"/></Properties></ChildItemQuery></Query></Actions><ObjectPaths><Property Id="32" ParentId="3" Name="SiteGroups"/><Property Id="3" ParentId="1" Name="Web"/><StaticProperty Id="1" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current"/></ObjectPaths></Request>
@nddipiazza
nddipiazza / run-remote-debugging-chromium.sh
Created January 7, 2020 16:04
Run chromium remote debugging sever
FUSION_HOME=/path/to/fusion/4.2.1
REMOTE_DEBUGGING_PORT=4050
AUTH_SERVER_WHITELIST="your.startlink.com" # comma separated
AUTH_NEGOTIATE_DELEGATE_WHITE_LIST="your.startlink.com" # comma separated
AUTH_SCHEMES="basic,digest,ntlm,negotiate"
HEADLESS="--headless" # set this to --headless if you want a headless browser, otherwise leave blank.
KEYTAB_FILE_PATH="/path/to/your/youruser.keytab"
KERBEROS_PRINCIPAL_NAME="HTTP/youruser@YOUR.REALM.COM"
echo "Removing current kerberos session from cache"
@nddipiazza
nddipiazza / common.sh
Last active January 6, 2020 22:35
common.sh with kinit for connectors-classic jvm
#!/usr/bin/env bash
AGENT="apps/lucidworks-agent.jar"
# FUSION_VERSION_BIN is e.g. /opt/lucidworks/fusion/3.0.0/bin
# this may have been set by a script that is sourcing this file
# like init/systemd/install.sh. If it is not set, assume we are being
# sourced by a script in bin and set it accordingly.
if [[ -z $FUSION_VERSION_BIN ]]; then
FUSION_VERSION_BIN=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
fi
@nddipiazza
nddipiazza / http-realm.json
Created December 14, 2019 03:11
http-realm.json
{
"enabled": true,
"name": "trusted_http_realm",
"realmType": "trusted-http",
"roleNames": [
"admin"
],
"config": {
"autoCreateUsers": true,
"identityKey": "iv-user",
@nddipiazza
nddipiazza / setup-mod-proxy.sh
Created December 14, 2019 03:10
setup-mod-proxy.sh
apt update
apt install openssl
# edit me, MUST have trailing slash
export fusion_host="http://192.168.1.199:8764/"
export myip="$(hostname --ip-address)"
echo '[ req ]' >> /usr/local/apache2/fusion.com.conf
echo 'default_bits = 4096' >> /usr/local/apache2/fusion.com.conf
@nddipiazza
nddipiazza / spoidcrl.ps1
Last active January 9, 2024 17:59
Retrieve SPOIDCR cookie for SharePoint Online.
<#
.Synopsis
Retrieve SPOIDCR cookie for SharePoint Online.
.Description
Authenticates to the sts and retrieves the SPOIDCR cookie for SharePoint Online.
Will use the custom IDP if one has been setup.
Optionally, can use integrated credentials (when integrated is set to true) with ADFS using the windowsmixed endpoint.
Results are formattable as XML, JSON, KEYVALUE, and by line.
Makes global variables avaiable at the end of the run.
@nddipiazza
nddipiazza / parse-output.json
Last active December 4, 2019 01:44
OneNote parse output from Here is the OneNote file I'm using to parse: https://drive.google.com/file/d/1uROTEnKeBKU08CG_K5zdDTGHa178LgBK/view?usp=sharing
This file has been truncated, but you can view the full file.
[ {
"revisionListGuid" : "{2CF11C0C-71AD-6F4E-BF76-E0E2AB84257D} [1]",
"oneNoteType" : "Revision",
"fileNode" : {
"oneNoteType" : "FileNodePointer",
"size" : 7,
"offsets" : [ 0, 1 ],
"children" : [ {
"fileNodeBaseType" : "0x1",
"oneNoteType" : "FileNode",