<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Peacemoon&#039;s Blog</title>
	<atom:link href="http://peacemoon.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://peacemoon.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 31 Oct 2009 16:11:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='peacemoon.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Peacemoon&#039;s Blog</title>
		<link>http://peacemoon.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://peacemoon.wordpress.com/osd.xml" title="Peacemoon&#039;s Blog" />
	<atom:link rel='hub' href='http://peacemoon.wordpress.com/?pushpress=hub'/>
		<item>
		<title>[Ubuntu]  HOWTO: Restore GRUB (if your MBR is messed up)</title>
		<link>http://peacemoon.wordpress.com/2009/10/31/ubuntu-howto-restore-grub-if-your-mbr-is-messed-up/</link>
		<comments>http://peacemoon.wordpress.com/2009/10/31/ubuntu-howto-restore-grub-if-your-mbr-is-messed-up/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:11:29 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/2009/10/31/ubuntu-howto-restore-grub-if-your-mbr-is-messed-up/</guid>
		<description><![CDATA[Don&#8217;t forget that this method, as described, puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root parititon. This is fine for most people, but not if you already have an alternative boot manager. In other words, if you use something like Boot Magic or System Commander, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=61&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t forget that this method, as described, puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root parititon. This is fine for most people, but not if you already have an alternative boot manager.</p>
<p>In other words, if you use something like Boot Magic or System Commander, the commands you&#8217;ve just read will overwrite what you&#8217;ve got.</p>
<p>If you&#8217;ve installed GRUB into the Root Partition instead of the MBR, the commands are a little different. Here&#8217;s are the instructions that I have for my system:</p>
<p>How to Restore the Grub Menu after a Re-Ghosting:</p>
<p>1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.</p>
<p>2. Open a Terminal. Go SuperUser (that is, type &#8220;su&#8221;). Enter root passwords as necessary.</p>
<p>3. Type &#8220;grub&#8221; which makes a GRUB prompt appear.</p>
<p>4. Type &#8220;find /boot/grub/stage1&#8243;. You&#8217;ll get a response like &#8220;(hd0)&#8221; or in my case &#8220;(hd0,3)&#8221;. Use whatever your computer spits out for the following lines.</p>
<p>5. Type &#8220;root (hd0,3)&#8221;.</p>
<p>6. Type &#8220;setup (hd0,3)&#8221;. This is key. Other instructions say to use &#8220;(hd0)&#8221;, and that&#8217;s fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as &#8220;(hd0,3)&#8221;.</p>
<p>7. Type &#8220;quit&#8221;.</p>
<p>8. Restart the system. Remove the bootable CD.</p>
<p>Hope this helps. Since I use Norton Ghost to make regular backups and restores (I do a lot of testing), I do this all the time&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=61&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/10/31/ubuntu-howto-restore-grub-if-your-mbr-is-messed-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>[Ubuntu] HOWTO: localhost subdomains</title>
		<link>http://peacemoon.wordpress.com/2009/10/01/ubuntu-howto-localhost-subdomains/</link>
		<comments>http://peacemoon.wordpress.com/2009/10/01/ubuntu-howto-localhost-subdomains/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 21:15:20 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/2009/10/01/ubuntu-howto-localhost-subdomains/</guid>
		<description><![CDATA[Creating subdomain(s) in any web development environment is essential. For example, I have 2 projects going on at the same time and developement is concurrent. And subdomains were not created. So we have this scenario: http://localhost/alphaproject/ http://localhost/betaproject/ http://localhost/phpmyadmin/ As you can see, I am assuming a Apache/PHP/MySql developemnt stack. 3 localhost urls that will be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=57&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Creating</strong> subdomain(s) in any web development environment is essential. For example, I have 2 projects going on at the same time and developement is concurrent. And subdomains were not created. So we have this scenario:</p>
<ul>
<li>http://localhost/alphaproject/</li>
<li>http://localhost/betaproject/</li>
<li>http://localhost/phpmyadmin/</li>
</ul>
<p>As you can see, I am assuming a Apache/PHP/MySql developemnt stack. 3 localhost urls that will be frequently accessed. Imagine what will happen when you want to access beta project? You “control+t” a new browser tab, and type in “localhost” only to have the url bar showing its history of the above 3 urls. Then you press the down arrow key to access the required url.</p>
<p>Waste of keystroke I will say. Now we create subdomains and we have:</p>
<ul>
<li>http://alphaproject.localhost/</li>
<li>http://betaproject.localhost/</li>
<li>http://phpmyadmin.localhost/</li>
</ul>
<p>So now when we want to access beta project? Type in “beta” and simply selected the required “remembered” url. Save some keystrokes and it will save up a a sizable amount of effort over time.</p>
<p>So how to create subdomain in Ubuntu?</p>
<p>Simple, I will cover the basic steps here. (Windows users, sorry, not here my friends).</p>
<p>Edit /etc/host and add the following line</p>
<blockquote><p>127.0.0.1        alphaproject.localhost</p></blockquote>
<p>Create a new configuration file in /etc/apache2/sites-available/alphaproject using</p>
<blockquote>
<pre>gksudo gedit /etc/apache2/sites-available/alphaproject</pre>
</blockquote>
<p>In this configuration file, have the following:</p>
<blockquote>
<pre>&lt;VirtualHost *&gt;
    DocumentRoot /home/username/alphaproject/
    ServerName alphaproject.localhost</pre>
<pre>    &lt;Directory /home/username/alphaproject/&gt;
        Options Indexes FollowSymLinks MultiViews +Includes
        AllowOverride None
        Order allow,deny
        allow from all
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
</blockquote>
<p>Save the file, and run the following:</p>
<blockquote>
<pre>sudo a2ensite alphaproject</pre>
</blockquote>
<p>Finally restart the Apache Server. Which I assume you should be using  Apache2.</p>
<blockquote>
<pre>sudo /etc/init.d/apache2 restart</pre>
</blockquote>
<p>And by going to http://alphaproject.localhost/ you should be able to access you newly created subdomain.</p>
<p>On a ending note, phpmyadmin does come installed as a package but default to http://localhost/pma which I do strongly encourage users to change it to http://pma.localhost/</p>
<p>Think of the key strokes you be saving. And yes, do name your subdomain smartly, try picking each subdomain to have a different starting character.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=57&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/10/01/ubuntu-howto-localhost-subdomains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>How to display a local file in the browser?</title>
		<link>http://peacemoon.wordpress.com/2009/08/28/how-to-display-a-local-file-in-the-browser/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/28/how-to-display-a-local-file-in-the-browser/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 09:15:11 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=54</guid>
		<description><![CDATA[1) For &#8220;static&#8221; files, you can use R class and use the browser to render them 2) For runtime-generated files or &#8220;out-of-resouces&#8221; class, you can&#8217;t use file:// URIs anymore 2)a) A possible solution: manually open the file and provide file content as string, mimetype and encoding 2)a)issue) WebView must be used calling loadData method, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=54&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Courier,Monospaced;">1) For &#8220;static&#8221; files, you can use R class and use the browser to<br />
render them<br />
2) For runtime-generated files or &#8220;out-of-resouces&#8221; class, you can&#8217;t<br />
use file:// URIs anymore<br />
2)a) A possible solution: manually open the file and provide file<br />
content as string, mimetype and encoding<br />
2)a)issue) WebView must be used calling loadData method, which doesn&#8217;t<br />
allow load content from network (so you can&#8217;t make it render external<br />
images)<br />
2)b) Another possible solution: create a content provider which<br />
returns file content, mimetype and encoding by accessing a content://<br />
URI. Theorically you can use WebView calling loadUrl method, which<br />
renders the page correctly</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=54&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/28/how-to-display-a-local-file-in-the-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>[Android] Developing Orientation-Aware Android Applications</title>
		<link>http://peacemoon.wordpress.com/2009/08/23/android-developing-orientation-aware-android-applications/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/23/android-developing-orientation-aware-android-applications/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:21:07 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=52</guid>
		<description><![CDATA[ost modern, self-respecting mobile operating systems in today&#8217;s market support different screen orientations based on the position of the device. Android is no exception. While this feature is often taken for granted, it&#8217;s something on which developers spend extra time, ensuring that their applications work flawlessly regardless of screen orientation. This article will show you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=52&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://assets.devx.com/dropcaps/3583.gif" alt="" />ost modern, self-respecting mobile operating systems in today&#8217;s market support different screen orientations based on the position of the device. Android is no exception. While this feature is often taken for granted, it&#8217;s something on which developers spend extra time, ensuring that their applications work flawlessly regardless of screen orientation. This article will show you how screen orientation works in Android and some techniques to make your life easier.</p>
<h3>Default Behavior for the Android G1</h3>
<p>Create a new Android project and name it <span>OrientationAware</span>. For today&#8217;s current Android device (which at the time of writing is the T-Mobile G1), the screen orientation changes only when the keyboard is opened or closed. When the keyboard is closed, the screen is displayed in portrait mode; when it is opened, the screen orientation changes to landscape.</p>
<p>To test the concepts discussed in this article, connect the G1 to your computer. In Eclipse, press F11 to deploy the application that you have just created to the G1. <a href="showSupportItem('figure1')">Figure 1</a> shows the UI of the application when the keyboard is closed. When the keyboard is opened, the orientation changes automatically to landscape mode, as shown in <a href="showSupportItem('figure2')">Figure 2</a>.</p>
<table border="0" cellpadding="3" width="75%" align="center">
<tbody>
<tr>
<td valign="top"><a href="showSupportItem('figure1')"><img src="http://assets.devx.com/articlefigs/40792_1.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure1')"><strong>Figure 1.</strong></a><strong> Portrait:</strong> Here&#8217;s the device display in portrait mode.</span></td>
<td width="12"></td>
<td valign="top"><a href="showSupportItem('figure2')"><img src="http://assets.devx.com/articlefigs/40792_2.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure2')"><strong>Figure 2.</strong></a><strong> Landscape:</strong> Here&#8217;s the device display in landscape mode.</span></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="239" align="right">
<tbody>
<tr>
<td valign="top"><a href="showSupportItem('figure3')"><img src="http://assets.devx.com/articlefigs/40792_3.jpg" border="0" alt="" width="150" height="150" /></a></td>
<td width="12"></td>
</tr>
<tr>
<td><a href="showSupportItem('figure3')"><strong>Figure 3.</strong></a><strong> Error:</strong> This is an activity that does not know how to react to a change in orientation.</td>
</tr>
</tbody>
</table>
<p>Reacting to changes in screen orientation is important because it affects the look of your UI. The left side of <a href="showSupportItem('figure3')">Figure 3</a> shows an application designed to display in portrait mode. However, if special care is not taken to adapt the UI for landscape mode, it will look like the right side of <a href="showSupportItem('figure3')">Figure 3</a> when the device changes to landscape mode.</p>
<p>There are three general techniques you can employ to handle changes in screen orientation:</p>
<ul>
<li> <em>Anchoring</em>: The easiest way is to &#8220;anchor&#8221; your views to the four edges of the screen—when the screen orientation changes, the views can anchor neatly to the edges.</li>
<li> <em>Centralizing</em>: Like anchoring, if your activity has only a few views, you might want to consider centralizing your views so that they are always displayed in the center of the screen.</li>
<li> <em>Resizing and Repositioning</em>: Anchoring and centralizing are simple techniques to ensure views can handle changes in screen orientation. The ultimate is resizing each and every view according to the current screen orientation.</li>
</ul>
<p><strong>Anchoring and Centralizing</strong><br />
Anchoring and centralizing can be easily achieved by using <span>RelativeLayout</span>. Consider <span>main.xml</span> (see <a href="showSupportItem('listing1')">Listing 1</a>), which contains five Button views embedded within the <span> </span> element.</p>
<p>Observe the following attributes found in the various Button views:</p>
<ul>
<li> <span>layout_alignParentLeft</span>: This aligns the view to the left of the parent view.</li>
<li> <span>layout_alignParentRight</span>: This aligns the view to the right of the parent view.</li>
<li> <span>layout_alignParentTop</span>: This aligns the view to the top of the parent view.</li>
<li> <span>layout_alignParentBottom</span>: This aligns the view to the bottom of the parent view.</li>
<li> <span>layout_centerVertical</span>: This centers the view vertically within its parent view.</li>
<li> <span>layout_centerHorizontal</span>: This centers the view horizontally within its parent view.</li>
</ul>
<p><a href="showSupportItem('figure4')">Figure 4</a> shows the activity when viewed in the portrait mode.</p>
<table border="0" cellpadding="3" width="75%" align="center">
<tbody>
<tr>
<td valign="top"><a href="showSupportItem('figure4')"><img src="http://assets.devx.com/articlefigs/40792_4.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure4')"><strong>Figure 4.</strong></a><strong> Portrait Mode:</strong> The image shows the activity in portrait mode.</span></td>
<td width="12"></td>
<td valign="top"><a href="showSupportItem('figure5')"><img src="http://assets.devx.com/articlefigs/40792_5.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure5')"><strong>Figure 5.</strong></a><strong> Landscape Mode:</strong>. This is what it looks like when all views are aligned appropriately.</span></td>
</tr>
</tbody>
</table>
<p>When the screen orientation changes to landscape mode, the four buttons are aligned to the four edges of the screen and the center button is centered in the middle of the screen with its width fully stretched (see <a href="showSupportItem('figure5')">Figure 5</a>).</p>
<h3>Manual Repositioning</h3>
<p>If you want to manually reposition each view in your activity when the screen orientation changes, use <span>AbsoluteLayout</span>. Consider the following content in <span>main.xml</span></p>
<p>:</p>
<pre><code>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;AbsoluteLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    &gt;
    &lt;Button
        android:id="@+id/button1"
        android:layout_width="121px"
        android:layout_height="44px"
        android:text="Button"
        android:layout_x="13px"
        android:layout_y="13px"
        &gt;
    &lt;/Button&gt;
&lt;/AbsoluteLayout&gt;
</code></pre>
<p>Here, the activity has only one button view as shown in <a href="showSupportItem('figure6')">Figure 6</a>.</p>
<table border="0" cellpadding="3" width="75%" align="center">
<tbody>
<tr>
<td valign="top"><a href="showSupportItem('figure6')"><img src="http://assets.devx.com/articlefigs/40792_6.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure6')"><strong>Figure 6.</strong></a><strong> Solo:</strong> This shows the activity with one view.</span></td>
<td width="12"></td>
<td valign="top"><a href="showSupportItem('figure7')"><img src="http://assets.devx.com/devx/40792_7.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure7')"><strong>Figure 7.</strong></a><strong> Redone:</strong> The Button view is repositioned and resized when it is in landscape mode.</span></td>
</tr>
</tbody>
</table>
<p>When the screen orientation changes to landscape mode, you might want to reposition the button view. In this case, you need to write some code to determine the current screen orientation the activity is in and then manually set the layout parameter of the view to reposition.</p>
<p>To see how this is done, use the code in <a href="showSupportItem('listing2')">Listing 2</a> in <span>Orientation.java</span>.</p>
<p>The above program first checks the current screen size and determines the orientation. It then creates a new <span>LayoutParams</span> object (containing the new position to locate the view) to be used by the Button view.</p>
<p><a href="showSupportItem('figure7')">Figure 7</a> shows the application in action—the Button view is repositioned and resized when the screen orientation changes to landscape mode.</p>
<h3>Using the layout Folder</h3>
<p>Apart from writing code, an easier way of customizing the UI based on screen orientation is to create a separate <span>res/layout</span> folder containing the XML files for the UI. To support landscape mode, you can create a new folder in the <span>res</span> folder and name it <span>layout-land</span> (representing landscape). <a href="showSupportItem('figure8')">Figure 8</a> shows that the new folder also contains the file <span>main.xml</span>.</p>
<table border="0" cellpadding="3" width="75%" align="center">
<tbody>
<tr>
<td valign="top"><a href="showSupportItem('figure8')"><img src="http://assets.devx.com/articlefigs/40792_8.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure8')"><strong>Figure 8.</strong></a><strong> Downloading Data:</strong> The <em>layout-land</em> folder contains the UI to be displayed in landscape mode.</span></td>
<td width="12"></td>
<td valign="top"><a href="showSupportItem('figure9')"><img src="http://assets.devx.com/articlefigs/40792_9.jpg" border="0" alt="" width="150" height="150" /></a><br />
<span><a href="showSupportItem('figure9')"><strong>Figure 9.</strong></a><strong> Emulate 3G:</strong> You can also apply the <em>–land</em> name extension to the drawable folder.</span></td>
</tr>
</tbody>
</table>
<p>Basically, the <span>main.xml</span> file contained within the <span>layout</span> folder defines the UI for the activity in portrait mode while the <span>main.xml</span> file in the <span>layout-land</span> folder defines the UI in landscape mode. The following shows the content of <span>main.xml</span> under the <span>layout-land</span> folder:</p>
<pre><code>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;AbsoluteLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    &gt;
    &lt;Button
        android:id="@+id/button1"
        android:layout_width="150px"
        android:layout_height="60px"
        android:text="Button"
        android:layout_x="280px"
        android:layout_y="180px"
        /&gt;
&lt;/AbsoluteLayout&gt;
</code></pre>
<p>Basically, the <span>main.xml</span> file contained within the <span>layout</span> folder defines the UI for the activity in portrait mode while the <span>main.xml</span> file in the <span>layout-land</span> folder defines the UI in landscape mode. The following shows the content of <span>main.xml</span> under the <span>layout-land</span> folder:</p>
<pre><code>
&lt;?xml version="1.0" encoding="utf-8"?&amp;glt;
&lt;AbsoluteLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    &amp;glt;
    &lt;Button
        android:id="@+id/button1"
        android:layout_width="150px"
        android:layout_height="60px"
        android:text="Button"
        android:layout_x="280px"
        android:layout_y="180px"
        /&amp;glt;
&lt;/AbsoluteLayout&amp;glt;
</code></pre>
<p>Using this method, when the orientation of the device changes, Android will automatically load the appropriate XML file.</p>
<p>Besides using the <span>–land</span> name extension on the <span>res/layout</span> folder, you can also use it on the <span>res/drawable</span> folder. For example, the <span>res/drawable-land</span> folder shown in <a href="showSupportItem('figure9')">Figure 9</a> contains images that are designed to be displayed in landscape mode while those in the <span>res/drawable</span> folder are designed to be displayed in portrait mode.</p>
<h3>Persisting State Information During Configuration Change</h3>
<p>One important concept you need to know when handling screen orientation changes is that when a screen changes orientation, the activity is destroyed and then recreated–the <span>onCreate</span> event is always called when the screen orientation changes. When this happens, the current state of the activity may be lost.</p>
<p>First and foremost, you should name all your views in your activity using the <span>android:id</span> attribute. This attribute is important for applications that change with screen orientation, because when Android destroys activities, it saves state only for named views. For example, suppose a user changes orientation in the midst of entering some text into an EditText view. When this happens, if you&#8217;ve named the EditText view using an <span>android:id</span> attribute, Android will persist any existing text inside the EditText view, and restore it automatically when the activity is recreated. In contrast, if the view does not have an <span>android:id</span> attribute, the system will not be able to persist the text, so when it recreates the activity, any already-entered text will be lost.</p>
<p>In addition, note that the <span>onSaveInstanceState</span> event is fired whenever an activity is about to be killed or put into the background. For example, when the orientation is changed, this event is fired so that the current state of the activity can be saved and restored later. This event is similar to the <span>onPause</span> event of the Activity class, but unlike the <span>onPause</span> event (which is called whenever the activity is being placed in the background or being killed), it is not fired when an activity is being unloaded from the stack (since there is no need to restore its state later on).</p>
<p>You can override the <span>onSaveInstanceState</span> event and save the information you need in this event. For example, the following code shows that you can save the string ID into the <span>Bundle</span> object during the <span>onSaveInstanceState</span> event:</p>
<pre><code>
    @Override
    public void onSaveInstanceState(Bundle outState)
    {
        //---save whatever you need to persist—
        outState.putString("ID", "1234567890");
        super.onSaveInstanceState(outState);
    }
</code></pre>
<p>When an activity is recreated, the <span>onCreate</span> event is fired first, followed by the <span>onRestoreInstanceState</span> event. This <span>onRestoreInstanceState</span> event allows you to retrieve the state that you have saved previously in the <span>onSaveInstanceState</span> event:</p>
<pre>
    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState)
    {
        super.onRestoreInstanceState(savedInstanceState);
        //---retrieve the information persisted earlier---
        String ID = savedInstanceState.getString("ID");
    }</pre>
<p>While you can use the <span>onSaveInstanceState</span> event to save state information, the limitation is that you can only save your state information into a <span>Bundle</span> object. If you need to save more complex data structures, then this is not an adequate solution.</p>
<p>Another event handler that you can use is the <span>onRetainNonConfigurationInstance</span> event. This event is fired when an activity is about to be destroyed due to a configuration change. (Screen orientation changes are considered configuration changes, and by default, all configuration changes cause the current activity to be destroyed). You can save your current data structure by returning it in this event, like this:</p>
<pre><code>
    @Override
    public Object onRetainNonConfigurationInstance()
    {
        return("Hello");
    }
</code></pre>
<p>Note that this event returns an <span>Object</span> type, which pretty much allows you to return any data type. To extract the saved data, you can extract it in the <span>onCreate</span> event, using the <span>getLastNonConfigurationInstance()</span> method, like this:</p>
<pre><code>
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        String str = (String) getLastNonConfigurationInstance();
    }
