<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>linux on Tutes Club</title><link>https://tutes.in/tag/linux/</link><description>Recent content in linux on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 17 Jan 2019 17:04:09 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>How to edit default python version for a linux user?</title><link>https://tutes.in/how-to-edit-default-python-version-for-a-linux-user/</link><pubDate>Mon, 31 Dec 2018 10:53:46 +0000</pubDate><guid>https://tutes.in/how-to-edit-default-python-version-for-a-linux-user/</guid><description>&lt;p&gt;Edit the bash profile and add an alias using the following code&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ nano ~/.bashrc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Put the following line of code in &lt;code&gt;.bashrc&lt;/code&gt; file and alter the python3.6 path as per your new installation&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;alias python=&amp;#39;/usr/local/bin/python3.6&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Use &lt;code&gt;CTRL x&lt;/code&gt; to exit and save&lt;br&gt;
After that you need to reload the source, so use the following command and you are good to go.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ &lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Windows v/s Linux. What’s your choice?</title><link>https://tutes.in/windows-v-s-linux-whats-your-choice/</link><pubDate>Thu, 01 Nov 2018 08:32:02 +0000</pubDate><guid>https://tutes.in/windows-v-s-linux-whats-your-choice/</guid><description>Know the pros and cons of each of these two operating system, and chose the right one for you.</description></item><item><title>How to repair a MySQL database?</title><link>https://tutes.in/how-to-repair-a-mysql-database/</link><pubDate>Tue, 30 Oct 2018 08:20:31 +0000</pubDate><guid>https://tutes.in/how-to-repair-a-mysql-database/</guid><description>Repair the MySQL database through Linux or Windows both covered in this article.</description></item><item><title>Linux commands for SSH</title><link>https://tutes.in/linux-commands-for-ssh/</link><pubDate>Fri, 27 Jul 2018 07:37:13 +0000</pubDate><guid>https://tutes.in/linux-commands-for-ssh/</guid><description>&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;tar&lt;/strong&gt;– to create archive files(.zip, .tar)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Syntax:&lt;br&gt;
tar [options] [archive-file] [file or directory to be archived]&lt;/p&gt;
&lt;p&gt;Options:&lt;br&gt;
-c : Creates Archive&lt;br&gt;
-x : Extract the archive&lt;br&gt;
-f : creates archive with given filename&lt;br&gt;
-t : displays or lists files in archived file&lt;br&gt;
-u : archives and adds to an existing archive file&lt;br&gt;
-v : Displays Verbose Information&lt;br&gt;
-A : Concatenates the archive files&lt;br&gt;
-z : zip, tells tar command that create tar file using gzip&lt;br&gt;
-j : filter archive tar file using tbzip&lt;br&gt;
-W : Verify a archive file&lt;br&gt;
-r : update or add file or directory in already existed .tar file&lt;/p&gt;</description></item><item><title>RPM repo not found connection errors on Centos Redhat duplicate problems</title><link>https://tutes.in/rpm-repo-not-found-connection-errors-on-centos-redhat-duplicate-problems/</link><pubDate>Tue, 24 Jul 2018 17:00:34 +0000</pubDate><guid>https://tutes.in/rpm-repo-not-found-connection-errors-on-centos-redhat-duplicate-problems/</guid><description>&lt;h2 id="yum--y-update-command-failing"&gt;yum -y update command failing&lt;/h2&gt;
&lt;p&gt;Command line will show messages like&lt;/p&gt;
&lt;p&gt;xxx is outdated and v abc will be installed&lt;br&gt;
but at the end it shows duplicate binary, please remove duplicate first.&lt;/p&gt;
&lt;p&gt;Process&lt;/p&gt;
&lt;p&gt;Backup first&lt;br&gt;
Integrity Check&lt;br&gt;
Find Problems&lt;br&gt;
Identify duplicates&lt;br&gt;
Clean duplicates&lt;br&gt;
re build conf cache&lt;br&gt;
update command&lt;br&gt;
remove backup file .prev if successfully solved&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;\c&lt;/span&gt;p -r /var/lib/rpm /var/lib/rpm.prev
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;yum-complete-transaction
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;package-cleanup --problems
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;package-cleanup --dupes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;package-cleanup --cleandupes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;yum clean all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rpm --rebuilddb
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;yum update
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# if all went OK run &amp;#39;rm -rf /var/lib/rpm.prev&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Other possible solution&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Linux – Rescue disk how to reset root password and unblock yourself if locked out</title><link>https://tutes.in/linux-rescue-disk-how-to-reset-root-password-and-unblock-yourself-if-locked-out/</link><pubDate>Mon, 23 Jul 2018 21:14:17 +0000</pubDate><guid>https://tutes.in/linux-rescue-disk-how-to-reset-root-password-and-unblock-yourself-if-locked-out/</guid><description>&lt;p&gt;Centos as test server&lt;/p&gt;
&lt;p&gt;Current situation – you are locked out, cant use WHM or SSH or anything else to login.&lt;br&gt;
You may or may not remember the password. In any case you can reproduce the following steps to unblock yourself.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use any other linux OS cd which can run live. I prefer FINNIX iso for such cases\&lt;/li&gt;
&lt;li&gt;Mount your main disk.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mount /dev/vda1 /mnt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="3"&gt;
&lt;li&gt;Reset password if needed to&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chroot /mnt passwd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="4"&gt;
&lt;li&gt;Enter new password for root and confirm\&lt;/li&gt;
&lt;li&gt;Reboot and done.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In case you have been locked out due to WHM cpanel:\&lt;/p&gt;</description></item><item><title>Linux Bash – How to change all filenames to uppercase leaving the file extension unchanged</title><link>https://tutes.in/linux-bash-how-to-change-all-filenames-to-uppercase-leaving-the-file-extension-unchanged/</link><pubDate>Wed, 28 Feb 2018 11:14:00 +0000</pubDate><guid>https://tutes.in/linux-bash-how-to-change-all-filenames-to-uppercase-leaving-the-file-extension-unchanged/</guid><description>&lt;p&gt;use this simple code in bash shell. The following code will change all xxx.jpg files to XXX.jpg in any particular working directory.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; i in *.jpg&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ext&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;##*.&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;basename &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;.&lt;/span&gt;&lt;span class="nv"&gt;$ext&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; tr &lt;span class="s1"&gt;&amp;#39;[a-z]&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[A-Z]&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;.&lt;span class="nv"&gt;$ext&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mv &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Compressing images directly on web server – Better Pagespeed tips</title><link>https://tutes.in/compressing-images-directly-on-web-server-better-pagespeed-tips/</link><pubDate>Fri, 02 Feb 2018 20:45:30 +0000</pubDate><guid>https://tutes.in/compressing-images-directly-on-web-server-better-pagespeed-tips/</guid><description>&lt;p&gt;for png, install on centos using command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;yum install optipng
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;for a single image&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;optipng -o5 filename.png
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;move to folder in which pngs are stored and use the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;for i in *.png; do optipng -o7 -strip all -quiet &amp;#34;$i&amp;#34;; done
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;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.&lt;br&gt;
-strip all will try to remove all meta data.&lt;br&gt;
you can use -preserve to preserve the modification date.&lt;br&gt;
also try -keep, if you want to save backup of each file&lt;/p&gt;</description></item></channel></rss>