Introduction to Networks


    • How can 2 computers talk to each other? 
      • through network
      • most people buy a wireless router to connect  things together
  • LAN = Local Area Network
      • combination of router, computer systems, wireless router
  • NIC = Network Interface Card
      • ear and mouth of a computer: receive and transmit information
  • WAN = Wide Area Network
      • connect networks across multiple cities, countries, etc;
      • to connect network in buildings and different floors (creating a small WAN): 
        • connect all systems on a floor with a router
        • connect all floors in a building with another router
  • Mac Address
      • how computers identify or communicate with each other
      • unique to each computer’s network interface card
      • format: 00:00:AB:13:5A:2C, or 0000.AB13.5A2C
        • represented in hexadecimals
        • 6 bytes long, 48 bits
    • Computer’s Communicating
      • computers share a medium
  • Collision Detection/Avoidance
    • originally: A talks to B, while B is talking to A, then there is interference and A’s message to B is lost
    • now: before C sends data to A, sees if there is a conversation going on with A, and only sends when A is free

How the Internet Works

In order to learn more about Internet Protocol and networks for more work this summer, I have been doing some research and learning around how the Internet Works. I came across this amazing video that explains in very clear terms how the internet works and I thought it was really interesting, so I took some notes and decided to share it here:

How the Internet Works

    • internet = wire
      • can be underground or satellite
    • servers are special computers connected directly to internet
      • servers can communicate with other servers connected to internet
      • webpages are files on server’s hard drive wire
    • every server has a unique internet protocol address/IP address
      • help computers find each other 
      • IP addresses given domain names to make it more easy to remember/access
        • ->
    • computer is not a server because it is not connected directly to the internet (called a client)
      • connected indirectly to internet with internet service provider (ISP)
  • client connects with ISP with DSL = Digital Subscriber Line
  • is a server and a ISP 
  • sending an email to someone using
    • from computer client > connect to ISP with DSL > connect to > once sent > sends it to [email protected] > next day someone can dial into and view it
  • when email/picture/webpage travels through internet, computer breaks down information into packets, and packets are reassembled on the receiving end
  • IP address and routers 
    • prevents what happens on your computer to appear on others computers
    • anywhere 2 or more of the internet intersects, a router directs your packets around the internet
    • every time you visit a website, there can be up to 10-15 routers helping you reach it
      • packet you send is like a candy wrapped in different layers
      • 1st layer: your computer’s IP address > your computer sends packet to router which adds its own IP address > each time packet sent to a new router a new layer of IP address is added until it reaches the server
      • when server sends back information, creates packets with identical wrapping > as packets make it back to your computer, each router unwraps a layer so it knows what IP address to send the packet to next to reach the right destination

The video:


python -m to run module

I just learned that to run a python module from the terminal, the command line is:  python -m <name_of_module>

I needed to learn this command because while I was grading for my python course, I had to run the module through an outside terminal because I had just reinstalled Anaconda-Navigator and Spyder and the graph that is supposed to be plot after running the module was not showing up because it was hidden, so I ran it on terminal to make sure it wasn’t the student’s code that broke.  Beforehand we always ran the modules with run -m <name_of_module> but when I tried those commands in the Mac terminal it didn’t work. I also was confused what -m meant before, but now I understand it means to run a python module!

Ted Talk – 5 Second Rule

I like to watch Ted Talks on my free time or when I’m passing time (like eating, washing dishes, doing chores, etc;) because it makes me feel like my time isn’t wasted and that I’m learning. I like to go to sleep everyday knowing that I have at least improved myself and my life in some way–whether it be socially where I’ve built stronger relationships or caught up with people, academically where I’ve completed assignments or psets, hobbies-wise where I’ve improved either in motor skills such as dance or skateboarding, creation-wise where I was able to make, edit, or produce something, knowledge where I’ve learned things that I can apply to my life. Recently, since my school has ended, the academic aspect has escaped me so I have “free time” but I am still often dissatisfied because I spend a lot of it in idleness and not really improving myself. Sometimes I feel like having too many things I want to do limit me and make me decide to do none or scatter myself too thinly between multiple goals, whereas if I just focused on one thing I could complete it and get really good at it. So, in an attempt to try to go to sleep feeling more satisfied with myself and my self-growth, I listened to a few Ted Talks while washing the dishes today.

One that I really liked was called “How to stop screwing yourself over.” The speaker was a woman who is basically a “life coach” for people to “get anything they want in life” which could be to lose weight, to make 3x the amount of money they currently are, to buy a house, to find romance. At first, the occupation “life coach” sounds like farce so I wasn’t too interested, but I really enjoyed her TedTalk. I’ve linked it here:

One thing she taught that really resonated with me was called the “5 second rule.” She said that if you have an impulse to do something such as to change your lifestyle or pursue a goal, then you must marry it with action within 5 seconds, or else your brain kills the idea. Depending on the what the thought is, the action doesn’t have to be huge–it could be simply writing a note, sending an email. The thought could be as small as going up to volunteer for something on stage or bigger like learning a new skill or huge like starting a life in a new country. I thought about the countless times I’ve tried to do things, but haven’t ever “gotten to it” because right after I had the impulse to do something, I feel extremely motivated and pumped, and then when I don’t act on it, it never gets done.

So, after listening to her speech, I responded to all my emails (that I haven’t in a while), finished my logo for CPEG, did some iMovie editing on the coding youtube video I wanted to post, and more largely started an eBay account and posted my first item. Making an eBay account is something I’ve wanted to do for a really long time. Even though I had this spur of inspiration and motivation, I wasn’t sure how long it would last, so I am really hoping I can keep aiming for my goals.

MySQL Basic Commands

Install MariaDB: sudo apt install mariadb-server

Connect to MariaDB: sudo mysql

Show databases available: show databases;

Select ‘mysql’ database: use mysql;

Show tables in a database: show tables;

Retrieve everything: SELECT * FROM user;

Retrieve only some columns: SELECT host, user, password FROM user;

Creating table (named ‘user_review’): Inserting into a table:

INSERT INTO user_review (reviewer_name, star_rating, details) VALUE (‘Chris’, ‘4’, ‘A little bitter.’);

INSERT INTO user_review (reviewer_name, star_rating, details) VALUE (‘Linda’, ‘5’, ‘Essential for living.’);

List all rows and columns of a table: DESCRIBE user_review;