Skip to content

Instantly share code, notes, and snippets.

@rszuban
rszuban / dotcover-report-generator-code-coverage-for-azure-devops.ps1
Created February 16, 2019 19:22
Script generating a code coverage report with dotCover and later converting it with Report Generator so that Azure DevOps task Publish Code Coverage Results can use it.
#region Basic configuration variables
# Comment out or remove $dotnetExecutable or $vsTestExecutable depending on needs.
# Adjust paths so that they lead to executables on a build server.
$dotCoverExecutable = 'C:\Program Files\DotCover\dotCover.exe'
$dotnetExecutable = 'C:\Program Files\dotnet\dotnet.exe'
$vsTestExecutable = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\Extensions\TestPlatform\vstest.console.exe'
$reportGeneratorExecutable = 'C:\Windows\ServiceProfiles\NetworkService\.dotnet\tools\reportgenerator.exe'
# This pattern will be used to identify test projects. Use array if necessary.
@rszuban
rszuban / your_amazing_site.com.conf
Created September 18, 2018 08:30
Denying access to Wordpress xmlrpc.php via Nginx Server block
server {
listen 80;
server_name your_amazing_site.com www.your_amazing_site.com;
root /var/www/your_amazing_site.com;
index index.php;
access_log /var/log/nginx/your_amazing_site.com.access.log;
error_log /var/log/nginx/your_amazing_site.com.error.log;
@rszuban
rszuban / your_amazing_site.com.conf
Last active September 18, 2018 08:25
Redirecting requests to Wordpress xmlrpc.php to other URLs via Nginx Server block
server {
listen 80;
server_name your_amazing_site.com www.your_amazing_site.com;
root /var/www/your_amazing_site.com;
index index.php;
access_log /var/log/nginx/your_amazing_site.com.access.log;
error_log /var/log/nginx/your_amazing_site.com.error.log;
@rszuban
rszuban / .htaccess
Created September 18, 2018 07:59
Redirecting requests to Wordpress xmlrpc.php to other URLs via .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@rszuban
rszuban / .htaccess
Last active September 18, 2018 07:58
Denying access to Wordpress xmlrpc.php via .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress