Skip to content

Instantly share code, notes, and snippets.

View Rvolvr's full-sized avatar

Aaron Fleck Rvolvr

View GitHub Profile
@Rvolvr
Rvolvr / SophosVPNUninstall.ps1
Created August 30, 2023 21:21
PowerShell Remove Sophos VPN
Get-Process openvpn* | kill -f; get-service openvpn* | set-Service -Status Stopped -StartupType disabled; start-process 'C:\Program Files (x86)\Sophos\Sophos SSL VPN Client\Uninstall.exe' -ArgumentList '/S /qn'
@Rvolvr
Rvolvr / Push_Template.ps1
Created May 11, 2023 18:56
Distribute a PowerShell file to computers listed in a Tenable export CSV.
# Import the list
$list = Import-csv -path 'C:\Users\ADMIN\Downloads\file.csv'
# Define the script block: call PowerShell to allow the script.
$script = {powershell /executionpolicy bypass 'c:\temp\script.ps1'}
Foreach ($Comp in $list."asset.Name") {
# Test to see if machine is online before doing the work.
If (Test-Path \\$comp\c$\temp){
Robocopy.exe C:\files\ \\$comp\c$\temp\ /MT /NP
@Rvolvr
Rvolvr / log-to-discord.sh
Created November 18, 2021 17:43
Discord Webhook Logs
#!/bin/bash
# Use: ./log-to-discord.sh <LogFilePath> <DiscordWebHook> <LogKeyword>
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent -H "Content-Type:application/json" \
--data "{\"content\": \"$(echo $LINE | sed "s/\"/'/g")\"}" "$2";
done