Skip to content

Instantly share code, notes, and snippets.

View nddipiazza's full-sized avatar

Nicholas DiPiazza nddipiazza

View GitHub Profile
@nddipiazza
nddipiazza / disable-cookie-validation.patch
Created March 8, 2018 15:38
Changes to apply to firefox in order to allow web driver to add cookies before navigating to a page (Universal diff format)
sudo docker run -t -d -p 8765:8765 -p 8984:8984 -p 8983:8983 -p 8764:8764 --shm-size=2g --name testzombies openjdk:8u151-jdk
sudo docker exec -i -t testzombies /bin/bash
apt-get -y --fix-missing update && \
apt-get -y --fix-missing upgrade && \
apt-get -y --no-install-recommends install apt-utils && \
apt-get install -y wget lbzip2 git openjdk-8-jdk libdbus-glib-1-2 xvfb libgtk-3.0 procps gradle psmisc
wget https://download-installer.cdn.mozilla.net/pub/devedition/releases/59.0b14/linux-x86_64/en-US/firefox-59.0b14.tar.bz2
tar xvf firefox-59.0b14.tar.bz2
wget https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz
tar xzvf geckodriver-v0.19.1-linux64.tar.gz
/home/ndipiazza/Downloads/jdk1.8.0_141/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:45155,suspend=y,server=n -javaagent:/home/ndipiazza/Downloads/idea-IC-173.4127.27/plugins/Groovy/lib/agent/gragent.jar -javaagent:/home/ndipiazza/Downloads/idea-IC-173.4127.27/lib/rt/debugger-agent.jar=/tmp/capture.props -Dfile.encoding=UTF-8 -classpath /home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/charsets.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/deploy.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/cldrdata.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/dnsns.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/jaccess.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/jfxrt.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/localedata.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/nashorn.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/sunec.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jre/lib/ext/sunjce_provider.jar:/home/ndipiazza/Downloads/jdk1.8.0_141/jr
1519885689195 geckodriver INFO geckodriver 0.19.1
151988155618998189576 8g9e1c9k5o dgreicvkeord rIiNvFeOr LIiNsFtOe ngiencgk oodnr i12v7e.r0 .00..119:.219
1519885865809
197 geckodriver INFO Listening on 127.0.0.1:11831
*** You are running in headless mode.
*** You are running in headless mode.
Mar 01, 2018 6:28:10 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Mar 01, 2018 6:28:10 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
<soapenv:Header/>
<soapenv:Body>
<soap:GetContent>
<soap:objectType>Site</soap:objectType>
<soap:retrieveChildItems>true</soap:retrieveChildItems>
<soap:securityOnly>true</soap:securityOnly>
</soap:GetContent>
</soapenv:Body>
</soapenv:Envelope>
#!/bin/bash
echo -n "Enter sharepoint url (i.e. https://mytenant.sharepoint.com):"
read sharepointUrl
echo "Enter fedAuthToken (from logs): i.e. EgApAgMAAAAEgAAAAwAB ... wAAAAAAAA=="
read token
echo ""
curl -v -L -X POST \
"${sharepointUrl}/_forms/default.aspx?wa=wsignin1.0" \
-H 'Content-Type: application/soap+xml' \
-H 'Content-Length: 740' \
#!/bin/bash
echo -n Enter Sharepoint Username:
read sharepointUsername
echo -n Enter Sharepoint Password:
read -s sharepointPassword
echo ""
echo "Enter ADFS STS Trust endpoint (e.g. https://server.com/adfs/services/trust/2005/usernamemixed)"
read stsUrl
echo ""
uuid=$(uuidgen)
@nddipiazza
nddipiazza / grpc-ssl-setup.sh
Last active July 18, 2022 00:18
Simple bash script that sets up test certs for grpc
CN_NAME=localhost
# Certificate Authority
echo Generate CA key:
openssl genrsa -passout pass:1111 -des3 -out ca.key 4096
echo Generate CA certificate:
openssl req -passin pass:1111 -new -x509 -days 365 -key ca.key -out ca.crt -subj "/CN=${CN_NAME}"
# Server side key
echo Generate server key:
@nddipiazza
nddipiazza / SpPrefetchIndexBuilder.cs
Created November 9, 2017 18:29
Simple sharepoint c# example
using System;
using System.Net;
using System.Security;
using Microsoft.SharePoint.Client;
namespace SpPrefetchIndexBuilder
{
class SpPrefetchIndexBuilder
{
public static string defaultSite = "http://localhost";