Posts

Showing posts from June, 2024

Root directory & Home directory

  Root Directory ( / ) Root Directory: The root directory ( / ) is the top-level directory of the filesystem hierarchy in Linux. It is the starting point for the directory tree, and all other directories and files are placed under this root directory. Root User's Home Directory: The root user (the superuser) has a specific home directory, typically /root or (~) . This is separate from other users' home directories. Home Directory ( /home ) Home Directory : Each non-root user has their own home directory under /home . For example, if you have a user named alice , her home directory would typically be /home/alice . Purpose : The home directory is where users store their personal files, configuration settings, and other data. It is a dedicated space for each user to manage their own files and environment settings without interfering with other users. Example of Home Directory Structure Root User : The home directory for the root user is /root . Regular Users : The home directori...

User creation in Linux

1. To create a new user in zabbix. useradd user_name useradd -m user_name   #Using the -m option with useradd to create a home directory for new user 2. To set the password. passwd user_name 3. To see the entry of the user. vi /etc/passwd Note: username:password:UID:GID:comment:home_directory:shell shell:  /usr/sbin/nologin The login shell for the user. The  /usr/sbin/nologin  shell is used to prevent the user from logging into the system interactively. It is typically used for system or service accounts that do not require interactive login capabilities. 4. We can see the entry of the user. cat /etc/passwd | grep user_name Output: newusername:x:1001:1001::/home/newusername:/bin/bash where /bin/bash indicates when a user logs in, the system starts this shell for the user, allowing them to interact with the system through Bash. 4. To see the password of all users in hashed form. vi /etc/shadow 5. To find out which user you are currently working as in a Linux environ...

