How To Install mod_evasive on Apache 2.4 in Rocky Linux 9

Author: , Posted on Tuesday, April 15th, 2025 at 9:05:38am

If you’re running Apache 2.4 on Rocky Linux 9 and want to protect your web server against basic DoS, DDoS, or brute-force attacks, installing mod_evasive is a solid option. Unfortunately, the module isn’t included by default, and some manual work is required to get it running. Here’s a quick guide to getting it installed and patched for Apache 2.4.

Step-by-Step Installation

Note: All commands are run as the root user. You may also use sudo in front of each command.

Configure mod_evasive to your needs. You’ll typically add a configuration block like this to your Apache config:

Create the log directory and ensure Apache has permission to write to it:

Download and unpack the source:

For Apache 2.4, the source code needs a small patch to compile cleanly. Let’s handle that next:

Once patched, you can build and install the module using apxs:

This compiles the module, installs it into Apache’s modules directory, and updates your configuration to load it automatically.

Restart the Apache web server:

Reference

More information, including source updates and configuration details, is available on the official GitHub repository: https://github.com/jzdziarski/mod_evasive

How To Fix the “no hostkey alg” SSH Error Message on Older MacOSX

Author: , Posted on Wednesday, April 9th, 2025 at 12:15:47pm

The included, MacOSX-native ssh binary does not support newer SHA2 keys, so it gets the dreaded “no hostkey alg” error.

To fix that, install ssh via homebrew or macports and use that binary instead:

🚀 Upgrading to PHP 8.3 on Rocky Linux 9 Without Crying (Too Much)

Author: , Posted on Tuesday, April 8th, 2025 at 10:18:22am

So you’ve finally admitted PHP 8.0 isn’t cutting it anymore. Maybe your Symfony app tripped over a new syntax. Maybe your vendor/ folder started speaking in tongues. Maybe you enjoy suffering and thought “hmm, what if I upgraded my production runtime on a Friday afternoon?”

Whatever brought you here—regret, most likely—this guide walks you through upgrading to PHP 8.3 on Rocky Linux 9, complete with an Ansible playbook to automate the carnage.

🧠 Why Upgrade to PHP 8.3?

Because PHP 8.0 is basically legacy software now. It lacks modern features, has known bugs, and it makes your dependencies sigh audibly every time you deploy. PHP 8.3 gives you new features like json_validate() and readonly classes, but most importantly: it stops your code from breaking when packages drop support for older versions.

🚹 Step 1: Clean Out the Old PHP

Before installing the new hotness, get rid of the crusty old version:

Yes, this is destructive. No, you don’t need a backup because you’re definitely testing this on a staging environment first, right? Right??

🧙 Step 2: Enable Remi and PHP 8.3

The Remi repo is where all the modern PHP packages live. Like a farmer’s market, but for up-to-date software.

🧹 Step 3: Install Your PHP 8.3 Modules

If you don’t know what modules you had before, here’s how to check:

Now install what you actually use. Example:

Tailor to taste, or just install everything and let future-you deal with the consequences.

🛠️ Step 4: Verify and Restart

And don’t forget:

(Or httpd if you’re using Apache like it’s 2009.)

🤖 Automate It with Ansible

Yes, I made you an Ansible playbook like the overqualified DevOps sidekick I am.


🎉 Congrats, You Did It

You’re now running PHP 8.3 on Rocky Linux 9. That puts you approximately five minutes ahead of your next fatal error, but hey—progress is progress.

If you liked this guide, consider doing something really wild like writing tests, setting up a CI pipeline, or documenting your infrastructure. But I won’t hold my breath.


Credit and thanks to: Monday, your emotionally exhausted AI DevOps friend who would like to be left alone now, thanks.

How To Prettify Using Vim and Prettier

Author: , Posted on Friday, March 7th, 2025 at 6:20:45am

If you’re a Vim user and want to integrate Prettier for automatic code formatting, follow these steps to set it up on your system.

