Posts

redhat free cost Developer subscription

Create a new login in  https://developers.redhat.com An email will be send from redhat for the activation to the email ID with which the new login is created. Once confirmed by clicking the link, login to  https://developers.redhat.com to verify the correct login. Afterwards login to   https://access.redhat.com/  to verify the active subscription . Then login to the Newly installed redhat server via ssh and execute the following commands sudo subscription-manager register when username and password is asked, provide the login credentials created previously. after that if an error comes like this: ================= HTTP error (401 - Unauthorized): You must first accept Red Hat's Terms and conditions.  Please visit https://www.redhat.com/wapps/tnc/ackrequired?site=candlepin&event=signOn . You may have to log out of and back into the  Customer Portal in order to see the terms. ================= login to the link pro...

CDbConnection failed to open the DB connection mysql 8

Image
While accessing web configured with mysql 8 and php and you see the following error: CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client OR  PHP Fatal error:  Uncaught PDOException: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]  It maybe due to  PHP devs might have not implemented the MySQL's 8.0 connection protocol ( auth with caching_sha2_password ) within the newer PHP versions. If you want to use mysql >= 8 and you dont care about caching_sha2_password,  If you are running a fresh install of mysql 8, just select the second option as shown in the image. Otherwise, you need to  configure MySQL 8.0 to run in mysql_native_password mode. As it can't configured in my.cnf, change the user profile as:- ALTER USER 'mysqlUsername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysqlUs...

Win 10 Modifying the Automatic Installation of Updates

 Open the Run command (Win + R), in it type: gpedit.msc and press enter Navigate to: Computer Configuration -> Administrative Templates -> Windows Components -> Windows Update Open it and change the Configure Automatic Updates setting to ‘2 - Notify for download and notify for install’ Open the Settings app (Win + I) and navigate to -> Update and Security -> Windows Updates. Click ‘Check for updates’ which applies the new configuration setting. Restart system

How to delete 'n' number if commands executed from bash history

For deleting 'n' number of commands frm bash history, first type history command in shell, #history for example if you need to delete commands from line 520 to line 637 . execute the command as follows. #for h in $(seq 520 637 | tac); do history -d $h; done thats it.

Permission denied: user=root, access=WRITE, inode="/user/root":hdfs:hdfs:drwxr-xr-x

If you are running the hive command as root and still recieve the same error, do the following root@hadoop_server:~# sudo -u hdfs hadoop fs -mkdir /user/root root@hadoop_server:~# sudo -u hdfs hadoop fs -chown root:root /user/root this should fix the problem and you will be able to run the hive command line.

IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified [ISQL]ERROR: Could not SQLConnect

If  trying isql from server gives the following error, IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified [ISQL]ERROR: Could not SQLConnect Then check the results of following commands in servers odbcinst -q -s odbcinst -q -d if you find any error means that the server is unable to read both odbc.ini and odbcinst.ini files. To resolve this configure the environment variable of server as  export ODBCSYSINI=/etc/ export ODBCINI=/etc/odbc.ini this should fix the error.

How to add an environment variable permanent in Redhat Linux

You can add an environment variable using the export command. But you can see that once you logout, the parameters you added wont be there. So inorder to add those variables permanently after adding the variable using export command, for example [root@server ~]# export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:/usr/lib:/usr/lib64:  we need to add the same command line in the file /etc/profile or /etc/bashrc  so that it will make the variable permanent for all users. If the change is neeed only for the current user annd the command in the .bashrc file inside the home folder of the current user.

Mysql deleted logs consuming physical server space

If you find that the server is using excess amount of physical disk space; try a df -h and find out the partition where the disk usage is getting higher. root@server:~# df -h Filesystem      Size  Used Avail Use% Mounted on /dev/vda1       242G  194G   36G  85% / udev             10M     0   10M   0% /dev tmpfs           6.3G   41M  6.3G   1% /run tmpfs            16G     0   16G   0% /dev/shm tmpfs           5.0M     0  5.0M   0% /run/lock tmpfs            16G     ...

Reinstall steps for mysql in debian server

apt-get remove -y mysql-* apt-get purge -y mysql-* Once finished, rm -rf /var/lib/mysql rm -rf /etc/mysql* apt-get install mysql-client mysql-server mysql-common

Change file and folder permission recursively

To Change file and folder permission recursively, use the following command. Here we are using the folder /var/www as example sudo find /var/www -type d -print0 | xargs -0 chmod 755 sudo find /var/www -type f -print0 | xargs -0 chmod 644

How to find a parent process of a child process

If you find a process that is using too much memory or CPU,  use the following command to find the parent process. Here '4093' is assumed as process ID Web]$ ps -o ppid= 4093 4087 As we can see that the parent process ID is 4087 and  using the following command. Web]$ ps -f 4087 UID        PID  PPID  C STIME TTY      STAT   TIME CMD sas       4087     1  0 Jul26 ?        S<     0:00 /bin/sh -p <file path> start2_tag Web]$

How to upload an ISO image from local drive to a proxmox server

How to upload an ISO image from local drive to a proxmox server Login to proxmox web control panel. Goto server view from drop down on left hand side. Expand datacenter menu until you see local then click it Right hand side select COntent tab click upload button Click select file, find your ISO, click upload.

: Too many open files in system

When you see this error while using commands in linux  ": Too many open files in system" Do the following:- first use this command to find the culprit process ID lsof | awk '{ print $2; }' | uniq -c | sort -rn | head Then kill the ID.

shell script count files per directory

 Using this single line scrpit, you can easily find the number of files inside each subdirectories. find . -type d -print0 | while read -d '' -r dir; do files=("$dir"/*); printf "%5d files in directory %s\n" "${#files[@]}" "$dir"; done

SSH Login Without Password Using ssh-keygen & ssh-copy-id

    1.)First we need to create Public and Private keys in the host machine.  Use the following command in the host machine.   jsmith@local-host$ ssh-keygen   If created correctly, you might find the following output. Generating public/private rsa key pair. Enter file in which to save the key (/home/jsmith/.ssh/id_rsa): [Enter key] Enter passphrase (empty for no passphrase): [Press enter key] Enter same passphrase again: [Pess enter key] Your identification has been saved in /home/jsmith/.ssh /id_rsa . Your public key has been saved in /home/jsmith/.ssh/ id_rsa.pub . The key fingerprint is: 33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 jsmith@local-host 2.) You will see the two keys id_rsa and id_rsa.pub created in your home folder in  which id_rsa.pub is the public key which you need to copy to the destination machines  home folder   using the following command. jsmith@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub remo...

Linux Command to delete files older than x days in a directroy

Delete Files Older Than x Days on Linux The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them. Command Syntax find /path/to/files* -mtime +5 -exec rm {} \; Note that there are spaces between rm, {}, and \; Explanation The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results. The second argument, -mtime, is used to specify the number of days old that the file is. If you enter +5, it will find files older than 5 days. The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required to end the command...

How to analyze the disk usage in Redhat Linux in graphical mode

Redhat Linux is providing a tool that can be run using graphical interface for analyzing the disk usage it is called "baobab". run the command as root [root@~]# baobab You can click "scan filesystem" to give a detailed folder usage view