<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MinhTech.com &#187; Linux</title>
	<atom:link href="http://minhtech.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://minhtech.com</link>
	<description>Yet another technology tutorial blog.</description>
	<lastBuildDate>Sat, 04 Sep 2010 19:04:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fedora Linux Create Video Thumbnail Montage Perl Script</title>
		<link>http://minhtech.com/linux/fedora-linux-create-video-thumbnail-montage-perl-script/</link>
		<comments>http://minhtech.com/linux/fedora-linux-create-video-thumbnail-montage-perl-script/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 15:59:40 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=804</guid>
		<description><![CDATA[Here is a Perl script to create a montage of sequential thumbnails in Fedora Linux 13.]]></description>
			<content:encoded><![CDATA[<p>Here is a Perl script to create a montage of sequential video thumbnails in Fedora Linux 13.</p>
<h3>First, Install Packages:</h3>
<p class="code">> <span class="input">su -</span><br />
> <span class="input">yum install perl mplayer ffmpeg ImageMagick</span><br />
> <span class="input">exit</span></p>
<p>Log into root and install the necessary packages. The <a href="http://rpmfusion.org/Configuration">RPM Fusion</a> repository needs to be configured for mplayer, ffmpeg, and ImageMagick.</p>
<h3>Copy Perl Script:</h3>
<p class="code">> <span class="input">vi <span class="codered">thumbs.pl</span></span><br/><br />
#!/usr/bin/perl -w<br/><br />
use strict;<br />
use POSIX;<br/><br />
my $dir = getcwd();<br />
my ($width, $height, $length);<br/><br />
opendir(DIR, $dir) or die $!;<br/><br />
while (my $file = readdir(DIR)) {<br />
&#160;&#160;&#160;<span class="codered">next unless ($file =~ m/\.mp4$/)</span>;<br/><br />
&#160;&#160;&#160;my @info = &#96;mplayer -benchmark -nosound -quiet -vo null -frames 1 -identify $file&#96;;<br/><br />
&#160;&#160;&#160;foreach (@info) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;if (substr($_, 0, 15) eq &#34;ID_VIDEO_WIDTH=&#34;) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$width = substr($_, 15);<br />
&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;elsif (substr($_, 0, 16) eq &#34;ID_VIDEO_HEIGHT=&#34;) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$height = substr($_, 16);<br />
&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;elsif (substr($_, 0, 10) eq &#34;ID_LENGTH=&#34;) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$length = substr($_, 10);<br />
&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;}<br/><br />
&#160;&#160;&#160;$width = floor($width / <span class="codered">3</span>);<br />
&#160;&#160;&#160;$height = floor($height / <span class="codered">3</span>);<br />
&#160;&#160;&#160;my ($tile_x, $tile_y, $frame) = (<span class="codered">6</span>, <span class="codered">4</span>, 1);<br />
&#160;&#160;&#160;my ($position, $files);<br/><br />
&#160;&#160;&#160;while ($frame < ($tile_x * $tile_y + 1)) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;$position = $frame * floor($length / ($tile_x * $tile_y));<br/><br />
&#160;&#160;&#160;&#160;&#160;&#160;system(&#34;ffmpeg -ss $position -i $file -vcodec mjpeg -vframes 1 -s $width&#34;.&#34;x&#34;.&#34;$height -an -f rawvideo -y __$frame.jpg 2> /dev/null&#34;);<br/><br />
&#160;&#160;&#160;&#160;&#160;&#160;$files = $files . &#34; __$frame.jpg&#34;;<br/><br />
&#160;&#160;&#160;&#160;&#160;&#160;$frame += 1;<br />
&#160;&#160;&#160;}<br/><br />
&#160;&#160;&#160;system(&#34;montage -title \&#34;$file\&#34; -geometry $width&#34;.&#34;x&#34;.&#34;$height&#34;.&#34;+&#34;.&#34;1&#34;.&#34;+&#34;.&#34;1 -tile $tile_x&#34;.&#34;x&#34;.&#34;$tile_y$files $file.jpg&#34;);<br/><br />
&#160;&#160;&#160;system(&#34;rm __*.jpg&#34;);<br />
}<br/><br />
closedir(DIR);</p>
<p>You can also download the <a href="http://minhtech.com/files/thumbs.pl">thumbs.pl</a> file.</p>
<p>There are a few things you may wish to configure. First is the script only creates montages for mp4 files. Change the regular expression for your needs. Second is the scale of each thumbnail relative to the resolution of the video.  I have selected one-third of the original size.  Third is the tile layout.  I have selected 6 horizontal by 4 vertical tiles. If you are editing the script, note that the <i>-ss</i> option must be before the <i>-i</i> option or else ffmpeg will crawl while creating thumbnails.</p>
<p>Why both mplayer and ffmpeg? mplayer has the ability to do montages but I usually have issues with the <i>-sstep</i> option, and <i>framestep</i> is way too slow. You can certainly pull video data with <i>ffmpeg -i</i> but <i>mplayer -identify</i> is much easier to parse and I was lazy. Sorry.</p>
<h3>Run the Perl Script:</h3>
<p class="code">> <span class="input">perl <span class="codered">thumbs.pl</span></span></p>
<p>Place the script into a directory and execute it. You can run it in the background with <span class="command">nohup perl thumbs.pl &#038;</span> instead. The script will find every mp4 file in its directory and make a sequential video thumbnail montage for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-linux-create-video-thumbnail-montage-perl-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Linux Install &amp; Configure VNC Server</title>
		<link>http://minhtech.com/linux/fedora-linux-install-configure-vnc-server/</link>
		<comments>http://minhtech.com/linux/fedora-linux-install-configure-vnc-server/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 01:36:21 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=770</guid>
		<description><![CDATA[Here is how to install and configure a VNC server on Fedora Linux 13.]]></description>
			<content:encoded><![CDATA[<p>Here is how to install and configure a VNC server on Fedora Linux 13.</p>
<h3>First, Install TigerVNC:</h3>
<p class="code">> <span class="input">su -</span><br />
> <span class="input">yum install tigervnc-server</span></p>
<p>Log into root and install the TigerVNC package.</p>
<h3>Configure VNC Server:</h3>
<p class="code">> <span class="input">echo &#39;VNCSERVERS=&#34;<span class="codered">1:mnguyen</span>&#34;&#39; &#62;&#62; /etc/sysconfig/vncservers</span><br />
> <span class="input">echo &#39;VNCSERVERARGS[<span class="codered">1</span>]=&#34;-geometry 1024&#215;768 -depth 16&#34;&#39; &#62;&#62; /etc/sysconfig/vncservers</span></p>
<p>Edit the <i>vncservers</i> configuration file and set up a user pair. Note the element numeral <i>1</i> which refers to a user pair. If you set up a second user, say snguyen, then use <span class="command">echo &#39;VNCSERVERS=&#34;2:snguyen&#34;&#39; &#62;&#62; /etc/sysconfig/vncservers</span> and <span class="command">echo &#39;VNCSERVERARGS[2]=&#34;-geometry 1024&#215;768 -depth 16&#34;&#39; &#62;&#62; /etc/sysconfig/vncservers</span>.</p>
<h3>Set VNC Password:</h3>
<p class="code">> <span class="input">su &#8211; <span class="codered">mnguyen</span></span><br />
> <span class="input">vncpasswd</span></p>
<p>Log into each user associated with a VNC server and configure a VNC password.</p>
<h3>Finally, Start VNC Server:</h3>
<p class="code">> <span class="input">exit</span><br />
> <span class="input">chkconfig &#45;&#45;level 2345 vncserver on</span><br />
> <span class="input">/etc/init.d/vncserver start</span></p>
<p>Exit back to root and start the VNC server daemon.  Each VNC server has a unique port, 590#, associated with the user pair element defined in the <i>vncservers</i> configuration file. So the VNC server for user <i>mnguyen</i> is on port 5901 and the VNC server for user <i>snguyen</i> is on port 5902.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-linux-install-configure-vnc-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fedora Google Chrome 64-Bit with Flash and Java</title>
		<link>http://minhtech.com/linux/fedora-google-chrome-64-bit-with-flash-and-java/</link>
		<comments>http://minhtech.com/linux/fedora-google-chrome-64-bit-with-flash-and-java/#comments</comments>
		<pubDate>Fri, 28 May 2010 12:44:13 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=735</guid>
		<description><![CDATA[Install the 64-bit version of Google Chrome with the Adobe Flash Player and Sun Java plugins on Fedora Linux 13.]]></description>
			<content:encoded><![CDATA[<p>Here is how to install the 64-bit version of Google Chrome with the Adobe Flash Player and Sun Java plugins on Fedora Linux 13.</p>
<h3>First, Import the Google Key:</h3>
<p class="code">> <span class="input">wget https://dl-ssl.google.com/linux/linux_signing_key.pub</span><br />
> <span class="input">rpm &#45;&#45;import linux_signing_key.pub</span></p>
<p>Log into root, download the Google signing key, and import it with RPM.</p>
<h3>Set Up the Google Repository:</h3>
<p class="code">> <span class="input">vi /etc/yum.repos.d/google64.repo</span><br />
[google64]<br />
name=Google &#8211; x86_64<br />
baseurl=http://dl.google.com/linux/rpm/stable/x86_64<br />
enabled=1<br />
gpgcheck=1<br />
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub</p>
<p>Create a yum repository file for Google and add the 64-bit information above.</p>
<h3>Next, Install Google Chrome:</h3>
<p class="code">> <span class="input">yum install google-chrome-stable</span></p>
<h3>Install the Adobe Flash Plugin:</h3>
<p class="code">> <span class="input">gzip -d libflashplayer-<span class="codered">10.0.45.2</span>.linux-x86_64.so.tar.gz</span><br />
> <span class="input">tar -xvf libflashplayer-<span class="codered">10.0.45.2</span>.linux-x86_64.so.tar</span><br />
> <span class="input">mkdir /opt/google/chrome/plugins/</span><br />
> <span class="input">mv libflashplayer.so /opt/google/chrome/plugins/</span></p>
<p>Download the 64-bit version of Flash Player for Linux from Adobe&#8217;s site <a href="http://labs.adobe.com/downloads/flashplayer10_64bit.html">here</a> and uncompress it. Create a <i>plugins</i> directory for Google Chrome, and then move the Adobe Flash Player plugin file into the newly created directory.</p>
<h3>Install the Sun Java Plugin:</h3>
<p class="code">> <span class="input">cd /opt/google/chrome/plugins</span><br />
> <span class="input">ln -s /usr/lib/java/<span class="codered">jre1.6.0_20</span>/lib/amd64/libnpjp2.so .</span></p>
<p>If you have not installed Sun&#8217;s Java runtime, follow my CentOS instructions <a href="http://minhtech.com/featuredlinux/centos-install-sun-java-se-jre/">here</a>. These instructions work for Fedora too. Simply link the 64-bit Java plugin file to Google Chrome&#8217;s plugin directory. Do not forget the period at the end.</p>
<h3>Finally, Check the Installed Plugins:</h3>
<p>Launch Google Chrome and type <span class="command">about:plugins</span> into the address bar.  You should see both the Adobe Flash Player and Sun Java plugins installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-google-chrome-64-bit-with-flash-and-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Linux 13 Install VMware Tools</title>
		<link>http://minhtech.com/linux/fedora-linux-13-install-vmware-tools/</link>
		<comments>http://minhtech.com/linux/fedora-linux-13-install-vmware-tools/#comments</comments>
		<pubDate>Thu, 27 May 2010 23:41:36 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=712</guid>
		<description><![CDATA[Install vmware-tools on a Fedora Linux 13 guest.]]></description>
			<content:encoded><![CDATA[<p>Here is how to install vmware-tools on a Fedora Linux 13 guest.</p>
<h3>First, Install the Dependencies:</h3>
<p class="code">> <span class="input">yum update</span><br />
> <span class="input">shutdown -r now</span><br />
> <span class="input">yum install gcc make kernel-devel perl</span></p>
<p>Perform an update to make sure you have the latest kernel, reboot Fedora, and then install the following packages: gcc, make, kernel-devel, and perl.  Make sure the kernel and kernel-devel packages are the exact same version.  If you are running 32-bit Fedora, install the kernel-PAE-devel package.</p>
<h3>Next, Prepare the vmware-tools Installer:</h3>
<p class="code">> <span class="input">mkdir /mnt/cdrom</span><br />
> <span class="input">mount /dev/cdrom /mnt/cdrom</span><br />
> <span class="input">cd /tmp</span><br />
> <span class="input">tar zxpf /mnt/cdrom/VMwareTools-<span class="codered">8.4.2-261058</span>.tar.gz</span><br />
> <span class="input">umount /dev/cdrom</span></p>
<p>In the <i>Virtual Machine</i> menu, select <i>Install VMware Tools</i>. VMware Fusion will make an image appear to Fedora.  Mount the image, uncompress the installer files to the temporary directory, and then unmount the image.</p>
<h3>Finally, Execute the Installer:</h3>
<p class="code">> <span class="input">cd vmware-tools-distrib</span><br />
 > <span class="input">./vmware-install.pl</span></p>
<p>Change to the <i>vmware-tools-distrib</i> directory and execute the Perl script, and then follow the prompts.  As long as the dependencies were installed correctly, and the version of the kernel headers match the currently running kernel, the installer will automatically find all the directories that it needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-linux-13-install-vmware-tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fedora Linux 13 Edit Gnome Desktop Menu</title>
		<link>http://minhtech.com/linux/fedora-linux-13-edit-gnome-menu/</link>
		<comments>http://minhtech.com/linux/fedora-linux-13-edit-gnome-menu/#comments</comments>
		<pubDate>Thu, 27 May 2010 01:35:41 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=697</guid>
		<description><![CDATA[Edit the applications menu in the Gnome Desktop Environment for Fedora Linux 13.]]></description>
			<content:encoded><![CDATA[<p>Here is how to edit the applications menu in the Gnome Desktop Environment for Fedora Linux 13.</p>
<h3>First, Install alacarte:</h3>
<p class="code">> <span class="input">su -c &#8216;yum install alacarte&#8217;</span></p>
<p>I have no idea why all of the sudden this is not installed by default with the Gnome Desktop Environment.</p>
<h3>Finally, restart X:</h3>
<p>Log out of, and then back into the desktop environment. Now you will see an &#8220;Edit Menus&#8221; option when you right-click on the menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-linux-13-edit-gnome-menu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fedora Linux Mount Samba, WebDAV</title>
		<link>http://minhtech.com/linux/fedora-linux-mount-samba-webdav/</link>
		<comments>http://minhtech.com/linux/fedora-linux-mount-samba-webdav/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 03:16:33 +0000</pubDate>
		<dc:creator>Minh</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://minhtech.com/?p=439</guid>
		<description><![CDATA[Here is how to mount various filesystems in Fedora Linux 10.]]></description>
			<content:encoded><![CDATA[<p>Here is how to mount various filesystems in Fedora Linux 10.</p>
<h3>First, List the Filesystems:</h3>
<p class="code">> <span class="input">fdisk -l</span></p>
<p>Use fdisk, the partition table manipulator for Linux, to list all partition tables.</p>
<h3>Mount a Partition:</h3>
<p class="code">> <span class="input">mkdir <span class="codered">/mnt/usbdrive</span></span><br />
> <span class="input">mount <span class="codered">/dev/sdb1</span> <span class="codered">/mnt/usbdrive</span></span></p>
<p>Create a directory as a mount point and then mount the partition to the directory.</p>
<h3>Mount a NTFS Partition:</h3>
<p class="code">> <span class="input">mkdir <span class="codered">/mnt/usbdrive</span></span><br />
> <span class="input">mount -t ntfs-3g <span class="codered">/dev/sdb1</span> <span class="codered">/mnt/usbdrive</span></span></p>
<p>You may need to install the ntfs-3g driver (<span class="command">yum install ntfs-3g</span>).</p>
<h3>Mount a Samba Share:</h3>
<p class="code">> <span class="input">mkdir <span class="codered">/mnt/smbshare</span></span><br />
> <span class="input">mount <span class="codered">//192.168.1.101/data</span> <span class="codered">/mnt/smbshare</span> -o username=<span class="codered">mnguyen</span>,password=<span class="codered">password</span></span></p>
<h3>Install fuse and wdfs To Mount a WebDAV Folder:</h3>
<p class="code">> <span class="input">yum install fuse wdfs</span></p>
<h3>Mount a WebDAV Folder:</h3>
<p class="code">> <span class="input">mkdir <span class="codered">/mnt/webdav</span></span><br />
> <span class="input">wdfs <span class="codered">http://webdav.domain.com/</span> <span class="codered">/mnt/webdav</span> -o username=<span class="codered">mnguyen</span>,password=<span class="codered">password</span>,allow_other</span></p>
<h3>Unmount a Filesystem:</h3>
<p class="code">> <span class="input">umount <span class="codered">/mnt/usbdrive</span></span></p>
<p>If the filesystem is busy, determine what process is using the filesystem (e.g. /dev/sdb1) with &#8220;<span class="command">fuser -m /dev/sdb1</span>&#8221; and then look up the PID (e.g. 123) with &#8220;<span class="command">ps auxw | grep 123</span>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://minhtech.com/linux/fedora-linux-mount-samba-webdav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
