This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rule name="HTTP to HTTPS redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
</conditions> | |
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> | |
</rule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump <dbname> -uroot --skip-triggers > "D:\<your>\<folder>\<dbname>%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.sql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forfiles.exe -p C:\<your>\<folder> -m *.txt -d -30 -c "cmd.exe /C del @path"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display_errors=On | |
log_errors=On | |
error_log = "D:\home\site\wwwroot\<your_dir>\php-errors.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hostname = hostname | |
Send-MailMessage -To admin@contoso.com -From "$hostname@contoso.com" -Priority High -SmtpServer smtp.contoso.com -Subject "$hostname - Backup Failure" -Body "A backup on $hostname has failed." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$webclient=New-Object System.Net.WebClient | |
$creds=Get-Credential | |
$webclient.Proxy.Credentials=$creds | |
$cred = Get-Credential | |
Add-AzureAccount -Credential $cred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cert = @(gci cert:\currentuser\my | |
-codesigning)[0] | |
Set-AuthenticodeSignature myscript.ps1 $cert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<system.webServer> | |
<security> | |
<requestFiltering> | |
<hiddenSegments> | |
<add segment="silverstripe-cache" /> | |
<add segment="vendor" /> | |
<add segment="composer.json" /> | |
<add segment="composer.lock" /> | |
</hiddenSegments> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADGroupMember -Identity "Some Group" -Recursive | Get-ADUser -Properties * | Export-Csv -Path "C:\Temp\groupdump.csv" -NoTypeInformation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define where Apache writes the log files | |
$logFiles = "C:\path\to\logs" | |
# Define the location the log files should be archived to | |
$logArchive = "C:\path\to\archive" | |
# Define for how many days we should retain logs in the archive location | |
$logLimit = (Get-Date).AddDays(-90) | |
# Stop the Apache HTTP Server service, using a wildcard to find it by name |
OlderNewer