Installing the NVIDIA Driver on Ubuntu and Stopping It from Auto-Updating
After you install the NVIDIA driver on Ubuntu, a system update will sometimes upgrade the driver along the way, and a version change can bring compatibility or stability problems. This post has two parts: first get the NVIDIA driver installed, then lock the driver version down with two mechanisms — an APT pin and apt-mark. Driver installation and verification require a real GPU, so that part is compiled from the original article’s tested record (Ubuntu 18.04 + GTX 1050) and updated to the Ubu...
Restricting User Command Execution with rbash (the Restricted Shell)
When contractors get temporary machine access or a student lab box hands out accounts, you can’t let those users run arbitrary commands on the system. Linux’s built-in restricted shell (rbash) exists exactly for this: switch the user’s login shell to bash’s restricted mode, combine it with a directory that only holds “whitelisted commands” and a narrowed PATH, and the user can only execute the commands you allow and access the paths you permit. The setup cost is low — no extra software, done ...
Managing Nginx Logs with logrotate: Configuration, Hooks, and Real Tests
Nginx’s access and error logs grow continuously; left unmanaged they will fill the disk sooner or later, and digging through history gets dragged down by huge single files. logrotate is the solution that ships with the system: rotate, compress, and delete old logs on a schedule, with a postrotate hook letting Nginx switch to the new file seamlessly. This article walks through a complete configuration using Nginx as the example, with the whole flow tested in an nginx:alpine container (nginx...
Setting Up a Postfix + Dovecot Mail Server on Rocky Linux 9 (with CentOS 7 Differences)
When you need to own your mail flow yourself — sending alerts from internal systems or notifications to registered users — Postfix can handle sending (MTA) and Dovecot can handle receiving (IMAP/POP3); together they make a perfectly usable self-hosted mail service. The main environment of this post is Rocky Linux 9, and everything from installation through the dual config check to a closed local-delivery loop was verified in a container: postfix check produced no output, ports 25/14...
Setting Up a BIND DNS Server on Rocky Linux 9: Forward and Reverse Resolution (with CentOS 7 Differences)
Once the intranet has a handful of machines, maintaining domains through /etc/hosts turns into a disaster — time to run your own DNS. This post uses BIND to set up a DNS server, configuring forward resolution (domain to IP) and reverse resolution (IP to domain) in one pass, and closes with the essentials of day-to-day maintenance and troubleshooting. The whole flow in this post was tested in a Rocky Linux 9 container: BIND 9.16.23-RH, both syntax checks, dig lookups in both directio...
Smooth Apache Upgrades: The Complete Path from 2.4.41 to 2.4.46
Upgrading Apache by uninstalling the old version and installing the new one straight over it costs you an outage window. The approach recorded here: compile and install the new version into its own directory, migrate the config over, bring it up on a separate port and test it, and only after it proves stable perform the switchover — keeping the upgrade’s impact on production as small as possible. Once you’ve walked the whole flow, old and new coexist and you can switch back at any time. This ...
/proc/sys/vm/drop_caches Best Practices: Manually Dropping Kernel Caches
Linux puts idle memory to work as file cache, so memory appearing “full” in free is often just the cache doing its job, not a real shortage — the available column is what applications can actually get. /proc/sys/vm/drop_caches therefore shouldn’t be cleaned every day, but it is the standard tool when you need a clean baseline before performance testing or want a maintenance window to start from a clean state: no reboot needed — write a number into this special file and the kernel releases the...
Installing MySQL 8.0 on Rocky Linux 9 (with CentOS 7 / MySQL 5.7 Differences)
To install Oracle’s MySQL on Linux there are two paths: use the distribution’s default repository, or add MySQL’s official repository to pin a specific version. This fork gave opposite answers in the two eras — CentOS 7’s default repository had only MariaDB, no MySQL; while Rocky Linux 9’s default repository provides MySQL 8.0 directly, installable with a single dnf install. The main environment for this post is Rocky Linux 9; the full flow from install, through initialization, to creating a ...
Writing a Shell Script That Restarts Tomcat Automatically
A Tomcat instance that runs long enough will eventually hit a memory leak or need a redeployment, and one clean automatic restart beats manually logging into the server every time. But the most common mistake in a “restart script” is getting the process up while never verifying anything. This post takes the original article’s classic script as the starting point, runs it on a Rocky Linux 9 container (Tomcat 10.1.59) and uncovers one false-positive defect in actual testing, then presents a cor...
Checking NIC Speed on Rocky Linux 9: ethtool, ifconfig, and nmcli
When troubleshooting a network problem, the first task is confirming what speed the NIC actually negotiated — a lit link light does not mean the link is running at its expected bandwidth. A gigabit port negotiating down to 100M, or auto-negotiation failing and downshifting the link: these are not rare in a server room. Linux offers three common entry points for NIC information: ethtool for link-layer speed, ifconfig (or its modern replacement ip addr) for interface state, and nmcli for device...