Setting the hostname on AWS Linux AMI from command line

May 6, 2018
aws hostname linux

The documentation for setting the hostname on AWS Linux AMI can be found here. However, what if you wanted to do it with a command line?

Try this -

MY_SERVER=my_host.rhapsody.com.au
sed -i "s/^\(HOSTNAME\s*=\s*\).*$/\1${MY_SERVER}/" /etc/sysconfig/network

Extract the size of a file from a bash script

May 26, 2018
linux stat bash

Sorting a list in lexographic order using bash

May 26, 2018
bash linux sort

Purge all items from an AWS dynamodb table with an exponential timing back-off

May 21, 2018
aws dynamodb python