</code></pre>
<h3>Bypassing the Activity Destruction Process</h3>
<p>Suppose you don&#8217;t want Android to go through the normal activity destroy-and-recreate process; instead, you want to handle recreating the views yourself. In this case, you can use the <span>android:configChanges</span> attributes on the <span>&lt;activity&gt;</span> element in <span>AndroidManifest.xml</span></p>
<p>:</p>
<pre><code>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="net.learn2develop.UIExample"
      android:versionCode="1"
      android:versionName="1.0.0"&gt;
    &lt;application android:icon="@drawable/icon"
                 android:label="@string/app_name"&gt;
        &lt;activity android:name=".UIActivity"
                  android:configChanges="orientation|keyboardHidden"
                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&amp;glt;
        &lt;/activity&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
<p>The above attribute indicates that you want to handle the flipping of the keyboard and the changes in the accelerometer (sensor) yourself. When a change in orientation occurs, the <span>onConfigurationChanged</span> event will be fired, which you can override to redraw your activity:</p>
<pre><code>
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        //---code to redraw your activity here---
        //...
    }
</code></pre>
<h3>Changing the Screen Orientation Based on the Accelerometer</h3>
<p>If you want to change the screen orientation automatically based on the positioning of the device, you can use the <span>android:screenOrientation</span> attribute in the <span>AndroidManifest.xml</span></p>
<p>file:</p>
<pre><code>

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="net.leanr2develop.OrientationAware"
      android:versionCode="1"
      android:versionName="1.0.0"&gt;
    &lt;application android:icon="@drawable/icon"
                 android:label="@string/app_name"&gt;
        &lt;activity android:name=".Orientation"
                  android:screenOrientation="sensor"
                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
