How to edit default python version for a linux user?

Edit the bash profile and add an alias using the following code $ nano ~/.bashrc Put the following line of code in .bashrc file and alter the python3.6 path as per your new installation alias python='/usr/local/bin/python3.6' Use CTRL x to exit and save After that you need to reload the source, so use the following command and you are good to go. $ source ~/.bashrc

December 31, 2018 · 1 min · Harshvardhan Malpani
lindows winux

Windows v/s Linux. What’s your choice?

Hi Everyone. Today we are going to talk about the two operating systems. Windows and Linux. Both of them have their own pros and cons. Offcourse Windows have its monopoly with 88% plus market shares. Although slowly but Linux has started getting attention and getting more popular day by day. Windows has dominated the market because it is way simpler to operate than any other operating system. In this article, we will be focusing on understanding the two operating systems and their pros and cons. ...

November 1, 2018 · 4 min · Harshvardhan Malpani

How to repair a MySQL database?

Hello! Good to see you. This is going to be a very important article because we are about to discuss “How to repair a MySQL database?” Why repair MySQL Database? Databases can become corrupted for any number of reasons, from software defects to hardware issues. If this occurs, you can try to repair the database. Wondering how to do it? Just follow this article. REPAIRING MYSQL DATABASES: Let’s see how to repair MySQL database through Linux and Windows command line. ...

October 30, 2018 · 2 min · Harshvardhan Malpani

Linux commands for SSH

tar– to create archive files(.zip, .tar) Syntax: tar [options] [archive-file] [file or directory to be archived] Options: -c : Creates Archive -x : Extract the archive -f : creates archive with given filename -t : displays or lists files in archived file -u : archives and adds to an existing archive file -v : Displays Verbose Information -A : Concatenates the archive files -z : zip, tells tar command that create tar file using gzip -j : filter archive tar file using tbzip -W : Verify a archive file -r : update or add file or directory in already existed .tar file ...

July 27, 2018 · 4 min · Harshvardhan Malpani

RPM repo not found connection errors on Centos Redhat duplicate problems

yum -y update command failing Command line will show messages like xxx is outdated and v abc will be installed but at the end it shows duplicate binary, please remove duplicate first. Process Backup first Integrity Check Find Problems Identify duplicates Clean duplicates re build conf cache update command remove backup file .prev if successfully solved \cp -r /var/lib/rpm /var/lib/rpm.prev yum-complete-transaction package-cleanup --problems package-cleanup --dupes package-cleanup --cleandupes yum clean all rpm --rebuilddb yum update # if all went OK run 'rm -rf /var/lib/rpm.prev' Other possible solution ...

July 24, 2018 · 1 min · Harshvardhan Malpani

Linux – Rescue disk how to reset root password and unblock yourself if locked out

Centos as test server Current situation – you are locked out, cant use WHM or SSH or anything else to login. You may or may not remember the password. In any case you can reproduce the following steps to unblock yourself. Use any other linux OS cd which can run live. I prefer FINNIX iso for such cases\ Mount your main disk. mount /dev/vda1 /mnt Reset password if needed to chroot /mnt passwd Enter new password for root and confirm\ Reboot and done. In case you have been locked out due to WHM cpanel:\ ...

July 23, 2018 · 2 min · Harshvardhan Malpani

Linux Bash – How to change all filenames to uppercase leaving the file extension unchanged

use this simple code in bash shell. The following code will change all xxx.jpg files to XXX.jpg in any particular working directory. for i in *.jpg; do ext=${i##*.}; name=$(basename "$i" ".$ext" | tr '[a-z]' '[A-Z]').$ext; if [ "$i" != "$name" ] then mv $i $name; fi done;

February 28, 2018 · 1 min · Harshvardhan Malpani

Compressing images directly on web server – Better Pagespeed tips

for png, install on centos using command yum install optipng for a single image optipng -o5 filename.png move to folder in which pngs are stored and use the following command: for i in *.png; do optipng -o7 -strip all -quiet "$i"; done this will overwrite all pngs, o7 is switch for number of tries. o5 will be less time consuming though. -quiet makes it muted, outputs nothing. -strip all will try to remove all meta data. you can use -preserve to preserve the modification date. also try -keep, if you want to save backup of each file

February 2, 2018 · 1 min · Harshvardhan Malpani