Skip to content

Instantly share code, notes, and snippets.

View mattou07's full-sized avatar

Matthew Hart mattou07

View GitHub Profile
@mattou07
mattou07 / self-container-sqllogin.txt
Created August 3, 2023 15:30
Self contained SQL login for Umbraco database run on the specific database
CREATE USER [username] with password = 'password'
ALTER ROLE [db_datawriter] ADD MEMBER [username]
ALTER ROLE [db_ddladmin] ADD MEMBER [username]
ALTER ROLE [db_datareader] ADD MEMBER [username]
@mattou07
mattou07 / getWifiPassword.ps1
Created November 17, 2022 15:06
A small script to list your wifi profiles and retrieve the password if present
$netshResult = &netsh wlan show profile
$wifiList = @()
foreach($t in $netshResult){
$line = $t -split(":")
if($line[1]){
$wifiList += $line[1].substring(1)
}
}
<rule name="RestrictBackOffice" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{URL}" pattern="/Umbraco/*" />
<add input="{URL}" pattern="/Umbraco/surface/*" negate="true" />
<add input="{REMOTE_ADDR}" pattern="Your-IP" negate="true"/>
<add input="{REMOTE_ADDR}" pattern="Another-IP" negate="true"/>
<add input="{REMOTE_ADDR}" pattern="127.0.0.1" negate="true"/>
<add input="{HTTP_X_FORWARDED_FOR}" pattern="Your-IP" negate="true"/>
<add input="{HTTP_X_FORWARDED_FOR}" pattern="Another-IP" negate="true"/>
@mattou07
mattou07 / build-project.ps1
Last active August 2, 2021 09:31
Build your Visual Studio Solution without "Opening" Visual Studio (You still need it installed)
#Place me in the same folder as the sln file
#Get the path of the sln file
Get-ChildItem -Path .\ -Filter *.sln -Recurse -File | ForEach-Object {
$solution = $_.FullName
}
#If you don't have Visual Studio Professional update the path to use a different edition i.e Community or Enterprise. Make sure MsBuild.exe is located there
cmd /c "`"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MsBuild.exe`" `"$solution`" /t:Restore"
cmd /c "`"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MsBuild.exe`" `"$solution`" /t:Rebuild"