Install AWS CLI on Ubuntu

The advantage of running Amazon Linux on AWS is that you already have the AWS CLI (command line interface) loaded as part of the image. In addition, Amazon Linux has rolling updates. It means you don’t have to perform major upgrades as you go to from one version to another. It’s all part of the process when you perform periodical updates. However, if you’re running Ubuntu, it’s no slouch. It’s a popular distro which many administrators have chosen to use due to its simplicity and robust repository. So, if you’re running Ubuntu, you might want to install the AWS CLI to give you the tools you need similar to what Amazon Linux has. Here’s how to install AWS CLI on Ubuntu.

$ sudo apt install awscli

You will need to run the configuration before you can start using AWS CLI. See example below.

$ sudo aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

Obviously, you will need your own Access Key and Secret Key that you’ll need to generate from your AWS Console under IAM.

Ubuntu Server Timezone

If you want to run a couple of cron jobs, you may need to check if your server is using your timezone. You can determine the server’s timezone by simply typing the system’s date command. You’ll see right away if your server is using the same timezone.

$ date
Sun Apr 23 21:21:24 PDT 2017

If it isn’t, then you need to change it so it’s in sync with cron jobs. To change timezone, run dpkg-reconfigure tzdata. You’ll be asked to choose a region and the nearest city. In this example, I’m picking the Americas/Los Angeles combination. Choose your own region and city.

$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/Los_Angeles'
Local time is now:      Sun Apr 23 21:24:57 PDT 2017.
Universal Time is now:  Mon Apr 24 04:24:57 UTC 2017.

You may need to restart cron so that the new timezone can take effect.

$ sudo service cron restart

Sass Basics

If you use CSS, it can sometimes get repetitive. One way of streamlining your code is to use Sass. Sass is a CSS extension that gives users power and elegance. Sass allows the use of variables, nested rules, mixins, inline imports, and many more in your code by cutting down on some repetitive tasks. Let me show you how it’s done. Below is an example of how to use Sass using variables.

Sass Variables – an example using the same hex color over and over again.

$link-color: #054943;
 
a, a:active { color: $link-color; }
pre { color: $link-color; }
#page { color: $link-color; }
.list { color: $link-color; }

With Sass’ preprocessor, the original will output a result like this:

a, a:active { color: #054943; }
pre { color: #054943; }
#page { color: #054943; }
.list { color: #054943; }

If you need to change the color in the future, you just need to change one line.

To start Using Sass, just issue the command below. Sass will watch input.scss and generate output.css.

$ sass input.scss output.css

If you use Github for versioning, you may have to ignore a few files, like the Sass cache, the mapping file and the input.scss itself, from showing up on your Github repository. To learn Sass, visit the website and read the documentation. To start using Sass, just install.

Ubuntu Switching to Gnome

Canonical made announcement today that it’s planning to do away with its Unity Desktop starting with the Ubuntu 18.04 release. Don’t worry, Canonical is not doing away with its own Linux Desktop. This means they are not going to develop anymore of its Unity Desktop environment. The Ubuntu desktop will be switching back to the Gnome desktop, which was its default desktop environment before going with Unity six years ago.

In addition, Canonical will also end its support for Unity8 which was targeted phones and tablets. Unity8 was meant to converge the desktop with phones and tablets. As far as the desktop, Canonical dominated the Linux desktop years ago according to Distrowatch.com. I think going with Unity pushed some users to switch over to other distros such as Linux Mint. I was one of them.

Despite the tumbles Canonical has made on the desktop, the Ubuntu Server is still a big hit on the cloud.