How To Fix Stuck WordPress Maintenance Mode

Author: , Posted on Thursday, July 8th, 2021 at 9:21:10pm

ERROR: Briefly Unavailable for Scheduled Maintenance. Check Back in a Minute
CAUSE: WordPress did not complete an action
SOLUTION: Either
– remove ~/wordpress/.maintenance
– edit ~/wordpress/wp-activate.php and set define( 'WP_INSTALLING', false );

How To Change Your GIT Name and Email Address Globally and Per Repository

Author: , Posted on Thursday, June 17th, 2021 at 12:45:23pm

To update your git user name and email address for all repos:

To update your git user name and email address for a specific repo:

How To Count Strings Inside Another In Perl

Author: , Posted on Wednesday, June 16th, 2021 at 12:19:06pm

Should result in 3

How To Search the APT Sources for Available Packages

Author: , Posted on Thursday, June 10th, 2021 at 4:14:53pm

Search for a string:

List all packages:

How To Convert from AWS Instance Family t2 to t3 with Enhanced Networking on Amazon Linux 1

Author: , Posted on Thursday, June 10th, 2021 at 1:19:03pm

I wanted to change instance type from t2 to t3, but got an error when i went to start the instance:

I found this AWS docs page: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-ena.html

Below are the steps I need to follow on AWS Linux 1.

Summary Steps

Pre-flight tests on t2

modinfo ena
-> see “ERROR: modinfo: could not find module ena”
ethtool -i eth0 | grep ^driver:
-> see “driver: vif”

Install the latest drivers

sudo yum -y update
sudo reboot
modinfo ena | grep ^description:
-> see “description: Elastic Network Adapter (ENA)”

Convert the instance to t3 to get ENA working

aws ec2 stop-instances --instance-ids {instanceid}
aws ec2 modify-instance-attribute --instance-id {instanceid} --instance-type t3.large
aws ec2 start-instances --instance-ids {instanceid}
ethtool -i eth0 | grep ^driver:
-> see “driver: ena”

Detailed Steps

Ensure the latest drivers are installed:

sudo yum -y update

IMPORTANT: You must reboot once the updates are done!

After the reboot, check to ensure the driver is loaded properly:

modinfo ena

DRIVER NOT INSTALLED

DRIVER INSTALLED √

Enable ENA on the instance

aws ec2 modify-instance-attribute --instance-id {instanceid} --ena-support

Note: To disable ENA support, use this command:
aws ec2 modify-instance-attribute --instance-id {instanceid} --no-ena-support

Check that it is enabled

aws ec2 describe-instances --instance-ids {instanceid} --query "Reservations[].Instances[].EnaSupport"

You should see the string ‘True’ as the result when enabled, and nothing when disabled.

Stop the instance so you can change the instance type.

aws ec2 stop-instances --instance-ids {instanceid}

Change instance type from t2 to t3

aws ec2 modify-instance-attribute --instance-id {instanceid} --instance-type t3.large

Start the instance

aws ec2 start-instances --instance-ids {instanceid}

Check the interface

ethtool -i eth0

DRIVER NOT INSTALLED

DRIVER INSTALLED √

NOTE: As per the AWS docs -> “The following AMIs include the required ENA module and have ENA support enabled: Amazon Linux 2”

How To Undo A Conflicting Merge in GIT

Author: , Posted on Tuesday, June 8th, 2021 at 11:11:18am

shell> git merge branch-with-messy-changes

shell> git status

shell> git merge --abort

shell> git status

IMPORTANT NOTE: Previous versions of git used different commands for this operation:

Latest version: git merge --abort
Older than version 1.7.4: git reset --merge
Older than version 1.6.2: git reset --hard

How To Control Output Formatting Via The MySQL Shell CLI

Author: , Posted on Wednesday, May 26th, 2021 at 3:32:31pm

https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-output-formats.html

Multiple Formats Available:
Table Format – use --result-format=table, alias --table
Tab Separated Format – use --result-format=tabbed, alias --tabbed
Vertical Format – use --result-format=vertical, alias --vertical
JSON Format Output – use --result-format=VALUE, alias --json[=pretty|raw|off]
VALUE may be one of:

  • json or json/pretty – These options both produce pretty-printed JSON.
  • ndjson or json/raw – These options both produce raw JSON delimited by newlines.
  • json/array – This option produces raw JSON wrapped in a JSON array.

How To Restart a Hung Top Menu Bar in MacOS

Author: , Posted on Friday, April 23rd, 2021 at 11:30:23am

Ever get the spinning beachball when trying to access the top menu on your Mac?

SOLUTIONS

Use the GUI
Open the Activity Monitor application
Select All Processes from the View menu
Click on the SystemUIServer process, then click Force Quit.

~or~

Via CLI
In Terminal, execute killall SystemUIServer

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

Author: , Posted on Friday, April 16th, 2021 at 3:07:24pm

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: , Posted on Monday, March 22nd, 2021 at 2:32:54pm

Ah, the power of grep!