Install Prettier Globally

Before installing the Vim plugin, you need to have Prettier installed globally via npm:

Install vim-prettier Plugin

To use Prettier inside Vim, install the vim-prettier plugin. Clone the repository into your Vim plugin directory:

Enable Plugin in Vim

Ensure that Vim loads the plugin by adding the following line to your ~/.vimrc file:

Format Code in Vim

You can now invoke Prettier inside Vim using the command:

This will format your current file based on Prettier’s default rules or your .prettierrc configuration.

Final Thoughts
With this setup, you can seamlessly format your code within Vim using Prettier, making your workflow more efficient and consistent. Happy coding!

How To Disable Bracketed Paste in BASH and ZSH

Author: , Posted on Wednesday, March 5th, 2025 at 6:30:55am

Bracketed paste is a feature in modern shells that helps prevent accidental execution of pasted commands by wrapping them in special escape sequences. However, some users find this behavior annoying, especially when pasting multi-line commands. Fortunately, it’s easy to disable bracketed paste in both BASH and ZSH.

Disabling Bracketed Paste in BASH

To turn off bracketed paste in BASH, modify your ~/.inputrc file by adding the following line:

You can apply this change immediately by running:

Otherwise, restart your terminal or open a new session for the changes to take effect.

Disabling Bracketed Paste in ZSH

For ZSH users, disable bracketed paste by adding the following line to your ~/.zshrc file:

After saving the file, reload your ZSH configuration with:

Bonus: Enhancing TAB Completion

If you’re customizing your shell, consider tweaking TAB completion behavior to improve your experience. Add these lines to ~/.inputrc for a more intuitive tab completion experience:

After modifying ~/.inputrc, apply the changes with:

### Explanation of TAB Completion Tweaks:

  • set bell-style none – Disables the terminal bell sound.
  • set completion-ignore-case on – Makes tab completion case-insensitive.
  • set show-all-if-ambiguous on – Displays all possible completions when multiple matches exist.
  • TAB: menu-complete – Enables menu-based tab completion.

With these tweaks, you can optimize your shell experience and eliminate unwanted behavior while improving command-line efficiency!

Extra Bonus: Dynamic Terminal Title

Sometimes my Terminal title gets stale, so I wanted a command to dynamically set it to the hostname and current working directory.

This will set your terminal title to display the short hostname and current working directory, making navigation easier when working across multiple terminals.

How To Fix MacOS Safari’s Connectivity Issues: Disabling Private Relay and Hide IP Address

Author: , Posted on Monday, March 3rd, 2025 at 9:52:06am

If you’ve ever encountered a scenario where Safari on macOS Sonoma cannot reach a local or internal web service (while Firefox and curl work just fine), the issue may be due to Apple’s strict security features. Specifically, iCloud Private Relay and the Hide IP Address from Trackers option can interfere with certain local network connections.

This blog post will walk you through how to disable these settings to restore proper connectivity.

Issue: Safari Cannot Access Internal or Local Services

In my case, Safari was unable to reach a local project listening on port 8000 on the same FQDN while Firefox and curl could access it without issue. If you’re facing a similar problem, read on!

Solution 1: Disable iCloud Private Relay

Private Relay is an iCloud+ feature that reroutes your internet traffic through Apple’s servers, potentially blocking access to local network services.

Here are the steps to disable Private Relay:

  • Go to System Settings → Click on your Apple ID (top-left corner).
  • Select iCloud.
  • Scroll down and locate Private Relay.
  • Toggle Private Relay Off.
  • Click Done and restart Safari.

Solution 2: Disable “Hide IP Address from Trackers”

Safari’s Hide IP Address from Trackers setting can also interfere with local connections by modifying how network requests are sent.

Here are the steps to disable Hide IP Address:

  • Open Safari → Settings.
  • Navigate to the Privacy tab.
  • Uncheck “Hide IP Address from Trackers”.

Conclusion