Scripting: Shebang

  What is a Shebang? The shebang ( #!/bin/bash ) is a special sequence of characters used at the very beginning of a script. It is sometimes referred to as a "hashbang" or "pound-bang." The shebang tells the operating system which interpreter to use to execute the script that follows. Structure of a Shebang The shebang line always starts with #! , followed by the path to the interpreter that should execute the script. Here’s the structure: #!/path/to/interpreter In the Context of #!/bin/bash #! : This sequence indicates the start of the shebang line. /bin/bash : This specifies the path to the bash interpreter. bash stands for "Bourne Again Shell," which is a commonly used command-line interpreter on Unix-like operating systems, including Linux. When the script starts with #!/bin/bash , it tells the operating system to use the bash shell to interpret and run the commands within the script.

API & API in Zabbix

API (Application programming interface):   An API is a set of rules and protocols that allows one software application to interact with another. It defines the methods and data formats that applications can use to request and exchange information. APIs are typically used for both retrieving data from a service (like fetching information from a database or another web service) and sending data to a service (like submitting a form or updating information). Zabbix API: The Zabbix API is a powerful tool that allows you to interact programmatically with the Zabbix monitoring system. It provides endpoints for various operations such as managing hosts, items, triggers, and more. The Zabbix API is a JSON-RPC-based interface provided by Zabbix for programmatically interacting with and managing the Zabbix monitoring system. ### Key Features - **Automate Tasks**: Create, update, or delete objects like hosts, items, and triggers. - **Query Data**: Retrieve monitoring data, configuration detail...

Webhook

A webhook is a way for one application to send real-time data to another application when something happens. It's like a phone call that an app makes to another app to say, "Hey, something just happened. Webhooks are triggered by events and send data (usually in JSON or XML format) to a specified URL when the event occurs. Webhook automated the messages sent from one apps to another app when something happens. Example:  Imagine you have a website where people can sign up for a newsletter. When someone signs up, you want their email to be added automatically to your mailing list in another application, like Mailchimp. Instead of manually copying every new email address, you can set up a webhook. When someone signs up on your website, it triggers the webhook to automatically send that email address to Mailchimp. This way, the process is automated and happens instantly. Note: There are two ways your apps can communicate with each other to share information: polling and webhooks. ...

Protocol: HTTP, HTTPS

HTTP (Hypertext Transfer Protocol) and HTTPS (HTTP Secure) are protocols used for transmitting data over the Internet. They operate primarily over TCP/IP (Transmission Control Protocol/Internet Protocol) and use specific ports to establish connections and exchange data between clients (such as web browsers) and servers (web servers). HTTP (Hypertext Transfer Protocol): Default Port : HTTP typically operates over port 80. Example : When you type a URL like http://example.com into your web browser and press Enter: The browser sends an HTTP request to the server example.com on port 80. The server receives the request, processes it, and sends back an HTTP response, typically containing HTML content, images, or other resources requested. The connection is established and data is transmitted in plaintext (unencrypted). HTTPS (HTTP Secure): Default Port : HTTPS typically operates over port 443. Example : When you type a URL like https://example.com into your web browser and press Enter: Th...

Network Protocol: TELNET, SSH

TELNET Telnet is a network protocol that provides a command-line interface for communication with a remote device or server over a network. Telnet allows users to connect to remote computers or devices over the Internet or a local network to manage and control them. Through Telnet, users can execute commands on the remote system as if they were physically present at the console of that machine.   Example Scenario: Accessing a Remote Server via Telnet Setup : You have a remote server with the IP address 192.168.1.100 . Telnet service is running on this server. You have a Telnet client installed on your local machine. Connecting to the Remote Server : Open a command prompt (Windows) or terminal (Linux/Mac) on your local machine. Type the command to initiate a Telnet connection to the remote server: Command: telnet 192.168.1.100 Note:  No Encryption in TELNET: Telnet transmits all data, including passwords and commands, in plaintext. This makes it vulnerable. Port : TELNET typic...

DevOps From Beginning: Ansible

Image
Ansible is an open-source IT configuration management, deployment, and orchestration tool. In simple language, if we want to install Ubuntu on the 10 servers we need to go to each server and manually install Ubuntu but Ansible removes this problem, we can install, delete and everything on 10 servers in single time through the Ansible tool. It aims to provide a large productivity gain to a wide variety of automation challenges. Developed by Michael Dehaan Redhat acquired the Ansible tool in 2015. Ansible is available for RHEL, Debian, Centos, oracle, Linux We can use this tool whether your servers are in on-premises or in cloud. It turns your code into infrastructure. Ansible is Agentless and will communicate with the node directly through the SSH. Advantages: Ansible is free to use by everyone. Ansible is very consistent and light weight(means occupy the less space). It is very secure due to its agentless capabilities and open ssh security feature. Ansible does not need any special s...

Apache Server: Installation

Apache is free and open-source software of web servers. Apache permits the owners of the websites to serve content over the web. It is the reason why it is known as a "web server." The aim of the web servers is to deliver websites over the internet. It behaves as a middleman among the client machines and servers to achieve that aim. It can pull the content through the server over every user request. Also, it delivers this request to the web. Apache is not any physical server; it is software that executes on the server. However, we define it as a web server. Its objective is to build a connection between the website visitor browsers (Safari, Google Chrome, Firefox, etc.) and the server. How to install an Apache server and how to edit the default webpage. 1. yum install apache2 –y 2. apache2 –version 3. systemctl status apache 4. hostname –i 5. Copy the public IP of Linux machine from GCP and test in the browser 6. To create a custom webpage or modify the webpag...

DevOps From Beginning: Docker

Image
  Docker:  · Docker is an open-source containerization platform by which you can pack your application and all its dependencies into a standardized unit called a container. · Docker is a tool that creates the Container. we can run the docker on any OS i.e. we can install the docker on Windows but the code inside the docker file will be of Linux. · Docker engine (which creates the container) runs natively on Linux OS. · Written in GO language. · Docker is a set of platforms as a service (PaaS) products that use Operating system-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries, and configuration files; they can communicate with each other through well-defined channels. · Docker Hub is a repository service and it is a cloud-based service where people push their Docker Container Images and also pull the Docker Container Images from the Docker Hub anytime or anywhere via the int...