How To Block Email Using Headers In Postfix

Author: , Posted on Tuesday, December 7th, 2021 at 12:05:44pm

I needed to block email based on the Subject header.

The solution is simple:

Edit main.cf as root and uncomment or add:

Next, creaate or edit /etc/postfix/header_checks as root and add the following line:

Finally, run sudo postfix reload

NOTE: Do NOT add the “i” after the regular expression! It is case-insensitive by default, and adding the “i” will break it!

How To Enable Focus Follows Mouse On MacOS

Author: , Posted on Thursday, December 2nd, 2021 at 10:59:53am

Use AutoRaise!

From the docs: “When you hover a window it will be raised to the front (with a delay of your choosing) and gets the focus.”

Web page: https://github.com/sbmpost/AutoRaise
Download: https://github.com/sbmpost/AutoRaise/archive/refs/heads/master.zip

How To Bounce the Dock Icon For All Incoming Email on MacOS

Author: , Posted on Tuesday, November 2nd, 2021 at 2:00:09pm

I needed a way to get the dock icon to bounce for all incoming emails and there did not seem to be any option to do so.

There is actually a simple way to do it, but it is not intuitive.

The key is to add a new Rule!

  1. Open Mail.app and choose Mail -> Preferences from the top menu
  2. Click on the Rules tab
  3. Click the ‘Add rule’ button
  4. In the Description field, enter: Bounce Dock Icon for Incoming Mail
  5. If “ANY” of the following conditions are met, choose “To”, “does not contain”, and then enter “abc123xyz789”
  6. Under “Perform the following action:” select ‘Bounce Icon in the Dock’, then click OK

This new rule will check every incoming message and wee that is does NOT find “abc123xyz789” in the To: header, and therefore triggers the rule to bounce the Dock icon.

How To Fix Let’s Encrypt Root Certificate Expiration on AWS Linux

Author: , Posted on Thursday, October 7th, 2021 at 10:36:10am

On Sept 30th 2021 Let’s Encrypts previous root certificate DST Root CA X3 (and it’s R3 intermediate) will expire. It has been replaced by their ISRG Root X1 certificate (and replacement R3 intermediate).

The version of the R3 intermediate signing certificate which chains to DST Root CA X3 expired September 29 19:21:40 2021 GMT.
The DST Root CA X3 root certificate expired September 30 14:01:15 2021 GMT.

Then restart your web server (i.e. Apache and php-fpm) as appropriate.

How To Enable WordPress Debug

Author: , Posted on Wednesday, September 22nd, 2021 at 11:34:04am

vi wp-config.php

Add at the bottom:

You can also use this URL in later versions:
/wp-login.php?action=entered_recovery_mode

How To Sync AWS S3 Buckets Using RClone

Author: , Posted on Thursday, September 9th, 2021 at 7:57:25pm

The aws s3 sync command is slow and painful!

I needed a more efficient way to sync to large buckets (prod to dev).

Finally settled on RClone: https://rclone.org/docs/

During rclone config I called remote “s3” ;-}

How To Get A Reverse DNS Lookup On The Command Line

Author: , Posted on Wednesday, September 1st, 2021 at 3:50:30pm

There are three commands in Linux to easily get a reverse DNS lookup with:
dig, host and nslookup.

Here are examples of each:

shell> dig -x 3.214.2.238 +short

shell> dig -x 3.214.2.238

shell> host 3.214.2.238

shell> nslookup 3.214.2.238

How To Load /etc/rc.local At Boot Time

Author: , Posted on Thursday, August 12th, 2021 at 10:27:25am

My /etc/rc.local was not loading at boot time.

rc.local is a symlink to /etc/rc.d/rc.local

lrwxrwxrwx 1 root root 13 Jun 22 2020 rc.local -> rc.d/rc.local

I had to execute the following:

How To Force Postfix To Use Only IPv4

Author: , Posted on Thursday, August 12th, 2021 at 10:25:05am

vi /etc/postfix/main.cf

service postfix restart

How To Copy Key Pairs To Another AWS Region Using The ssh-keygen Command

Author: , Posted on Wednesday, August 4th, 2021 at 2:02:08pm

I wanted to use the same SSH keys for multiple AWS regions. As it turns out, AWS simply stores the public key when you download the private key as a .pem file.

The solution is to simply generate the public key locally from the existing .pem, then import the public key using the same name in a different region.

Step 1: Generate public key from existing private key in .pem format:

Step 2: Import the generated public key into AWS:

Login to the AWS Console and navigate to EC2 -> Key Pairs, then choose Actions -> Import Key Pair in the upper-right corner of the page:

Finally, enter the name for the key pair, and either select the file or paste in the generated public key, then click “Import key pair” at the bottom right:

Reference: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ssh-key-pair-regions/