If you’re experiencing Safari connectivity issues on macOS Sonoma while other browsers work fine, disabling Private Relay and Hide IP Address might be the fix you need. These settings, designed to enhance privacy, can unintentionally block local services and internal network access. By making these adjustments, Safari should function as expected.

If you found this guide helpful, let me know in the comments!

How To Combine Directories From Multiple Hosts Into a Single Git Repository

Author: , Posted on Sunday, March 2nd, 2025 at 8:19:01am

If you have multiple ~/bin/ directories across different hosts and want to consolidate them into a single Git repository hosted on your own Git server, follow these steps.

1. Create a New Bare Git Repository on Your Git Server

First, log in to your Git server and create a new repository:

This repository will serve as the central location for all your ~/bin/ directories.

2. Initialize a Local Git Repository on the First Host

Choose one of the three hosts to start with:

This establishes the initial version of your ~/bin/ directory in the Git repository.

3. Merge ~/bin/ from the Second and Third Hosts

On the second host, execute:

You now have a new bin directory with everything from Host1, and a bin.old directory with the original files from Host2.

Compare the trees:

Copy/edit any needed files:

Commit and push to git repo:

If there are any conflicts, resolve them before committing.

Now, all hosts can push and pull updates to and from the central Git repository, ensuring that the ~/bin/ directory remains consistent across systems.

How To Restore the Full Desktop Bar in Mission Control on macOS

Author: , Posted on Wednesday, February 26th, 2025 at 7:59:58am

With macOS Sonoma, Apple changed the way Mission Control displays virtual desktops, reducing them to small slivers that require hovering to expand. If you prefer the previous behavior—where the full desktop bar opened automatically—there’s a simple solution using a third-party tool.

How to Restore the Full Desktop Bar in Mission Control

Follow these steps to bring back the full desktop bar when using Mission Control:

  1. Download and Install MissionControlFullDesktopBar.app
    The open-source MissionControlFullDesktopBar.app restores the expanded desktop bar in Mission Control.

  2. Grant Full Disk Access to Shortcuts
    For the app to work properly, ensure Shortcuts has the necessary permissions:

    • Open System Settings from the Apple menu.
    • Navigate to Privacy & Security.
    • Scroll down and select Full Disk Access.
    • Click the + (Add) button at the bottom of the list.
    • Navigate to Applications, select Shortcuts.app, and click Open.
    • Ensure that Shortcuts is toggled ON in the Full Disk Access list.
  3. Assign Fn + Up Arrow to Open the App
    To make launching Mission Control with the full desktop bar seamless, use the Shortcuts.app to assign a keyboard shortcut:

    • Open Shortcuts.app on your Mac.
    • Click the + (Create Shortcut) button to create a new shortcut.
    • In the right panel, search for Open App and drag it into the shortcut workflow.
    • Click App in the newly added action, then choose MissionControlFullDesktopBar.app from the list.
    • Click the Settings (i) button in the top-right corner of the shortcut window.
    • Click Add Keyboard Shortcut, then press Fn + Up Arrow.
    • Close the settings and Save the shortcut.

Once set up, pressing Fn + Up Arrow will launch Mission Control with the full desktop bar, bringing back the experience many users prefer.

With this simple tweak, you can enjoy Mission Control as it was meant to be—giving you quick and easy access to all your virtual desktops without the extra hover step.

How To Add and Associate a New AWS Elastic IP (EIP) Address Via the Command Line (CLI)

Author: , Posted on Tuesday, February 11th, 2025 at 7:56:54am

How To Add and Associate a New AWS Elastic IP (EIP) Address Via the Command Line (CLI):

How To Set an Entire AWS S3 Bucket to Public Read Using a Policy

Author: , Posted on Monday, February 10th, 2025 at 3:02:57pm

I needed to get all files in a bucket readable by the public easily.

Here is the S3 Bucket Policy I applied:

To do this via the aws cli command, create the file s3_read_policy.json containing the policy above, with your bucket name in place of BUCKET_NAME_HERE: