Skip to content

Instantly share code, notes, and snippets.

View nddipiazza's full-sized avatar

Nicholas DiPiazza nddipiazza

View GitHub Profile
git config --global alias.recent "for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.cp cherry-pick
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
namespace SharePointOnlineTest {
class Program {
@nddipiazza
nddipiazza / confluence-create-test-users.xml
Created May 15, 2019 03:53
Soap UI project that can create a bunch of test users. Just update your password and go.
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="5bd9ce8d-2762-4c4f-ba6c-d8870f999878" activeEnvironment="Default" name="confluence" resourceRoot="" soapui-version="5.4.0" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:WsdlInterface" id="241b4ecf-ef3e-4ad5-b9dd-99f86f597f8c" wsaVersion="NONE" name="confluenceservice-v2SoapBinding" type="wsdl" bindingName="{http://localhost:8090/plugins/servlet/soap-axis1/confluenceservice-v2}confluenceservice-v2SoapBinding" soapVersion="1_1" anonymous="optional" definition="http://localhost:8090/rpc/soap-axis/confluenceservice-v2?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart="http://localhost:8090/rpc/soap-axis/confluenceservice-v2?wsdl"><con:part><con:url>http://localhost:8090/rpc/soap-axis/confluenceservice-v2?wsdl</con:url><con:content><![CDATA[<wsdl:definitions targetNamespace="http://localhost:8090/plugins/servlet/soap-axis1/confluenceservice-v2"
<#
.Synopsis
Get access token for AAD web app.
.Description
Authorizes AAD app and retrieves access token using OAuth 2.0 and endpoints.
Refreshes the token if within 5 minutes of expiration or, optionally forces refresh.
Sets global variable ($Global:accessTokenResult) that can be used after the script runs.
.Todo
#!/bin/bash
out_dir="/home/ndipiazza/test-files/lots_of_small_text_files"
mkdir -p "$out_dir"
num_folders=10
num_files_in_folders=1000
for i in $(seq 1 $num_folders)
do
mkdir "$out_dir/$i"
for j in $(seq 1 $num_files_in_folders)
do
@nddipiazza
nddipiazza / frozen-requirements.txt
Created November 9, 2019 15:25
frozen-requirements.txt updated for new cyrpto
apipkg==1.4
appdirs==1.4.3
asn1crypto==0.22.0
atomicwrites==1.1.5
attrs==18.1.0
awscli==1.10.58
azure-common==1.1.4
azure-nspkg==1.0.0
azure-storage==0.20.3
bcrypt==3.1.4
@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",
@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 / 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 / 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",