Entries Categorized as 'How-To’s'

How To Sync AWS S3 Buckets Using RClone

Author: , September 9th, 2021

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: , September 1st, 2021

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 +short

shell> dig -x

shell> host

shell> nslookup

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

Author: , August 12th, 2021

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: , August 12th, 2021

vi /etc/postfix/main.cf

service postfix restart

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

Author: , August 4th, 2021

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 […]

How To Allow AWS IAM Users EBS Snapshot Create And Delete Access

Author: , July 29th, 2021

SUMMARY: Needed to create an AWS IAM Policy to allow a user access to create and delete EBS snapshots. This script also needed to be able to list volumes:

How To Fix aws Command Error “You must specify a region”

Author: , July 29th, 2021

I was getting error “You must specify a region” when running any aws CLI command. The fix: Using the aws command:

which will automatically add the following to the file ~/.aws/config:

You many simply edit the ~/.aws/config file yourself and append the same thing:

How To Allow IAM Users AWS CDN Read/Write Access For W3 Total Cache

Author: , July 28th, 2021

SUMMARY: Needed to create an AWS IAM Policy to allow a user access to two buckets and their associated CDN’s in WordPress W3 Total Cache

How To Disable VIM Mouse Automatic Visual Mode

Author: , July 27th, 2021

Current Session:

All Sessions: Add the following to your ~/.vimrc file:

How To Match Complex Element IDs In jQuery

Author: , July 22nd, 2021

PROBLEM: An element ID that looked like this would fail to match: service = east node = db1-demo.thedomain.com

SOLUTION: Rig any special characters in the complex hostname (:.[],-@) with a backslash in front of them to ensure proper matching: