Internet / Computers / CLI / Devops / Misc Flashcards
What are “rc” files
config files
rc –> run commands
First Contentful Paint (FCP)
Time until the user sees an indication that the page is loading
Largest Contentful Paint (LCP)
- how quickly the main content of a web page is loaded
- the time from when the user initiates loading the page until the largest image or text block is rendered within the viewport
Cumulative Layout Shift (CLS)
Movement distance and impact of page elements during the entire lifetime of the document the user sees
First Input Delay (FID)
The browser time delay between the user’s first click and execution of application code
Example:
User clicks a button but eventhandler does not fire right away b/c page JS hasn’t finished loading
4 Web Vitals & tips for success
First Contentful Paint (FCP) - Respond quick
Largest Contentful Paint (LCP) - Get to the point
Cumulative Layout Shift (CLS) - Don’t move stuff
First Input Delay (FID) - Don’t load too much
What is the internet?
The internet is composed of many computers connected to each other and exchanging information.
These connections establish what’s known as a “network.”
When you connect to the internet, you’re connecting to a huge network consisting of many computers.
How computers talk to each other
- Computers and other devices have addresses.
- Computers send and receive information to and from each other with these addresses.
- When shared between computers, the information is turned into chunks of data the internet knows how to handle.
- Some computers, called servers, can send out information to other computers upon request.
Key components to Internet
- IP addresses
- Nodes and hosts
- Protocols
- Data packets
- Networking infrastructure
- Internet infrastructure
- Internet routing
- Domain names
IP Address
Computers use Internet protocol (IP) addresses to connect with one another through the internet
(similar to addresses we use to send postal mail)
Nodes and Hosts
Nodes - computers and devices connected to a network
Hosts - nodes that run applications that send and accept information from other nodes
Protocols
Protocol - a way of transmitting data between computers and other devices.
Most common protocols:
* Simple Mail Transfer Protocol (SMTP). This is used for email.
* Hypertext Transfer Protocol (HTTP). HTTP is used to connect to web pages on the World Wide Web (WWW).
* Transmission Control Protocol (TCP) - a standard that defines how to establish and maintain a network conversation by which applications can exchange data. TCP works with the Internet Protocol (IP), which defines how computers send packets of data to each other.
Data packets
- how bytes of data are packaged before traveling through the internet
- similar to normal packages that contain the parts of something that must be put together
Networking infrastructure
the physical devices that networks use to transmit data
Internet infrastructure
The infrastructure of the internet is built and supported by network service providers (NSPs).
By “infrastructure,” we mean the physical components that carry data through the internet. For example, these would include core routers, which take data and send it someplace else, and fiber optic cables, which carry data.
Internet routing
- In order for data to be sent to the right place over the internet, each data packet has routing information that tells it where to go. In this way, data on the internet is similar to mail you send through the post office. Each packet of data has information that tells it where it needs to be sent.
- Then a router, which sends data along the right route, takes the data, reads the information that says where it’s supposed to go, and sends it there.
- Each time the data goes from one router to another, it’s called a “hop.” Eventually, the data hops to your computer or another device.
Domain names
- A domain name is what you type into your browser, such as “Google.com,” “Yahoo.com,” or “Codecademy.com.” Domain names generally consist of two parts: Top-level domains (TLDs) and second-level domains (2LDs)
- TLDs are what follow the period in a domain name, like “.com” or other common TLDs like “.gov” or “.edu.”
- 2LDs precede the period in a domain name. For “Codecademy.com,” “Codecademy” is the 2LD. Generally, a 2LD can be whatever you want it to be — as long as it’s not already in use.
CPU
Central Processing Unit
aka processor or microprocessor
CPU Core
Essentially, a core is a CPU itself, a separate device inside the main CPU chip. This means that it has the ability to do just one thing at a time.
However, modern computers have the ability to support more than one core inside the main chip.
What is usually meant by the term “elastic”?
- Ability to scale
- Elastic cloud computing is the ability to quickly expand or decrease computer processing, memory, and storage resources to meet changing demands.
VPS
Virtual Private Server
* a slice of a server
* a virtual machine that provides virtualized server resources on a physical server that is shared with other users. With VPS hosting, you get dedicated server space with a reserved amount of resources, offering greater control and customization than shared hosting.
VPC
Virtual Private Cloud
a secure, isolated private cloud hosted within a public cloud.
Types of DNS Records
A Record
Maps name to IP Address
i.e. drinkvsdrink.com → 23.23.185.61
CNAME
Maps name to name
i.e. blog.drinkvsdrink.com → drinkvsdrink.com
Proxy Server (Forward Proxy)
allows multiple clients to route traffic to an external network.
e.g. a business may have a proxy that routes and filters employee traffic to the public Internet. A reverse proxy, on the other hand, routes traffic on behalf of multiple servers.
Reverse Proxy
- accepts a request from a client, forwards it to a server that can fulfill it, and returns the server’s response to the client.
- You can think of the reverse proxy as a website’s “public face.” Its address is the one advertised for the website, and it sits at the edge of the site’s network to accept requests from web browsers and mobile apps for the content hosted at the website.
Benefits of Reverse Proxy
- Increased security
- Increased scalability and flexibility
- Web Acceleration
- Compression
- SSL termination
- Caching
Load Balancer
- distributes incoming client requests among a group of servers, in each case returning the response from the selected server to the appropriate client.
- used to increase capacity (concurrent users) and reliability of applications.
Bandwidth
the amount of data that can be sent from one point to another in a certain period of time. It is measured as a bit rate expressed in bits per second (bits/s) or multiples of it (kbit/s Mbit/s etc.)
Caching
A cache – is hardware or software that is used to store something, usually data, temporarily in a computing environment.
2 main types of server operating systems
- Windows
- Unix
Examples of lineages from these OSs:
Unix –> Linux –> Ubuntu
Unix –> Linux –> Debian
Unix –> Linux –> Red Hat
Unix –> BSD –> freeBSD –> OSX/MacOS
Linux
Think about an OS like a car engine. An engine can run on its own, but it becomes a functional car when it’s connected with a transmission, axles, and wheels. Without the engine running properly, the rest of the car won’t work.
Linux was designed to be similar to UNIX, but has evolved to run on a wide variety of hardware from phones to supercomputers.
Every Linux-based OS involves the Linux kernel—which manages hardware resources—and a set of software packages that make up the rest of the operating system. Organizations can also choose to run their Linux OS on a Linux server.
Daemon
In Unix and Linux, a daemon is a program that runs in the background without requiring user interaction.
Long-term support (LTS)
policy in which a stable release of computer software is maintained for a longer period of time than the standard edition.
The term is typically reserved for open-source software, where it describes a software edition that is supported for months or years longer than the software’s standard edition.
Short term support (STS)
support policy for the software’s standard edition. STS software has a comparatively short life cycle, and may be afforded new features that are omitted from the LTS edition to avoid potentially compromising the stability or compatibility of the LTS release
2 types of Authentication
- username / pw
- SSH keys
SSH
Secure Shell (aka Secure Socket Shell)
Very large key
Two Keys:
1. Private Key
2. Public Key
You need the private key (on your computer) to decrypt the public key
Strongest authentication available
SSH vs SSHD
SSHD - SSH Daemon
The main difference is that sshd is a server (like a web server serving https) and SSH is a client (think of a web browser). The client/user authenticates itself against the server using the users credentials
Firewall
network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules
Port
communication endpoint that maps to a specific process or network service
what’s the point of ports? - you can hit the IP address, but then where do you want to go? By specifying the port, you can say exactly where you want communication to go - much better than having a trillion ip addresses.
HTTP
- Hypertext transport protocol
- defines how the code moves from the server to the client and how to decrypt that
- Runs over TCP
HTTPS:
- Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website.
- Encrypted on the client, decrypted on the server
HTTP Headers and Cookies
Header - metadata about where the packet is going, where its from (think of it like the writing on an envelope - you can read it without opening up the packet)
Headers are different based on if its a request or response
Common headers:
* Host: tells request where its going
* User-Agent: information about the requesting user agent (e.g. browser)
How to SSH into a Server
ssh user@[ip_address]
Bash
Bash is a shell program.
A shell program is typically an executable binary that takes commands that you type and (once you hit return), translates those commands into (ultimately) system calls to the Operating System API.
Note: A binary is a file that contains the instructions for a program, ie it is a ‘program’ file, rather than a ‘text’ file, or an ‘application’ file (such as a Word document).
If you’re not sure what an Operating System API is, then don’t worry. You only need to know that a shell program is a program that allows you to tell the computer what to do. In that way, it’s not much different to many other kinds of programming languages.
dot .
linux
The dot (.) represents the current directory in the filesystem.
dot-dot ..
linux
The dot-dot (..) represents one level above the current directory.
/
linux
The forward slash (/) represents the “root” of the filesystem. (Every directory/file in the Linux filesystem is nested under the root / directory.)
tilde ~
linux
The tilde (~) represents the home directory of the currently logged in user.
The tilde (~) is a Linux “shortcut” to denote a user’s home directory. Thus tilde slash (~/) is the beginning of a path to a file or directory below the user’s home directory.
pwd
linux
pwd - print working directory
cd
linux
cd - change directory
apt
linux
Advanced Package Tool
- set of core tools inside Debian and Ubuntu Linux system.
- You can use the apt command to install, delete or remove apps, keep Ubuntu/Debian server up to date with security patches and more.
source
linux
reads and executes the file content in the current shell
(useful when updating ~/.zshrc file and you want iterm to access those updated values without restarting iterm)
source ~/.zshrc
redirection
|
read from stdout
> write stdout to file
> append stdout to file
<
read from stdin
2>
read from stderr
Multi Plexing
HTTP/2 can send multiple requests for data in parallel over a single TCP connection. This is the most advanced feature of the HTTP/2 protocol because it allows you to download web files asynchronously from one server.
Most modern browsers limit TCP connections to one server. This reduces the additional round trip time (RTT), making your website load faster without any optimization, and makes domain sharding unnecessary.
What is a CDN and what is the benefit of using one?
A content delivery network (CDN) is a network of interconnected servers that speeds up webpage loading for data-heavy applications.
CDN can stand for content delivery network or content distribution network.
When a user visits a website, data from that website’s server has to travel across the internet to reach the user’s computer. If the user is located far from that server, it will take a long time to load a large file, such as a video or website image. Instead, the website content is stored on CDN servers geographically closer to the users and reaches their computers much faster.
We use AWS Cloudfront as our CDN
What is the difference between AWS ECR and ECS?
The primary difference between Amazon ECR and ECS is that while ECR provides the repository that stores all code that has been written and packaged as a Docker image, the ECS takes these files and actively uses them in the deployment of applications.
vertical vs horizontal scaling
Vertical - add more power (CPU, RAM) to existing machine
Horizontal - add more machines into your pool of resources
What does bit stand for
Binary digit.
- smallest unit of data in a computer. Either 0 or 1