Skip to content

Instantly share code, notes, and snippets.

View joegasper's full-sized avatar

Joe Gasper joegasper

View GitHub Profile
@joegasper
joegasper / proofpoint-decoder.html
Last active March 23, 2020 19:37
ProofPoint URL Defense (TAP) Decoder
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ProofPoint URLdefense Decoder</title>
<style type="text/css">
#decoded
{
width:515px;
height:400px;
@joegasper
joegasper / Get-PingSweep.ps1
Last active May 27, 2024 15:52
Get-PingSweep - super fast (~500ms) subnet ping sweep with option to resolve IP address
# Inspiration from https://twitter.com/mrhvid/status/929717169130176512 @mrhvid @Lee_Holmes
function ResolveIp($IpAddress) {
try {
(Resolve-DnsName $IpAddress -QuickTimeout -ErrorAction SilentlyContinue).NameHost
} catch {
$null
}
}
@joegasper
joegasper / Robocopy-WithPS.ps1
Created December 1, 2017 20:24
Run Robocopy with PowerShell
$site = 'mysite01'
$source = "\\my-web1\e$\websites\$site\"
$destination = "E:\websites\$site\"
#List only first
$logfile = "E:\$site-robo-test.txt"
$switches = "/E /L /R:2 /W:3 /NP /FFT /DST /LOG:$logfile /XF "".DS_Store"" ""thumbs.db"""
& robocopy.exe $source $destination $switches.Split(' ')
#Check Log File
Get-Content -Path $logfile -First 17
@joegasper
joegasper / Set-DnsClient2CloudFlareDnsService
Created April 2, 2018 01:03
Set Windows client to use CloudFlare DNS Service 1.1.1.1
#See: https://1.1.1.1/ and https://www.cnet.com/news/cloudfare-new-1111-dns-privacy-tool-would-speed-your-internet-too/
#Run in elevated PowerShell command shell
#Store current DNS servers
Get-NetAdapter -Physical | Where-Object {$_.Status -eq 'Up'} | Get-DnsClientServerAddress | Select ServerAddresses -expand ServerAddresses | Set-Content -Path $env:USERPROFILE\OriginalDNSservers.txt
$Display current DNS servers
Get-NetAdapter -Physical | Where-Object {$_.Status -eq 'Up'} | Get-DnsClientServerAddress
#Specifiy CloudFlare 1.1.1.1 service IP addresses (IPv4/IPv6)
$DNSservers = ('1.1.1.1','1.0.0.1','2606:4700:4700::1111','2606:4700:4700::1001')
#Set client DNS servers to CloudFlare DNS servers
Get-NetAdapter -Physical | Where-Object {$_.Status -eq 'Up'} | Set-DnsClientServerAddress -ServerAddresses $DNSservers
@joegasper
joegasper / Get-LoremName.ps1
Last active September 2, 2021 04:02
Generate random names and accounts based on Lorem Ipsum
<#
.Synopsis
Return a name based on Lorem Ipsum.
.DESCRIPTION
Calls public Loren Ipsum API and returns name and account name if requested.
.EXAMPLE
Get-LoremName
FirstName LastName
--------- --------
Plane Gloriosam
@joegasper
joegasper / Get-ShadowBox.ps1
Last active February 10, 2020 20:59
Remote Desktop Session Shadowing Mode in Windows 10
#Inspired by http://woshub.com/rdp-session-shadow-to-windows-10-user/
#You could feed ConvertFrom-String a template to have a perfect object from the qwinsta.exe command, but I didn't want to
#have to keep the template file around.
#This is quicker than walking someone through Quick Assist, but QA will work over the internet.
#This command will shadow a user's Windows 10 system and you will have control (after remote user's consent if you are proper - see GPO in the link).
$PC=(Read-Host -Prompt "PC Name");$ID = (qwinsta.exe /server:$PC | ConvertFrom-String | Where-Object P2 -eq console | select P4).P4;mstsc.exe /shadow:$ID /v:$PC /control
@joegasper
joegasper / ConvertTo-SRT.ps1
Last active January 13, 2025 16:33
Convert VTT files to SRT format
<#
.SYNOPSIS
Fast conversion of Microsoft Stream VTT subtitle file to SRT format.
.DESCRIPTION
Uses select-string instead of get-content to improve speed 2 magnitudes.
.PARAMETER Path
Specifies the path to the VTT text file (mandatory).
.PARAMETER OutFile
Specifies the path to the output SRT text file (defaults to input file with .srt).
.EXAMPLE
@joegasper
joegasper / Create-DriveSubstituteWithRecycleBinSupport.ps1
Last active October 26, 2024 20:32
Create Windows persistent drive substitute with support for Recycle Bin ( subst psubst )
# Run elevated. Rebooting is required.
# Enter your drive substitute and path
$DriveLetter = 'R'
$MapPath = 'C:\GitHub' #Ensure this path exists
# Inspired by https://superuser.com/questions/29072/how-to-make-subst-mapping-persistent-across-reboots
# Do not edit below
# Setup GUID in standard Registry notation
$GUID = '{' + [guid]::NewGuid().ToString() + '}'
# Save the GUID to a file so you can more easily find the registry changes further below.
@joegasper
joegasper / mslists-asset-manager-asset-gallery.json
Created November 4, 2020 23:44
MS Lists - Asset manager Asset gallery JSON code as of 11/4/2020 - fixed for Device Photo
@joegasper
joegasper / KalturaDownload.txt
Created December 9, 2020 06:41
Download Kaltura Video
You can get the videos from Kaltura.
In the code in the iframe player, in the <script> section with the comment "// Initialize the iframe with associated setup", the "downloadUrl" value is the path to the source video file.
"downloadUrl":"https:\/\/cdnapisec.kaltura.com\/p\/1727781\/sp\/172778100\/playManifest\/entryId\/1_6em2hqfj\/format\/download\/protocol\/https\/flavorParamIds\/0"
You can put that value as is straight into your browser's address bar and it will download the video.
After downloading, this is the path the browser saw as the download link.
https://cfvod.kaltura.com/pd/p/1727781/sp/172778100/serveFlavor/entryId/1_6em2hqfj/v/51/ev/35/flavorId/1_15xqmt35/fileName/18-RJA-1154_RJA_Culture_Video_(Source).mp4/name/a.mp4
The file downloaded as: 18-RJA-1154_RJA_Culture_Video_(Source).mp4