<p>The above specifies that the screen orientation for the Orientation activity is based on the sensor (accelerometer) of the device. If you hold the device upright, the screen will be displayed in portrait mode; if you hold it sideways, it will change to landscape mode.</p>
<h3>Changing the Screen Orientation Programmatically</h3>
<p>There are times where you need to ensure that your application is displayed only in a certain orientation. For example, suppose you are writing a game that should only be viewed in landscape mode. In this case, you can programmatically force a change in orientation using the <span>setRequestOrientation()</span> method of the Activity class:</p>
<pre><code>
package net.learn2develop.OrientationAware;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;

public class Orientation extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //---change to landscape mode---
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    }
}
</code></pre>
<p>To change to portrait mode, use the <span>ActivityInfo.SCREEN_ORIENTATION_PORTRAIT</span> constant:</p>
<pre><code>
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
</code></pre>
<p>Besides using the <span>setRequestOrientation()</span> method, you can also use the <span>android:screenOrientation</span> attribute on the <span>&lt;activity&gt;</span> element in <span>AndroidManifest.xml</span> as follows to fix the activity to a certain orientation:</p>
<pre><code>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="net.learn2develop.UIExample"
      android:versionCode="1"
      android:versionName="1.0.0"&gt;
    &lt;application android:icon="@drawable/icon"
                 android:label="@string/app_name"&gt;
        &lt;activity android:name=".UIActivity"
                  android:screenOrientation="landscape"
                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
