Skip to content

Instantly share code, notes, and snippets.

View domkirby's full-sized avatar
💭
I may be slow to respond. Contacting me at domkirby.com is best.

Dom Kirby domkirby

💭
I may be slow to respond. Contacting me at domkirby.com is best.
View GitHub Profile
@domkirby
domkirby / sharex_upload.php
Last active September 5, 2022 09:22
ShareX Uploader PHP script
<?php
/*
Sharex php upload
INSTALLATION:
-Fill out $secret_key, $sharexdir (or leave blank), and $domain_url
-Upload this to the root for the selected domain
-Configure ShareX Custom Uploader: https://i.imgur.com/y4WHMTH.png (to get to that menu: https://i.imgur.com/psMj84t.png)
@domkirby
domkirby / cb-to-teams.php
Created May 9, 2019 18:00
Middle man webhook to send customer thermometer responses to a channel in MSTeams
<?php
/*
Use of this script assumes that you know how to create a webhook url in teams. Google is your friend.
STEPS IN THIS FILE:
-Create a random password with no special charcters, put it in the quotes after $postSecret=
-Create your teams webhook, put it in quotes after $teams_webhook_url = (look within the PostToTeams function)
-Upload it to a webhost with PHP 7 or better, and use HTTPS like a friggin grownup
STEPS IS CUSTOMER THERMOMETER:
@domkirby
domkirby / FN_Connect-EOCustom.ps1
Created May 18, 2020 22:19
A function that checks for the new Exchange Online Management Shell and will use it if it's available. Otherwise, it falls back to the old connector, but with a warning.
function Connect-EOCustom {
if(Get-Command Connect-ExchangeOnline -ErrorAction SilentlyContinue) {
#The new module is installed
Write-Host "You have the modern management shell installed, it will be used to connect to EO!" -ForegroundColor Green;
Import-Module ExchangeOnlineManagement;
Connect-ExchangeOnline;
} else {
#the new module is not installed
Write-Host "NOTICE: You are not using the modern management shell. The old shell will soon be deprecated, but the script will continue for now." -ForegroundColor Yellow;
Write-Host "It is strongly recommended that you install the new shell using Install-Module -Name ExchangeOnlineManagement" -ForegroundColor Yellow;
@domkirby
domkirby / pandadoc.pem
Created November 22, 2022 23:44
Example PandaDoc Certificate
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
68:cf:f9:f9:80:49:e9:e3:62:0c:5b:da:09:ad:b8:ff
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2015 Entrust, Inc. - for authorized use only", CN = Entrust Class 3 Client CA - SHA256
Validity
Not Before: Dec 3 13:15:31 2021 GMT
Not After : Dec 25 13:15:31 2022 GMT
@domkirby
domkirby / Get-TenantIdFromDomainName.ps1
Created January 15, 2025 00:01
Uses openid /.well-known on Entra to look for a Tenant ID
function Get-TenantIdFromDomainName {
param (
[Parameter(Mandatory = $true)]
[ValidatePattern('^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$')]
[string]$DomainName
)
try {
# Construct the URL
$domLookupUrl = "https://login.microsoftonline.com/$DomainName/.well-known/openid-configuration"
@domkirby
domkirby / Fetch-MicrosoftSkuList.ps1
Last active January 17, 2025 16:03
Fetches a list of Microsoft SKUs to enable part number translation to product names
function Fetch-MicrosoftSkuList {
$csvUrl = 'https://download.microsoft.com/download/e/3/e/e3e9faf2-f28b-490a-9ada-c6089a1fc5b0/Product%20names%20and%20service%20plan%20identifiers%20for%20licensing.csv'
# The csvUrl will likely need to be updated from time to time.
try {
$csvContent =Invoke-WebRequest -Uri $csvUrl
$csvData = $csvContent | ConvertFrom-Csv
$skuLookup = @{}
foreach ($row in $csvData) {
$skuPartNumber = $row.'String_Id';
$productName = $row.'???Product_Display_Name'; #Weird bug where we get ??? on this column
@domkirby
domkirby / sha256.py
Created April 11, 2025 20:06
Simple sha256 for CTF
import hashlib
import sys
def hash_with_sha256(input_string):
"""Hashes the given input string using SHA-256 and returns the hexadecimal digest."""
sha256_hash = hashlib.sha256(input_string.encode('utf-8')).hexdigest()
return sha256_hash
if __name__ == "__main__":
if len(sys.argv) != 2: