George McKinney Adventures in Software Development

January 12, 2022

Securing an AWS Account with Multi-Factor Authentication

Filed under: AWS,CIS,CIS 192 — georgemck @ 3:49 pm

July 20, 2021

Upgrading to PHP 7.2 on Amazon Linux

Filed under: AWS,CIS 192,PHP — georgemck @ 10:24 pm

#Upgrading to PHP 7.2 on Amazon Linux

#check current version of PHP
php -v

#stop APACHE and PHP services
sudo service httpd stop

#uninstall APACHE and PHP
sudo yum remove httpd* php*

#Get latest updates
sudo yum update -y

#install PHP 7.2
sudo yum install php72

#install MySQL driver for PHP 7.2
sudo yum install php72-mysqlnd

#Start APACHE web server
sudo service httpd start

sudo yum clean all

April 20, 2021

Alexa Fact Skill Content

Filed under: Alexa,Amazon,AWS — georgemck @ 5:41 pm


const GET_FACT_MESSAGE = ‘Here\’s your information: ‘;
const HELP_MESSAGE = ‘You can say tell me a fact, or, tell me about something… What can I help you with?’;
const HELP_REPROMPT = ‘What can I help you with?’;
const STOP_MESSAGE = ‘Goodbye!’;

const data = [
‘Fact Number One.’,
‘Fact Number Two.’

const GetNewFactHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === ‘LaunchRequest’
|| (request.type === ‘IntentRequest’
&& === ‘GetNewFactIntent’);
handle(handlerInput) {
const factArr = data;
const factIndex = Math.floor(Math.random() * factArr.length);
const randomFact = factArr[factIndex];
const speechOutput = GET_FACT_MESSAGE + randomFact;

return handlerInput.responseBuilder
.withSimpleCard(SKILL_NAME, randomFact)

March 10, 2021

AWS CLI Builder

Filed under: AWS — georgemck @ 6:19 pm

Tool for constructing AWS CLI commands

Created by

AWS BASH Export Lambda Functions

Filed under: AWS — georgemck @ 6:18 pm

AWS CLI 2 for Exporting Lambdas

Export all lambda functions to lambdafunctions directory as indivudual zip files. Be sure to update the region, currently set to us-east-1


mkdir lambdafunctions
aws lambda list-functions | \
grep FunctionName | \
cut -d '"' -f4 | \
while read -r name; do
aws lambda get-function --function-name $name | tail -n 3 | egrep -o 'https?://[^ ]+' | sed 's/"//' | xargs wget -O ./lambdafunctions/$

AWS BASH Export Lex Bots

Filed under: AWS — georgemck @ 6:14 pm

AWS CLI 2 for Exporting a Bot

Export all bots to lexbots directory as indivudual zip files. Be sure to update the region, currently set to us-east-1


mkdir lexbots
aws lex-models get-bots | grep name | cut -d '"' -f4 | \
while read -r name; do
echo $name
url=$(aws lex-models get-export --name $name --resource-type BOT --export-type LEX --resource-version 1 --region us-east-1 --output json | grep url | cut -d '"' -f4)
wget $url -O ./lexbots/$


March 9, 2021

AWS Shell Gradle Install

Filed under: AWS — georgemck @ 3:12 am

Gradle versions available from:


sudo mkdir /opt/gradle
wget -c
sudo unzip -d /opt/gradle
export PATH=$PATH:/opt/gradle/gradle-6.8.3/bin

gradle -v


**NOTE:   export PATH will have to be done over with every launch of the shell. Alternatively, add it to ~/.bash_profile



AWS Shell Java Install

Filed under: AWS — georgemck @ 3:05 am

You can switch between versions with sudo



Step 1 – Install Java on Amazon Linux

The OpenJDK 8 is available under default yum repositories and OpenJDK 11 is available under Amazon Linux 2 extras repositories. You can simply install Java 11 or Java 8 on the Amazon Linux system using the following commands.

  • Run below commands to install Java 11 on Amazon Linux:
    sudo amazon-linux-extras install java-openjdk11
  • Run below commands to install Java 8 on Amazon Linux:
    sudo yum install java-1.8.0-openjdk

Step 2 – Check Active Java Version

After successfully installing Java on Amazon Linux using the above steps, Let’s verify the installed version using the following command.

java -version

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

Step 3 – Switch Java Version

Use alternatives command-line utility to switch active Java version on your Amazon Linux system. Run below command from the command line and select the appropriate Java version to make it default.

sudo alternatives --config java

Install Java on Amazon Linux

After switching let’s check again active Java version:

java -version

openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)




January 2, 2021

AWS CloudShell Homebrew Install Process

Filed under: AWS — georgemck @ 10:35 pm


1. Clone.

git clone ~/.linuxbrew/Homebrew

2. Compile.

mkdir ~/.linuxbrew/bin

3. Link.

ln -s ../Homebrew/bin/brew ~/.linuxbrew/bin

4. Update environment.

eval $(~/.linuxbrew/bin/brew shellenv)

AWS CloudShell CLI Update Process

Filed under: Amazon,AWS — georgemck @ 8:36 pm

Quick Procedure to update the AWS CloudShell available for IAM user accounts following instructions per


curl “” -o “”


sudo ./aws/install



AWS Shell Curl command
AWS Shell Unzip command
AWS Shell update command
Older Posts »

Powered by WordPress