<p>The above example fixes the activity to a certain orientation (landscape in this case) and prevents the activity from being destroyed; that is, the activity will not be destroyed and the <span>onCreate</span> event will not be fired again when the orientation changes.</p>
<p>Now, you&#8217;ve seen the various ways to handle screen orientation changes in Android and how an activity gets recreated when an activity changes orientation. You should be able to use these methods to persist your state during transition.</p>
<p>Source: http://www.devx.com/wireless/Article/40792/1954</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=52&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/23/android-developing-orientation-aware-android-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>

		<media:content url="http://assets.devx.com/dropcaps/3583.gif" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_1.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_2.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_3.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_4.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_5.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_6.jpg" medium="image" />

		<media:content url="http://assets.devx.com/devx/40792_7.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_8.jpg" medium="image" />

		<media:content url="http://assets.devx.com/articlefigs/40792_9.jpg" medium="image" />
	</item>
		<item>
		<title>[Sqlite] Copy records from one DB to another</title>
		<link>http://peacemoon.wordpress.com/2009/08/20/sqlite-copy-records-from-one-db-to-another/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/20/sqlite-copy-records-from-one-db-to-another/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:07:47 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Sqlite]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=49</guid>
		<description><![CDATA[sqlite3 db1.db &#62; attach db2.db as db2; &#62; insert into table1 select * from db2.table1; &#62; .quit<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=49&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre style="margin:0;">sqlite3 db1.db
&gt; attach db2.db as db2;
&gt; insert into table1 select * from db2.table1;
&gt; .quit</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=49&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/20/sqlite-copy-records-from-one-db-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>[Ubuntu] Compiz Grid Plugin</title>
		<link>http://peacemoon.wordpress.com/2009/08/14/ubuntu-compiz-grid-plugin/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/14/ubuntu-compiz-grid-plugin/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 12:27:41 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=46</guid>
		<description><![CDATA[1. Code: sudo apt-get install compiz-bcop compiz-dev compizconfig-settings-manager build-essential libtool libglu1-mesa-dev libxss-dev libcairo2-dev git-core 2. Code: mkdir ~/compiz 3. Code: cd ~/compiz 4. Code: git clone git://anongit.compiz-fusion.org/compiz/plugins/grid 5. Code: cd grid 6. Code: make 7. Code: make install 7.1 You may need to enable &#8220;Normal&#8221; or &#8220;Extra&#8221; under desktop effects in System-&#62;Preferences-&#62;Appearance first. (You may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=46&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">sudo apt-get install compiz-bcop compiz-dev compizconfig-settings-manager build-essential libtool libglu1-mesa-dev libxss-dev libcairo2-dev git-core</pre>
</div>
<p>2.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">mkdir ~/compiz</pre>
</div>
<p>3.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">cd ~/compiz</pre>
</div>
<p>4.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">git clone git://anongit.compiz-fusion.org/compiz/plugins/grid</pre>
</div>
<p>5.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">cd grid</pre>
</div>
<p>6.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">make</pre>
</div>
<p>7.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">make install</pre>
</div>
<p>7.1 You may need to enable &#8220;Normal&#8221; or &#8220;Extra&#8221; under desktop effects in System-&gt;Preferences-&gt;Appearance first. (You may also need to chown -R user:user ~/compiz in order to get things to compile.)</p>
<p>8.</p>
<div style="margin:5px 20px 20px;">
<div style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;text-align:left;margin:0;padding:6px;">ccsm</pre>
</div>
<p>9. Check &#8220;grid&#8221; under &#8220;Window Management&#8221;. Note you can actually click on the icon and &#8220;grid&#8221; to bring up keyboard shortcuts for placing the windows where you want them. Do not expect to have new icons come up at the top of the windows (next to minimize/maximize/close), this won&#8217;t happen. However, &lt;ctrl&gt;&lt;alt&gt;&lt;kp 6&gt; is quicker anyway.</p>
<p>10. Play around with what the different control-alt-numeric keypad combos do to get an idea of how to use this. It&#8217;s pretty intuitive.</p>
<p>In Ubuntu 9.04 you have to delete the folder ~/.compiz/ first and log in again</p>
<p>Source : http://ubuntuforums.org/showthread.php?t=1148397</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=46&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/14/ubuntu-compiz-grid-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>[PHP] Debugging a CodeIgniter application with FirePHP</title>
		<link>http://peacemoon.wordpress.com/2009/08/13/php-debugging-a-codeigniter-application-with-firephp/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/13/php-debugging-a-codeigniter-application-with-firephp/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 22:28:58 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=42</guid>
		<description><![CDATA[FirePHP is an addon for FireBug extension for Firefox browser. FirePHP extends FireBug functionalities to show log or error messages coming from your PHP application. These messages won’t be printed on the application interface but instead on the FireBug console. What do you need to integrate this debugging feature in your application : Firefox browser [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=42&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://firephp.org/">FirePHP</a> is an addon for <a href="http://getfirebug.com/">FireBug</a> extension for <a href="http://www.mozilla.com/en-US/firefox/">Firefox browser</a>.</p>
<p>FirePHP extends FireBug functionalities to show log or error messages coming from your PHP application. These messages won’t be printed on the application interface but instead on the FireBug console.</p>
<p>What do you need to integrate this debugging feature in your application :</p>
<ol>
<li><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> browser</li>
<li><a href="http://getfirebug.com/">FireBug</a> extension</li>
<li><a href="http://firephp.org/">FirePHP</a> extension</li>
</ol>
<p>The next step is to open Firefox and visit the url where your application is located and activate the <code>Net panel</code> in FireBug, clicking the bottom right Firebug icon in Firefox window.</p>
<p><img title="FireBug Net Panel" src="http://speedtech.it/wp-content/uploads/2009/05/firebug-net-panel.png" alt="FireBug Net Panel" width="500" height="137" /></p>
<p>The client (the browser), is now ready to accept the debugging messages, we have now to integrate the FirePHP library with the CodeIgniter application on server side :</p>
<ul>
<li>dowload the FirePHP Core Library from <a href="http://www.firephp.org/DownloadRelease/FirePHPLibrary-FirePHPCore-0.2.1">here</a></li>
<li>extract the <code>FirePHP.class.php</code> from the archive, rename it to <code>firephp.php</code> and copy in the <code>system/application/libraries</code> directory of your CodeIgniter application</li>
</ul>
<p>Now you can use FirePHP to debug your code :</p>
<ul>
<li>load the library : <code>$this-&gt;load-&gt;library('firephp')</code></li>
<li>send debug messages to the FireBug console : <code>$this-&gt;firephp-&gt;log($myvariable)</code> or <code>$this-&gt;firephp-&gt;error('Error at this line')</code></li>
</ul>
<p>Detailed instructions to use FirePHP are available on <a href="http://www.firephp.org/HQ/Use.htm">FirePHP project website</a>. The most useful method for me are :</p>
<ul>
<li><code>$this-&gt;firephp-&gt;log($myvariable)</code> : send a dump of the variable <code>$myvariable</code> on the FireBug console</li>
<li><code>$this-&gt;firephp-&gt;warn($myvariable)</code> : send a dump of the variable <code>$myvariable</code> on the FireBug console classified as a warning</li>
<li><code>$this-&gt;firephp-&gt;error($myvariable)</code> : send a dump of the variable <code>$myvariable</code> on the FireBug console classified as an error</li>
</ul>
<p>Here there is a little example on how you can use FirePHP with CodeIgniter :</p>
<div>
<div>
<pre style="font-family:monospace;"><span style="color:#000000;font-weight:bold;">&lt;?php</span>
    <span style="color:#000088;">$this</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">load</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">library</span><span style="color:#009900;">(</span><span style="color:#0000ff;">'firephp'</span><span style="color:#009900;">)</span><span style="color:#339933;">;</span>
    <span style="color:#000088;">$myvariable</span> <span style="color:#339933;">=</span> <span style="color:#990000;">array</span> <span style="color:#009900;">(</span>
      <span style="color:#0000ff;">'language'</span> <span style="color:#339933;">=&gt;</span> <span style="color:#0000ff;">'PHP'</span><span style="color:#339933;">,</span>
      <span style="color:#0000ff;">'database'</span> <span style="color:#339933;">=&gt;</span> <span style="color:#0000ff;">'MySQL'</span><span style="color:#339933;">,</span>
      <span style="color:#0000ff;">'blogging platform'</span> <span style="color:#339933;">=&gt;</span> <span style="color:#0000ff;">'WordPress'</span><span style="color:#339933;">,</span>
      <span style="color:#0000ff;">'post'</span> <span style="color:#339933;">=&gt;</span> <span style="color:#0000ff;">'CodeIgniter and FirePHP'</span><span style="color:#339933;">,</span>
    <span style="color:#009900;">)</span><span style="color:#339933;">;</span>
    <span style="color:#000088;">$this</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">firephp</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">log</span><span style="color:#009900;">(</span><span style="color:#000088;">$myvariable</span><span style="color:#009900;">)</span><span style="color:#339933;">;</span>
<span style="color:#000000;font-weight:bold;">?&gt;</span></pre>
</div>
</div>
<p>And this is the output on the Firefox’s FirePHP console :<br />
<img title="FirePHP console" src="http://speedtech.it/wp-content/uploads/2009/05/firephp_console.png" alt="FirePHP console" width="596" height="193" /></p>
<p>The debug messages can be disabled with the method : <code>$this-&gt;firepgp-&gt;setEnabled(FALSE)</code>.<br />
It is also possible to make the messages appear only for specific ip addresses :</p>
<div>
<div>
<pre style="font-family:monospace;"><span style="color:#000000;font-weight:bold;">&lt;?php</span>
<span style="color:#b1b100;">if</span><span style="color:#009900;">(</span><span style="color:#000088;">$this</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">input</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">ip_address</span><span style="color:#009900;">(</span><span style="color:#009900;">)</span> <span style="color:#339933;">==</span><span style="color:#0000ff;">'1.2.3.4'</span><span style="color:#009900;">)</span>
<span style="color:#009900;">{</span>
  <span style="color:#000088;">$this</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">firephp</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">setEnabled</span><span style="color:#009900;">(</span><span style="color:#009900;font-weight:bold;">TRUE</span><span style="color:#009900;">)</span><span style="color:#339933;">;</span>
<span style="color:#009900;">}</span>
<span style="color:#b1b100;">else</span>
<span style="color:#009900;">{</span>
  <span style="color:#000088;">$this</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">firephp</span><span style="color:#339933;">-&gt;</span><span style="color:#004000;">setEnabled</span><span style="color:#009900;">(</span><span style="color:#009900;font-weight:bold;">FALSE</span><span style="color:#009900;">)</span><span style="color:#339933;">;</span>
<span style="color:#009900;">}</span>
<span style="color:#000000;font-weight:bold;">?&gt;</span></pre>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=42&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/13/php-debugging-a-codeigniter-application-with-firephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>

		<media:content url="http://speedtech.it/wp-content/uploads/2009/05/firebug-net-panel.png" medium="image">
			<media:title type="html">FireBug Net Panel</media:title>
		</media:content>

		<media:content url="http://speedtech.it/wp-content/uploads/2009/05/firephp_console.png" medium="image">
			<media:title type="html">FirePHP console</media:title>
		</media:content>
	</item>
		<item>
		<title>[Ubuntu] Share One Keyboard and Mouse Between Multiple Computers</title>
		<link>http://peacemoon.wordpress.com/2009/08/12/ubuntu-share-one-keyboard-and-mouse-between-multiple-computers/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/12/ubuntu-share-one-keyboard-and-mouse-between-multiple-computers/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 16:28:44 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=40</guid>
		<description><![CDATA[Have multiple keyboards and mice on your desk? With Synergy, you can seamlessly share one keyboard, mouse, and clipboard between multiple systems. Have a laptop to the right of your main display? Just move the cursor off the right edge of the screen and it will appear on the laptop. QuickSynergy is a graphical application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=40&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have multiple keyboards and mice on your desk? With <a href="http://synergy2.sourceforge.net/">Synergy</a>, you can seamlessly share one keyboard, mouse, and clipboard between multiple systems. Have a laptop to the right of your main display? Just move the cursor off the right edge of the screen and it will appear on the laptop.</p>
<p><a href="http://quicksynergy.sourceforge.net/">QuickSynergy</a> is a graphical application for setting up Synergy servers and clients. I used it to to share my mouse and keyboard between my desktop and Eee PC laptop. Synergy works flawlessly, even when the laptop is on wifi I can’t tell that I’m using a remote mouse and keyboard.</p>
<p><img src="http://tombuntu.com/wp-content/uploads/2008/09/quicksynergy.jpg" alt="QuickSynergy" /></p>
<p>Install QuickSynergy from the package <a href="quicksynergy">quicksynergy</a> (click the link to install), or by running the command below in your terminal:<br />
<code>sudo apt-get install quicksynergy</code></p>
<p>Open QuickSynergy from <em>Applications-&gt;Accessories-&gt;QuickSynergy</em>.</p>
<p><strong>On the Synergy server:</strong><br />
In the <em>Share</em> tab, type the hostnames of the clients (you must specify a hostname and not a IP address) into the appropriate boxes to position them around your main display. Click <em>Start</em> and the server will start (QuickSynergy will close). Open QuickSynergy again if you want to stop the server.</p>
<p><strong>On the clients:</strong><br />
In the <em>Use</em> tab, type the IP address of the server. Select the <em>Settings</em> tab and select the <em>Keep synergy running</em> option so you can close the QuickSynergy window without disconnecting. Click <em>Start</em> to connect.</p>
<p><strong>Tips:</strong></p>
<ul>
<li>Find your IP address in <em>System-&gt;Administration-&gt;Network Tools</em> in the <em>Device</em> tab. (You’ll need to select your network device from the drop down.)</li>
<li> Find your hostname in <em>System-&gt;Administration-&gt;Network</em> in the <em>General</em> tab.</li>
</ul>
<p>Source : http://tombuntu.com/index.php/2008/09/15/share-one-keyboard-and-mouse-between-multiple-systems/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=40&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/12/ubuntu-share-one-keyboard-and-mouse-between-multiple-computers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>

		<media:content url="http://tombuntu.com/wp-content/uploads/2008/09/quicksynergy.jpg" medium="image">
			<media:title type="html">QuickSynergy</media:title>
		</media:content>
	</item>
		<item>
		<title>[Ubuntu] Automount Hard Drive Partitions Everytime You Login to Ubuntu Linux</title>
		<link>http://peacemoon.wordpress.com/2009/08/11/ubuntu-automount-hard-drive-partitions-everytime-you-login-to-ubuntu-linux/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/11/ubuntu-automount-hard-drive-partitions-everytime-you-login-to-ubuntu-linux/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 14:53:16 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/2009/08/11/ubuntu-automount-hard-drive-partitions-everytime-you-login-to-ubuntu-linux/</guid>
		<description><![CDATA[Hello people, This is Bharath Ram. I wanted to share with you an information I just found. This indeed solved my problem so I thought it would solve yours too. In ubuntu (and may be in other distros) every time you login you never get your drives auto mounted (don’t you?). This is a real [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=38&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello people,</p>
<p>This is Bharath Ram. I wanted to share with you an information I just found. This indeed solved my problem so I thought it would solve yours too.</p>
<p>In ubuntu (and may be in other distros) every time you login you never get your drives auto mounted (don’t you?). This is a real pest especially when you would have set your wallpaper from an external drive or some other reason you want to use external drives for.</p>
<p>I have just found out a solution for this problem. That is no big deal but a small software called “pysdm”. It was there for me in the ubuntu repositories but i seriously don’t know about other distros. Install this software and if necessary open it after install (alt+f2 -&gt; type “pysdm” -&gt; enter) and in the options there say to automount your partition(s) at startup. Now the drives of ur hard disk will be mounted whenever you login. You won’t have to manually/using computer mount them.</p>
<p>Hope this helps</p>
<p>Source: http://sathyasays.com/2008/10/08/how-to-automount-hard-drive-partitions-everytime-you-login-in-linux/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=38&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/11/ubuntu-automount-hard-drive-partitions-everytime-you-login-to-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>
	</item>
		<item>
		<title>[Ubuntu] How to Mount iso, Bin And Cue Files Directly From Nautilus</title>
		<link>http://peacemoon.wordpress.com/2009/08/10/ubuntu-how-to-mount-iso-bin-and-cue-files-directly-from-nautilus/</link>
		<comments>http://peacemoon.wordpress.com/2009/08/10/ubuntu-how-to-mount-iso-bin-and-cue-files-directly-from-nautilus/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 08:46:48 +0000</pubDate>
		<dc:creator>peacemoon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://peacemoon.wordpress.com/?p=35</guid>
		<description><![CDATA[We have covered the easy way to mount iso images in Windows. This time round, we are going to cover the easy way to mount an iso, bin or cue file in Ubuntu without having to hit the terminal every time. With the use of fuesiso and nautilus-actions, we can easily create an option in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=35&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have covered the <a href="http://maketecheasier.com/mount-iso-images-in-windows/2009/05/19" target="_blank">easy way to mount iso images in Windows</a>. This time round, we are going to cover the easy way to mount an iso, bin or cue file in Ubuntu without having to hit the terminal every time.</p>
<p>With the use of <em><a href="http://fuse.sourceforge.net/" target="_blank">fuesiso</a></em> and <em>nautilus-actions</em>, we can easily create an option in Nautilus to mount the CD images right from the context menu (mouse right click).</p>
<p><strong>Here it goes:</strong></p>
<p>First, install fuseiso and nautilus actions</p>
<div>
<div>
<pre style="font-family:monospace;"><span style="color:#c20cb9;font-weight:bold;">sudo</span> <span style="color:#c20cb9;font-weight:bold;">apt-get</span> <span style="color:#c20cb9;font-weight:bold;">install</span> fuseiso nautilus-actions
<span style="color:#c20cb9;font-weight:bold;">sudo</span> usermod <span style="color:#660033;">-a</span> <span style="color:#660033;">-G</span> fuse username</pre>
</div>
</div>
<p>Change the <em>username</em> to your login name</p>
<p>Logout and back in.</p>
<p>Download the <a href="http://thefrys.com/userisomount.sh" target="_blank">userisomount.sh</a> script to your home folder.</p>
<p>Copy it to /usr/local/bin/ folder and make it executable.</p>
<div>
<div>
<pre style="font-family:monospace;"><span style="color:#c20cb9;font-weight:bold;">sudo</span> <span style="color:#c20cb9;font-weight:bold;">mv</span> ~<span style="color:#000000;font-weight:bold;">/</span>userisomount.sh <span style="color:#000000;font-weight:bold;">/</span>usr<span style="color:#000000;font-weight:bold;">/</span>local<span style="color:#000000;font-weight:bold;">/</span>bin<span style="color:#000000;font-weight:bold;">/</span>
<span style="color:#c20cb9;font-weight:bold;">sudo</span> <span style="color:#c20cb9;font-weight:bold;">chown</span> root:fuse <span style="color:#000000;font-weight:bold;">/</span>usr<span style="color:#000000;font-weight:bold;">/</span>local<span style="color:#000000;font-weight:bold;">/</span>bin<span style="color:#000000;font-weight:bold;">/</span>userisomount.sh
<span style="color:#c20cb9;font-weight:bold;">sudo</span> <span style="color:#c20cb9;font-weight:bold;">chmod</span> <span style="color:#000000;">754</span> <span style="color:#000000;font-weight:bold;">/</span>usr<span style="color:#000000;font-weight:bold;">/</span>local<span style="color:#000000;font-weight:bold;">/</span>bin<span style="color:#000000;font-weight:bold;">/</span>userisomount.sh</pre>
</div>
</div>
<p>Download the Nautilus Actions Schemas for <a href="http://thefrys.com/mount.schemas" target="_blank">MOUNTING</a> and <a href="http://thefrys.com/umount.schemas" target="_blank">UNMOUNTING</a> disk images.</p>
<div style="border:1px dashed #333333;padding:5px;"><strong>If you are using Ubuntu Jaunty</strong>, do the following:1. Open the MOUNTING and UNMOUNTING schemas with gedit</p>
<p>2. Locate the line with the code <code>&lt;default&gt;1.1&lt;/default&gt;</code></p>
<p>3. Replace it with <code>&lt;default&gt;2.0&lt;/default&gt;</code></p>
<p>4. Save and close the files.</p></div>
<p>Open up Nautilus Actions Configuration (<em>System-&gt;Preferences-&gt;Nautilus Actions Configuration</em>). Import the two files into Nautilus Actions.</p>
<p>Save and close Nautilus Actions.</p>
<p>In your terminal, restart Nautilus</p>
<div>
<div>
<pre style="font-family:monospace;"><span style="color:#c20cb9;font-weight:bold;">killall</span> nautilus</pre>
</div>
</div>
<p>You should be able to find a  Mount Disk Image on the context menu of your Nautilus now.</p>
<p><img title="nautilus-context" src="http://images.maketecheasier.com/2009/05/nautilus-context.jpg" alt="nautilus-context" width="334" height="229" /></p>
<p>To mount a iso, bin or cue file, simply right click and choose Mount Disk Image from the menu.</p>
<p>Reference: <a href="https://help.ubuntu.com/community/ManageDiscImages" target="_blank">Ubuntu community documentation</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peacemoon.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peacemoon.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peacemoon.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peacemoon.wordpress.com&amp;blog=8590661&amp;post=35&amp;subd=peacemoon&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peacemoon.wordpress.com/2009/08/10/ubuntu-how-to-mount-iso-bin-and-cue-files-directly-from-nautilus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d003793aee0c2b08565cb608b45fb5df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peacemoon</media:title>
		</media:content>

		<media:content url="http://images.maketecheasier.com/2009/05/nautilus-context.jpg" medium="image">
			<media:title type="html">nautilus-context</media:title>
		</media:content>
	</item>
	</channel>
</rss>
