<?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>CINAQ ~xiwen &#187; Mac OS X</title>
	<atom:link href="http://www.cinaq.com/wordpress/category/macosx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cinaq.com/wordpress</link>
	<description>Whistles and bells</description>
	<lastBuildDate>Sat, 22 Aug 2009 21:51:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Recovering data from corrupted partitiontable</title>
		<link>http://www.cinaq.com/wordpress/2009/01/recovering-data-from-corrupted-partitiontable/</link>
		<comments>http://www.cinaq.com/wordpress/2009/01/recovering-data-from-corrupted-partitiontable/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 17:15:26 +0000</pubDate>
		<dc:creator>xiwen</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[corrupt]]></category>
		<category><![CDATA[ext2]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[partitiontable]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[scandrive]]></category>
		<category><![CDATA[sfdisk]]></category>

		<guid isPermaLink="false">http://www.cinaq.com/wordpress/?p=11</guid>
		<description><![CDATA[The situation is very simple. It does not happen regularly, but if you do come across it you might find this post useful. Now quit the chit-chat. As the title already implies, my external HDD (harddrive), a Western Digital mybook 500GB with data ended up with a corrupted partitiontable. The story began like this: I [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The situation is very simple. It does not happen regularly, but if you do come across it you might find this post useful. Now quit the chit-chat. As the title already implies, my external HDD (harddrive), a Western Digital mybook 500GB with data ended up with a corrupted partitiontable.</p>
<p><span id="more-11"></span></p>
<p>The story began like this: I needed a hfs (Mac OS) to do some testing. I remember the first 3 partitions on my HDD functioned as test-subject during my <a href="https://i.cinaq.com/trac/amsonia">Amsonia adventures</a>. So I thought, why not merge these into one larger partition. In the beginning my HDD had this structure:</p>
<table>
<tr>
<td>
primary 1
</td>
<td>
swap
</td>
</tr>
<tr>
<td>
primary 2
</td>
<td>
fat32
</td>
</tr>
<tr>
<td>
primary 3
</td>
<td>
ext3
</td>
</tr>
<tr>
<td>
extended partition
</td>
<td>
-
</td>
</tr>
<tr>
<td>
logical 1
</td>
<td>
ext3
</td>
</tr>
<tr>
<td>
logical 2
</td>
<td>
ext3
</td>
</tr>
</table>
<p>This structure is then altered using <i>fdisk</i> and resulted in this state:</p>
<table>
<tr>
<td>
Free space
</td>
<td>
-
</td>
</tr>
<tr>
<td>
extended partition
</td>
<td>
-
</td>
</tr>
<tr>
<td>
logical 1
</td>
<td>
ext3
</td>
</tr>
<tr>
<td>
logical 2
</td>
<td>
ext3
</td>
</tr>
</table>
<p>So the process of freeing space was done beautifully. The data on my logical partitions remained intact as they should be. The next step would be of course connect the disc to the macbook and launch <i>Disk Utility</i> to create the partition and format it. I double checked it won&#8217;t touch the partitions by reviewing the options hidden in <i>options</i>. Everything seems fine, so let&#8217;s apply the changes&#8230;. and there comes the surprise: Disk utility failed to apply the changes and ejects the device.</p>
<p>Apparently Disk Utility did modify the partitiontable but failed to do it successfully. Here I am, my partitions inaccessible. A quick web-hunt resulted in trying out <i>gpart</i>. The process of scanning 500GB took around 10 hours to complete; the disc was connected over usb 2.0. Average readspeed was 16mb/s. When gpart was done scanning, it didn&#8217;t report anything useful. So the hunt continues till I stumbled against <a href="http://www.unixwiz.net/techtips/recovering-ext2.html">Recovering lost ext2 Linux filesystems</a>. After reading the article I decided to give their hand-crafted utility a try. <i>My article is written with the hope to add value to the information you&#8217;ve gathered. It should not be seen as a replacement! </i></p>
<p>After scanning the whole disc, Scandrive produces a ~2mb report. As the article indicates, lines of the following format might indicate partition start:<br />
<code><br />
ext2	432180492	# size=68095510 #0<br />
</code><br />
So, let&#8217;s filter out these interesting line with <i>grep</i>:<br />
<code><br />
grep -w "#0" /path/to/file<br />
</code><br />
The key here is to find a pattern in the less cluttered data. With pattern I mean consecutive large groups having the same size. All found groups are potential partitions, the first block of the group minus two might be the start of a partition. </p>
<p>Once you&#8217;ve gathered the offsets and sorted by group size, you can start trying to recreate the partitiontable (preferably one by one) using <i>sfdisk</i>.</p>
<p>Back to my situation, after some trial and error attempts I found <i>logical 1</i>, but the size appears to be incorrect. Because the system could only read that partition partially (some directories could not be read). So I decided to calculate the maximum size of my HDD and use it as the right-boundary. This allowed me to recover all files on <i>logical 1</i>. When the copying process was done, the second partition can also be found and treated in the same way. </p>
<p>You can define the boundaries (your new partitiontable structure) in a text file like this:<br />
<code><br />
# partition table of /dev/sdc<br />
unit: sectors</p>
<p>/dev/sdb1 : start=       432003978, size=544764087, Id=83<br />
</code><br />
Then write it to the disc using sfdisk:<br />
<code><br />
sfdisk -n /dev/YOURDEV < /path/to/new/pt<br />
</code><br />
If you think it is good, commit to disc:<br />
<code><br />
sfdisk --force /dev/YOURDEV < /path/to/new/pt<br />
</code><br />
Then try to mount the new partition. If mount bails out with an error, don't panic, continue trying other potential starting offsets.</p>
<p>Notice the start offset is calculated this way, say you found this line:<br />
<code><br />
ext2	432180492	# size=68095510 #0<br />
</code><br />
The start offset should be: 432180492-2 = 432180490<br />
You only have to do this for the first offset in a group!</p>
<p>The recovering adventure lasted 1.5 days with a happy ending. I've learned a lot during this process, I hope you find this information useful. Special thanks go to <i>Steve Friedl's Unixwiz.net Tech Tips</i>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cinaq.com/wordpress/2009/01/recovering-data-from-corrupted-partitiontable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian as nxserver and OS X tiger with nxclient (freeNX)</title>
		<link>http://www.cinaq.com/wordpress/2008/07/debian-as-nxserver-and-os-x-tiger-with-nxclient-freenx/</link>
		<comments>http://www.cinaq.com/wordpress/2008/07/debian-as-nxserver-and-os-x-tiger-with-nxclient-freenx/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 07:41:30 +0000</pubDate>
		<dc:creator>xiwen</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[nomachine]]></category>
		<category><![CDATA[nxclient]]></category>
		<category><![CDATA[nxserver]]></category>
		<category><![CDATA[qtnx]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[tiger]]></category>

		<guid isPermaLink="false">http://www.cinaq.com/wordpress/?p=9</guid>
		<description><![CDATA[Test-drive NX server free edition on a debian server and a client running OS X Tiger.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nomachine.com">No Machines</a> NX solution has been around for a while. It is an equivalent of RDP (remote desktop protocol in the MS windows world) which supports resumable sessions.  It opens the door the conventional X-protocol was not designed to operate on, which is efficient usage of bandwidth.<span id="more-9"></span></p>
<p><strong>Setup</strong> &#8211; The environment I tested consists of the following components:</p>
<ol>
<li>A server, in my case a Debian Etch</li>
<li>A client, mac OS X Tiger on a macbook</li>
<li>X11 on OS X</li>
<li><a href="http://www.nomachine.com/select-package.php?os=linux&amp;id=1">freenx server-3.2.0-13</a> from No Machine</li>
<li><a href="http://www.nomachine.com/download-client-macosx.php">nxclient-3.2.0-9</a>, there are other platforms.</li>
<li>A window manager on the server, I use e17 (see screenshot in the end)</li>
<li>In case you wonder, my connection is an Adsl 2+ with 14mbps down and 1mbps up.  Ping to the server under normal network load is 20ms.</li>
</ol>
<p><strong>Performance</strong> &#8211; &#8220;Wow&#8221;, that&#8217;s all I can say. The performance is just great! Compared to RDP, I think they are on the same level, or possibly better: the special effects (animations) in e17 worked flawlessly, the transitions were smooth. Flipping desktop had a little delay, not quite noticable though. During usage it uses approximately 20kb/s (kilobytes) of the pipe.</p>
<p><strong>Security</strong> &#8211; You shouldn&#8217;t worry about security as NX traffics are tunneled through SSH by default, hence you only need to open port 22 on the server side.</p>
<p><strong>QtNX</strong> &#8211; George Wright released a <a href="http://blog.gwright.org.uk/articles/2008/01/30/qtnx-for-mac-os-x-a-release">QT-based nxclient for OS X</a>. This is an alternative of nxclient if you dislike the X11-aqua-like interface components.</p>
<p><strong>Drawbacks</strong> &#8211; First is its X11 requirement, this means a lot of things; like no clip-board integration.  GDM (or any Desktop manager) doesn&#8217;t support NX (as of this writing). This can be worked around pretty easily with a wrapper (or I hope so). I&#8217;m considering to add it to my projects queue.</p>
<p><strong>Experiments</strong> &#8211; In the future some hard-benchmarks can prove freenx&#8217; competence. For now it has convinced me enough.</p>
<p><a href="http://www.cinaq.com/wordpress/wp-content/uploads/2008/07/picture-3.png"><img class="alignnone size-medium wp-image-10" title="e17 in nxclient" src="http://www.cinaq.com/wordpress/wp-content/uploads/2008/07/picture-3-300x187.png" alt="" width="300" height="187" /></a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cinaq.com/wordpress/2008/07/debian-as-nxserver-and-os-x-tiger-with-nxclient-freenx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take quick notes with Sidenote</title>
		<link>http://www.cinaq.com/wordpress/2008/06/take-quick-notes-with-sidenote/</link>
		<comments>http://www.cinaq.com/wordpress/2008/06/take-quick-notes-with-sidenote/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 22:38:34 +0000</pubDate>
		<dc:creator>xiwen</dc:creator>
				<category><![CDATA[Cool Apps]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://www.cinaq.com/wordpress/?p=5</guid>
		<description><![CDATA[The idea behind sidenote is very compelling. Although it integrates seamlessly into MacOS X, it doesn&#8217;t work properly when it is out of focus while having a third application covering the whole desktop (not full screen, maximize is the appropriate term). This is quite annoying because 90% of the time I work with programs that [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The idea behind <a title="Sidenote Official site" href="http://www.chatelp.org/?page_id=5">sidenote</a> is very compelling. Although it integrates <em>seamlessly</em> into MacOS X, it doesn&#8217;t work properly when it is out of focus while having a third application covering the whole desktop (not full screen, <em>maximize</em> is the appropriate term). This is quite annoying because 90% of the time I work with programs that take up the whole screen. The list of apps I tested with are: firefox 3, thunderbird 2 and iTunes.<span id="more-5"></span><a href="http://www.cinaq.com/wordpress/wp-content/uploads/2008/06/17654_scr.png"><img class="inlineimage" title="screenshot_sidenote" src="http://www.cinaq.com/wordpress/wp-content/uploads/2008/06/17654_scr.png" alt="Sidenote screenshot" width="225" height="202" /></a></p>
<p>Another not very pleasant behavior is that Sidenote also shows up in Expose. Even worse&#8230; as a static window without any meaning whatsoever. I&#8217;m not sure whether that was intended or was overlooked during implementation.</p>
<p>Until the author fixes these <em>small</em> glitches, I&#8217;ll pass. These are my verdict and insights. You can read why you should give it a try at <a title="via Tauw" href="http://www.tuaw.com/2008/06/19/sidenote-keeps-your-notes-on-the-side/">Tuaw</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cinaq.com/wordpress/2008/06/take-quick-notes-with-sidenote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon.com plugin for Corripio</title>
		<link>http://www.cinaq.com/wordpress/2008/06/amazoncom-plugin-for-corripio/</link>
		<comments>http://www.cinaq.com/wordpress/2008/06/amazoncom-plugin-for-corripio/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 15:48:13 +0000</pubDate>
		<dc:creator>xiwen</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[albums]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[cd covers]]></category>
		<category><![CDATA[corripio]]></category>
		<category><![CDATA[mac os x]]></category>

		<guid isPermaLink="false">http://www.cinaq.com/wordpress/?p=4</guid>
		<description><![CDATA[Corripio is a pretty useful tool to help find missing CD covers for your own album rips. The fact the default plugins don&#8217;t satisfy my diverse taste of music I decided to create my own: amazon.rb . It queries amazon.com which has the largest database (or so I hope). No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a title="Corripio Official site" href="http://nclasssoftware.com/corripio">Corripio</a> is a pretty useful tool to help find missing CD covers for your own album rips. The fact the default plugins don&#8217;t satisfy my diverse taste of music I decided to create my own: <a href="http://www.cinaq.com/wordpress/wp-content/uploads/2008/06/amazon.rb">amazon.rb</a> . It queries amazon.com which has the largest database (or so I hope).</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.cinaq.com/wordpress/2008/06/amazoncom-plugin-for-corripio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
