You are here: Sysadmins of the North » website

website

You are here: Sysadmins of the North » website

ASP.NET web application monitoring in Zabbix, part 2

Zabbix logo

When you host multiple websites in IIS, and you need to monitor them, Zabbix is one of your options. In Zabbix, you can take advantage of Windows Servers performance counters using perf_counter and perf_counter_en. In this article, I’ll show you some important Windows performance counters to monitor your ASP.NET web application in Zabbix.

Hugo development environment in WSL 2

My New Hugo Site created in WSL 2 on WIndows 10

Do you find it too difficult to install Go or Hugo in Windows for your static site development? Have you tried Windows Subsystem for Linux (WSL) 2? Using a default Ubuntu 20.04, it is pretty easy to install Hugo, set up your development environment and configure Hugo to listen on your Ubuntu’s IP address instead of localhost / 127.0.0.1. This makes your Hugo development site accessible for browsers in Windows 10. Neat, right?

How to fix System.Collections.Generic.KeyNotFoundException “The given key was not present in the dictionary” Exception with MySQL Connector/NET and utf8mb4 character set

An System.Collections.Generic.KeyNotFoundException “The given key was not present in the dictionary” can be the result of using a too old MySQL Connector/NET version in your ASP.NET web application. A KeyNotFoundException is thrown when an operation attempts to retrieve an element from a collection using a key that does not exist in that collection. An unsupported character set like utf8mb4 can be such a key, if your Connector/NET doesn’t support this character set. Luckily there is an easy workaround for this.

SSL in WordPress: how to move WordPress to HTTPS? The definitive guide

HTTPS for WordPress

Having an SSL certificate in your WordPress is the de-facto standard nowadays, did you know that? Google ranks sites having HTTPS higher in their SERP. But in WordPress, how do you configure an SSL certificate and HTTPS URL? You’ll learn the important steps to move WordPress from http to https in this post.

PHP 5.6 default_charset change may break HTML output

An important note for everyone who’s upgrading from PHP 5.4 and PHP 5.5, to PHP 5.6: the PHP default_charset in php.ini changed from “empty” to UTF-8, making UTF-8 the default charset in PHP. This may break HTML output if you try to set a different charset in your HTML head. It may also break functions like htmlentities() and htmlspecialchars. For example:

Redirect old URL to new URL or send 404 page with PHP

black traffic light under blue sky

Redirect pages with PHP. If you’ve moved some old PHP pages, or URLs, to new pages and URLs, you can use the following PHP code snippet to easily redirect all visitors and incoming requests to the new location. This PHP code snippet uses a 301 Moved Permanently redirect, perfect for SEO and returns a 404 Not Found if a new location hasn’t been set up yet.

Conditionally start Application Pools on remote IIS web servers

Microsoft Internet Information Services logo

In my routine, I occasionally have to start multiple website application pools when they are in a stopped state. On more than one web server. Being a lazy system administrator, I find it too much work to log on every server. Therefore I start those application pools in a loop. A condition for me to start application pools is that the application pool AutoStart property is set to true. This is because I set autostart to false when I disable hacked websites, and those application pools may not be started until all problems are resolved of course. To start application pools, I use the AppCmd command.

Exploit PHP mail() to get remote code execution

Exploit PHP mail() function to perform remote code execution, under rare circumstances. Security Sucks wrote about an interesting way to exploit PHP’s mail() function for remote code execution. Apparently, if you are able to control the 5th parameter of the mail() function ($options), you have the opportunity to execute arbitrary commands.

Send authenticated SMTP email over TLS from WordPress

How to configure TLS for SMTP email in WordPress. I was suprised WordPress is not able to send email using an SMTP server out-of-the-box. Not to mention using authenticated SMTP or TLS transport for security. A quick Google search showed me multiple plugins to handle this, but I wanted to create something myself. Here is how to override the wp-mail() function and send email using authenticated SMTP and StartTLS from WordPress.

Scroll to Top