Sysadmins of the North (Page 14)

Technical SysOps blog, where topics include Sysadmin, DevOps, computers, servers, web, MySQL, database, virtualization, optimization and security

How to: Test MySQL database connectivity in ASP.NET, PHP, ASP

Whenever you need a MySQL connectivity test from a website or server, it's handy to have various test scripts nearby. Whether it is because you are setting up a new website or you have just installed a new server and are running your tests.

How to hide the .php file extension with IIS URL Rewrite Module

Sometimes it's important to remove (or hide) the file extension of scripts you use. Security by obscurity might be that reason, if you don't want others to know what script language you are using for your website, or for static site hosts.

Minify JavaScript, CSS and compress images

Optimizing, minify and compressing JavaScript and CSS files, the easy and fast way? With YUI Compressor on the Windows-, Linux- and macOS command line of course! Compacting HTML, CSS, and JavaScript can speeds up your website because of smaller and faster downloads, parsing, and execution time.

Read more...

Test SMTP Authentication and StartTLS

Investigate SMTP authentication issues like a boss! Particular over TLS encrypted SMTP connections, it's always handy if you are able to test the SMTP authentication and StartTLS connection. Preferably from your command-prompt.

IIS Outbound Rules with gzip compression

Saotn.org used URL Rewrite Outbound Rules in IIS to offload content from a different server or host name. Doing so, IIS uses URL Rewrite and acts as a reverse proxy. Add gzip compression to the mix, and this will improve website performance. But just recently I noticed Outbound Rules conflicted with gzip compressed content. The following HTTP 500.52 URL Rewrite Module Error was thrown...

prettyPhoto DOM based XSS

Uh-oh, prettyPhoto DOM based XSS on Saotn.org...

WordPress wp_options table autoload micro-optimization

Learn how to add an index and optimize WordPress' wp_options table for faster database results. This probably isn't a big issue, but today I noticed a slow MySQL query coming from a WordPress database (WordPress wp_options table). This made me investigate and to optimize the WordPress wp_options table "autoload" feature.

Check, repair and optimize MySQL tables with mysqlcheck

Mysqlcheck is a command line table maintenance program for MySQL. It checks, repairs, optimizes, or analyzes MySQL tables. Very handy for _automated performance optimizations_ of MySQL databases and tables. In this post I'll show you how to use `mysqlcheck` to optimize all MySQL tables using a cronjob.

Optimize WP StatPress plugin database performance

The WordPress StatPress plugin (no longer available in the Plugin Directory) is still widely used and still is very slow. Here are some MySQL statements you can use to optimize its performance, as a WordPress optimization tip...

Install WordPress plugins without WP-admin access

Install WordPress plugins without admin access, and automate your WordPress customization and plugin installation. WordPress has a little drop-in plugin option available in the form of /wp-content/install.php. This install.php file is not present at default, but when created it can be used to install plugins without wp-admin access. This might come in handy for unattended WordPress installations, customization, and so on.

Read more...

How to clean up Contact Form 7 temporary captcha files on IIS web servers

Contact Form 7 (CF7) is a WordPress plugin that provides a simple but flexible contact form. On IIS, Contact Form 7 captcha has one HUGE disadvantage: temporary captcha files placed in wp-content/uploads/wpcf7_captcha, are not automatically removed. The files are made read only. Here is how to remove Contact Form 7 temporary captcha files on IIS...

Read more...

Validate MIME types with PHP Fileinfo

How to check the file type in PHP and secure file uploads: it is important to validate MIME types in PHP. Especially of files uploaded through an upload form to your website.

Set or remove the read-only attribute assigned to files with PHP chmod

Chmod.php, change file attributes with PHP to make files read only or normally accessible on Windows IIS servers. Sometimes you need chmod to make files read only on your website, or make them normally accessible in case they already are read only. For instance Drupal's settings.php configuration file, or WordPress Contact Form 7 temporary captcha files, are examples of read-only files.

How to compare MD5 and SHA1 hashes in MySQL

Learn how to do MD5 and SHA1 hash comparisons in MySQL

WordPress plugin "In Over Your Archives" Call-time pass-by-reference fix for PHP 5.4

Here is how to fix PHP "Call-time pass-by-reference has been removed in ..." errors in PHP and WordPress.