Latest posts

Visualising Class C Subnets

V

I’ve just started learning how to subnet and while there are plenty of resources to help with the calculations and understand the maths I tend to grasp things better if I have some visual representation.

To help, I put together the following table which – I hope – nicely illustrates the patterns of binary 0s and 1s in the 4th octet of a class C IP address and their correlation to the patterns of block sizes, network IDs, host IDs and broadcast addresses of the various subnets. The table is not intended to explain how to calculate subnets nor even to act as a cheat-sheet, but others may find the visual representation helpful.

(more…)

mysqli::prepare Fails Using ALTER TABLE In A Statement With Parameter Markers

m

Part of a project I’m working on requires re-setting a MySQL table by deleting most – but not all – rows. In PHP I’m using mysqli::prepare to prepare the MySQL statements.

$id = 5;
$query = $conn->prepare("DELETE FROM table WHERE id>?");

 

 

The MySQL statement includes a parameter marker – denoted by ? – which is then substituted for the value of the $id variable using mysqli::bind_param.

(more…)

Securing WordPress Login Using HTTP Authentication

S

Having spent some considerable time and effort cleaning this site after it had been hacked I was determined to make it as secure as I possibly could in an attempt to prevent it happening again.

This is a WordPress site running on an Apache server so one of the numerous measures I implemented was to use HTTP Authentication to password-protect the wp-login.php file.

(more…)

Resetting MAMP’s MySQL Root User Password

R

Those of you familiar with MAMP will no doubt know that MAMP’s MySQL root user password is set to root by default and changing it is not as straightforward as it perhaps should be.

I’ve previously described a way of successfully changing the root user password providing, of course, that you know the current password. If you’ve forgotten it, this method will not work and a way of re-setting the password is required.

(more…)

Recovering Lost Jetpack Stats in WordPress

R

Many of you will be familiar with the Jetpack plugin. I use Jetpack’s Stats module — previously the WordPress.com Stats plugin — to record and display this site’s page views.

Several Jetpack modules including the Stats module require a connection to an account at WordPress.com where your self-hosted WordPress site is given a unique ID. This unique ID is associated with the site’s domain name. If you change an already connected site’s domain name and reconnect it to your WordPress.com account it is given a new unique ID.

Herein lies the source of a problem I had recently which resulted in the apparent loss of all this site’s stats.

(more…)

Collapsible Sidebar Lists Plugin for WordPress

C

A previous theme I used for this site incorporated For some while this site’s been using the collapsible sidebar lists I described in this post. This method requires manually adding PHP and Javascript to the theme’s code. All a bit clunky really.

I’ve finally completed a plugin which provides the same functionality, but in a far more convenient way. The collapsible lists currently displayed in this site’s sidebar are generated by this plugin.

(more…)

Recent Comments

Recent Posts

Archives