Skip to content

Instantly share code, notes, and snippets.

View jimdiroffii's full-sized avatar
🏠
Working from home

Jim Diroff II jimdiroffii

🏠
Working from home
View GitHub Profile
@jimdiroffii
jimdiroffii / process-monitor.au3
Created September 14, 2020 15:17
Process monitor for Windows
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Icon\<iconfile.ico>
#AutoIt3Wrapper_outfile=ProcessMonitor.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Include<file.au3>
Dim $date = @MON & @MDAY & @YEAR
Dim $ProcessName1 = "<process1name.exe>"
Dim $ProcessName2 = "<process2name.exe>"
@jimdiroffii
jimdiroffii / move-mouse.ahk
Created September 14, 2020 15:18
Mouse Automation Example in AutoHotKey
^!m::
Loop 15
{
MouseMove, 766, 421
click 766, 421
Send 18{Enter}
MouseMove, 579, 75
Click 579, 75
MouseMove, 766, 421
}
@jimdiroffii
jimdiroffii / generateclientcert.ps1
Last active January 4, 2021 21:57
Azure Powershell - Generate root and client certificates
# With previous session from root generation still open
New-SelfSignedCertificate -Type Custom -DnsName <clientcertificatename> -KeySpec Signature `
-Subject "CN=<clientcertificatename>" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 4096 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
@jimdiroffii
jimdiroffii / updateOps.bat
Created January 28, 2021 07:48
Change a Simphony POS configuration without a CAL
@echo off
set /p id="Enter ServiceHost ID: "
set /p ws="Enter Workstation ID: "
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Micros\CAL\Config"
powershell -Command "(gc C:\Micros\Simphony\POSClient\Cfg\PosConfiguration.ini) -replace 'ClientID=\d\d\d\d\d\d', 'ClientID=%id%' | Out-File -encoding ASCII C:\Micros\Simphony\POSClient\Cfg\PosConfiguration.ini"
@jimdiroffii
jimdiroffii / removeapps.ps1
Created February 22, 2021 10:50
Remove Microsoft Store App Packages
# 3D Builder
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
# Alarms & Clock
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
# Calculator
Get-AppxPackage *windowscalculator* | Remove-AppxPackage
# Camera
@jimdiroffii
jimdiroffii / tsprereq.ps1
Created February 24, 2021 23:03
Oracle Micros - Transaction Services Prerequisite Installer Script
<#
# Check DNS Configuration
#>
Write-Host "Checking DNS configuration..."
$error.clear()
try {Resolve-DnsName -Name microsoft.com -DnsOnly -QuickTimeout}
catch { "timeout period expired" }
if ($error) {
@jimdiroffii
jimdiroffii / testsmtp.py
Created March 22, 2022 16:30
SMTP Tester in Python
import smtplib
def prompt(prompt):
return input(prompt).strip()
fromaddr = prompt("From: ")
toaddrs = prompt("To: ").split()
print("Enter message, end with ^D (Unix) or ^Z (Windows):")
# Add the From: and To: headers at the start!
@jimdiroffii
jimdiroffii / removeDNSServer.ps1
Last active May 19, 2022 17:14
Remove all old DNS server entries from Forward and Reverse Zones in Active Directory DNS using Powershell
# Original idea: https://devblogs.microsoft.com/scripting/clean-up-domain-controller-dns-records-with-powershell/
# dnsSrv is only the only the hostname, no domain, of active DNS server, i.e. MYDNSSERVER
$dnsSrv = "<active-dns-server-hostname>"
# the server we are trying to remove, FQDN is Fully Qualified Domain Name, i.e. MYDNSSERVER.mydomain.local
$oldSrvFQDN = "<old-dns-FQDN>"
$oldSrvHost = "<old-dns-Hostname>"
$oldSrvIp = "<old-dns-ip-address>"
@jimdiroffii
jimdiroffii / md5hash.ps1
Created April 2, 2023 03:49
Powershell MD5 File Hashing with Table Resize
Get-FileHash .\FGT* -Algorithm MD5 | Format-Table -AutoSize
@jimdiroffii
jimdiroffii / get-activeconnections.ps1
Created July 25, 2023 14:58
Display all active network connections using PowerShell
Function Get-ActiveConnections {
netstat -an | Where-Object { $_ -match 'ESTABLISHED|LISTENING' }
}