This blog is written for beginners preparing to use AWS (Amazon Web Services) as their sandbox server since Amazon provides a full year (750hrs per month) trial time for basic service. After setting up this server, the implementation would be various, such as building a website, running Machine Learning mode, programming games.
Here we are only aiming for:
- Setup the server
- Connecting the server from any cmd prompt terminal
- Set the developing environment for coding in the C language
- Connect with Git Hub
- Config editor Vim
Setup the server
- Apply an AWS Free Tier account through https://aws.amazon.com/
- Sign in to the Console (button to the up-right corner)
- Click EC2 (Virtual Service in the cloud) under All Services -> Compute
4. Click Launch Instance
5.Choose a Free Tier Eligible system and click the Select button to the right. Here use Ubuntu 20.04 LTS 64-bit (x86) as an example to create this instance.
6.Click the Review and Launch button to the bottom
7.Confirm the instance detail and click the Launch button on the next page
8.Create key pair/Choose existing key pair to improve the security level of your server. The key.pem file will be downloaded, and it will be used whenever accessing the server
9.Click Launch, and Amazon will launch this instant in 2–5 minutes. And we can click the button View Instances to see the status.
Connect the server from the command prompt terminal
- Click the name of our newly created server and click the Connect button to the up-right
- Follow the instructions on the next page, and please be noticed that the key pem file needs to use the full address. For this instance, the full command is
ssh -i “C:\Users\sunmi\Downloads\Simon_Holberton.pem” ubuntu@ec2–18–220–123–134.us-east-2.compute.amazonaws.com
3.Open a command prompt terminal. Here using Windows 10 as the example. Input the command above.
4.Connected
Set the developing environment for coding in C language(install make, man, GCC, gdb, Valgrind)
- Run command sudo –s to switch to the administrator mode since we are installing quite a few programs.
- Run command apt-get upgrade to get the information of the latest versions of essential programs.
- Run apt-get –y install make
- Run apt-get –y install man
- Run apt-get –y install gcc
- Run apt-get –y install valgrind
- Run apt-get –y install git-all
- Run apt-get –y install gdb
Setup Git Hub SSH connection
- Open Git Bash
- Paste the text below, substituting in your GitHub email address ssh-keygen -t ed25519 -C your_email@example.com (ed25519 is your own id from GitHub, clicking web page above to check this ID)
- When you’re prompted to “Enter a file in which to save the key,” press Enter, this accepts the default file location.
- Press Enter key 3 times if you do not want to set up a security phrase.
- Your key will be saved under /root/.ssh/
- Enter command less /root/.ssh/id_ed25519.pub, and you will read a long string represent your key.
- Copy the string and paste to the GitHub->settings->SSH and GPG keys->New SSH key
- Pull a repository and test the developing environment.
Setup configurations of Vim
-This part is only for the reader who chooses Vim as a coding editor, and this is just the configuration the writer is using.
- Install Universal Ctags run apt install universal-ctags
- Clone vim configuration file from https://gist.github.com/miguelgrinberg/527bb5a400791f89b3c4da4bd61222e4
- Find the file .vimrc copy it to the home directory as ~/.vimrc
- Run Vim. The program will first download the needed add-ons, and under command mode, press “\” + “n” and “\” + “t” to enable the NerdTree and variable/functional monitor.
- Press “Ctrl + w”(holding) then “w” key to move the cursor among 3 different windows