<?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>[protofusion] &#187; Quick Tips</title>
	<atom:link href="http://protofusion.org/wordpress/category/quick-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://protofusion.org/wordpress</link>
	<description>Generally Interesting</description>
	<lastBuildDate>Thu, 26 Aug 2010 03:54:01 +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>JavaScript &#8220;Current Filename&#8221; Function</title>
		<link>http://protofusion.org/wordpress/2010/07/javascript-current-filename-function/</link>
		<comments>http://protofusion.org/wordpress/2010/07/javascript-current-filename-function/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:01:18 +0000</pubDate>
		<dc:creator>Ethan Zonca</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://protofusion.org/wordpress/?p=621</guid>
		<description><![CDATA[I found the need to get the current filename, without the file extension, of a webpage using javascript. I thought ]]></description>
			<content:encoded><![CDATA[<p>I found the need to get the current filename, without the file extension, of a webpage using javascript. I thought there would be an easy way with jQuery, but I found a good way to do it in plain javascript. I made a quick function to take care of this task that might save you some time, the compressed version is shown below. I&#8217;ll add a more human-readable version in the near future.</p>
<pre class="brush: jscript;">
function getCurrentFile() {
  var filename = document.location.href;
  var tail = (filename.indexOf(&quot;.&quot;, (filename.indexOf(&quot;.edu&quot;)+1)) == -1) ? filename.length : filename.lastIndexOf(&quot;.&quot;);
  return (filename.lastIndexOf(&quot;/&quot;) &gt;= (filename.length - 1)) ? (filename.substring( filename.substring(0, filename.length - 2).lastIndexOf(&quot;/&quot;)+1, filename.lastIndexOf(&quot;/&quot;))).toLowerCase() : (filename.substring(filename.lastIndexOf(&quot;/&quot;)+1, tail)).toLowerCase();
}
</pre>
<p>This function returns the current filename (minus the file extension) in all lower-case. Feel free to modify it to suit your needs. It also works properly even when a URL does not have a file extension (such as with some asp-based sites), or when there is no filename present (returns the folder name). This function is great for highlighting menu items based on which page the user is currently browsing. If you don&#8217;t understand some of the syntax, note that I&#8217;m using javascript&#8217;s conditional syntax as shorthand for if/else statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://protofusion.org/wordpress/2010/07/javascript-current-filename-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting .MTS video files into .mp4 files</title>
		<link>http://protofusion.org/wordpress/2010/07/converting-mts-video-files-into-mp4-files/</link>
		<comments>http://protofusion.org/wordpress/2010/07/converting-mts-video-files-into-mp4-files/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 04:34:04 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[avidemux]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://protofusion.org/wordpress/?p=568</guid>
		<description><![CDATA[I have a Canon HF200 video camera and it outputs HD video, but it&#8217;s in .MTS file format. This is ]]></description>
			<content:encoded><![CDATA[<p><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/convert-mts-to-mp4.jpg" rel="lightbox[568]"><img class="alignnone size-large wp-image-615" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/convert-mts-to-mp4-500x206.jpg" alt="" width="500" height="206" /></a></p>
<p>I  have a Canon HF200 video camera and it outputs HD video, but it&#8217;s in  .MTS file format. This is a pain because there are no good free video  converters or editors for .MTS files. But using <a href="http://fixounet.free.fr/avidemux/download.html" target="_blank">Avidemux</a>, an open-source video converter, I was able to  edit and convert my video to .mp4 while keeping my sanity and my money.</p>
<p><span id="more-568"></span>If you know your way around avidemux, pay attention to black colored text.</p>
<p>If you need extra help along the way, or I have something pointless to say, it will be in <span style="color: #999999;">gray<span style="color: #000000;">.</span></span></p>
<h3>1 &#8211; Open the File</h3>
<p><span style="color: #999999;">The first thing you have to do is import your video into Avidemux by one of two methods:</span></p>
<p><span style="color: #999999;">1) file &#8211;&gt; open &#8211;&gt; your-video.MTS</span></p>
<p><span style="color: #999999;">2) drag and drop the video file into avidemux</span></p>
<p><span style="color: #999999;">A dialog will appear saying, &#8220;This looks like MPEG, Do you want to index it?&#8221;&#8230; say &#8220;yes&#8221;</span></p>
<p><span style="color: #999999;">Avidemux will then tell you that it has detected H.264, say &#8220;yes&#8221;  to it&#8217;s other mode.</span></p>
<h3><span style="color: #999999;"><span style="color: #000000;">2 &#8211; Set Encoding Options</span><br />
</span></h3>
<p><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/MPEG-4-AVC2.jpg" rel="lightbox[568]"><img class="size-full wp-image-570 alignnone" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/MPEG-4-AVC2.jpg" alt="" width="124" height="237" /></a></p>
<p>For the Video encoder you should use MPEG-4 AVC</p>
<p>For Audio I recommend AAC (Faac) and a bitrate of 192, <span style="color: #999999;">(I&#8217;ll tell you right now AC3 does NOT work with youtube).</span></p>
<p><span style="color: #999999;"><span style="color: #000000;">Use mp4 for the encapsulation <span style="color: #999999;">(not avi like in the above pic).</span></span><br />
</span></p>
<p><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/HQmp4.jpg" rel="lightbox[568]"><img class="size-full wp-image-576 alignnone" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/HQmp4.jpg" alt="" width="180" height="210" /></a><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/HQmp4_1.jpg" rel="lightbox[568]"><img class="size-full wp-image-577  alignnone" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/HQmp4_1.jpg" alt="" width="180" height="210" /></a></p>
<p>Configure &#8211;&gt; General</p>
<p style="padding-left: 30px;">Use CRF (Constant Rate Factor) around 16 &#8211; 20. A CRF of 16  produces a larger file size; the higher the number, the less the  quality and file size.</p>
<p>Configure &#8211;&gt; Motion</p>
<p style="padding-left: 30px;">Use UHS (Uneven Hexagonal Search) and SR (Subpixel Refinement) of  9 for  best results.</p>
<h3>3 &#8211; Fix Frame Rate  Issues</h3>
<p>Here is where everyone has the problem of &#8220;Why is the video half speed!?&#8221;</p>
<p><span style="color: #999999;">Well, that&#8217;s because avidemux doesn&#8217;t like you, and that <span style="color: #000000;">A</span></span>videmux decided to treat the predictive and reference frames differently.</p>
<p>The way I fixed this was to double the video frame rate:</p>
<p>Main menu &#8211;&gt; Video &#8211;&gt; Frame Rate</p>
<p><span style="color: #999999;">According to my TI-89, 29.97 * 2 = </span>59.94<span style="color: #999999;"> (or I just did it in my head, but think the 89 is a powerful tool, especially if you&#8217;re an electrical engineer)</span></p>
<p><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/frame-rate1.jpg" rel="lightbox[568]"><img class="size-full wp-image-578 alignnone" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/frame-rate1.jpg" alt="" width="266" height="174" /></a></p>
<p><span style="color: #999999;">Well&#8230; now your video is the right speed&#8230; but why is the file so large?</span></p>
<p><span style="color: #999999;">Go to video filters, transform &#8211;&gt; </span>Resample fps <span style="color: #999999;">(</span>back to 29.97<span style="color: #999999;">).</span></p>
<p><a href="http://protofusion.org/wordpress/wp-content/uploads/2010/07/filters.jpg" rel="lightbox[568]"><img class="size-full wp-image-574 alignnone" src="http://protofusion.org/wordpress/wp-content/uploads/2010/07/filters.jpg" alt="" width="400" height="249" /></a></p>
<p><span style="color: #999999;">Yeah, I know, I went extra wide screen with my video, so I feel like a ninja when I watch it, big deal.</span></p>
<p>I used other filters as well to reduce the resolution and trim the unneeded parts of the video to save space.</p>
<h3>4 &#8211; Save the Video</h3>
<p>File &#8211;&gt; Save &#8211;&gt; Save Video</p>
<p><span style="color: #999999;">Make sure you use the .mp4 extension.</span></p>
<p><span style="color: #999999;"><span style="color: #000000;">That&#8217;s all, enjoy your well-compressed .mp4 video!</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://protofusion.org/wordpress/2010/07/converting-mts-video-files-into-mp4-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insurgency: Access your linux box from anywhere</title>
		<link>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/</link>
		<comments>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 07:33:15 +0000</pubDate>
		<dc:creator>Ethan Zonca</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[insurgent]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[port-forwarding]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://protofusion.org/wordpress/?p=184</guid>
		<description><![CDATA[The problem: you have a computer sitting behind a firewall. You want to access it from a different location, but ]]></description>
			<content:encoded><![CDATA[<p><img class="size-full   alignnone" title="Networking" src="http://protofusion.org/wordpress/wp-content/uploads/2009/12/3834148667_ceeeb12b4a_b.jpg" alt="Routers :: Credit: flicr user stars6" width="438" height="208" /></p>
<p>The problem: you have a computer sitting behind a firewall. You want to access it from a different location, but you don&#8217;t have the ability to forward any ports to it. The answer: SSH tunneling.<br />
<span id="more-184"></span><br />
<h2>The Solution</h2>
<p>Using an SSH tunnel, you can reverse-forward ports from one computer to another. To do this, you will need a computer running linux and <a href="http://openssh.org/">sshd</a> to reverse-forward the ports to. It is very convenient if this is the computer you will be using to access the remote machine. Otherwise, additional steps must be taken.</p>
<h2>The Setup</h2>
<p>The easiest way to set up and maintain a reverse port-forwarding tunnel is with ohnobinki&#8217;s <a href="http://ohnopublishing.net/hg/insurgent" target="_blank">insurgent</a> script. The script allows you to specify a remote host and the ports you want to reverse-forward. To start off, create a new user on your system, such as <tt>insurgent</tt>. Log in or start a shell as this user. Assuming you have <a href="http://mercurial.selenic.com/">mercurial</a> installed, run:</p>
<blockquote><p><code>hg clone https://ohnopublishing.net/hg/insurgent</code></p></blockquote>
<p>Now cd to the newly created insurgent/bin directory. Finally, place the contents of insurgent/share/contab.txt into your crontab (use <tt>crontab -e</tt> to edit your crontab).</p>
<p>Now you simply need to configure the script. To do so, open insurgent.sh in your favorite editor, and update the REMOTE_HOST and other variables. The format for ports is [remoteport]:hostname:[localport] (<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&#038;sektion=1#TCP+FORWARDING">ssh(1)</a> ). I recommend starting with reverse-fowarding SSH (port 22), a vnc session (590x where x is the VNC display number), and nfs.</p>
<p>If you have not done so already, you need to set up <a href="/wordpress/2009/12/quick-and-easy-passwordless-public-key-auth/">passwordless public key authentication</a> for the new <tt>insurgent</tt> user.</p>
<h2>You&#8217;re Done!</h2>
<p>If you&#8217;ve gotten this far, you may be ready to go. You should be able to access any port on your insurgent box via the corresponding port on your local box. Have any problems? Drop some comments below or pop into <a href="irc://irc.ohnopub.net/protofusion">irc.ohnopub.net#protofusion</a> and speak to <tt>ohnobinki</tt> or <tt>normaldotcom</tt>.</p>
<h6>Image credit: <a href="http://www.flickr.com/star6" target="_blank">star6</a>. Used under Creative Commons <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/">CC BY-SA 2.0</a></h6>
]]></content:encoded>
			<wfw:commentRss>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Quit Messages in IRC</title>
		<link>http://protofusion.org/wordpress/2009/08/quit-messages-irc/</link>
		<comments>http://protofusion.org/wordpress/2009/08/quit-messages-irc/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 03:12:57 +0000</pubDate>
		<dc:creator>Ethan Zonca</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[etiquette]]></category>
		<category><![CDATA[irc]]></category>

		<guid isPermaLink="false">http://protofusion.org/wordpress/?p=54</guid>
		<description><![CDATA[Ever exited out of IRC without telling people why? Don&#8217;t know how to tell people why you&#8217;re leaving? Then you ]]></description>
			<content:encoded><![CDATA[<p>Ever exited out of IRC without telling people why? Don&#8217;t know how to tell people why you&#8217;re leaving? Then you need to use quit messages. Really. It&#8217;s just annoying to see people randomly leave with no reasoning.</p>
<p><span id="more-54"></span>By default, when you exit most IRC clients (including pidgin), the quit message will look something like &#8220;normaldotcom has quit (Quit: normaldotcom).&#8221; The preferred way to exit out of a channel or an IRC session is using the /quit IRC command. It&#8217;s pretty simple, just type &#8220;/quit leaving to do something in real life with real people.&#8221; This will notify others of your departure, and your reasoning for doing so. It&#8217;s just a lot nicer and a lot less annoying. Practice proper IRC etiquette and use /quit !</p>
]]></content:encoded>
			<wfw:commentRss>http://protofusion.org/wordpress/2009/08/quit-messages-irc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Quieting computer fans</title>
		<link>http://protofusion.org/wordpress/2009/08/quick-tip-quieting-computer-fans/</link>
		<comments>http://protofusion.org/wordpress/2009/08/quick-tip-quieting-computer-fans/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 04:31:36 +0000</pubDate>
		<dc:creator>Ethan Zonca</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[quick tip]]></category>

		<guid isPermaLink="false">http://protofusion.org/wordpress/?p=49</guid>
		<description><![CDATA[Does your computer sound like a supersonic jet somehow hovering directly over your workspace? Does your computer make odd scraping ]]></description>
			<content:encoded><![CDATA[<p>Does your computer sound like a supersonic jet somehow hovering directly over your workspace? Does your computer make odd scraping noises, often accompanied by random crashes? Check out this [protofusion] quick tip.</p>
<p><span id="more-49"></span>Classify the problem: Are your fans loud or do they make scraping noises?</p>
<h2>Scraping Noises</h2>
<p>Scraping noises are often caused by bad bearings, whether it be an oil-sleeve bearing or a ball bearing. Take the label off of your fan, if you see a bearing surrounding the shaft, then you do NOT have an oil-sleeve bearing.</p>
<p>Oil sleeve bearings: Place one drop of light oil (sewing machine oil works quite well) on the spindle, replace the label, and let the fan run for a few minutes. Do not over-oil. If the fan is still noisy, remove the clip from the end of the shaft (if present) and detach the fan blades from the coil/case assembly. Ensure that the spindle and sleeve are clean, then re-assemble and oil.</p>
<p>Ball bearings: Place 1-2 drops of oil on the bearing(s). This may have limited success. If it fails, you can try flushing the bearings with oil, drying with paper towel, then putting on a single drop of oil.</p>
<h2>Loud</h2>
<p>Have loud fans? Chances are you need to just replace them or throttle them.</p>
<p>Throttling: Check out your bios for settings related to &#8220;Quiet n Cool&#8221; (for AMD CPU fan throttling) and PWM settings for other 3-pin fans on your system. Don&#8217;t have the options or 3-pin fans? Throttling can be done manually with rheostats and resistors, just make sure you don&#8217;t over heat your system.</p>
<p>Replacement: Check out eBay or your local junk drawer for any fans that may work as decent replacements. Feel free to use overly large fans on small heatsinks, such as northbridges; if positioned correctly, these may render decent results. <em>Warning: Don&#8217;t try this with graphics card heatsinks, as they get much hotter than the average northbridge under load. </em>For case fans, try and get larger (120mm) fans if your case accommodates them. Larger == less rpm == less noise + good airflow.</p>
<p>Any questions, comments, or criticism? Feel free to leave some comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://protofusion.org/wordpress/2009/08/quick-tip-quieting-computer-fans/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
