INSTALLATION DOCUMENTS BY RAVI

Showing posts with label LINUX. Show all posts
Showing posts with label LINUX. Show all posts

Saturday, February 17, 2018

Installing Anaconda On Linux

Downloading software:

cd /opt


wget http://repo.continuum.io/archive/Anaconda3-4.0.0-Linux-x86_64.sh















Installing Anaconda:

Run the below command to install Anaconda

bash Anaconda3-4.0.0-Linux-x86_64.sh







Press Enter to continue the installation
















Type yes to accept licence agreement

Provide the location for anaconda installation

































Installation completed successfully

Testing Anaconda installation





























Thursday, December 21, 2017

Sudo User: Steps To Add and Grant Sudo Privileges to Users in Linux










In order to add the user to sudoers file please find the steps below:


Logged in as root run the visudo command:






When we type this command, we will be taken into a text editor session with the file that defines sudo privileges pre-loaded. We will have to add our user to this file to grant our desired access rights.















Save and close the file

Now, when you are logged in as your oracle user, you can execute a certain command with root privileges by typing:

sudo "command"










Monday, November 20, 2017

Enable Root User on Ubuntu

1. Set password for root user:

Login as user
Open terminal
Issue the below command to set password for root user

$sudo passwd root

Give the password for root user 

2. Open the file 50-ubuntu.conf under the path (/usr/share/lightdm/lightdm.conf.d/)

Add the below line to it.

greeter-show-manual-login=true

Save and close the file.

3. Reboot the machine and now we can login as root user.





Tuesday, October 31, 2017

Copying files between widows to linux from command prompt using ftp

Open the command prompt as an administrator on windows machine
Try to connect to linux machine using ftp and try to copy a file













Here we are getting the message as "Not connected"

To resolve this we need to modify "vsftpd.conf" on linux machine as below:





uncomment the following line below and save the file
local_enable=YES
write_enable=YES
anon_upload_enable=YES
















Now restart the ftp server as below:






Now again try to connect from windows machine






Here we tried to connect as root user but it got failed.
By default ftp server was not open to linux as root user so try with normal user.






Copy a file from windows to linux using "put" command in ftp prompt





Now check for the file in linux machine





Basic ftp commands:

1. ls
List the contents of remote directory










2. cd
Change the remote working directory









3. dir
List contents of remote directory









4. get
To receive file from the linux machine to windows machine





Check for the file on windows machine













5. lcd
Change the local working directory on windows machine


















6. mget
Getting multiple files from linux machine










Checking files on windows machine













7. mput
Sending multiple files to linux machine












Checking files on linux machine







8. rename
Renaming a file name




Checking for the renamed file






9. bye
Terminating the ftp session




10. close
Terminating the ftp connection







11. help
Displays the local help information










Thursday, July 27, 2017

Command to change the time stamp of all the files in a directory in linux

We can change the time stamp of all the files in a directory with a simple command

For example below screen shot contains a directory with two files of different date






Syntax for changing the time stamp of files in a directory

$ find "PATH-TO-THE-FILES-DIRECTORY" -exec touch -t YYYYMMDDhhmm {} \;







See in the above screen time stamp of the files changed to the date we mentioned in the screen




Steps for clearing the history in linux terminal

1. Command to check the history

Open a terminal and type the command "history" and click enter



















It will give the history of all commands which we used

2. Command to clear the history

To clear this history in the terminal type the command "history -c" and click enter




3. Now again check for history it will show nothing






Sunday, June 11, 2017

Shell script for getting an Alert Mail if the Disk Usage reaches 90% of space Linux

Prerequisites:
Any one of the below mail utility must be present on the linux server
1. sendmail
2. mail
3. mutt
4. ssmtp
5. telnet

1. Below script will send an alert mail if the disk usage space of a directory in linux server reaches 90%
In this script I used "mail" utility for sending alert mails

ADMIN="lravikumarvsp@gmail.com"
ALERT=90
message=$(df -h | awk -v ALERT="$ALERT" '
    NR == 1 {next}
    $1 == "abc:/xyz/pqr" {next}
    $1 == "tmpfs" {next}
    $1 == "/dev/cdrom" {next}
    1 {sub(/%/,"",$5)}
    $5 >= ALERT {printf "%s is almost full: %d%%\n", $1, $5}
')
if [ -n "$message" ]; then
  echo "$message" | mail -s "Alert: Almost out of disk space" "$ADMIN"
fi

2. Below script will send an alert mail if the disk usage space of the root partition in linux server exceeds 90%

#!/bin/bash
CURRENT=$(df / | grep / | awk '{ print $4}' | sed 's/%//g')
THRESHOLD=90
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
    mail -s 'Disk Space Alert' lravikumarvsp@gmail.com << EOF
Your root partition remaining free space is critically low. Used: $CURRENT%
EOF
fi


Sunday, May 14, 2017

How to recover the forgot linux root password

Boot into single usermode or boot using rescue disk.

If Grub is password protected then use the rescue disk, chroot /mnt/sysimage, then use the passwd command.

If Grub is not password protected, then you can login to single usermode by appending an "S" to the end of the kernel line that you have to boot. Select the kernel that you wish to boot with and press 'e'.

Now append an 'S' to the end of the line, press Return, and then 'b', once the system is booted into single usermode you can use the passwd command to reset the root password.

Thursday, May 11, 2017

sed command to add a line in nth place of a file in linux

Command to add a string in nth line of a file:

sed -i '8i string to add' filename

8: stands for 8th line in file
i: insert

The above command will add the string in 8th line of all the file.

Command to add a string in nth line of all files in a directory:

sed -i '8i string to add' *

The above command will add the string in 8th line of all the files in the directory.


sed -i '8i string to add' filename*.txt

The above command will add the string in 8th line of all the files with extension .txt in the directory.

sed command to search replace a word in a file in linux

Command to search and replace a word in a file:

sed -i 's/original word/word to replace/g' filename

Command to search and replace a word in all of the files in a directory:


grep -rl 'original word' path_of_the_directory | xargs sed -i 's/original word/word to replace/g'

Sunday, May 7, 2017

Step by Step Oracle Linux 5 Installation

Boot from the CD or DVD. At the boot screen, press the "Enter" key



















Press Enter or Shift + Enter
















Select Skip and press Enter




















Click Next



















Select the language you want and click next



















Select the keyboard type and click next



















Click yes



















Select remove linux partitions on selected drives and create default layout

Check the option Review and modify partitioning layout

Click next



















Click yes



















Click next



















Select the option and click next



















Click Next



















Click Next



















Provide password and click next



















Select Customize now and click next



















Select Desktop Environment you want and click next



















Click next





































Click Reboot



















Click Forward



















Accept the license agreement and click Forward



















Disable the firewall and click Forward



















click yes



















Disable selinux and click forward



















click yes



















Click forward



















Adjust date and time and click forward



















Select no and click forward



















Click forward



















click continue



















click forward



















Click Finish



















Click ok







































  Opatch reports 'Cyclic Dependency Detected' error when patching ODI   Issue: When applying a Patch Set Update (PSU) to WebLogic Se...