Thursday, 29 September 2022

Layers of the OSI Model

OSI (Open Systems Interconnection) model is a conceptual framework that standardizes how different network protocols communicate across a computer network. It was developed by the International Organization for Standardization (ISO) in 1984 to provide a universal set of rules for network communication.

7 Layers of the OSI Model
The OSI model is organized into 7 distinct layers, each with specific responsibilities. Data flows from the top layer (Application) down to the bottom layer (Physical) when sending, and from bottom to top when receiving.
🔝 Layer 7: Application Layer
What it does: Interface between user applications and the network
    Examples: HTTP/HTTPS, FTP, SMTP, DNS, DHCP
    Function: Provides network services directly to applications
    Real-world example: When you browse a website, your browser uses HTTP/HTTPS protocols

📋 Layer 6: Presentation Layer
What it does: Data translation, encryption, and compression
    Examples: SSL/TLS, JPEG, GIF, ASCII, EBCDIC
    Function: Ensures data is readable by the receiving system
    Real-world example: Encrypting your password when logging into a website

🔗 Layer 5: Session Layer
What it does: Manages communication sessions between applications
    Examples: NetBIOS, RPC, SQL sessions
    Function: Establishes, maintains, and terminates connections
    Real-world example: Maintaining your login session on a website

🚚 Layer 4: Transport Layer
What it does: Reliable data transfer and error correction
    Examples: TCP, UDP
    Function: Ensures complete data transfer with error checking
    Real-world example: TCP ensures all parts of a file download arrive correctly

🗺️ Layer 3: Network Layer
What it does: Routing and logical addressing
    Examples: IP (IPv4/IPv6), ICMP, OSPF, BGP
    Function: Determines the best path for data across multiple networks
    Real-world example: Routers use IP addresses to forward data packets

🔌 Layer 2: Data Link Layer
What it does: Node-to-node delivery and error detection
    Examples: Ethernet, Wi-Fi (802.11), PPP
    Function: Handles communication between directly connected devices
    Real-world example: Your computer communicating with your router via Ethernet or Wi-Fi

⚡ Layer 1: Physical Layer
What it does: Raw data transmission over physical medium
    Examples: Cables, fiber optics, radio waves, electrical signals
    Function: Transmits raw bits over the physical medium
    Real-world example: Electrical signals traveling through an Ethernet cable

🔄 How Data Flows Through the OSI Model
Sending Data (Top to Bottom)
    Application → User creates data (email, web request)
    Presentation → Data is encrypted/compressed
    Session → Session is established
    Transport → Data is segmented and prepared for reliable delivery
    Network → Routing information is added
    Data Link → Frame headers are added for local delivery
    Physical → Data becomes electrical/optical signals





Sunday, 4 September 2022

zsh: no matches found

"zsh: no matches found" typically occurs in the Zsh shell when you use wildcard characters (such as *, ?, or []) in a command, and there are no files or directories that match the specified pattern in the current directory.

Here are a few common scenarios where you might encounter this error:
Using a command with a wildcard pattern that doesn't match any files:
$ ls *.xyz
zsh: no matches found: *.xyz

In this example, Zsh couldn't find any files in the current directory with the ".xyz" extension.
Using a command with a wildcard pattern, but the pattern itself doesn't match anything:

$ echo [a-z]
zsh: no matches found: [a-z]

If there are no lowercase letters in the current directory, the [a-z] pattern won't match anything.

To resolve this issue, you can do the following:

1.Double-check your command or wildcard pattern to ensure it matches existing files or directories in the current directory.
2.Use proper escaping or quoting if necessary. For example, if you want to list files with a literal asterisk in their names, you can use single or double quotes to prevent globbing:

$ ls '*.*'

If you want to use a wildcard pattern to match files in subdirectories as well, consider enabling the globstar option in Zsh:

$ setopt globstar
$ ls **/*.txt

The ** pattern will match files in subdirectories.

How to Delete a Primary Key Index in Oracle

Deleting a primary key index can be a complex task, as it involves modifying the structure of the database table. Here are the steps you can follow to delete a primary key index:

Identify the name of the primary key index: 

SELECT index_name FROM dba_constraints WHERE table_name = 'table_name' AND constraint_type = 'P';

Drop the primary key constraint: Before you can drop the primary key index, you must first drop the primary key constraint. 

ALTER TABLE table_name DROP PRIMARY KEY;

Drop the primary key index: Once the primary key constraint has been dropped, you can then drop the primary key index

DROP INDEX index_name ON table_name;

It's important to note that deleting a primary key index will also remove the associated primary key constraint, which can have implications for data integrity and referential integrity in your database. Be sure to fully understand the implications of removing a primary key index before proceeding.