tag:blogger.com,1999:blog-76842216010482099642024-03-14T03:14:26.674-07:00Gliding PhenomenaRavi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.comBlogger134125tag:blogger.com,1999:blog-7684221601048209964.post-41829165130706020202024-02-06T11:04:00.000-08:002024-02-06T11:04:39.863-08:00Python contextlib for Timing Python code<span style="font-family: helvetica;">
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module offers an elegant solution. In particular, we can use it to create a timer that functions as a context manager, simplifying the process of tracking performance without cluttering your code with timing logic. </span><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">Consider the following example of a timer implemented as a context manager: </span></div><div><span style="font-family: helvetica;"><br /></span></div><div>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">from</span> <span style="color: #0e84b5; font-weight: bold">contextlib</span> <span style="color: #008800; font-weight: bold">import</span> contextmanager
<span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">time</span>
<span style="color: #555555; font-weight: bold">@contextmanager</span>
<span style="color: #008800; font-weight: bold">def</span> <span style="color: #0066BB; font-weight: bold">timer</span>(label):
start <span style="color: #333333">=</span> time<span style="color: #333333">.</span>time()
<span style="color: #008800; font-weight: bold">try</span>:
<span style="color: #008800; font-weight: bold">yield</span>
<span style="color: #008800; font-weight: bold">finally</span>:
end <span style="color: #333333">=</span> time<span style="color: #333333">.</span>time()
<span style="color: #008800; font-weight: bold">print</span>(f<span style="background-color: #fff0f0">'{label}: {end - start} seconds'</span>)
<span style="color: #888888"># Usage:</span>
<span style="color: #008800; font-weight: bold">with</span> timer(<span style="background-color: #fff0f0">'Model training'</span>):
<span style="color: #888888"># Your code block here, e.g., train your model</span>
</pre></div>
</div><div><br /></div><div><span style="font-family: helvetica;">In this example, the `timer` function is decorated with `@contextmanager`, transforming it into a context manager. When you use this timer within a `with` statement, it automatically measures the time taken to execute the enclosed code block. </span></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">This feature proves exceptionally useful for profiling the performance of various parts of your codebase. For instance, in the context of machine learning, you can easily measure the duration of model training or inference without inserting cumbersome timing statements throughout your code. </span></div><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">By adopting Python's context manager and the `contextlib` module, you can streamline the process of performance profiling, making your code more readable and focused on its primary logic. Try incorporating this timer into your projects to gain valuable insights into the execution time of critical code segments.</span></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-5031949280977795812023-12-21T09:33:00.000-08:002023-12-21T09:54:47.932-08:00Linux HTOP settings/configuration <!--HTML generated using hilite.me--><div style="background: repeat rgb(255, 255, 255); border-color: gray; border-image: none; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">vi ~/.config/htop/htoprc
</pre></div><div><br /></div><span style="font-family: verdana;">
Update with the following:</span><div>
<!--HTML generated using hilite.me--><div style="background: repeat rgb(255, 255, 255); border-color: gray; border-image: none; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #888888;"># Beware! This file is rewritten by htop when settings are changed in the interface.</span>
<span style="color: #888888;"># The parser is also very primitive, and not human-friendly.</span>
<span style="color: #996633;">fields</span><span style="color: #333333;">=</span>0 48 17 18 38 39 40 2 46 47 49 1
<span style="color: #996633;">sort_key</span><span style="color: #333333;">=</span>46
<span style="color: #996633;">sort_direction</span><span style="color: #333333;">=</span>-1
<span style="color: #996633;">tree_sort_key</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">tree_sort_direction</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">hide_kernel_threads</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">hide_userland_threads</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">shadow_other_users</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">show_thread_names</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">show_program_path</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">highlight_base_name</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">highlight_megabytes</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">highlight_threads</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">highlight_changes</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">highlight_changes_delay_secs</span><span style="color: #333333;">=</span>5
<span style="color: #996633;">find_comm_in_cmdline</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">strip_exe_from_cmdline</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">show_merged_command</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">tree_view</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">tree_view_always_by_pid</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">header_margin</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">detailed_cpu_time</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">cpu_count_from_one</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">show_cpu_usage</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">show_cpu_frequency</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">show_cpu_temperature</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">degree_fahrenheit</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">update_process_names</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">account_guest_in_cpu_meter</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">color_scheme</span><span style="color: #333333;">=</span>0
<span style="color: #996633;">enable_mouse</span><span style="color: #333333;">=</span>1
<span style="color: #996633;">delay</span><span style="color: #333333;">=</span>15
<span style="color: #996633;">left_meters</span><span style="color: #333333;">=</span>LeftCPUs8 Memory Swap
<span style="color: #996633;">left_meter_modes</span><span style="color: #333333;">=</span>1 1 1
<span style="color: #996633;">right_meters</span><span style="color: #333333;">=</span>RightCPUs8 Tasks LoadAverage Uptime
<span style="color: #996633;">right_meter_modes</span><span style="color: #333333;">=</span>1 2 2 2
<span style="color: #996633;">hide_function_bar</span><span style="color: #333333;">=</span>0
</pre></div>
</div><span style="font-family: verdana;"><div><span style="font-family: verdana;"><br /></span></div>
Following will be the view:
</span><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi12aD-AM5mIKR62GwPA3fGwnj0m9SRNGrfw2_AHfmAe9_kchamhj4nVKRku7Zq1uFoP4Dipa_nynUc7iSMAFWSexKEWTS5l6jLwQ2Uoimd_5f3QLVOfXI8as6IduaYgkR5ZhkK23IkbYcAxAE-rj0pnEI38OgoJYTrX_vLfz5L-UzxHAOcYtMeLudGvHBN/s1302/htop_blog.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="274" data-original-width="1302" height="84" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi12aD-AM5mIKR62GwPA3fGwnj0m9SRNGrfw2_AHfmAe9_kchamhj4nVKRku7Zq1uFoP4Dipa_nynUc7iSMAFWSexKEWTS5l6jLwQ2Uoimd_5f3QLVOfXI8as6IduaYgkR5ZhkK23IkbYcAxAE-rj0pnEI38OgoJYTrX_vLfz5L-UzxHAOcYtMeLudGvHBN/w400-h84/htop_blog.png" width="400" /></a></div><br /><span style="font-family: verdana;"><br /></span></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-85117451208966324972023-11-10T12:05:00.003-08:002023-11-10T12:05:39.447-08:00Disk Utilities in Linux<p>Linux, renowned for its robustness, is a preferred choice among software professionals. Navigating the expansive world of disk management, Linux offers a spectrum of utilities. In this concise guide, we'll explore essential tools tailored for professionals, shedding light on three practical examples for each.</p>
<ol>
<li><p><strong>df (Disk Free):</strong></p>
<ul>
<li><p>Example 1: Display disk space usage for all mounted filesystems.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">df -h</span>
</code></pre>
</li>
<li><p>Example 2: Show the total, used, and available space for a specific directory.</p>
<pre><code class="lang-bash">df -h /path/<span class="hljs-built_in">to</span>/<span class="hljs-built_in">directory</span>
</code></pre>
</li>
<li><p>Example 3: Highlight human-readable disk space information in 1K blocks.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">df -kh</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>du (Disk Usage):</strong></p>
<ul>
<li><p>Example 1: Determine the size of a directory and its subdirectories.</p>
<pre><code class="lang-bash">du -h /path/<span class="hljs-built_in">to</span>/<span class="hljs-built_in">directory</span>
</code></pre>
</li>
<li><p>Example 2: Display the sizes of all files in a directory.</p>
<pre><code class="lang-bash">du -h --<span class="hljs-built_in">max</span>-<span class="hljs-built_in">depth</span>=<span class="hljs-number">1</span>
</code></pre>
</li>
<li><p>Example 3: Sort and list top disk space-consuming directories.</p>
<pre><code class="lang-bash">du -h --<span class="hljs-built_in">max</span>-depth=<span class="hljs-number">1</span> | <span class="hljs-built_in">sort</span> -rh
</code></pre>
</li>
</ul>
</li>
<li><p><strong>fdisk:</strong></p>
<ul>
<li><p>Example 1: List all available disk partitions.</p>
<pre><code class="lang-bash">fdisk <span class="hljs-_">-l</span>
</code></pre>
</li>
<li><p>Example 2: Create a new partition on a specific disk.</p>
<pre><code class="lang-bash">fdisk <span class="hljs-regexp">/dev/</span>sdX
</code></pre>
</li>
<li><p>Example 3: Delete a partition from a disk.</p>
<pre><code class="lang-bash">fdisk <span class="hljs-regexp">/dev/</span>sdX -d
</code></pre>
</li>
</ul>
</li>
<li><p><strong>parted:</strong></p>
<ul>
<li><p>Example 1: Display partition information for a specific disk.</p>
<pre><code class="lang-bash">parted <span class="hljs-regexp">/dev/</span>sdX <span class="hljs-keyword">print</span>
</code></pre>
</li>
<li><p>Example 2: Resize a partition to a specific size.</p>
<pre><code class="lang-bash">parted <span class="hljs-regexp">/dev/</span>sdX resizepart N <span class="hljs-number">50</span>G
</code></pre>
</li>
<li><p>Example 3: Create a new partition on a disk.</p>
<pre><code class="lang-bash">parted /dev/sdX mkpart primary ext<span class="hljs-number">4</span> <span class="hljs-number">0</span><span class="hljs-meta">%</span> <span class="hljs-number">100</span><span class="hljs-meta">%</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>gparted:</strong></p>
<ul>
<li><p>Example 1: Launch the graphical partition editor.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">gparted</span>
</code></pre>
</li>
<li><p>Example 2: Resize a partition using the GUI interface.</p>
<pre><code class="lang-bash">gparted <span class="hljs-regexp">/dev/</span>sdX
</code></pre>
</li>
<li><p>Example 3: Format a partition with a specific file system.</p>
<pre><code class="lang-bash">gparted /dev/sdX - <span class="hljs-keyword">create</span> <span class="hljs-keyword">new</span> ext4 <span class="hljs-keyword">partition</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>badblocks:</strong></p>
<ul>
<li><p>Example 1: Check for bad blocks on a specific disk.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">badblocks </span>-s /dev/sdX
</code></pre>
</li>
<li><p>Example 2: Print a list of bad blocks found during testing.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">badblocks </span>-l /dev/sdX
</code></pre>
</li>
<li><p>Example 3: Non-destructive read-write test for bad blocks.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">badblocks </span>-n /dev/sdX
</code></pre>
</li>
</ul>
</li>
<li><p><strong>smartctl:</strong></p>
<ul>
<li><p>Example 1: Display SMART information for a specific disk.</p>
<pre><code class="lang-bash">smartctl -<span class="hljs-selector-tag">a</span> /dev/sdX
</code></pre>
</li>
<li><p>Example 2: Run a short self-test on a disk.</p>
<pre><code class="lang-bash">smartctl -t <span class="hljs-keyword">short</span> <span class="hljs-regexp">/dev/</span>sdX
</code></pre>
</li>
<li><p>Example 3: View the test result and overall health status.</p>
<pre><code class="lang-bash"><span class="hljs-symbol">smartctl</span> -l <span class="hljs-keyword">selftest </span>/dev/sdX
</code></pre>
</li>
</ul>
</li>
<li><p><strong>rsync:</strong></p>
<ul>
<li><p>Example 1: Copy files and directories to a remote server.</p>
<pre><code class="lang-bash">rsync -av /local/path/ user<span class="hljs-variable">@remote</span><span class="hljs-symbol">:/remote/path/</span>
</code></pre>
</li>
<li><p>Example 2: Synchronize two directories, updating only changed files.</p>
<pre><code class="lang-bash">rsync -av --update <span class="hljs-regexp">/source/</span>directory<span class="hljs-regexp">/ /</span>destination<span class="hljs-regexp">/directory/</span>
</code></pre>
</li>
<li><p>Example 3: Backup a directory and exclude specific files.</p>
<pre><code class="lang-bash">rsync -av --<span class="hljs-keyword">exclude</span>=<span class="hljs-string">'*.log'</span> <span class="hljs-regexp">/source/</span>directory<span class="hljs-regexp">/ /</span>backup<span class="hljs-regexp">/directory/</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>lvm (Logical Volume Manager):</strong></p>
<ul>
<li><p>Example 1: Display information about logical volumes.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">lvs</span>
</code></pre>
</li>
<li><p>Example 2: Create a new logical volume.</p>
<pre><code class="lang-bash">lvcreate -L <span class="hljs-number">10</span>G -<span class="hljs-built_in">n</span> myvolume myvg
</code></pre>
</li>
<li><p>Example 3: Extend the size of a logical volume.</p>
<pre><code class="lang-bash">lvextend -L +<span class="hljs-number">5</span>G <span class="hljs-regexp">/dev/my</span>vg<span class="hljs-regexp">/myvolume</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>fstrim:</strong></p>
<ul>
<li><p>Example 1: Trim all mounted filesystems.</p>
<pre><code class="lang-bash">fstrim <span class="hljs-_">-a</span>
</code></pre>
</li>
<li><p>Example 2: Trim a specific mount point.</p>
<pre><code class="lang-bash">fstrim <span class="hljs-regexp">/path/</span>to<span class="hljs-regexp">/mount/</span>point
</code></pre>
</li>
<li><p>Example 3: Dry-run trim to check for discardable blocks.</p>
<pre><code class="lang-bash">fstrim -v --dry-<span class="hljs-built_in">run</span> /path/to/mount/<span class="hljs-built_in">point</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>duf:</strong></p>
<ul>
<li><p>Example 1: Display disk usage with a colorful and user-friendly interface.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">duf -c</span>
</code></pre>
</li>
<li><p>Example 2: Show disk usage for a specific directory.</p>
<pre><code class="lang-bash">duf /path/<span class="hljs-built_in">to</span>/<span class="hljs-built_in">directory</span>
</code></pre>
</li>
<li><p>Example 3: Display disk usage with detailed information.</p>
<pre><code class="lang-bash">duf <span class="hljs-_">-l</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>ncdu:</strong></p>
<ul>
<li><p>Example 1: Launch the NCurses Disk Usage tool for interactive disk exploration.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">ncdu</span>
</code></pre>
</li>
<li><p>Example 2: Scan and analyze disk usage for a specific directory.</p>
<pre><code class="lang-bash">ncdu /path/<span class="hljs-built_in">to</span>/<span class="hljs-built_in">directory</span>
</code></pre>
</li>
<li><p>Example 3: Display disk usage in a human-readable format.</p>
<pre><code class="lang-bash"><span class="hljs-attribute">ncdu -x</span>
</code></pre>
</li>
</ul>
</li>
<li><p><strong>fstab (File System Table):</strong></p>
<ul>
<li><p>Example 1: Edit the fstab file for automatic mounting of partitions at boot.</p>
<pre><code class="lang-bash">nano <span class="hljs-regexp">/etc/</span>fstab
</code></pre>
</li>
<li><p>Example 2: View the current entries in the fstab file.</p>
<pre><code class="lang-bash">cat <span class="hljs-regexp">/etc/</span>fstab
</code></pre>
</li>
<li><p>Example 3: Check for errors in the fstab file syntax.</p>
<pre><code class="lang-bash">mount -<span class="hljs-keyword">a</span> <span class="hljs-comment">--test</span></code></pre></li></ul></li></ol>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-29162402720641756422023-07-17T19:59:00.004-07:002023-07-17T19:59:42.043-07:00Get PIP package versions and licenses within a virtual environment <!--HTML generated using hilite.me--><div style="background: repeat rgb(255, 255, 255); border-color: gray; border-image: none; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">pip install pip-licenses
pip-licenses --format<span style="color: #333333;">=</span>csv \</pre><pre style="line-height: 125%; margin: 0px;">--with-urls \</pre><pre style="line-height: 125%; margin: 0px;">--with-authors \</pre><pre style="line-height: 125%; margin: 0px;">--with-maintainers \</pre><pre style="line-height: 125%; margin: 0px;">--with-description > packages.csv
<br /></pre><pre style="line-height: 125%; margin: 0px;"># The following will produce main packages only without nested dependencies.
pip install pipdeptree
pipdeptree -f | grep -P <span style="background-color: #fff0f0;">'^\w+'</span> | cut -d <span style="color: #333333;">=</span> -f 1 > main-packages.txt
</pre></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-66876506938273687792023-02-07T14:23:00.002-08:002023-02-07T14:23:35.141-08:00Ubuntu Error constructing proxy for org.gnome.Terminal<p>If the terminal fails to start when using Ubuntu desktop via VNC Server. If you see the below error in <span style="font-family: courier;">~/.vnc/<some-ip>.log.</span></p>
<p>Ubuntu org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName</p>
<!--HTML generated using hilite.me--><div style="background-color: white; background: #ffffff; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">Error constructing proxy <span style="color: #0000aa;">for </span>org.gnome.Terminal: /org/gnome/Terminal/Factory0: </pre><pre style="line-height: 125%; margin: 0px;">Error calling StartServiceByName <span style="color: #0000aa;">for </span>org.gnome.Terminal: </pre><pre style="line-height: 125%; margin: 0px;">GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: </pre><pre style="line-height: 125%; margin: 0px;">Process /usr/lib/gnome-terminal/gnome-terminal-server exited with status 8
</pre></div><div><br /></div><span style="font-family: verdana;">
Instead of using gnome-terminal use <span>urxvt</span></span><div><span style="font-family: helvetica;"><br /></span></div>
<!--HTML generated using hilite.me--><div style="background-color: #f8f8f8; background: #f8f8f8; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">sudo apt-get update
sudo apt-get install rxvt-unicode
</pre></div><div><br /></div><span style="font-family: verdana;">
Launch urxvt by adding it to the `~/.vnc/xstartup`
vim ~/.vnc/xstartup
</span><!--HTML generated using hilite.me--><div style="background-color: #f8f8f8; background: #f8f8f8; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;">#!/bin/sh</span>
<span style="color: #aa22ff;">export </span><span style="color: darkgoldenrod;">XKL_XMODMAP_DISABLE</span><span style="color: #666666;">=</span>1
<span style="color: #aa22ff;">unset </span>SESSION_MANAGER
<span style="color: #aa22ff;">unset </span>DBUS_SESSION_BUS_ADDRESS
<span style="color: #666666;">[</span> -x /etc/vnc/xstartup <span style="color: #666666;">]</span> <span style="color: #666666;">&&</span> <span style="color: #aa22ff;">exec</span> /etc/vnc/xstartup
<span style="color: #666666;">[</span> -r <span style="color: darkgoldenrod;">$HOME</span>/.Xresources <span style="color: #666666;">]</span> <span style="color: #666666;">&&</span> xrdb <span style="color: darkgoldenrod;">$HOME</span>/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
urxvt &
</pre></div><div><br /></div><span style="font-family: verdana;">
Restart VNCSERVER session
</span><!--HTML generated using hilite.me--><div style="background-color: #f8f8f8; background: #f8f8f8; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">vncserver -kill :1
vncserver :1
</pre></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-79202878858951635612022-11-07T10:11:00.002-08:002023-07-13T08:38:42.388-07:00Install iGPU / Intel integrated GPU drivers for OpenVINO Inference<p>To enable Intel integrated GPU / iGPU for running deep learning inference with OpenVINO, we need to install the<a href="https://github.com/intel/compute-runtime/releases" target="_blank"> Intel Graphics Compute Runtime</a> for oneAPI Level Zero and OpenCL™ Driver on Linux.</p><p>More info: <a href="https://dgpu-docs.intel.com/driver/client/overview.html">https://dgpu-docs.intel.com/driver/client/overview.html</a></p><p>The script required to run is: <a href="https://github.com/openvinotoolkit/openvino/blob/master/scripts/install_dependencies/install_NEO_OCL_driver.sh" target="_blank">openvino/scripts/install_dependencies/install_NEO_OCL_driver.sh</a></p><p><br /></p>
<!--HTML generated using hilite.me--><div style="background: repeat rgb(255, 255, 255); border-color: gray; border-image: none; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">wget https://raw.githubusercontent.com/openvinotoolkit/openvino/master/scripts/install_dependencies/install_NEO_OCL_driver.sh
chmod +x ./install_NEO_OCL_driver.sh
sudo ./install_NEO_OCL_driver.sh
sudo usermod -aG video <span style="color: #996633;">$USER</span>
sudo usermod -aG render <span style="color: #996633;">$USER</span>
</pre></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-61709850353121819672022-02-03T11:28:00.005-08:002022-11-07T09:51:53.902-08:00Build OpenVINO from source - Linux<p><span style="font-family: verdana;">Official Instructions - <a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingForLinux#build-steps" target="_blank">Click Here</a></span></p><p><span style="font-family: verdana;">Build instructions for OpenVINO from Source with the Python API Wrapper</span></p><p><span style="font-family: verdana;">OpenVINO 2022.1.0 and later require GLIBC 2.27+, check with `ldd --version`</span></p><p><span style="font-family: verdana;">Here instructions are for Python 3.7, you can change it to 3.6 as well.</span></p><div><span style="background-color: white; color: #262626; font-family: verdana; font-size: 16px; font-variant-ligatures: normal; orphans: 2; text-decoration-thickness: initial; widows: 2;"><p style="box-sizing: border-box; font-variant-ligatures: normal; line-height: 1.25; margin: 0px 0px 11px; text-decoration-thickness: initial;"><b><a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingForLinux#software-requirements" target="_blank">Software Requirements:</a></b></p></span><div style="text-align: left;"><span style="font-family: verdana; font-size: x-small;">- CMake 3.13 or higher<br />- GCC 7.5 or higher to build OpenVINO Runtime<br />- Python 3.6 or higher for OpenVINO Runtime Python API<br />- (Optional) Install Intel® Graphics Compute Runtime for OpenCL™ <a href="https://github.com/intel/compute-runtime/releases/tag/19.41.14441" target="_blank">Driver package 19.41.14441</a> to enable inference on Intel integrated GPUs.</span></div></div><div style="text-align: left;"><br /></div>
<!--HTML generated using hilite.me--><div style="background: #ffffff; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="background-color: white; line-height: 125%; margin: 0px; text-align: left;"><span style="color: #996633;"><br /></span></pre><pre style="background-color: white; line-height: 125%; margin: 0px; text-align: left;"><span style="color: #996633;">$ </span>sudo apt-get install python3.7-dev
<span style="color: #996633;">$ </span>pip install cython numpy
<span style="color: #996633;">$ </span><span style="color: #007020;">cd</span> ~ <span style="color: #888888;">#openvino will be installed in ~/openvino</span>
<span style="color: #996633;">$ </span>git clone https://github.com/openvinotoolkit/openvino.git
<span style="color: #996633;">$ </span><span style="color: #007020;">cd </span>openvino
<span style="color: #996633;">$ </span>git submodule update --init --recursive
<span style="color: #996633;">$ </span>chmod +x install_dependencies.sh
<span style="color: #996633;">$ </span>./install_dependencies.sh
<span style="color: #996633;">$ </span>mkdir build <span style="color: #333333;">&&</span> <span style="color: #007020;">cd </span>build
<span style="color: #996633;">$ </span>cmake -DCMAKE_BUILD_TYPE<span style="color: #333333;">=</span>Release <span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\</span></pre><pre style="line-height: 125%; margin: 0px; text-align: left;">-DENABLE_INTEL_GNA=OFF -DENABLE_INTEL_MYRIAD_COMMON=OFF \</pre><pre style="line-height: 125%; margin: 0px; text-align: left;">-DENABLE_PYTHON<span style="background-color: white; color: #333333;">=</span><span style="background-color: white;">ON </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\</span><span style="background-color: white;">
-DPYTHON_EXECUTABLE</span><span style="background-color: white; color: #333333;">=</span><span style="background-color: #fff0f0;">`</span><span style="background-color: white;">which python3.7</span><span style="background-color: #fff0f0;">`</span><span style="background-color: white;"> </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\</span><span style="background-color: white;">
-DPYTHON_LIBRARY</span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;">/usr/lib/x86_64-linux-gnu/libpython3.7m.so </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\</span><span style="background-color: white;">
-DPYTHON_INCLUDE_DIR</span><span style="background-color: white; color: #333333;">=</span><span style="background-color: white;">/usr/include/python3.7 ..
</span><span style="background-color: white; color: #996633;"><br /></span></pre><pre style="background-color: white; line-height: 125%; margin: 0px;"><span style="color: #996633;">$ </span>make --jobs<span style="color: #333333;">=</span><span style="color: #008800; font-weight: bold;">$(</span>nproc --all<span style="color: #008800; font-weight: bold;">)</span>
<span style="color: #996633;">$ </span><span style="color: #007020;">export </span><span style="color: #996633;">PYTHONPATH</span><span style="color: #333333;">=</span><span style="color: #996633;">$PYTHONPATH</span>:~/openvino/bin/intel64/Release/lib/python_api/python3.7/
<span style="color: #996633;">$ </span><span style="color: #007020;">export </span><span style="color: #996633;">LD_LIBRARY_PATH</span><span style="color: #333333;">=</span><span style="color: #996633;">$LD_LIBRARY_PATH</span>:~/openvino/bin/intel64/Release/lib/
<br /></pre><pre style="background-color: white; line-height: 125%; margin: 0px;"># OR Install the wheel with PIP</pre><pre style="background-color: white; line-height: 125%; margin: 0px;">$ pip install ~/openvino/build/wheel/*.whl<br /><span style="color: #996633;"><br /></span></pre><pre style="background-color: white; line-height: 125%; margin: 0px;"><span style="color: #996633;"><pre style="caret-color: rgb(0, 0, 0); color: black; line-height: 16.25px; margin-bottom: 0px; margin-top: 0px;"><span style="color: #888888;"># TEST BUILD</span></pre></span></pre><pre style="background-color: white; line-height: 125%; margin: 0px;"><span style="color: #996633;">$ </span>python3.7
>>> from openvino.inference_engine import IENetwork, IECore
<span style="color: #888888;"># Test Benchmark app</span>
<span style="color: #996633;">$ </span><span style="color: #007020;">alias </span><span style="color: #996633;">benchmark_app</span><span style="color: #333333;">=</span>~/openvino/bin/intel64/Release/benchmark_app
<span style="color: #996633;">$ </span>benchmark_app -h
</pre><pre style="background-color: white; line-height: 125%; margin: 0px;"><br /></pre></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-77432998714946017352022-01-24T14:23:00.007-08:002022-02-03T11:31:32.106-08:00Install Python3.6 or Python3.7 in Ubuntu 20.04; ImportError: libpython3.6m.so.1.0: cannot open shared object file<div style="text-align: left;"><span style="font-family: arial;">Ubuntu 20.04 has Python 3.8 by default. <br />See below to install Python 3.6 or 3.7</span></div><div style="text-align: left;"><br /></div>
<!--HTML generated using hilite.me--><div style="background-color: white; background: #ffffff; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">sudo -E add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
sudo apt-get install -y libpython3.6-dev
</pre></div>
<div><span style="font-family: arial;"><br /></span></div><div><span style="font-family: arial;">Install like above if you get below error</span></div><div><br /></div><div><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory</p></div><div><br /></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-41952845527996942792022-01-18T16:09:00.001-08:002022-01-18T16:09:10.461-08:00Debugging Python with pudb<p><span style="font-family: verdana;">1. Install pudb pip package..</span></p><p> <span style="background-color: #272822; color: #f8f8f2; font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 0.9rem; orphans: 2; widows: 2;">$ pip install pudb</span></p><div style="text-align: left;"><span style="font-family: verdana;">2. Add the following statement in python code.</span></div><pre style="background-color: #272822; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; color: #f8f8f2; font-size: 0.9rem; font-variant-ligatures: normal; line-height: 1.618; orphans: 2; overflow-wrap: normal; overflow-x: auto; padding: 1rem; tab-size: 4; text-decoration-thickness: initial; widows: 2; word-break: normal;" tabindex="0"><code class="language-python" data-lang="python" style="border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 0.9rem; margin: 0px; padding: 0.2em 0px;"><span style="color: #f92672;">import</span> pudb; pudb<span style="color: #f92672;">.</span>set_trace()</code></pre>
<div style="text-align: left;"><span style="font-family: verdana;">3. Or, Launch the debugger like below</span></div>
<div><pre style="background-color: #272822; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; color: #f8f8f2; font-size: 0.9rem; font-variant-ligatures: normal; line-height: 1.618; orphans: 2; overflow-wrap: normal; overflow-x: auto; padding: 1rem; tab-size: 4; text-decoration-thickness: initial; widows: 2; word-break: normal;" tabindex="0"><code class="language-bash" data-lang="bash" style="border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 0.9rem; margin: 0px; padding: 0.2em 0px;">$ python -m pudb my_script.py</code></pre></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-28282799633050958782021-11-01T22:30:00.003-07:002021-11-09T11:49:50.015-08:00TMUX Scrolling with Mouse<h4 style="text-align: left;"><span style="font-family: helvetica;">
TMUX Scrolling with Mouse
</span></h4><div><br /></div><div><span style="font-family: helvetica;"><br /></span></div><!--HTML generated using hilite.me--><div style="background-color: #f8f8f8; background: #f8f8f8; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #aa22ff;"># Add these in ~/.tmux.conf</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #aa22ff;">set</span> -g mouse on <span style="color: #008800; font-style: italic;">#For tmux version 2.1 and up </span>
<span style="color: #aa22ff;">set</span> -g @scroll-down-exit-copy-mode <span style="color: #bb4444;">"off"</span>
<span style="color: #aa22ff;">set</span> -g terminal-overrides <span style="color: #bb4444;">'xterm*:smcup@:rmcup@'</span> <span style="color: #008800; font-style: italic;"># Sane scrolling</span>
</pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># RELOAD the conf file: </span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># tmux source-file ~/.tmux.conf</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># If you get Error: protocol version mismatch (client 8, server 7)</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># sudo killall -9 tmux</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># If conf error, make sure you have tmux version >2.1</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># tmux -V</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;"># Update tmux. Ex: sudo yum install tmux</span></pre></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-67233495157687584152021-10-08T10:32:00.001-07:002021-10-08T10:32:23.579-07:00Install ClamAV on Amazon Linux 2 <h4 style="text-align: left;"><span style="font-family: arial;">Install ClamAV Scan on Amazon Linux 2</span></h4><div><!--HTML generated using hilite.me--><div style="background-color: white; background: #ffffff; border-color: gray; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">sudo amazon-linux-extras install epel
sudo yum install clamav clamd -y
sudo sed -i -e "s/Example/#Example/" /etc/freshclam.conf
sudo sed -i -e "s:#DatabaseDirectory /var/lib/clamav:DatabaseDirectory /var/lib/clamav:" /etc/freshclam.conf
sudo sed -i -e "s:#UpdateLogFile /var/log/freshclam.log:UpdateLogFile /var/log/freshclam.log:" /etc/freshclam.conf
sudo sed -i -e "s/#DatabaseOwner clamupdate/DatabaseOwner clamupdate/" /etc/freshclam.conf
sudo vi /etc/clamd.d/scan.conf
# Change MaxThreads if desired.
sudo freshclam
clamscan -r / 2>&1 | tee openvinoami_clamav_scan.txt
# If problems arise, restart
sudo pkill freshclam
sudo freshclam
clamscan -r / 2>&1 | tee openvinoami_clamav_scan.txt
</pre></div>
</div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-41268385703984919742021-03-01T23:14:00.004-08:002021-03-01T23:14:39.340-08:00Dynamic Port Forwarding using Firefox Browser<p><br /></p><p><span style="background-color: #f8f8f8; color: #333333; font-family: "Overpass Mono", Consolas, Monaco, "Andale Mono", monospace; font-size: 15px; font-variant-ligatures: normal; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;">[bob@workstation ~]$ ssh -D 1080 bastion.securecorp.io
[bob@bastion ~]$</span></p><p><span style="background-color: #f8f8f8; color: #333333; font-family: "Overpass Mono", Consolas, Monaco, "Andale Mono", monospace; font-size: 15px; font-variant-ligatures: normal; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;"><span style="background-color: white; color: #646668; font-family: RedHatText, Overpass, Overpass, Helvetica, Arial, sans-serif; font-size: 16.2px; font-style: italic; font-variant-ligatures: normal; text-align: center; text-decoration-thickness: initial; white-space: normal;"><b>SOCKS5 configuration in Firefox:</b></span></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://www.redhat.com/sysadmin/sites/default/files/styles/embed_medium/public/2021-01/firefox-socks-proxy-configuration_0.png?itok=FoNnwhzJ" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="744" height="640" src="https://www.redhat.com/sysadmin/sites/default/files/styles/embed_medium/public/2021-01/firefox-socks-proxy-configuration_0.png?itok=FoNnwhzJ" width="594" /></a></div><br /><p>Source: <a href="https://www.redhat.com/sysadmin/ssh-dynamic-port-forwarding">https://www.redhat.com/sysadmin/ssh-dynamic-port-forwarding</a></p>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-397804337806838382021-02-18T10:53:00.008-08:002021-02-18T14:00:20.027-08:00Host a static website in Ubuntu using Nginx<h4 style="text-align: left;"> <span style="background-color: white; color: #292929; font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif; orphans: 2; widows: 2;"><span style="font-size: medium;">Install Ngnix Web Server</span></span></h4><p class="hy hz fo ia b ib jt id ie if ju ih ii ij jv il im in jw ip iq ir jx it iu iv dh gk" data-selectable-paragraph="" id="6b6c" style="background-color: white; box-sizing: inherit; color: #292929; font-family: charter, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; font-variant-ligatures: normal; letter-spacing: -0.003em; line-height: 32px; margin: 0.86em 0px -0.46em; orphans: 2; text-decoration-thickness: initial; widows: 2; word-break: break-word;"><span style="background-color: #f2f2f2; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 16px; letter-spacing: -0.022em; white-space: pre-wrap;">sudo apt-get install nginx</span></p><h4 style="text-align: left;"><span style="font-size: large; letter-spacing: -0.003em;">Controlling Nginx</span></h4><div><span style="background-color: #f2f2f2; color: #292929; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;">sudo systemctl start nginx</span></div><div><span style="background-color: #f2f2f2; color: #292929; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo systemctl stop nginx</span></span></div><div><span style="background-color: #f2f2f2; color: #292929; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo systemctl restart nginx</span></span></span></div><div><span style="background-color: #f2f2f2; color: #292929; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo systemctl reload nginx</span></span></span></span></div><div><span style="background-color: white; color: #292929; font-size: large; orphans: 2; widows: 2;"><br /></span></div><h4 style="text-align: left;"><span style="background-color: white; color: #292929; font-size: large; orphans: 2; widows: 2;">Firewall</span></h4><div><span style="background-color: #f2f2f2; color: #292929; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-variant-ligatures: normal; letter-spacing: -0.352px; orphans: 2; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><div style="font-size: 16px;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo ufw allow 'Nginx Full'</span></div><div style="font-size: 16px;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo ufw reload</span></div><h4 style="text-align: left;"><span face="sohne, "Helvetica Neue", Helvetica, Arial, sans-serif" style="background-color: white; font-size: medium; letter-spacing: normal; white-space: normal;">Nginx Configuration Directory</span></h4><div style="font-size: 16px;"><span style="letter-spacing: -0.022em;">cd /etc/nginx</span></div><div style="font-size: 16px;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo cp nginx.conf nginx.conf.bak</span></div><div style="font-size: 16px;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><br /></span></div><div style="font-size: 16px;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo nano nginx.conf</span></div><div style="font-size: 16px;"><br class="Apple-interchange-newline" style="caret-color: rgb(0, 0, 0); color: black; letter-spacing: normal; white-space: normal;" /></div><div style="text-align: left;"><span style="background-color: white; font-family: charter, Georgia, Cambria, "Times New Roman", Times, serif; font-variant-ligatures: normal; letter-spacing: -0.063px; text-decoration-thickness: initial; white-space: normal;">Verify this line is uncommented, </span><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;">include /etc/nginx/sites-enabled/*;</code></div><div style="font-size: 16px;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><br /></code></div><div style="font-size: 16px;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><span style="font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial; white-space: pre-wrap;">cd sites-available</span></code></div><div style="font-size: 16px;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><span style="font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial; white-space: pre-wrap;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">sudo nano default</span></span></code></div><div style="font-size: 16px;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><span style="font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial; white-space: pre-wrap;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><br /></span></span></code></div><div style="font-size: 16px;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-size: 15.75px; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><span style="font-size: 16px; font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial; white-space: pre-wrap;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;">server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /home/ravi/www/html;
index index.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}</span></span></code></div><h4 style="text-align: left;"><code class="hs kp kq kr kh b" style="box-sizing: inherit; font-family: Menlo, Monaco, "Courier New", Courier, monospace; font-variant-ligatures: normal; letter-spacing: -0.063px; padding: 2px 4px; text-decoration-thickness: initial; white-space: normal;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial; white-space: pre-wrap;"><span style="font-variant-ligatures: normal; letter-spacing: -0.352px; text-decoration-thickness: initial;"><span face="sohne, "Helvetica Neue", Helvetica, Arial, sans-serif" style="background-color: white; font-size: medium; letter-spacing: normal; white-space: normal;">Restart Server</span></span></span></code></h4><div style="font-size: 16px;"><span style="letter-spacing: -0.352px;">sudo systemctl restart nginx</span></div><div style="font-size: 16px;"><span style="letter-spacing: -0.352px;"><br /></span></div><div style="font-size: 16px;"><span style="letter-spacing: -0.352px;"><br /></span></div><div style="font-size: 16px;"><span style="letter-spacing: -0.352px;">Source: </span><a href="https://medium.com/@jasonrigden/how-to-host-a-static-website-with-nginx-8b2dd0c5b301">https://medium.com/@jasonrigden/how-to-host-a-static-website-with-nginx-8b2dd0c5b301</a></div></span></span></span></span></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-48940833956316042942020-09-04T09:22:00.005-07:002020-09-04T09:22:25.547-07:00Manage logging in python. Suppress and Set Log Level in PythonExample to supress Tensorflow logging
<pre><code>
import logging
logging.getLogger('tensorflow').setLevel(logging.ERROR)
</code>
</pre>
To get all the list of available loggers:
<pre>
<code>
import logging
for key in logging.Logger.manager.loggerDict:
print(key)
</code>
</pre>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-64844841425447703882020-08-06T11:08:00.008-07:002020-08-06T11:08:49.799-07:00Check if MKL is enabled in Tensorflow installationCheck if MKL is enabled in Tensorflow
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; font-variant-ligatures: normal; orphans: 2; widows: 2;"><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><br /></p><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><br /></p><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">python -c "import tensorflow; print(tensorflow.pywrap_tensorflow.IsMklEnabled())"</p><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><br /></p><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><br /></p></div><div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; font-variant-ligatures: normal; orphans: 2; widows: 2;"><br /></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-20118115212521925182020-07-22T16:31:00.008-07:002020-09-21T21:54:27.521-07:00Start Jupyter or Jupyter-lab on startup of ec-2 instance.<div><br /></div><div>Start Jupyter or Jupyter-lab on startup of ec-2 instance.</div><div><br /></div>
Edit the crontab by running
<br /><div><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="font-family: monospace;"><span style="color: white;">sudo crontab -e</span></span></p><div><span style="font-family: helvetica;"><br /></span></div><div><span style="font-family: helvetica;">and add the following</span></div><div><span style="font-family: helvetica;"><br /></span></div><div><code></code><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">@reboot su ec2-user -c "/home/ec2-user/.start_jupyter.sh"
</p><div><br /></div>
Create a file <div><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="color: white;">vi /home/ec2-user/.start_jupyter.sh</span></p><div><p style="text-align: left;">and add the following</p><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">cd</span> /home/ec2-user</p><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">source</span> /home/ec2-user/.bashrc</p><p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">source</span> /opt/intel/openvino/bin/setupvars.sh</p><p style="-webkit-text-stroke-color: rgb(170, 26, 172); -webkit-text-stroke-width: initial; background-color: #111213; color: #aa1aac; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">/home/ec2-user/.local/bin/jupyter notebook </span>--no-browser<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--NotebookApp.allow_password_change=False<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--NotebookApp.token=<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span>$INSTANCE_ID<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--ip<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--port<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">8888</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">></span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> /tmp/jupyter.out </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">2</span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">>&1</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> &</span></p><div><br /></div><div>We can leave this option to true, but changing password is not working...</div><span style="-webkit-text-stroke-color: rgb(170, 26, 172); -webkit-text-stroke-width: initial; background-color: #111213; color: #aa1aac; font-family: Menlo; font-size: 14px;">--NotebookApp.allow_password_change=False</span> because change password is not working. It is a bug in Jupyter. See <a href="https://github.com/jupyter/notebook/issues/3842">https://github.com/jupyter/notebook/issues/3842</a></div><div><br /></div><div>Give executable file permissions.</div>
<div><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">chmod 755 .start_jupyter.sh </p></div><h3 style="text-align: left;">
Debugging
</h3></div><div><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">sudo cat /var/log/cron</p></div>
Also,
<div><p style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;">cat /tmp/jupyter.out </p></div></div><div><br /></div><h4 style="text-align: left;"><b style="background-color: #fff2cc;"><span style="font-family: helvetica; font-size: medium;">
If you want to set password randomly on EC2-Instance:</span></b></h4><div><p style="-webkit-text-stroke-color: rgb(159, 54, 55); -webkit-text-stroke-width: initial; background-color: #111213; color: #9f3637; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #1396a2; color: #1396a2;">TOKEN</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">=</span><span style="-webkit-text-stroke: 0.112px #aa1aac; color: #aa1aac;">`curl -X PUT </span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span>http://169.254.169.254/latest/api/token<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span><span style="-webkit-text-stroke: 0.112px #aa1aac; color: #aa1aac;"> -H </span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span>X-aws-ec2-metadata-token-ttl-seconds: 21600<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span><span style="-webkit-text-stroke: 0.112px #aa1aac; color: #aa1aac;">`</span></p>
<p style="-webkit-text-stroke-color: rgb(170, 26, 172); -webkit-text-stroke-width: initial; background-color: #111213; color: #aa1aac; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #1396a2; color: #1396a2;">INSTANCE_ID</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">=</span>`curl -H <span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">X-aws-ec2-metadata-token: </span>$TOKEN<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span> http://<span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">169</span>.<span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">254</span>.<span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">169</span>.<span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">254</span>/latest/meta-data/instance-id`</p>
<p style="-webkit-text-stroke-color: rgb(170, 26, 172); -webkit-text-stroke-width: initial; background-color: #111213; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px; min-height: 16px;"><br /></p>
<p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">cd</span> /home/ec2-user</p>
<p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">source</span> /home/ec2-user/.bashrc</p>
<p style="-webkit-text-stroke-color: rgb(185, 188, 186); -webkit-text-stroke-width: initial; background-color: #111213; color: #b9bcba; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">source</span> /opt/intel/openvino/bin/setupvars.sh</p>
<p style="-webkit-text-stroke-color: rgb(170, 26, 172); -webkit-text-stroke-width: initial; background-color: #111213; color: #aa1aac; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; margin: 0px;"><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">/home/ec2-user/.local/bin/jupyter notebook </span>--no-browser<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--NotebookApp.allow_password_change=False<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--NotebookApp.token=<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span>$INSTANCE_ID<span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">"</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--ip<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;">.</span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">0</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span>--port<span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">8888</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> </span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">></span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> /tmp/jupyter.out </span><span style="-webkit-text-stroke: 0.112px #9f3637; color: #9f3637;">2</span><span style="-webkit-text-stroke: 0.112px #9e4c04; color: #9e4c04;">>&1</span><span style="-webkit-text-stroke: 0.112px #b9bcba; color: #b9bcba;"> &</span></p></div><div><br /></div>
See:
<div><a href="https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html#security">https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html#security</a></div><div><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html</a></div></div>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-282124483309747092020-07-16T16:20:00.000-07:002020-07-16T16:20:18.104-07:00Set Python3 as default in CentOS or Amazon Linux2 <pre class="default prettyprint prettyprinted" style="border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-ligatures: normal; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; margin-top: 0px; max-height: 600px; orphans: 2; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; widows: 2; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><br /></span></code></pre><pre class="default prettyprint prettyprinted" style="border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-ligatures: normal; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; margin-top: 0px; max-height: 600px; orphans: 2; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; widows: 2; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"># Install Python3
sudo yum install -y python3</span></pre><pre class="default prettyprint prettyprinted" style="border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-ligatures: normal; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; margin-top: 0px; max-height: 600px; orphans: 2; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; widows: 2; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: consolas, menlo, monaco, "lucida console", "liberation mono", "dejavu sans mono", "bitstream vera sans mono", "courier new", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"># Start by registering python2 as an alternative</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
sudo alternatives </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">--</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">install </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">usr</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">python python </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">usr</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">python2 </span><span class="lit" style="border: 0px; box-sizing: inherit; color: var(--red-800); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">50</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"># Register python3.5 as an alternative</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
sudo alternatives </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">--</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">install </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">usr</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">python python </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">usr</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">python3</span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="lit" style="border: 0px; box-sizing: inherit; color: var(--red-800); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">5</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="lit" style="border: 0px; box-sizing: inherit; color: var(--red-800); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">60</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="com" style="border: 0px; box-sizing: inherit; color: var(--black-400); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"># Select which Python version to use</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
sudo alternatives </span><span class="pun" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">--</span><span class="pln" style="border: 0px; box-sizing: inherit; color: var(--black-750); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant-alternates: inherit; font-variant-caps: inherit; font-variant-east-asian: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-position: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">config python</span></code></pre>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-1892401529390343902020-04-06T13:55:00.004-07:002020-04-06T13:56:11.393-07:00Ubuntu 18.04: Create/Modify SWAP partition memory limit.Common error: <br />
<pre>fallocate: fallocate failed: Text file busy in ubuntu OS </pre>
<br />
Check the allocation:
<br />
<pre>free -m
or
sudo swapon --show
</pre>
<br />
Make sure you have enough free disk space by
<br />
<pre>df -h</pre>
<br />
Disable the use of swap, allocate new swap space, enable swap.
<br />
<pre>sudo swapoff -a
sudo fallocate -l 8G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
</pre>
<br />
Check the allocation:
<br />
<pre>free -m
or
sudo swapon --show
</pre>
<br />
For detailed information: <a href="https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04">https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04</a>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com2tag:blogger.com,1999:blog-7684221601048209964.post-3901701340531785002020-03-18T14:43:00.001-07:002020-03-18T14:48:28.428-07:00Connecting to Ubuntu Remote Desktop from Mac OSConnecting to Ubuntu or any linux server via Mac OS:<br />
-- Access the "Spotlight" by hitting CMD + Space-bar<br />
-- Within the Spotlight field, enter vnc://your_server_ip:5900<br />
<br />
If you get an error when connecting to Ubuntu from Mac OS using VNC screen sharing:<br />
"The software on the remote computer appears to be incompatible with this version of Screen Sharing."
<br />
On Ubuntu 18.04:<br />
<pre>$ gsettings set org.gnome.Vino require-encryption false
</pre>
Verify the setting with
<br />
<pre>$ gsettings list-recursively org.gnome.Vino | grep encrypt
</pre>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-8658257999259068882020-03-18T14:02:00.001-07:002020-03-18T14:02:35.314-07:00 Fix wrong time in Ubuntu
Fix wrong time in Ubuntu .
<pre>sudo timedatectl set-local-rtc 1 --adjust-system-clock
</pre>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-49851577044420035772020-03-12T01:11:00.002-07:002020-03-12T01:11:41.513-07:00BIOS settings to Install Ubuntu<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
If Ubuntu installation shows only the USB drive from which you are installing, make sure you have the BIOS settings as follows.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
BIOS settings to Install Ubuntu alongside with Windows :</div>
<ol style="background-color: white; border: 0px; box-sizing: inherit; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0.5em; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;">Disable Secure Boot.</li>
<li style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0.5em; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;">Set SATA-controller to AHCI from RAID On.</li>
<li style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;">Set boot mode to legacy from UEFI.</li>
</ol>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-36613016431597222782020-02-13T13:32:00.000-08:002020-02-13T13:35:55.119-08:00How to fix error Requires: libva.so.1(VA_API_0.33.0)(64bit)If you get the following error while installing FFMPEG or other packages on <b>CentOS 7.
</b><br />
<pre><code>
Requires: libva.so.1(VA_API_0.33.0)(64bit)
</code></pre>
<br />
<b><span style="color: blue;">Follow the following steps to install libva
</span></b><br />
<pre><code>
sudo yum install libwayland-client
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libva-1.8.3-1.el7.x86_64.rpm
sudo rpm -i libva-1.8.3-1.el7.x86_64.rpm
</code></pre>
<b><br /></b>
<b>Sample error log when installing FFMPEG:
</b><br />
<pre><code>
Error: Package: ffmpeg-libs-3.4.7-1.el7.x86_64 (rpmfusion-free-updates)
Requires: libva.so.1(VA_API_0.33.0)(64bit)
Error: Package: ffmpeg-libs-3.4.7-1.el7.x86_64 (rpmfusion-free-updates)
Requires: libva-x11.so.1()(64bit)
Error: Package: libmfx-1.21-2.el7.x86_64 (epel)
Requires: libva-x11.so.1()(64bit)
Error: Package: libmfx-1.21-2.el7.x86_64 (epel)
Requires: libva-drm.so.1()(64bit)
Error: Package: ffmpeg-libs-3.4.7-1.el7.x86_64 (rpmfusion-free-updates)
Requires: libva-drm.so.1()(64bit)
Error: Package: ffmpeg-libs-3.4.7-1.el7.x86_64 (rpmfusion-free-updates)
Requires: libva.so.1()(64bit)
Error: Package: libmfx-1.21-2.el7.x86_64 (epel)
Requires: libva.so.1()(64bit)
</code></pre>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com3tag:blogger.com,1999:blog-7684221601048209964.post-85644905444624890782019-05-23T17:59:00.000-07:002019-06-09T15:09:08.199-07:00Azure VM --os-disk-size-gb partition, format and mount<span style="font-family: "arial" , "helvetica" , sans-serif;">If you are using Azure VM --os-disk-size-gb parameter to increase the size of the OS disk, you need to partition, format and mount to use it.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Check the current status with</span><br />
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
fdisk -l</div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
df -Th<span style="color: black;"> </span></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 1: Create a partition (See sample output below)</span><br />
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
sudo fdisk /dev/sda</div>
<span style="font-size: 14.666666984558105px;"><span style="font-family: "arial" , "helvetica" , sans-serif;">(use n to create new partition, and follow prompts)</span></span><br />
<span style="font-size: 14.666666984558105px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: 14.666666984558105px;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Step 2: Refresh partition table</span></span><br />
<span style="background-color: #1e1f29; color: white; font-family: "menlo"; font-size: 14px;"> sudo partprobe</span><br />
<div>
<br /></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 3: Format the new partition, get the name from step 1 or use fdisk -l </span></div>
<div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
mkfs.xfs /dev/sda3<span style="color: black;"> </span></div>
</div>
<span style="font-size: 14.666666984558105px;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 4: Mount </span><br />
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
mkdir /mnt/shared</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
mount /dev/sda3 /mnt/shared/<span style="color: black;"> </span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Step 5: Verify </span><br />
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
df -Th<span style="color: black;"> </span></div>
<div>
<span style="color: black;"><br /></span>
<span style="color: black;">Step 6: Edit the /etc/fstab to automatically mount when restarted </span><br />
<span style="color: black;"></span><br />
<div>
</div>
<br />
<div style="background-color: #1e1f29; color: white; font-family: menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<div style="margin: 0px;">
vi /etc/fstab</div>
</div>
Append line <span style="-webkit-text-stroke-color: rgb(255, 255, 255); background-color: #1e1f29; caret-color: rgb(0, 255, 255); color: cyan; font-family: Menlo; font-size: 14px;">/dev/sda3 /mnt/shared xfs defaults 0 0 </span><span style="-webkit-text-stroke-color: rgb(255, 255, 255); background-color: #1e1f29; caret-color: rgb(0, 255, 255); color: cyan; font-family: Menlo; font-size: 14px;"> </span>. Please note the filesystem type "xfs" is used as it was formatted in "xfs" in Step 3. You could use other formats as well based on your requirements .<br />
<div style="background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;">#</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;"># /etc/fstab</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;"># Created by anaconda on Wed Dec 19 23:06:16 2018</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;">#</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
# Accessible filesystems, by reference, are maintained under '/dev/disk'<span style="color: black;"> </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info<span style="color: black;"> </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;">#</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: white;">UUID=fdb125e2-1ce5-4b7a-98db-88c0f66a86ee /</span> <span style="color: white;">xfs defaults</span> <span style="color: white;">0 0</span> </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
UUID=d4c5a046-3513-4ff0-a955-621311869210 /boot<span style="color: black;"> </span>xfs defaults<span style="color: black;"> </span>0 0<span style="color: black;"> </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: cyan;">/dev/sda3 /mnt/shared xfs defaults 0 0 </span><span style="color: black;"> </span></div>
<br />
<span style="font-family: arial, helvetica, sans-serif;"><br /></span>
<span style="font-family: arial, helvetica, sans-serif;"><b><span style="color: blue;">Sample Output:</span></b></span><br />
<span style="color: black;"><br /></span>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="caret-color: rgb(255, 255, 255); color: white;">[root@azvm azureusr]</span><span style="color: yellow;"># fdisk /dev/sda</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
The device presents a logical sector size that is smaller than</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
the physical sector size. Aligning to a physical sector (or optimal</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
I/O) size boundary is recommended, or performance may be impacted.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Welcome to fdisk (util-linux 2.23.2).</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Changes will remain in memory only, until you decide to write them.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Be careful before using the write command.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">Command (m for help): n</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Partition type:</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
p primary (2 primary, 0 extended, 2 free)</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
e extended</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">Select (default p): </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">Using default response p</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">Partition number (3,4, default 3): </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
First sector (62914560-125829119, default 62914560): </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Using default value 62914560</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Last sector, +sectors or +size{K,M,G} (62914560-125829119, default 125829119): </div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Using default value 125829119</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: lime;">Partition 3 of type Linux and of size 30 GiB is set</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">Command (m for help): w</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
The partition table has been altered!</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Calling ioctl() to re-read partition table.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
The kernel still uses the old table. The new table will be used at</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
the next reboot or after you run partprobe(8) or kpartx(8)</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Syncing disks.</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">[root@azvm azureusr]# partprobe</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">[root@azvm azureusr]# fdisk -l</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 sectors</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Units = sectors of 1 * 512 = 512 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Sector size (logical/physical): 512 bytes / 4096 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
I/O size (minimum/optimal): 4096 bytes / 4096 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk label type: dos</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk identifier: 0x000eba6a</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Device Boot Start End Blocks Id System</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda1 * 2048 1026047 512000 83 Linux</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda2 1026048 62914559 30944256 83 Linux</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: lime;">/dev/sda3 62914560 125829119 31457280 83 Linux</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk /dev/sdb: 751.6 GB, 751619276800 bytes, 1468006400 sectors</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Units = sectors of 1 * 512 = 512 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Sector size (logical/physical): 512 bytes / 4096 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
I/O size (minimum/optimal): 4096 bytes / 4096 bytes</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk label type: dos</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Disk identifier: 0x3fde6d89</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal; min-height: 16px;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Device Boot Start End Blocks Id System</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sdb1 128 1468004351 734002112 83 Linux</div>
</div>
<div>
<br /></div>
<div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">[root@azvm azureusr]# df -Th</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Filesystem Type Size Used Avail Use% Mounted on</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda2 xfs 32G 5.8G 26G 19% /</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
devtmpfs devtmpfs 186G 0 186G 0% /dev</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 186G 0 186G 0% /dev/shm</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 186G 9.5M 186G 1% /run</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 186G 0 186G 0% /sys/fs/cgroup</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda1 xfs 521M 68M 454M 13% /boot</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sdb1 ext4 740G 76M 703G 1% /mnt/resource</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 38G 0 38G 0% /run/user/1000</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">[root@azvm azureusr]# mkfs.xfs /dev/sda3 </span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
meta-data=/dev/sda3 isize=512 agcount=4, agsize=1966080 blks</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
= sectsz=4096 attr=2, projid32bit=1</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
= crc=1 finobt=0, sparse=0</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
data = bsize=4096 blocks=7864320, imaxpct=25</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
= sunit=0 swidth=0 blks</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
naming =version 2 bsize=4096 ascii-ci=0 ftype=1</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
log =internal log bsize=4096 blocks=3840, version=2</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
= sectsz=4096 sunit=1 blks, lazy-count=1</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
realtime =none extsz=4096 blocks=0, rtextents=0</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;"><br /></span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: yellow;">[root@azvm azureusr]# mkdir /mnt/shared</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="-webkit-text-stroke-width: initial;"><span style="color: yellow;"><br /></span></span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="caret-color: rgb(255, 255, 0); color: yellow;">[root@azvm azureusr]#</span><span style="-webkit-text-stroke-width: initial;"><span style="color: yellow;"> mount /dev/sda3 /mnt/shared/ </span></span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="caret-color: rgb(255, 255, 0); color: yellow;">[root@azvm azureusr]#</span><span style="color: yellow;"> df -Th</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
Filesystem Type Size Used Avail Use% Mounted on</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda2 xfs 30G 5.4G 25G 19% /</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
devtmpfs devtmpfs 174G 0 174G 0% /dev</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 174G 0 174G 0% /dev/shm</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 174G 9.1M 174G 1% /run</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 174G 0 174G 0% /sys/fs/cgroup</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sda1 xfs 497M 65M 433M 13% /boot</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
/dev/sdb1 ext4 689G 73M 654G 1% /mnt/resource</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
tmpfs tmpfs 35G 0 35G 0% /run/user/1000</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: lime;">/dev/sda3 xfs 30G 33M 30G 1% /mnt/shared</span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<span style="color: lime;"><br /></span></div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
</div>
<div style="-webkit-text-stroke-color: rgb(255, 255, 255); -webkit-text-stroke-width: initial; background-color: #1e1f29; color: white; font-family: Menlo; font-size: 14px; font-stretch: normal; line-height: normal;">
<br /></div>
</div>
<div>
<br /></div>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-50571870992440017842017-07-05T08:59:00.001-07:002017-07-05T08:59:30.346-07:00Get Memory information in Linux<pre><code>
sudo dmidecode --type 17
</code></pre>Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0tag:blogger.com,1999:blog-7684221601048209964.post-43372453697372189572017-07-05T08:56:00.002-07:002017-07-05T08:57:46.382-07:00Watch CPU Frequencies in real time<pre><code>
sudo watch -n 1 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
</code></pre>
Ravi Panchumarthyhttp://www.blogger.com/profile/00361822144559486170noreply@blogger.com0