Planning & Design
Prior Experience
I came into these assignments already using the command line often. my first experience with Linux and therefore having to use the command line was with my old laptop, the battery of which got so degraded that it could only last a couple hours, but Linux near tripled that time. using ran Ubuntu 22.04 LTS for the last end of freshmen year, and during that had to learn how to use a package manager, how to build software, and basic terminal commands. Additionally, on windows I have to commonly use the command line to run code, build projects, run a minecraft server, and use github. Through all of this, I came into these classes with a really clear understanding of almost all commands we were taught. As for networking, I've done a bunch with microcontroller or full on server (minecraft) networking, as well as port forwarding games to the internet to make them multiplayer (subnautica).
Map the Maze Part 1
The first part of Map the Maze was all about the file system. This served as an introduction to the linux file system, which I was not very familiar with at the time. We also got started with the command line, starting with mac because the virtual machines were not fully setup at the time. We also were given a list of some of the most important commands, as seen below
My notes on the commands we were taught
My sketch of a file system, based off my home computer.
~/
└──home
| ⊢Documents
| | └──homework.txt
| ⊢Music
| | └──song.mp3
| ⊢Photos
| | └──cat.png
My text based rendering of a Linux File System
We also, as seen in my notes on PWD, were introduced to the concepts of relative and absolute paths. These mean that paths can either be relative, where it is the path from your current location to your new one, or absolute. an example of either, based on my sketch on the left, would be:
Relative from "Noahs": photos\dog.jpg
Absolute: C:\Users\Noahs\Photos\dog.jpg
Networking
We also did a bit of networking with the command line, starting with learning some important terms:
Endpoint Device A device that actually uses the internet, a computer
Wifi/Ethernet Signal Carriers, how endpoint devices connect to the internet
Network Adapter/Interface The hardware related to the internet, either a ethernet adaper or a wifi card.
IP address A unique address assigned to everything connected to the internet.
Default gateway (router) Endpoint devices connect to this which connects to the whole internet
DNS (Domain Name System) A system that allows URLs to be converted into IP addressess.
Ping A command that sends a small hearbeat packet to a remote/local server.
NAT/Shared Networking The VM is the same IP as the MAC, can cause some issues but very easy to use
Bridged Networking The VM is a different IP from the mac, its treated as its own device but harder to set up
One of the most important was the IP address, which we went more into detail on, learning some of the common ranges and their meanings
192.168.x.x Local Private addresses, very common on home networks
10.x.x.x Less common local private addressess, used in big companies or for our VMs
172.16.x.x 173.31.x.x Even less common local private addressess
169.254.x.x Self assigned IP address, usually mean that the router wasn't able to reach/assign an IP to the device
Technical Development
The Linux command line for beginners
The first thing to do was follow the Linux command line for beginners, which can be found here. This is the perfect tutorial for learning any version of linux, teaching the history and a usage guide of the command line. it retaught the basic parts of linux, since I mainly used command line on windows, which had different file structures ( / vs \ ) and different usual storage locations (C:/Users/Noahs/Documents vs (/home/ubuntu/Documents). It also taught me some new commands, such as the cat (check contents, add files together), echo (good for making short text files), and tree(show a tree of all the files/folders) commands
Learning how Linux differs from windows
The echo and cat commands
Discovering the tree command
Map the Maze Part 2
After learning the basics of the CLI, we were tasked to use those to do some more advanced things. in this, we created a maze and hid clues, while also learning a really powerful tool for us. the "Hostshare" command is a way to share files between the virtual machine and real mac, which I went into more detail below. With the rest of it, it reintroduced nano to me (a text editor in the command line), and solidified my understanding of the basic commands
File Sharing
The way we shared the files between the 2 computers was mounting a drive on both, specifically, on linux we called this command
sudo mount -t davfs http://127.0.0.1:9843/ ~/hostshare/
to mount a new virtual drive to ~/hostshare. on mac, we used the menu with utm to mount that same drive into our documents folder, opening a virtual window between the two location and any file there on one side would be accessible on the other.
I started by creating the clue files
I then mounted the drive (with the command in text above) and used sudo (superuserdo) to share it into hostshare
On the mac, I checked to see if the file I created appeared.
I then made a file on the mac, put it into the "shared with utm" folder, and on linux looked in hostshare to see it
Networking
The most important thing we learned out of this was the ping command. This command allows for a very small packet of data to be sent to a server, that then prompts that server to send a "conformation" packet with a bit of data about it. The most important part of that data is the time it was sent, which allows you to figure out the latency of your connection to that server. Also, if you don't get a packet back its the easiest way to confirm that there is something wrong with your network.
An example of using it is
"ping 1.1.1.1" which will ping the server every second until you press ctrl + c.
If you need a specific amount of pings use "ping -c 4 1.1.1.1" which will ping it 4 times and give a report about average latency after.
Testing and Evaluation
House Activity
For a final test of our command line mastery, we did a house sitting themed activity. The activity and instructions can be found on its github, which we had to use to download it onto our VMs. First we had to install github with sudo apt install -y git, then move into the documents folder and use "git clone" to copy the files onto our machine. we then changed directories into the main activity, and were ready to go. Going through the house, I made frequent use of CD, LS, CAT, RM, and .. to go back one directory, mostly using that with cd.
Specifically, In the house I
Navigated around with cd, going back with cd ../
looked around with ls, taking a close look with ls -a
opened files with cat
created a simple text file with echo (echo "text" > file.txt)
checked where I was with pwd
removed files with rm (learning to remove multiple at a time with space
removed multiple files using a * as a any character.
Here is how the house looks after completing the activity, with no trash in any cardboard boxes
Networking
Using what we learned about networking, we ran latency tests and built graphs describing the troubleshooting order for internet related issues.
Using the ping command, I compared the latency of 2 of the fastest servers, google and cloudflare. Google, whose IP is 8.8.8.8 managed a average response time of 24ms , while cloudflare, on 1.1.1.1, had only 15ms of ping. This makes sense, as google's closest datacenter that probably was responding was 70 miles away, while cloudflare has one in Charlotte.
We also used it to compare the Bridged and Shared mode of our VMs networking. Bridged and shared are different ways that the Mac gives the VM internet, bridged being acting like its its own device, the same idea as running a mobile hotspot on your phone to get your laptop internet. Shared is sharing the network, which doesnt give the VM independence from the Mac.
All of the troubleshooting flows in the correct order
Reflection
This assignment taught me:
Linux file systems creation commands (mkdir, echo >, touch, nano) Navigation commands(ls, cd, tree)
file manipulation commands(mv, cp) file checking commands(cat, more/less) Mac file systems
Hostshare when sudo is needed Git bash(git clone, git pull) Hidden Files (touch .hidden)
Ping Command Line Networking Troubleshooting Networks
These series off command line related assignments taught me how files are stored, either in Linux or mac, and how the virtual machine creates a wall that blocks any files from being accessed by the wrong machine, except with a easily controllable "hostshare", which allows a file to be shared with the host machine or vice versa. Additionally, this taught me how Linux filesystems are set up, using ~ instead of C:/ for the root, and then expanding outwards towards the user directory just like windows. Compared to a easier to use GUI, the text based command line gives a lot more power to repeatedly get stuff done. A trick I learned for this was the up arrow, which allowed a recently executed command to be instantly put back up, which allows for quick editing/fixing of that command. In the real world, a CLI interface allows for way easier control over a computer compared to a mouse and keyboard, which is something I have experienced. A project I did for fun 2 years ago was a pi zero 2 w connected to a small HDMI display in order to act as a really low power (and really crappy) wireless 2nd monitor. I never finished this project because the zero 2 w was too underpowered, but in working with it I had to use SSH to control the pi from my main computer, and then installed moonlight to do all the streaming for me.
The networking part of this also proved pretty easy for me, partially due to me getting lucky and not having a broken ping command like some of my classmates, and again partially due to previous experience with networking, mostly in running a mine craft server off Ubuntu and using moonlight to control that computer as I hide it in the basement.