Sunday, October 22, 2023

Details about all /etc/files

 The "/etc" directory in Linux contains a wide range of configuration files and directories that are essential for the proper functioning of the system and various software applications. Below are some common files and directories found in "/etc" and their typical usage:
/etc/passwd: This file contains user account information, including usernames, user IDs, group IDs, home directories, and shell types.

/etc/group: It stores information about user groups, including group names and group IDs.

/etc/shadow: This file holds encrypted password information for user accounts.

/etc/hostname: It stores the system's hostname, which is used to identify the machine on a network.

/etc/hosts: This file maps hostnames to IP addresses, allowing the system to resolve hostnames to IP addresses without using DNS.

/etc/hostname: It specifies the system's hostname, which is used during system boot.

/etc/resolv.conf: Contains DNS resolver configuration, including the IP addresses of DNS servers.

/etc/network/interfaces (or /etc/sysconfig/network-scripts): These files are used to configure network 
interfaces on the system.

/etc/fstab: It lists the file systems and partitions to be mounted at boot and their associated options.

/etc/mtab: This file contains a list of currently mounted file systems.

/etc/ssh/sshd_config: Configuration file for the OpenSSH server.

/etc/sudoers: Configuration for the sudo command, which allows users to execute commands as superusers.

/etc/apt/sources.list (Debian/Ubuntu) or /etc/yum.conf (RHEL/CentOS): Configuration files for package management systems. They define where the package manager should look for software packages.

/etc/crontab: The system-wide crontab file for scheduling tasks at specific times or intervals.

/etc/sysctl.conf: Configuration file for the sysctl command, which allows you to configure kernel parameters.

/etc/hostnamectl (systemd-based systems): This file contains system hostname and related information.

/etc/selinux/config (SELinux-enabled systems): Configuration file for SELinux, a mandatory access control system.

*/etc/default (or /etc/default/ on Debian-based systems)**: These directories store default configuration settings for various services.

/etc/X11/xorg.conf (or /etc/X11/xorg.conf.d/ on some systems): Configuration files for the X Window System.

/etc/samba/smb.conf (if Samba is installed): Configuration file for the Samba file-sharing service.

Please note that the above list is not exhaustive, and the files and directories in the "/etc" directory can vary between different Linux distributions and systems. Each file serves a specific purpose in configuring and managing the system and its software components. It's essential to use caution when making changes to these files, as misconfiguration can affect system stability and security.





Sunday, October 15, 2023

archivelogs location in oracle

 select inst_id,name,value from v$diag_info;



best for finding exact location of archivelog location in oracle linux:-

select dest_name,status,destination from gv$archive_dest where status='VALID';


SELECT name, space_limit, space_used FROM v$recovery_file_dest;

DBMS PACKAGES IN ORACLE

 


rm -rf !(folder) in linux

shopt -s extglob  # Enable extended pattern matching

rm -rf !(folder)  # Delete everything except the 'folder' directory

shopt -u extglob  # Disable extended pattern matching (optional)


Monday, October 9, 2023

savepoint, rollback, commit in oracle db

 commit: make changes done in transaction permanent.

rollback : rollback the state of database to the last commit point.

savepoint : use to specify a point in transaction to which later you can rollback.





create table student 

(

id number primary key,

name varchar2(50),

college varchar2(50)

);


insert all

into student values (1,'pravin','ness')

into student values (2,'prakash','ness')

into student values (3,'pratap','ness')

into student values (4,'pranav','ness')

into student values (5,'prayank','ness')

select * from dual;


--create savepoint student_original --

savepoint student_original;


-- delete some records --

delete student where id=5;


-- rollback to student_original savepoint --

rollback to student_original;


-- most important fact --

you cannot rollback to any previous savepoint once you've triggered commit; 


Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...