TECH / ARCHIVE

Servers & Websites

TECH / Servers & Websites 4 min

How to Set Up a Local Network NTP Server on FreeBSD

While auditing internal network services, I decided to document how to spin up a dedicated local NTP server to keep clocks aligned across office machines. If your network already runs a FreeBSD gateway or server for more than ten workstations, standing up local NTP takes about ten minutes.

FreeBSD local network NTP server architecture with /etc/ntp.conf and pool.ntp.org

In short: FreeBSD includes the ntpd daemon in the base system. All you need is enabling autostart in /etc/rc.conf, configuring pool.ntp.org upstreams with safe restrict rules in /etc/ntp.conf, opening UDP port 123 in your firewall, and checking peers with ntpq -p.

Read full article →

TECH / Servers & Websites 2 min

How to Get the First or Last Two Characters of a String in PHP

Grabbing the first two – or last few – characters of a string is an everyday PHP task when working with language codes, prefixes, or file extensions. For plain ASCII letters and digits, built-in substr() does the job, while multibyte UTF-8 text requires mb_substr().

PHP logo

Here are concise working examples for both cases so you never accidentally corrupt accented or non-Latin characters.

Read full article →

TECH / Servers & Websites 2 min

How to Fix “MySQL server has gone away” (Error 2006) – Causes & Solutions

The MySQL server has gone away error (code 2006) is one of the most common headaches when importing large SQL dumps, running WordPress migrations, or executing long-running PHP/Python scripts. It means your client sent a query after MySQL or MariaDB had already closed the connection.

Fixing MySQL server has gone away error 2006

Quick answer: 90% of the time it comes down to two server settings – max_allowed_packet being too small (large query or SQL dump import) or wait_timeout expiring on an idle connection.

Read full article →

TECH / Servers & Websites 4 min

How to Translate or Customize “Continue reading” in WordPress

I had a WordPress blog with a translated theme where menus, templates, and most plugin strings were already localized, yet every post preview still showed an English “Continue reading” link instead of the translated button.

Unlocalized Continue reading link in a WordPress themeLink in theme

Naturally, I opened the theme files, found the phrase “Continue reading,” and replaced it – but nothing changed on the live site. Online threads gave conflicting advice: some suggested editing localization files, others told me to modify template loops, and none of it worked reliably for everyone. Below is what actually caused the issue in my case and all the clean ways to customize or translate this link in WordPress.

Read full article →