All my projects are in docker containers in an AWS EC2 instance. To keep the cost down I stop the instance every time I finish coding.
Being a student and taking classes forces me to take breaks and restart my instance multiple times a day. Going to AWS console, restarting the instance then copying the public DNS to SSH into the instance quickly becomes tedious.
To continue you first need to enable the developer mode. lifehacker has a fantastic article on how to install Ubuntu on Chromebook. Here we only need the first step "Enable Developer Mode". In short :
-
Hold down "ESC" and "Refresh" keys and press the power button to reboot into recovery mode
-
Press "Ctrl+D" when the yellow exclamation mark appears
-
Press enter to continue (this will take a while) warning! this will erase your local information
-
Press "Ctrl+D" when the red exclamation mark appears (on every reboot)
You can find detailed instructions for your specific device on Chromium site
Press "Ctrl"+"Alt"+"t" to open up crush. Then type "shell" and enter
Crouton is a chroot generator for Chrome OS. We will use Crouton to install the command line tools.
-
Donwload the latest release from their page
-
Run (this might take a while)
$ sudo sh ~/Downloads/crouton -t core
Now enter chroot sudo enter-chroot
Download get-pip.py script
$ wget https://bootstrap.pypa.io/get-pip.py
Run python get-pip.py
Install AWS CLI using pip
$ sudo pip install awscli
Now to configure aws
$ aws configure
-
Intel Chromebooks only. Below we are going to use Chromebrew. As of this writing Chromebrew does not support ARM chipsets.
-
The following steps have been tested on an Acer cb3 131 series
$ uname -a
Linux localhost 3.10.18 #1 SMP Thu May 12 00:16:32 PDT 2016 x86_64 Intel(R) Celeron(R) CPU N2840 @ 2.16GHz GenuineIntel GNU/Linux
Chromebrew is a package manager for Chrome OS. We will use this to install Python.
You can find more details on the installation on their github page. In short run :
$ wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | bash
Download get-pip.py script
Run python /path_to_script/get-pip.py
AWS has amazing documentation on how to get started. In short run :
$ sudo pip install awscli
If you try to run any aws commands at this point, it fails. The problem is permissions on the aws executables under "/usr/local/bin/"
My friend Bapi noticed this problem proposed the following to fix it
$ sudo chmod +x /usr/local/bin/aws
Now to configure aws
$ aws configure
Some of the dependencies might be missing (i.e. "groff"). This will cause the help command to fail
To start your instance
$ aws ec2 start-instances --instance-ids your_instance_id
To get public DNS records
$ aws ec2 describe-instances --instance-id your_instance_id | grep PublicDnsName
To ssh into your instance
$ ssh -i path_to_.pem_file username@PublicDnsName
To stop your instance
$ sudo shutdown -P now