Tutorials for Developers & Sysadmins

Step-by-step guides for the work we actually do — Laravel, PHP, WordPress, MySQL, Linux servers, and the occasional rabbit hole. Every command has been run on a real machine; nothing is theoretical.

How to Get the Index in a jQuery .each() Loop

Get the index in a jQuery .each() loop via the first callback parameter: function (index, element). Includes $.each() for arrays/objects…

how7o

How to Get a Remote File’s Size from a URL in PHP

Get a remote file's size from a URL in PHP without downloading — get_headers($url, true) reads Content-Length, or cURL with…

how7o

How to Get the Current Year in PHP (and Laravel and JS)

Get the current year in PHP with date('Y'), in Laravel with now()->year or date('Y'), in JavaScript with new Date().getFullYear() —…

how7o

How to Get a Website’s Favicon URL with JavaScript

Get a website's favicon URL with JavaScript using Google's favicon service, DuckDuckGo's icons API, or the bare /favicon.ico fallback —…

how7o

How to Format a Number with Leading Zeros in PHP

Format a number with leading zeros in PHP using sprintf('%04d', $n) or str_pad($n, 4, '0', STR_PAD_LEFT). Both pad short numbers…

how7o

How to Reduce High Memory Usage on Windows 11

Reduce high memory usage on Windows 11: triage in Task Manager, disable startup apps, disable SysMain on SSDs, adjust visual…

how7o

How to Fix Quotas in cPanel

Fix broken cPanel quotas with /usr/local/cpanel/scripts/fixquotas. Includes the mount-option check, package quota verification, and CloudLinux INODES cap.

how7o

How to Find What’s Pinning MySQL at 100% CPU

Find what's pinning MySQL at 100% CPU: SHOW FULL PROCESSLIST, SHOW ENGINE INNODB STATUS\G, and information_schema.processlist queries to roll up…

how7o

How to Fix “Error: MySQL Shutdown Unexpectedly” in XAMPP

Fix the "MySQL shutdown unexpectedly" error in XAMPP: rename mysql/data to data_old, copy mysql/backup as the new data, restore your…

how7o

How to Fix “CORS Policy Blocked Origin” Errors

Fix "Origin blocked by CORS policy" errors: send Access-Control-Allow-Origin from PHP or .htaccess, handle preflight OPTIONS, and drop the wildcard…

how7o