Coding Projects
Website / Web Application Development
AWS Cost Dashboard
As part of my interest and ongoing training in AWS, this personal project showcases my evolving proficiency with the platform. It provides real-time cost metrics for all AWS services used within my account, retrieved directly via AWS APIs. The data is presented through a streamlined dashboard that alternates between tables and charts for easy visualization. The front end was built using TailwindCSS and AlpineJS, ensuring a responsive and modern user experience.
Scripting

HTML Server Reports
The attached PowerShell script was developed to query remote computers and servers for event log data. It retrieves relevant events and formats the results into an HTML table, making it easier to review and analyze system activity. This approach streamlines log monitoring across multiple machines and enhances readability for support.
$hosts = "localhost"
$Error_System = Get-eventlog -computername $hosts -LogName system | where {$_.EntryType -eq "Error"} | where {$_.TimeGenerated -gt ((Get-Date).AddDays(-1))} `
| select EventID, Timegenerated, EntryType, Source, Message | convertto-html -Fragment -PreContent "<H3><b> SYSTEM LOG</H3>" | out-string
$warning_System = Get-eventlog -computername $hosts -LogName system | where {$_.EntryType -eq "Warning"} | where {$_.TimeGenerated -gt ((Get-Date).AddDays(-1))} `
| select EventID, Timegenerated, EntryType, Source, Message | convertto-html -Fragment | out-string
$Error_App = Get-eventlog -computername $hosts -LogName application | where {$_.EntryType -eq "Error"} | where {$_.TimeGenerated -gt ((Get-Date).AddDays(-1))} `
| select EventID, Timegenerated, EntryType, Source, Message | convertto-html -Fragment -PreContent "<H3><b> APPLICATION LOG</H3>" | out-string
$warning_App = Get-eventlog -computername $hosts -LogName application | where {$_.EntryType -eq "Warning"} | where {$_.TimeGenerated -gt ((Get-Date).AddDays(-1))} `
| select EventID, Timegenerated, EntryType, Source, Message | convertto-html -Fragment | out-string
$Pre = "<h1>Daily Eventlog Report on $hosts</h1>"
$Header = @"
<title>
Event Log on *
</title>
<style>
TABLE {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
TH {font-weight: bold;border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color: #6495ED;}
TD {border-width: 1px;padding: 3px;border-style: solid;border-color: black;}
</style>
"@
$path = "C:\"+$hosts+".htm"
ConvertTo-Html -As table -Head $header -PostContent $ErrorSystem,$warningSystem,$Error_App,$warning_App -PreContent $pre | out-file $path -ForceGet Software Uninstall String From the Registry
The following PowerShell script was used to remotely uninstall software from desktop machines by leveraging the uninstall string stored in the Windows Registry. It automates the process by querying the target computer’s registry for installed applications, extracting the appropriate uninstall command, and executing it remotely. This method is particularly useful for managing software across a network without requiring manual intervention on each device.
$computers = "kevin-pc"
$array = @()
foreach($pc in $computers){
$computername=$pc
#Define the variable to hold the location of Currently Installed Programs
$UninstallKey=”SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall”
#Create an instance of the Registry Object and open the HKLM base key
$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey(‘LocalMachine’,$computername)
#Drill down into the Uninstall key using the OpenSubKey Method
$regkey=$reg.OpenSubKey($UninstallKey)
#Retrieve an array of string that contain all the subkey names
$subkeys=$regkey.GetSubKeyNames()
#Open each Subkey and use GetValue Method to return the required values for each
foreach($key in $subkeys){
$thisKey=$UninstallKey+”\\”+$key
$thisSubKey=$reg.OpenSubKey($thisKey)
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name “ComputerName” -Value $computername
$obj | Add-Member -MemberType NoteProperty -Name “DisplayName” -Value $($thisSubKey.GetValue(“DisplayName”))
$obj | Add-Member -MemberType NoteProperty -Name “DisplayVersion” -Value $($thisSubKey.GetValue(“DisplayVersion”))
$obj | Add-Member -MemberType NoteProperty -Name “InstallLocation” -Value $($thisSubKey.GetValue(“InstallLocation”))
$obj | Add-Member -MemberType NoteProperty -Name “Publisher” -Value $($thisSubKey.GetValue(“Publisher”))
$obj | Add-Member -MemberType NoteProperty -Name “UninstallString” -Value $($thisSubKey.GetValue(“UninstallString”))
$array += $obj
}
}
$array | where {$_.displayname} | Sort displayname | select ComputerName, DisplayName, DisplayVersion, Publisher,uninstallstring | ft -auto
Modify Active Directory Phone Numbers
This PowerShell script was developed to modify phone numbers in Active Directory during my time as Parmley Graham. As far as i recall the UK dialing code 44 was causing an issue with the CRM we were using. It automates the process of updating user attributes, ensuring consistency and accuracy across the directory. The script can be customized to target specific user groups or attributes, making it a versatile tool for managing user information in a Windows environment.
Import-Module activedirectory
$users = get-aduser -filter * -SearchBase "OU=HQ,DC=kevinlwilson,DC=CO,DC=UK" -Properties *
foreach ($user in $users) {
$mobnum = $user.mobilephone -replace "\+44","" -replace "\(", "" -replace "\)", ""
$officenum = $user.officephone -replace "\+44","" -replace "\(", "" -replace "\)", ""
$fax = $user.fax -replace "\+44","" -replace "\(", "" -replace "\)", ""
$homephone = $user.homephone -replace "\+44","" -replace "\(", "" -replace "\)", ""
$user | set-aduser -MobilePhone $num -Fax $fax -OfficePhone $officenum -HomePhone $homephone
}
Pyhton Image scraper
A Python program to extract image URLs from a web page
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin
# Replace with the URL you want to scrape
url = 'https://claires-recipes.uk'
try:
response = requests.get(url)
response.raise_for_status()
soup = BeautifulSoup(response.text, 'html.parser')
# Extract all image URLs
images = [urljoin(url, img['src']) for img in soup.find_all('img', src=True)]
print("Extracted image URLs:")
for img_url in images:
print(img_url)
print(" ")
except requests.exceptions.RequestException as e:
print(f"Error fetching the page: {e}")