Setting the timezone on AWS Linux AMI from command line

May 7, 2018
aws linux timezone

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

Try this -

MY_TZ="Australia/Sydney"
MY_TZ_ESC="$(echo ${MY_TZ} | sed 's/\//\\\//')"

<span lang="en-AU">sed -i "s/^\(ZONE\s*=\s*\).*$/\1\"${MY_TZ_ESC}\"/" </span><span lang="en-US">/etc/sysconfig/clock</span>
ln -sf /usr/share/zoneinfo/${MY_TZ} /etc/localtime

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