<?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>Echo.2 &#187; hacking</title>
	<atom:link href="http://blogs.infoecho.net/echo/tag/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.infoecho.net/echo</link>
	<description>ping and pong in the ocean of network</description>
	<lastBuildDate>Sat, 29 May 2010 06:00:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to save PDF/Images from Mobile Safari to WebDAV compatible iPhone program?</title>
		<link>http://blogs.infoecho.net/echo/2009/06/27/how-to-save-pdfimages-in-directly-lfrom-mobile-safari-to-webdav-compatible-iphone-program/</link>
		<comments>http://blogs.infoecho.net/echo/2009/06/27/how-to-save-pdfimages-in-directly-lfrom-mobile-safari-to-webdav-compatible-iphone-program/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 17:37:43 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/2009/06/how-to-save-pdfimages-in-directly-lfrom-mobile-safari-to-webdav-compatible-iphone-program/</guid>
		<description><![CDATA[Unlike most desktop browser, there is no &#8220;download&#8221; option to save an image, a PDF file, etc., from the Mobile Safari so one can read thoses files offline. Well, this is purely a restriction imposed by Apple for security or whatever other stupid reasons.  Fortunately, with the most recent update of the operation that [...]]]></description>
			<content:encoded><![CDATA[<p>Unlike most desktop browser, there is no &#8220;download&#8221; option to save an image, a PDF file, etc., from the Mobile Safari so one can read thoses files offline. Well, this is purely a restriction imposed by Apple for security or whatever other stupid reasons.  Fortunately, with the most recent update of the operation that support cut and paste and some third party WebDAV compatible file viewer, there could have a workaround.</p>
<p>I have recently set up a system such that when I found an interesting URL, I can cut and paste the URL to a widget served from my own host such that it will fetch the resource from the URL, and save it to a location that corresponds to the location of a WebDAV service in my web host account. Then, I can setup the WebDAV compatible file viewer (currently, I am using Air Share Pro) to view the file in my WebDAV direcotry.  Specially, you can also download the files in the WevDAV server locally for future offline reading. This is extreme useful. Once the file is local, you don&#8217;t have to worry if you get wifi, EDGE, or 3G signal, and you might also save some battery power since you don&#8217;t have to reload the files from the network when you read a document on and off.</p>
<p>The main caveat is that you probably need your own web hosting service or iDisk that supports WebDAV. Beside that, you will need to some simple CGI/AJAX programming and spend some money to buy a WebDAV compatible file viewer like Air Share Pro. I won&#8217;t be surprised that one day there will be an iPhone app that implements something like this using a similar idea in a more polished way. Nevertheless, such application is always at Apple&#8217;s mercy. Once Apple opens some policy in the OS allowing sharing data and files between application like an real operation system, all workarounds will be totally useless. Wait, actually, the way I set up getting file to iPhone is not limited for submitting URL from Mobile Safari. Any browser can push the resource from an URL to the WebDAV directory, regradless if an desktop OS supports mounting a WebDAV volumn.  Not bad as an quick method to get some useful document in the Internet from a desktop system to iPhone.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2009/06/27/how-to-save-pdfimages-in-directly-lfrom-mobile-safari-to-webdav-compatible-iphone-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Safari on iPhone to read CHM file</title>
		<link>http://blogs.infoecho.net/echo/2007/09/23/using-safari-on-iphone-to-read-chm-file/</link>
		<comments>http://blogs.infoecho.net/echo/2007/09/23/using-safari-on-iphone-to-read-chm-file/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 01:55:49 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=103</guid>
		<description><![CDATA[iPhone is a fancy toy with a lot of power but Apple deliberately locks a lot of the potential power. One thing I like to do on an iPhone is to be able to read CHM files. As a weekend project, I setup the tool chain for iPhone following the instructions. Then, I grabbed the [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone is a fancy toy with a lot of power but Apple deliberately locks a lot of the potential power. One thing I like to do on an iPhone is to be able to read CHM files. As a weekend project, I setup the tool chain for iPhone following <a href="http://code.google.com/p/iphone-dev/wiki/Building">the instructions</a>. Then, I grabbed the source code of <a href="http://www.jedrea.com/chmlib/"><tt>chmlib</tt></a>. With some minor modification, I was able to compile the <tt>chmlib</tt> as an iPhone binary library. That was very encouraging.</p>
<p>This provides a convenient way to make iPhone as a CHM reader. In the <tt>chmlib</tt> source code distribution, there is an example program that runs as a http-server that serves the content of a CHM as standard web page. The &#8220;mobileSafari&#8221; has no problem to render the results, but the fonts are usually too small to read and the text is typically rendered too wide such that a lot horizontal scrolling becomes annoyingly necessary.</p>
<p>I decided to combine some python code with the <tt>chm_http</tt> server from the <tt>chmlib</tt> source code. I modified the source code of <tt>chm_http</tt> so it can call python code to modify the HTML code in the CHM file, replacing the original CSS with new setting for reading on small screen. Furthermore, I found it was tedious to start the <tt>chm_http</tt> from a terminal every time when you want to read a different book. I wrote another small python script that can scan a directory and find all CHM files in the directory to output an index html page. At the end, I was able to use the mobileSafari pointing to the index page and select the book I want to read. The &#8220;chm_http&#8221; server would start automatically to get the book I like to read.</p>
<p>If you are interested in reading CHM on your iPhone. Get this <a href="http://infoecho.net/files/iphoneCHM.tgz">iphoneCHM.tgz</a> <strike>(the file would be upload soon)</strike>. Copy the &#8220;<tt>chm_http2</tt>&#8220;, &#8220;<tt>rewriteHTML.py</tt>&#8220;, and &#8220;<tt>CHMServer</tt>&#8221; to &#8220;<tt>/usr/local/bin/</tt>&#8221; in your iPhone. Change the permission of these files such that you can run all of them. Put some chm files in <tt>/var/root/Media/CHM_Ebooks/</tt>. Open a terminal in the iPhone or ssh into the iPhone to run &#8220;CHMServer&#8221;. After that, ask the Safari to open this URL <tt>http://127.0.0.1:8000</tt>. You should see the links to the CHM files. You can now click on any of them and enjoy a nice reading time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2007/09/23/using-safari-on-iphone-to-read-chm-file/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Diggs in a box</title>
		<link>http://blogs.infoecho.net/echo/2007/02/12/diggs-in-a-box/</link>
		<comments>http://blogs.infoecho.net/echo/2007/02/12/diggs-in-a-box/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 06:03:58 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[treemap]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=93</guid>
		<description><![CDATA[I have been a fan of the &#8220;treemap&#8221; algorithm to visualize data with tree-like structure .  Finally, I decide to implement one last Friday noon. After a few hours, I had a basic Treemap class in python.  When I was testing the class, I found the algorithm can generate some interesting artistic painting [...]]]></description>
			<content:encoded><![CDATA[<p>I have been a fan of the <a href="http://en.wikipedia.org/wiki/Treemap">&#8220;treemap&#8221; algorithm</a> to visualize data with tree-like structure .  Finally, I decide to implement one last Friday noon. After a few hours, I had a basic Treemap class in python.  When I was testing the class, I found the algorithm can generate some interesting <a href="http://www.flickr.com/photos/orcas/385329660/">artistic painting effect</a>.
<p>The following is a composition using the <a href="http://www.geneontology.org">Gene Ontology</a>. I guess this is one of the many ways to visualize the so-called Systems Biology.  You can also click on the image to see some other randomly generated compositions.<br />
<a href="http://infoecho.net/TreemapArt/"><br />
<img src="http://infoecho.net/blogs/echo/wp-content/uploads/2007/02/Picture%202.jpg" height="251" width="350" border="1" hspace="4" vspace="4" alt="Picture 2" /></a>
</p>
<p>Inspired by <a href="http://www.marumushi.com/apps/newsmap/newsmap.cfm">Newsmap</a>, I tried to see if I can use the python Treemap class and some javascript to map <a href="http://www.digg.com">Diggs</a> to a treemap. So, I spent a few hours in the last weekend making this little toy &#8212; <a href="http://infoecho.net/Sandbox/DiggsInABox.py">Diggs in A Box</a>.<br />
<a href="http://infoecho.net/Sandbox/DiggsInABox.py"><br />
<img src="http://infoecho.net/blogs/echo/wp-content/uploads/2007/02/Picture%203.jpg" height="228" width="350" border="1" hspace="4" vspace="4" alt="Picture 3" />
</p>
<p></a><br />
It is rather primitive now and I can think a long TODO list to improve it. Hopefully, I will get some time to improve its functionality and appearance eventually. If you have any suggestions, please leave a message and I hope you find such presentation of data interesting and useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2007/02/12/diggs-in-a-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Snippet for Converting Longitude and Latitude to Google Image Tiles URI</title>
		<link>http://blogs.infoecho.net/echo/2007/02/05/code-snippet-for-converting-longitude-and-latitude-to-google-image-tiles-uri/</link>
		<comments>http://blogs.infoecho.net/echo/2007/02/05/code-snippet-for-converting-longitude-and-latitude-to-google-image-tiles-uri/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 01:59:15 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=91</guid>
		<description><![CDATA[This function in javascript returns the X and Y used to fetch google map tiles by giving the longitude and latitude.

function getXYfromLatLon(lat, lon, zoomLevel) {
  var lon = 180.0 + lon;
  var x = Math.floor( (lon / 360.0) * 131072 ); /* 2^17 = 131072 */
  x >>= zoomLevel;

  var lat [...]]]></description>
			<content:encoded><![CDATA[<p>This function in javascript returns the X and Y used to fetch google map tiles by giving the longitude and latitude.</p>
<pre>
function getXYfromLatLon(lat, lon, zoomLevel) {
  var lon = 180.0 + lon;
  var x = Math.floor( (lon / 360.0) * 131072 ); /* 2^17 = 131072 */
  x >>= zoomLevel;

  var lat = lat / 180.0 * 3.1415926
  var y = Math.PI - 0.5 * Math.log((1+Math.sin(lat))/(1-Math.sin(lat)))
  y = Math.floor( (y / 2 / Math.PI) * 131072 );
  y >>= zoomLevel;
  return new Array(x,y);
}
</pre>
<p>This function returns the string used to fetch the satellite image tiles by give the X and Y from the <tt>getXYfromLatLon()</tt>.</p>
<pre>
function getImageTileStrFromXY(x, y, zoomLevel) {
    var quarter2letter = new Array("q","r","t","s");
    var rtnStr = "t"
    for (i=16-zoomLevel; i>=0; i--) {
        var quarter =
        (x &#038; (1 < < i)) >> i | ( ((y &#038; (1 < < i)) >> i) < < 1 );
        rtnStr += quarter2letter[quarter];
    }
    return rtnStr;
}
</pre>
</pre>
<p>Simple usage:</p>
<pre>
&#60;script language="javascript"&#62;
var lon = -122;
var lat = 37;
var zl =3;

var XY = getXYfromLatLon(lat, lon, zl);
document.getElementById('img1').src=
"http://mt0.google.com/mt?v=w2.61&#038;x="+XY[0]+"&#038;y="+XY[1]+"&#038;zoom="+zl;

var tileStr = getImageTileStrFromXY(XY[0], XY[1], zl);
document.getElementById('img2').src=
"http://kh0.google.com/kh?&#038;v=20&#038;t="+tileStr;
&#60;/script&#62;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2007/02/05/code-snippet-for-converting-longitude-and-latitude-to-google-image-tiles-uri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Block web ad</title>
		<link>http://blogs.infoecho.net/echo/2007/01/29/block-web-ad/</link>
		<comments>http://blogs.infoecho.net/echo/2007/01/29/block-web-ad/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 19:16:14 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=87</guid>
		<description><![CDATA[We are living in a world where ads are everywhere.  With powerful servers, web advertisement is ubiquitous.  Unfortunately, I think they are too intrusive most of time.  So, it is generally a good idea to disable the online ads.  For a free solution, there are several common techniques.  First, figure [...]]]></description>
			<content:encoded><![CDATA[<p>We are living in a world where ads are <a href="http://www.nytimes.com/2007/01/15/business/media/15everywhere.html?_r=1&#038;oref=slogin">everywhere</a>.  With powerful servers, web advertisement is ubiquitous.  Unfortunately, I think they are too intrusive most of time.  So, it is generally a good idea to disable the online ads.  For a free solution, there are several common techniques.  First, figure the ad servers&#8217; IP, and use <tt>/etc/hosts</tt> to send the ad request call into void.  Second, use a <a href="http://www.floppymoose.com/"><tt>userContent.css</tt></a> to filter out ads.  For example, if you don&#8217;t like the Google ads. You can put the following lines in your <tt>/etc/hosts</tt> (for OS X or other unix).</p>
<pre>
127.0.0.1   pagead.googlesyndication.com
127.0.0.1   pagead2.googlesyndication.com
127.0.0.1   domains.googlesyndication.com
127.0.0.1   googlesyndication.com
127.0.0.1   www.google-analytics.com
127.0.0.1   partner.googleadservices.com
</pre>
<p>For OS X, you will need to use the Terminal.app to run the command <tt>lookupd -flushcache</tt> to re-flush the DNS cache.</p>
<p>Now, with this setup, I am free from all mighty Google ads.  You can do the same to block other ad providers. Combined with the <tt>userContent.css</tt>, I have regain the nice web browsing experience without the interferences from ads.</p>
<p>I also find out that the Safari plugin <a href="http://fsbsoftware.com/">SafariBlock</a> can block images and flash ads in a convenient way.  Moreover, it can also block specific javascripts although you might have to type the URL pointing to the javascript in SafariBlock&#8217;s preferences by yourself.  For example, you can block the annoying in-text pop-out type ads from <a href="http://intellitxt.com/">Intellitext</a> by putting a new rule in the SafariBlock preferences to block out the URL &#8216;http://*.intellitxt.com/*.js&#8217;. This will block all javascript from Intellitext without disabling javascript totally.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2007/01/29/block-web-ad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building BOOST under OS X</title>
		<link>http://blogs.infoecho.net/echo/2006/10/12/building-boost-under-os-x/</link>
		<comments>http://blogs.infoecho.net/echo/2006/10/12/building-boost-under-os-x/#comments</comments>
		<pubDate>Fri, 13 Oct 2006 02:21:46 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=80</guid>
		<description><![CDATA[I have not programed in C/C++ for a while. For some reason, I think it is time for me to sharp my C++ knowledge again. I decide to install BOOST in my OS X laptop and start to get familiar with C++ and BOOST again. So, I downloaded the package, configure it and make. As [...]]]></description>
			<content:encoded><![CDATA[<p>I have not programed in C/C++ for a while. For some reason, I think it is time for me to sharp my C++ knowledge again. I decide to install BOOST in my OS X laptop and start to get familiar with C++ and BOOST again. So, I downloaded the package, configure it and make. As usual, &#8220;make&#8221; never works the first time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2006/10/12/building-boost-under-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mindstorm NXT, python wrap</title>
		<link>http://blogs.infoecho.net/echo/2006/09/05/mindstorm-nxt-python-wrap/</link>
		<comments>http://blogs.infoecho.net/echo/2006/09/05/mindstorm-nxt-python-wrap/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 09:34:44 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=77</guid>
		<description><![CDATA[I finally decide to get a set of Lego Mindstorm NXT. After built the first model, I was looking for a better way to program the NXT and a way to build bidirectional communication between the NXT and my powerbook. I wrote a simple python wrap to the direct command set. The NXT python class [...]]]></description>
			<content:encoded><![CDATA[<p>I finally decide to get a set of Lego Mindstorm NXT. After built the first model, I was looking for a better way to program the NXT and a way to build bidirectional communication between the NXT and my powerbook. I wrote a simple python wrap to the direct command set. The <a href="http://infoecho.net/files/NXT/">NXT python class</a> can be downloaded. It is very preliminary but it works. A separated script <a href="http://infoecho.net/files/NXT/nxt_download.py">nxt_download.py</a> can help to download rxe file to the NXT brick. I can now use NBC + my downloading script to program the NXT brick on my powerbook without using any GUI. Is that cool?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2006/09/05/mindstorm-nxt-python-wrap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create DMG Automator</title>
		<link>http://blogs.infoecho.net/echo/2006/07/23/create-dmg-automator/</link>
		<comments>http://blogs.infoecho.net/echo/2006/07/23/create-dmg-automator/#comments</comments>
		<pubDate>Sun, 23 Jul 2006 20:36:11 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=76</guid>
		<description><![CDATA[This is a simple bash script to create DMG under Finder.

  for f in &#8220;$@&#8221; do b=$(basename &#8220;$f&#8221;) d=$(dirname &#8220;$f&#8221;) hdiutil create -format UDZO -srcfolder &#8220;$f&#8221; &#8220;$d/$b.dmg&#8221; done

You can use this simple script combined with Automator such that you can create disk image files by selecting files or directories and using the Automator context [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple bash script to create DMG under Finder.</p>
<blockquote><p>
  for f in &#8220;$@&#8221; do b=$(basename &#8220;$f&#8221;) d=$(dirname &#8220;$f&#8221;) hdiutil create -format UDZO -srcfolder &#8220;$f&#8221; &#8220;$d/$b.dmg&#8221; done
</p></blockquote>
<p>You can use this simple script combined with Automator such that you can create disk image files by selecting files or directories and using the Automator context menu in Finder.</p>
<p>Automator setup</p>
<p><a href="./wp-content/200607231435.jpg" onclick="window.open('./wp-content/200607231435.jpg','popup','width=463,height=191,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://infoecho.net/blogs/echo/wp-content/200607231435-tm.jpg" height="100" width="242" border="1" hspace="4" vspace="4" alt="200607231435" /></a></p>
<p>
Usage:</p>
<p><a href="./wp-content/200607231435-1.jpg" onclick="window.open('./wp-content/200607231435-1.jpg','popup','width=453,height=429,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://infoecho.net/blogs/echo/wp-content/200607231435-1-tm.jpg" height="100" width="105" border="1" hspace="4" vspace="4" alt="200607231435-1" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2006/07/23/create-dmg-automator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix firewire HD problem on a powerbook</title>
		<link>http://blogs.infoecho.net/echo/2006/06/04/fix-firewire-hd-problem-on-a-powerbook/</link>
		<comments>http://blogs.infoecho.net/echo/2006/06/04/fix-firewire-hd-problem-on-a-powerbook/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 02:37:21 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=73</guid>
		<description><![CDATA[After re-organizing some of my daughter&#8217;s video and pictures, it is time to backup my whole user directory. Unfortunately, my PB failed to write to two different firewire HDs. The PB mounted the firewire HDs but it hanged when writing some files (I got such log: Jun 4 23:42:26 ECHO kernel[0]: disk1s3: I/O error.). At [...]]]></description>
			<content:encoded><![CDATA[<p>After re-organizing some of my daughter&#8217;s video and pictures, it is time to backup my whole user directory. Unfortunately, my PB failed to write to two different firewire HDs. The PB mounted the firewire HDs but it hanged when writing some files (I got such log: Jun 4 23:42:26 ECHO kernel[0]: disk1s3: I/O error.). At beginning, I though it was a problem of my firewire enclosure, but it happened on two external HD. I had to conclude the problem was on my PB. So, it was voodoo time. I zapped the PRAM, reseted NVRAM. Reboot, it behaved much better. At least it only hanged after finished copying my /User. This was the message I got in syslog.log</p>
<pre>
Jun  4 23:57:40 ECHO kernel[0]: FireWire (OHCI) Apple ID 31 built-in:
handleARxReqInt - ARx Request packet error, status = 0xe00002c7
</pre>
<p>Well, I unpluged the HD and re-pluged it back. It seemed working fine. I tested to write large files to the other HD, it also worked while it failed consistently before I had reseted the PRAM. So, I guess the problem is solved. I still don&#8217;t know what NVRAM has any thing to do with firewire.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2006/06/04/fix-firewire-hd-problem-on-a-powerbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress Canon A620 AVI and DV to H.264 mp4 file</title>
		<link>http://blogs.infoecho.net/echo/2006/05/31/compress-canon-a620-avi-and-dv-to-h264-mp4-file/</link>
		<comments>http://blogs.infoecho.net/echo/2006/05/31/compress-canon-a620-avi-and-dv-to-h264-mp4-file/#comments</comments>
		<pubDate>Wed, 31 May 2006 14:11:35 +0000</pubDate>
		<dc:creator>Jason Chin</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.infoecho.net/echo/?p=71</guid>
		<description><![CDATA[Just a memo for myself.
With mencoder, mplayer, ffmpeg and mp4box, I can finally reduce the size of the video files created from my Canon A620 to reasonable sizes such I can put them in my powerbook without depleting the hard drive space.
This is the script for converting AVI to mp4,

mencoder $1 \
-ovc x264 -nosound -ni [...]]]></description>
			<content:encoded><![CDATA[<p>Just a memo for myself.</p>
<p>With mencoder, mplayer, ffmpeg and mp4box, I can finally reduce the size of the video files created from my Canon A620 to reasonable sizes such I can put them in my powerbook without depleting the hard drive space.</p>
<p>This is the script for converting AVI to mp4,</p>
<pre>
mencoder $1 \
-ovc x264 -nosound -ni -sws 0 -x264encopts \
threads=1:me=2:qp_min=22:\
qp_max=51:i4x4:keyint=120:nocabac:deblock:nob_adapt \
-ofps 29.97 -vop harddup -of rawvideo \
-o $1.264

mplayer -vc dummy -vo null -ao pcm:file=$1.wav $1

ffmpeg -i $1.264 -i $1.wav -y -vn -f mp4 -acodec aac \
-ab 96 -ar 11025 -ac 2 -map 1.0:0.0 $1.aac.mp4

MP4Box -fps 29.97 -add $1.264 -add $1.aac.mp4 -new $1.mp4

rm $1.wav
rm $1.264
rm $1.aac.mp4
touch -r $1 $1.mp4
</pre>
<p>For convert DV to mp4, I use</p>
<pre>
ffmpeg -i $1 -y -vcodec h264 -f mp4 -acodec aac \
-deinterlace -b 1280 -aspect 4:3 -s 640x480 -naq \
-parti4x4 -deblock -copyts -keyint_min 120 -h264 1 \
-mv4 1 -bf 2 -coder 1 -parti4x4 -partp4x4 -parti8x8 \
partp8x8 $1.mp4touch -r $1 $1.mp4
</pre>
<p>The results seem pretty reasonable good, while the sizes are still under control.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infoecho.net/echo/2006/05/31/compress-canon-a620-avi-and-dv-to-h264-mp4-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
