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

Author: , April 17th, 2023

First, use the AWS Console to modify the volume to the desired size, in our example we want to go from 10GB to 25GB for the root filesystem For a Xen ext4 root volume

For NVMe First, use lsblk to see the raw partitions:

Note how the partition at 259:1 is only 20GB, […]

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 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 Fix Email Service Unavailable Delivery Issues with IPv6 on Amazon Linux

Author: , July 16th, 2021

PROBLEM: Email delivery to Google was failing with a “Service Unavailable” error:

Note that the network address for the destination is shown as IPv6! That is the root cause of the issue: 1. Sendmail is sending mail from the IPv6 address instead of the IPv4 address 2. Google rejects IPv6 senders without proper reverse […]

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 Downgrade PIP After Upgrade on Amazon Linux

Author: , March 25th, 2020

I tried upgrading pip when prompted to do so: sudo pip install –upgrade pip This worked, but removed the system install in /usr/bin/pip and replaced it with /usr/local/bin/pip – NOT GOOD! The solution is as follows:

How To Block All Traffic From China Using iptables and ipset on Amazon Linux

Author: , October 24th, 2019

All credit to Matt Wilcox for this excellent article, for which this post is based – thank you, Matt! https://mattwilcox.net/web-development/unexpected-ddos-blocking-china-with-ipset-and-iptables/ All commands run as root!

Do this once only:

Then add blockchina to the root cron

How To Sync Box to S3 Using rclone

Author: , October 3rd, 2019

To sync various cloud resources, use the excellent cli tool rclone from https://rclone.org/docs/ For this use case, the need was to sync from Box to an AWS S3 bucket. Install rclone:

Configure both S3 and Box – for remote name labels I just used “S3” and “Box”:

Validate Access and Functionality:

Perform […]

How To Upgrade PHP on AWS Linux

Author: , August 22nd, 2019

As root:

~or~

THEN:

Be sure to restart your web server!!

How To Obtain a Public Key from an AWS .pem Private Key on Linux and Mac

Author: , February 4th, 2019

Use the ssh-keygen command on a computer to which you’ve downloaded your private key .pem file; for example: First, ensure permissions will allow ssh-keygen to work: chmod 600 /path/to/the/file/your-key-pair.pem Then generate an RSA public key: ssh-keygen -y -f /path/to/the/file/your-key-pair.pem > your-key-pair.pub