<?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; Minh</title> <atom:link href="http://minhtech.com/author/minh/feed/" rel="self" type="application/rss+xml" /><link>http://minhtech.com</link> <description>Yet another technology tutorial blog.</description> <lastBuildDate>Fri, 16 Dec 2011 13:45:47 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Google Chrome Pin Web Sites on New Tab Page</title><link>http://minhtech.com/miscellaneous/google-chrome-pin-web-sites-on-new-tab-page/</link> <comments>http://minhtech.com/miscellaneous/google-chrome-pin-web-sites-on-new-tab-page/#comments</comments> <pubDate>Fri, 16 Dec 2011 13:38:35 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Miscellaneous]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=1114</guid> <description><![CDATA[Here is how to pin Web sites on the "New Tab Page" of Google Chrome 15 or 16.]]></description> <content:encoded><![CDATA[<p>Here is how to pin Web sites on the &#8220;New Tab Page&#8221; of Google Chrome 15 or 16. For some reason, the pin button has been removed from the recent releases but the functionality still exists. This section of the New Tab Page used to be titled &#8220;Most visited.&#8221;</p><h3>First, Open the Preferences file:</h3><p
class="code"><span
style="font-weight:bold;">Windows 7</span>: \Users\<span
class="codered">Username</span>\AppData\Local\Google\Chrome\User Data\Default\Preferences<br
/> <span
style="font-weight:bold;">MAC OS X</span>: /Users/<span
class="codered">Username</span>/Library/Application Support/Google/Chrome/Default/Preferences</p><p>Completely exit Google Chrome and make sure all windows are closed. Open the <b>Preferences</b> file in your favorite text editor.</p><h3>Edit the Preferences file:</h3><p
class="code">&#34;pinned_urls&#34;: {<br
/> &nbsp;&nbsp;&nbsp;&#34;<span
class="codered">http://www.domain1.com/</span>&#34;: <span
class="codered">1</span>,<br
/> &nbsp;&nbsp;&nbsp;&#34;<span
class="codered">http://www.domain2.net/</span>&#34;: <span
class="codered">2</span>,<br
/> &nbsp;&nbsp;&nbsp;&#34;<span
class="codered">http://www.domain3.org/</span>&#34;: <span
class="codered">0</span><br
/> },</p><p>Look for the section listed above and edit it. You may have up to 8 pinned Web sites numbered 0 to 7 in the <b>Preferences</b> file. The number indicates the order of the pinned sites.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/miscellaneous/google-chrome-pin-web-sites-on-new-tab-page/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fedora Linux 14 Install Nonpareil Calculator Emulator</title><link>http://minhtech.com/linux/fedora-linux-14-install-nonpareil-calculator-emulator/</link> <comments>http://minhtech.com/linux/fedora-linux-14-install-nonpareil-calculator-emulator/#comments</comments> <pubDate>Fri, 18 Mar 2011 15:01:51 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Linux]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=976</guid> <description><![CDATA[Install the Nonpareil high-fidelity simulator for classic HP calculators on Fedora Linux 14.]]></description> <content:encoded><![CDATA[<p>Install Eric Smith&#8217;s <a
href="http://nonpareil.brouhaha.com/">Nonpareil</a> high-fidelity simulator for classic HP calculators on Fedora Linux 14.</p><h3>First, Download and Unarchive the Source:</h3><p>Version 0.79 can be downloaded from Eric Smith&#8217;s site at <a
href="http://nonpareil.brouhaha.com/download/">http://nonpareil.brouhaha.com/download/</a>. I will be installing version 0.78 which has the Voyager series models that include my beloved HP 15c.</p><p
class="code">> <span
class="input">gzip -d nonpareil-<span
class="codered">0.78</span>.tar.gz</span><br
/> > <span
class="input"> tar -xvf nonpareil-<span
class="codered">0.78</span>.tar</span><br
/> > <span
class="input"> cd nonpareil-<span
class="codered">0.78</span></span></p><h3>Install Build Dependencies:</h3><p
class="code">> <span
class="input">yum install gcc flex bison scons python netpbm netpbm-progs</span></p><p>We install all the build dependencies listed in the source&#8217;s <i>INSTALL</i> file.  We also install the netpbm-progs package for the <span
class="command">pngtopnm</span> command. Otherwise we will later receive a <b>sh: pngtopnm: command not found</b> error message.</p><h3>Install Runtime Dependencies:</h3><p
class="code">> <span
class="input">yum install gtk2 gtk2-devel gdk-pixbuf2 gdk-pixbuf2-devel glib2 glib2-devel libxml2 libxml2-devel SDL SDL-devel SDL_mixer SDL_mixer-devel</span></p><p>Next we install the runtime dependencies listed in the <i>README</i> file. Note that the corresponding header files must also be installed as stated in the source&#8217;s <i>INSTALL</i> file.</p><h3>Install Nonpareil:</h3><p
class="code">> <span
class="input">scons install</span><br/><br
/> &#60;command-line&#62;:0:1: error: macro names must be identifiers<br
/> scons: *** [build/posix/csim.o] Error 1<br
/> scons: building terminated because of errors.</p><p>Oops, it looks like a source file needs to be modified. Search for the line <b>csim_env.Append (CPPDEFINES = {&#39;DEFAULT_PATH&#39;: build_env [&#39;libdir&#39;]})</b> and edit it as listed below.</p><p
class="code">> <span
class="input">vi src/SConscript</span><br/><br
/> csim_env.Append (CPPDEFINES = [(&#39;DEFAULT_PATH&#39;, build_env [&#39;libdir&#39;])])<br/><br
/> > <span
class="input">scons install</span><br/><br
/> scons: done building targets.</p><p>That&#8217;s it. The <span
class="command">nonpareil</span> command can be found at the path <b>/usr/local/bin/</b>. Enjoy!</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/linux/fedora-linux-14-install-nonpareil-calculator-emulator/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Perl Script to Convert or Parse EBCDIC File</title><link>http://minhtech.com/perl/perl-script-to-parse-ebcdic-file/</link> <comments>http://minhtech.com/perl/perl-script-to-parse-ebcdic-file/#comments</comments> <pubDate>Wed, 16 Mar 2011 15:24:00 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Perl]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=973</guid> <description><![CDATA[Here is a simple Perl script to convert/parse data in IBM EBCDIC to ASCII format.]]></description> <content:encoded><![CDATA[<p>Here is a simple Perl script to convert/parse data in IBM Extended Binary Coded Decimal Interchange Code, EBCDIC, to ASCII format.</p><h3>Analyze EBCDIC File:</h3><p>Suppose we have a file in EBCDIC format with the following field name, offset, size, and data type elements:</p><p
class="code">field_01 0 7 packed decimal(14)<br
/> field_02 7 4 integer(4)<br
/> field_03 11 4 ebcdic string(4)</p><p>Note the numeric field length. Each byte of a packed decimal contains two digits. So “field1″ is 7 * 2 = 14 = 13 digits plus the symbol.</p><h3>Create the Perl Script:</h3><p
class="code">> <span
class="input">vi ebcdic2ascii.pl</span><br/><br
/> #!/usr/bin/perl -w<br/><br
/> use strict;<br
/> use Convert::EBCDIC;<br/><br
/> sub convert2ascii_decimal {<br
/> &#160;&#160;&#160;my ($number) = unpack(&#39;H*&#39;, $_[0]);<br
/> &#160;&#160;&#160;my ($sign) = chop $number;<br
/> &#160;&#160;&#160;my ($scale) = $_[1];<br/><br
/> &#160;&#160;&#160;if ($scale > 0) {<br
/> &#160;&#160;&#160;&#160;&#160;&#160;$number = (substr $number, 0, -$scale) . &#39;.&#39; . (substr $number, -$scale);<br
/> &#160;&#160;&#160;}<br/><br
/> &#160;&#160;&#160;if ($sign eq &#39;d&#39;) {<br
/> &#160;&#160;&#160;&#160;&#160;&#160;$number = -$number;<br
/> &#160;&#160;&#160;}<br/><br
/> &#160;&#160;&#160;return $number;<br
/> }<br/><br
/> sub convert2ascii_integer {<br
/> &#160;&#160;&#160;my ($integer) = @_;<br/><br
/> &#160;&#160;&#160;return unpack(&#39;i&#39;, $integer);<br
/> }<br/><br
/> sub convert2ascii_string {<br
/> &#160;&#160;&#160;my ($string) = @_;<br/><br
/> &#160;&#160;&#160;return Convert::EBCDIC::ebcdic2ascii($string);<br
/> }<br/><br
/> sub filewrite {<br
/> &#160;&#160;&#160;my ($file, $string) = @_;<br/><br
/> &#160;&#160;&#160;open FH, &#39;>>&#39;, $file or die $!;<br
/> &#160;&#160;&#160;select FH;<br
/> &#160;&#160;&#160;print &#34;$string\n&#34;;<br
/> &#160;&#160;&#160;select STDOUT;<br
/> &#160;&#160;&#160;close FH or die $!;<br
/> }<br/><br
/> sub recordparse {<br
/> &#160;&#160;&#160;my ($record) = @_;<br
/> &#160;&#160;&#160;my $string;<br/><br
/> &#160;&#160;&#160;$string = undefined2defined(convert2ascii_decimal((substr $record, <span
class="codered">0</span>, <span
class="codered">7</span>), <span
class="codered">2</span>));<br
/> &#160;&#160;&#160;$string = $string . chr(9) . undefined2defined(convert2ascii_integer((substr $record, <span
class="codered">7</span>, <span
class="codered">4</span>)));<br
/> &#160;&#160;&#160;$string = $string . chr(9) . undefined2defined(convert2ascii_string((substr $record, <span
class="codered">11</span>, <span
class="codered">4</span>)));<br/><br
/> &#160;&#160;&#160;return $string;<br
/> }<br/><br
/> sub undefined2defined {<br
/> &#160;&#160;&#160;my ($string) = @_;<br/><br
/> &#160;&#160;&#160;if (defined $string) {<br
/> &#160;&#160;&#160;&#160;&#160;&#160;return $string;<br
/> &#160;&#160;&#160;}<br
/> &#160;&#160;&#160;else {<br
/> &#160;&#160;&#160;&#160;&#160;&#160;return &#39;&#39;;<br
/> &#160;&#160;&#160;}<br
/> }<br/><br
/> my $string;<br/><br
/> open (FILE, $ARGV[0]) or die $!;<br/><br
/> while ((read FILE, $string, <span
class="codered">14</span>) != 0) {<br
/> &#160;&#160;&#160;filewrite ($ARGV[1], recordparse($string));<br
/> }<br/><br
/> close(FILE) or die $!;<br/><br
/> exit;</p><p>In this example, the main procedure is reading in 14 characters at a time from the file, which is the record length.  The function <span
class="command">recordparse</span> parses each record by calling <span
class="command">convert2ascii_decimal</span>, <span
class="command">convert2ascii_integer</span>, and <span
class="command">convert2ascii_string</span>; these functions unpack packed decimals, unpack integers, and convert EBCDIC strings to ASCII respectively.</p><p>Note that the code using <span
class="command">convert2ascii_decimal</span> has a third highlighted parameter, field scale, in addition to field offset and field length.  In this example, &#8220;field1&#8243; has a field offset of 0, a field length of 7, and a field scale of 2 (or 2 decimal places).</p><h3>Finally, Run the Script:</h3><p
class="code">> <span
class="input">perl ebcdic2ascii.pl ebcdic.ods ascii.txt</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/perl/perl-script-to-parse-ebcdic-file/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fedora Linux 14 Unable to ssh to Server</title><link>http://minhtech.com/linux/fedora-linux-unable-to-change-sshd-port/</link> <comments>http://minhtech.com/linux/fedora-linux-unable-to-change-sshd-port/#comments</comments> <pubDate>Sun, 13 Feb 2011 02:24:51 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Linux]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=922</guid> <description><![CDATA[Here are some troubleshooting tips if you are unable to connect to your Fedora Linux 14 server via ssh.]]></description> <content:encoded><![CDATA[<p>Here are some troubleshooting tips if you are unable to connect to your Fedora Linux 14 server via ssh.</p><h3>First, Check iptables:</h3><p
class="code">> <span
class="input">su -</span><br
/> > <span
class="input">head -20 /etc/ssh/sshd_config</span><br/><br
/> #       $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $<br/><br
/> # This is the sshd server system-wide configuration file.  See<br
/> # sshd_config(5) for more information.<br/><br
/> # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin<br/><br
/> # The strategy used for options in the default sshd_config shipped with<br
/> # OpenSSH is to specify options with their default value where<br
/> # possible, but leave them commented.  Uncommented options change a<br
/> # default value.<br/><br
/> Port <span
class="codered">9090</span><br
/> #AddressFamily any<br
/> #ListenAddress 0.0.0.0<br
/> #ListenAddress ::<br/><br
/> # The default requires explicit activation of protocol 1<br
/> Protocol 2<br/><br
/> > <span
class="input">/etc/init.d/sshd status</span><br/><br
/> openssh-daemon (pid  1309) is running&#8230;<br/><br
/> > <span
class="input">/etc/init.d/iptables status</span><br/><br
/> Table: filter<br
/> Chain INPUT (policy DROP)<br
/> num  target     prot opt source               destination<br
/> 1    ACCEPT     tcp  &#8212;  0.0.0.0/0            0.0.0.0/0           tcp dpt:80<br
/> 2    ACCEPT     all  &#8212;  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED<br
/> 3    ACCEPT     all  &#8212;  0.0.0.0/0            0.0.0.0/0<br/><br
/> Chain FORWARD (policy DROP)<br
/> num  target     prot opt source               destination<br/><br
/> Chain OUTPUT (policy ACCEPT)<br
/> num  target     prot opt source               destination</p><p>Log into root and check the port binding. In this example, we are binding sshd to port 9090 and confirm that sshd is running.  Then we check iptables and notice there is no explicit rule to allow access to port 9090.</p><p
class="code">> <span
class="input">iptables -A INPUT -i <span
class="codered">eth0</span> -p tcp &#45;&#45;dport <span
class="codered">9090</span> -j ACCEPT</span></p><p>So we create a firewall rule to allow access to port 9090 via interface eth0.  Omitting the interface parameter would allow access to port 9090 via all network interfaces.</p><h3>Next, check SELinux:</h3><p
class="code">> <span
class="input">/etc/init.d/sshd start</span><br
/> > <span
class="input">/etc/init.d/sshd status</span><br/><br
/> openssh-daemon is stopped<br/><br
/> > <span
class="input">cat /etc/selinux/config</span><br/><br
/> # This file controls the state of SELinux on the system.<br
/> # SELINUX= can take one of these three values:<br
/> #     enforcing &#8211; SELinux security policy is enforced.<br
/> #     permissive &#8211; SELinux prints warnings instead of enforcing.<br
/> #     disabled &#8211; No SELinux policy is loaded.<br
/> SELINUX=enforcing<br
/> # SELINUXTYPE= can take one of these two values:<br
/> #     targeted &#8211; Targeted processes are protected,<br
/> #     mls &#8211; Multi Level Security protection.<br
/> SELINUXTYPE=targeted</p><p>In this case, we attempt to start sshd but it is not running, and then check the SELinux configuration. SELinux policy is enforcing. You could edit the config file and make SELinux policy permissive or disabled but that is not recommended.  Instead, you should configure SELinux to allow sshd to bind to port 9090.</p><p
class="code">> <span
class="input">semanage port -a -t ssh_port_t -p tcp <span
class="codered">9090</span></span></p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/linux/fedora-linux-unable-to-change-sshd-port/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Convert XPS to PDF without Printer Driver via GhostPDL</title><link>http://minhtech.com/windows/convert-xps-to-pdf-without-printer-driver/</link> <comments>http://minhtech.com/windows/convert-xps-to-pdf-without-printer-driver/#comments</comments> <pubDate>Sat, 04 Sep 2010 19:03:02 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Windows]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=869</guid> <description><![CDATA[Here is how to convert XPS documents to PDF without an installed PDF distiller or printer driver.]]></description> <content:encoded><![CDATA[<p>Here is how to convert XPS documents to PDF without an installed PDF distiller or printer driver.</p><p>This is especially useful if you lack Windows administrator privileges, such as on an employer-maintained workstation, and cannot install a PDF application or printer driver.  If you have Microsoft Office installed, you can &#8220;print&#8221; into a XPS document with the <b>Microsoft XPS Document Writer</b> printer driver, and then convert it into PDF for easy distribution.</p><h3>First, Download GhostPDL:</h3><p>Go to Ghostscript&#8217;s Google Project Home and download the already compiled GhostPDL Windows binaries <a
href="http://code.google.com/p/ghostscript/downloads/list">here</a>.  No compiling or installation is required.  Simply uncompress the ZIP archive and you are ready to go.</p><h3>Convert XPS to PDF via Command Line</h3><p>Open a command prompt by going to <i>Start > Programs > Accessories > Command Prompt</i>, and then use the following syntax.  You may also use the run prompt via </i>Start > Run</i>.</p><p
class="code">C:\<span
class="input">gxps-<span
class="codered">871</span>.exe -sDEVICE=pdfwrite -sOutputFile=<span
class="codered">myfile.pdf</span> -dNOPAUSE <span
class="codered">myfile.xps</span></span></p><p>You may need to use absolute paths.  Here I am using the gxps binary installed in the My Documents directory to convert a file on the Desktop.</p><p
class="code">C:\<span
class="input"><span
class="codered">&#34;C:\Documents and Settings\Minh Nguyen\My Documents\ghostpdl-8.71-win32</span>\gxps-<span
class="codered">871</span>.exe&#34; -sDEVICE=pdfwrite -sOutputFile=<span
class="codered">&#34;C:\Documents and Settings\Minh Nguyen\Desktop\file.pdf&#34;</span> -dNOPAUSE <span
class="codered">&#34;C:\Documents and Settings\Minh Nguyen\Desktop\file.xps&#34;</span></span></p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/windows/convert-xps-to-pdf-without-printer-driver/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Excel VBA Unable to set the Visible property of the PivotItem class</title><link>http://minhtech.com/office/excel-vba-unable-to-set-the-visible-property-of-the-pivotitem-class/</link> <comments>http://minhtech.com/office/excel-vba-unable-to-set-the-visible-property-of-the-pivotitem-class/#comments</comments> <pubDate>Sat, 07 Aug 2010 20:32:00 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Office]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=853</guid> <description><![CDATA[Chances are AutoSort is enabled if you are getting this error message.]]></description> <content:encoded><![CDATA[<p>In versions of Microsoft Excel before 2007, chances are AutoSort is enabled if you are getting the error message <i>Unable to set the Visible property of the PivotItem class</i> or <i>Method &#8216;Visible&#8217; of object &#8216;PivotItem&#8217; failed</i>. Microsoft has a bulletin, <a
href="http://support.microsoft.com/kb/114822">KB114822</a>, for it. Basically only contiguous PivotItems in a PivotField can be hidden or unhidden. This appears to be fixed in Microsoft Excel 2007 and later.</p><h3>ManualUpdate and AutoSort Workaround:</h3><p
class="code">Dim mySheet As Worksheet<br
/> Dim myTable As PivotTable, myField As PivotField, myItem As PivotItem<br/><br
/> Set mySheet = Sheets(1)<br
/> Set myTable = mySheet.PivotTables(1)<br
/> Set myField = myTable.PivotFields(1)<br/><br
/> For Each myItem In myField.PivotItems<br
/> &#160;&#160;&#160;&#160;<span
class="input">myField.AutoSort xlManual, myField.SourceName</span><br
/> &#160;&#160;&#160;&#160;<span
class="input">myTable.ManualUpdate = True</span><br/><br
/> &#160;&#160;&#160;&#160;myItem.Visible = True<br/><br
/> &#160;&#160;&#160;&#160;<span
class="input">myTable.ManualUpdate = False</span><br
/> &#160;&#160;&#160;&#160;<span
class="input">myField.AutoSort xlAscending, myField.SourceName</span><br
/> Next myItem</p><p>The workaround is to temporarily enable ManualUpdate in the PivotTable and disable AutoSort in the PivotField.  Download <a
href="http://minhtech.com/files/pivot.xls">pivot.xls</a> for a sample of the error and the workaround.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/office/excel-vba-unable-to-set-the-visible-property-of-the-pivotitem-class/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <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> <category><![CDATA[Perl]]></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><h3>Update February 14, 2011:</h3><p
class="code">mplayer: could not connect to socket<br
/> mplayer: No such file or directory<br
/> Failed to open LIRC support. You will not be able to use your remote control.<br/><br
/> > <span
class="input">vi ~/.mplayer/config</span><br/><br
/> nolirc=yes</p><p>Linux Infrared Remote Control (LIRC) support in mplayer is compiled by default in Fedora Linux. If you do not have a remote or if you wish to disable support, edit the mplayer config file in your home directory to add the nolirc option.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/linux/fedora-linux-create-video-thumbnail-montage-perl-script/feed/</wfw:commentRss> <slash:comments>2</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><h3>Update February 13, 2011:</h3><p
class="code">> <span
class="input">sestatus</span><br/><br
/> SELinux status:                 enabled<br
/> SELinuxfs mount:                /selinux<br
/> Current mode:                   enforcing<br
/> Mode from config file:          enforcing<br
/> Policy version:                 24<br
/> Policy from config file:        targeted<br/><br
/> > <span
class="input">setsebool -P sshd_forward_ports 1</span></p><p>If SELinux policy is enforcing, then you must enable the sshd_forward_ports boolean.</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.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 16 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, 14, 15, or 16 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.6-385536</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>11</slash:comments> </item> </channel> </rss>
