How To Dynamically Add a Path to the Perl @INC At Compile-Time

Author: , April 16th, 2021

The key is to define a variable first, then use the BEGIN block to initialize the variable, then reference the variable in use lib $var; later on ;-} For example, enable a module contained in the same directory as a script called via the PATH:

How To Determine Where MySQL Looks For my.cnf

Author: , March 22nd, 2021

Ah, the power of grep!

How To Configure GIT To Push The Current Branch Only

Author: , March 16th, 2021

Recent changes to git have made the push default choice a bit confusing – “matching” vs. “simple” I picked “matching” when prompted. This means that git push by itself will try to push ALL local branches, not just the one you are working on. Personally, I find that a bit mad, so I decided to […]

How To Process System Exit Codes Using Perl Eval

Author: , March 9th, 2021

The trick to using eval to catch shell execution is to return twice, once inside the eval and once outside:

Neat!

How To Prevent Spotlight From Indexing External Drives on MacOS

Author: , February 26th, 2021

On MacOSX 10.10.5 Yosemite, I was having trouble with Spotlight preventing the clean eject of an attached hard drive. Using the fuser command allowed me to see that it what the Spotlight-specific mds process preventing the eject.

At first, I tried to disable the indexing via the mdutil command, but that just gave me […]

How To Create WordPress Category Pages in Genesis Including Title and Content

Author: , February 19th, 2021

Create two template files in the wp-content/themes/{themeName}/ subdirectory:

page_blog.php

page_blog_plus_content.php

How To Expand an NVMe EBS Volumes After a Disk Resize on Amazon Linux

Author: , February 19th, 2021

First, use lsblk to see the raw partitions:

Note how the partition at 259:1 is only 20GB, while the entire disk at 259:0 is 40GB. A partition resize is required in this case.

For an EXT4 filesystem, use the resize2fs command instead:

For more information, please visit the AMW Docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

How To Login To A Docker Container Shell

Author: , February 15th, 2021

First, get the container ID using docker ps:

Now run docker exec -it {ContainerID} /bin/bash:

You can make a simple shell script to ease typing a bit:

How To Escape Single and Double Quotes in Perl

Author: , February 11th, 2021

## to add a single backslash in front of whatever char was matched

## to double whatever char was matched

## to convert ‘ to ‘\” for shell execution

How To Renew A Single Domain With certbot

Author: , February 8th, 2021

Test Renewal of a Single Domain

Execute Renewal of a Single Domain