SyntaxHighlighter JS

2021-07-02

Packer and package installs

Problem: 
When using Packer to generate an Ubuntu AWS AMI, I use a shell script provisioner to install and update packages via apt-get. When executing apt commands in the script, I was getting the errors such as: 
"Package has no installation candidate"
"Unable to locate package" 

 Solution: 
The error in the shell script was that I was executing apt-get commands before the AWS cloud-init completed.

To check that cloud-init finished before running apt-get, modify the script via

while [ ! -f  /var/lib/cloud/instance/boot-finished ];
do
    echo "Waiting for cloud-init to finish ..."
    sleep 2
done

apt-get update -y
apt-get install -y package

2018-10-29

Ruby on Rails json LoadError

Problem:
Running Ruby on Rails 'bin/rails s' and you get an error

in require: cannot load such file -- json (LoadError)


Solution:
Edit the Gemfile and add

gem 'json'


Installing Ruby on Rails on AWS Linux

To install Ruby on Rails on the AWS Linux VM, you need to install some prerequisites first.

sudo su -
yum install -y ruby24
alternatives --set ruby /usr/bin/ruby2.4
yum install -y ruby24-devel rubygems ruby24-devel gcc zlib-devel patch sqlite-devel
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs

gem install rails
rails --version

2018-10-26

Add hard disk to VMware CentOS 7 VM

There are two easy steps to add a hard disk for a a VMware CentOS 7 VM

  1.  Assign a new hard disk in VMware vSphere
  2.  Configure the new hard disk in CentOS
See the full picture tutorial at
https://dev.to/juttayaya/add-hard-disk-to-vmware-centos-7-vm-22m8