<?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</title> <atom:link href="http://minhtech.com/feed/" rel="self" type="application/rss+xml" /><link>http://minhtech.com</link> <description>Yet another technology tutorial blog.</description> <lastBuildDate>Fri, 15 Mar 2013 05:15:19 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <item><title>Oracle Database 11g XE Hostname Change</title><link>http://minhtech.com/oracle/oracle-11g-xe-hostname-change/</link> <comments>http://minhtech.com/oracle/oracle-11g-xe-hostname-change/#comments</comments> <pubDate>Thu, 10 Jan 2013 00:56:28 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=1205</guid> <description><![CDATA[Apparently, Oracle Database does not like hostname changes.]]></description> <content:encoded><![CDATA[<p>I have an instance of Oracle Database 11g Express Edition (XE) installed on a remote virtual machine for testing purposes. I recently had trouble accessing the Application Express Login page despite being able to connect to the database locally via <span
class="command">sqlplus</span>. Apparently, Oracle does not like hostname changes.</p><h3>Update Oracle for Hostname Change:</h3><p>Edit both the listener.ora and tnsnames.ora files at <span
class="command">$ORACLE_HOME/network/admin/listener.ora</span> and <span
class="command">$ORACLE_HOME/network/admin/tnsnames.ora</span>. In the files, replace instances of the old hostname with the new hostname.  Finally, log into root and force a reload.</p><p
class="code"> > <span
class="input">su -</span><br
/> > <span
class="input">/etc/init.d/oracle-xe force-reload</span></p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/oracle/oracle-11g-xe-hostname-change/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Oracle APEX Prevent Cell Wrapping in Interactive Report</title><link>http://minhtech.com/oracle/oracle-apex-prevent-cell-wrapping-in-interactive-report/</link> <comments>http://minhtech.com/oracle/oracle-apex-prevent-cell-wrapping-in-interactive-report/#comments</comments> <pubDate>Fri, 27 Apr 2012 17:47:20 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=1193</guid> <description><![CDATA[Here is how to prevent cells from wrapping in an interactive report in Oracle Application Express (APEX).]]></description> <content:encoded><![CDATA[<p>Here is how to prevent cells from wrapping in an interactive report in Oracle Application Express (APEX).</p><h3>Cascading Style Sheet Definition:</h3><p
class="code"> &#60;style type=&#34;text/css&#34;&#62;<br
/> &#160;&#160;&#160;table.apexir_WORKSHEET_DATA td {<br
/> &#160;&#160;&#160;&#160;&#160;&#160;white-space:nowrap;<br
/> &#160;&#160;&#160;}<br
/> &#60;/style&#62;</p><p>Go to the <b>Region Definition</b> of the interactive report. In the <b>Header and Footer</b> section, place the above Cascading Style Sheet (CSS) definition in the <b>Region Header</b>.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/oracle/oracle-apex-prevent-cell-wrapping-in-interactive-report/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fedora Linux 16 Install PPTP VPN Server PPTPD</title><link>http://minhtech.com/linux/fedora-linux-16-install-pptp-vpn-server-pptpd/</link> <comments>http://minhtech.com/linux/fedora-linux-16-install-pptp-vpn-server-pptpd/#comments</comments> <pubDate>Tue, 24 Apr 2012 01:33:05 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Linux]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=1145</guid> <description><![CDATA[Install and configure a PPTP VPN server on Fedora Linux 16 or CentOS 5.]]></description> <content:encoded><![CDATA[<p>Install and configure a PPTP VPN server on Fedora Linux 16 or CentOS 5. I chose PPTP VPN over OpenVPN because 1) it is easy to set up and 2) there are native, built-in clients for Windows, Mac, and iOS devices (i.e. iPhone and iPad).</p><h3>First, Install PPTPD:</h3><p
class="code">> <span
class="input">rpm -Uhv http://poptop.sourceforge.net/yum/stable/<span
class="codered">fc16</span>/pptp-release-current.noarch.rpm</span><br
/> > <span
class="input">yum install pptpd</span></p><p>As root, add the Poptop stable repository for Fedora Linux 16 and install the pptpd package. For CentOS 5, substitute <b>fc16</b> with <b>rhel5</b>.</p><h3>Configure PPTPD:</h3><p
class="code">> <span
class="input">vi /etc/pptpd.conf</span><br/><br
/> localip <span
class="codered">111.111.111.111</span><br
/> remoteip 10.10.1.2-254<br/><br
/> > <span
class="input">cat /etc/resolv.conf</span><br/><br
/> nameserver <span
class="codered">222.222.222.222</span><br
/> nameserver <span
class="codered">333.333.333.333</span><br/><br
/> > <span
class="input">vi /etc/ppp/options.pptpd</span><br/><br
/> ms-dns <span
class="codered">222.222.222.222</span><br
/> ms-dns <span
class="codered">333.333.333.333</span><br/><br
/> refuse-mschap<br
/> require-mschap-v2<br
/> require-mppe-128<br
/> require-mppe</p><p>First, edit the <b>/etc/pptpd.conf</b> file. <b>localip</b> is the server&#8217;s IP address (or the address that the remote clients will connect to). List the server&#8217;s IP address with the <span
class="command">ifconfig</span> command. <b>remoteip</b> is the range of internal IP addresses that the PPTP VPN server will assign to the remote clients as they connect to the VPN.</p><p>Next list the contents of the <b>/etc/resolv.conf</b> file to discover the DNS addresses that the server is using. Then edit the <b>/etc/ppp/options.pptpd</b> file and change the <b>ms-dns</b> entries to match those DNS addresses. Or use the OpenDNS addresses 208.67.220.220 and 208.67.222.222. Before closing the file, also edit the authentication protocols as listed above.</p><h3>Configure Clients:</h3><p
class="code">> <span
class="input">vi /etc/ppp/chap-secrets</span><br/><br
/> <span
class="codered">mnguyen</span> pptpd <span
class="codered">password1</span> *<br
/> <span
class="codered">snguyen</span> pptpd <span
class="codered">password2</span> *</p><p>Add the username, server, password, and allowable IP addresses for each client. This example uses a wildcard to allow both clients to connect to the PPTP VPN server from any IP address.</p><h3>Enable Packet forwarding:</h3><p
class="code">> <span
class="input">vi /etc/sysctl.conf</span><br/><br
/> net.ipv4.ip_forward = 1<br/><br
/> > <span
class="input">sysctl -p</span></p><p>Edit the <b>/etc/sysctl.conf</b> file to allow packet forwarding and enable it immediately with the <span
class="command">sysctl -p</span> command.</p><h3>Modify Default MTU:</h3><p
class="code">> <span
class="input">vi /etc/ppp/ip-up</span><br/><br
/> ifconfig $1 mtu 1400</p><p>Modify the default MTU to enable live chat and other services to run via the PPTP VPN server. Add the <b>ifconfig $1 mtu 1400</b> line before the <b>exit 0</b> line in the file.</p><h3>Configure iptables:</h3><p
class="code">> <span
class="input">iptables -A INPUT -i <span
class="codered">p3p1</span> -p tcp &#45;&#45;dport 1723 -j ACCEPT</span><br
/> > <span
class="input">iptables -A INPUT -i <span
class="codered">p3p1</span> -p gre -j ACCEPT</span><br
/> > <span
class="input">iptables -A FORWARD -i ppp+ -o <span
class="codered">p3p1</span> -j ACCEPT</span><br
/> > <span
class="input">iptables -A FORWARD -i <span
class="codered">p3p1</span> -o ppp+ -j ACCEPT</span><br
/> > <span
class="input">iptables -A OUTPUT -p tcp &#45;&#45;dport 1723 -j ACCEPT</span><br
/> > <span
class="input">iptables -A OUTPUT -p gre -j ACCEPT</span><br
/> > <span
class="input">iptables -t nat -A POSTROUTING -o <span
class="codered">p3p1</span> -j MASQUERADE</span></p><p>Add the above rules to allow connections to the PPTP VPN server through the firewall. <b>p3p1</b> is the interface and may be eth0, eth1, venet0, etc.</p><p>For a <a
href="http://buyvm.net/">BuyVM</a> OpenVZ virtual private server (VPS) running CentOS 5, substitute the <b>iptables -t nat -A POSTROUTING -o p3p1 -j MASQUERADE</b> line with <b>iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j SNAT &#45;&#45;to-source 999.999.999.999</b> instead (where 999.999.999.999 is the internal IP address provisioned for the VPS).</p><h3>Finally, Start PPTPD:</h3><p
class="code">> <span
class="input">service pptpd start</span><br
/> > <span
class="input">chkconfig &#45;&#45;level 2345 pptpd on</span><p/> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/linux/fedora-linux-16-install-pptp-vpn-server-pptpd/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <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>2</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>1</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>1</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>10</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>4</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> </channel> </rss>