<?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>Chris Jean&#039;s Blog &#187; Tips &#8216;n Tricks</title>
	<atom:link href="http://chrisjean.com/category/tips-n-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisjean.com</link>
	<description>Linux, WordPress, programming, anime, and other stuff</description>
	<lastBuildDate>Mon, 30 Aug 2010 16:30:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fix &#8220;WordPress database error Table &#8230; is marked as crashed and should be repaired&#8221;</title>
		<link>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/</link>
		<comments>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 15:46:58 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://chrisjean.com/?p=1823</guid>
		<description><![CDATA[All the content on my site was gone. When I went to investigate, I found my error log was filled with the following error: WordPress database error Table &#8216;./database_name/prefix_posts&#8217; is marked as crashed and should be repaired for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM prefix_posts  WHERE post_type = &#8216;post&#8217; [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>All the content on my site was gone. When I went to investigate, I found my error log was filled with the following error:</p>
<p class="code" style="padding-left: 30px;">WordPress database error Table &#8216;./database_name/prefix_posts&#8217; is marked as crashed and should be repaired for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM prefix_posts  WHERE post_type = &#8216;post&#8217; AND post_status = &#8216;publish&#8217; GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC  made by require, require_once, include, do_action, call_user_func_array, flexx_after_content, get_sidebar, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WP_Widget-&gt;display_callback, WP_Widget_Archives-&gt;widget, wp_get_archives</p>
<p>A very scary looking error, but it was easy to fix.</p>
<h3>My Preferred Repair Method</h3>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~/public_html</span>]$</span> <span style="color:#FFF;">mysql -u user -p</span>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1120449
Server version: 5.1.48 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">connect database</span>
Connection id:    1120477
Current database: database

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">select * from prefix_posts limit 1;</span>
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1120568
Current database: database

ERROR 145 (HY000): Table './database/prefix_posts' is marked as crashed and should be repaired
<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">repair table prefix_posts;</span>
+-----------------------+--------+----------+----------+
| Table                 | Op     | Msg_type | Msg_text |
+-----------------------+--------+----------+----------+
| database.prefix_posts | repair | status   | OK       |
+-----------------------+--------+----------+----------+
1 row in set (3.56 sec)

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">select * from prefix_posts limit 1;</span>
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| ID | post_author | post_date           | post_date_gmt       | post_content | post_title | post_category | post_excerpt | post_status | comment_status | ping_status | post_password | post_name | to_ping | pinged | post_modified       | post_modified_gmt   | post_content_filtered | post_parent | guid                                                       | menu_order | post_type  | post_mime_type | comment_count |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| 12 |           8 | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |              | 308image1  |             0 |              | inherit     | open           | open        |               | 308image1 |         |        | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |                       |           0 | http://gaarai.com/wp-content/uploads/2008/05/308image1.gif |          0 | attachment | image/gif      |             0 |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
1 row in set (0.00 sec)

<span style="color:#8FED99;">mysql&gt;</span> <span style="color:#FFF;">exit</span>
<span style="color:#FFF;">Bye</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">user@server</span> <span style="color:#729FCF;">~/public_html</span>]$</span> <span style="color:#FFF;"></span></pre>
<p>For me, this was the easiest and quickest way to repair the table.</p>
<h3>Repairing Tables with phpMyAdmin</h3>
<p>For you, you might prefer to use phpMyAdmin. Fortunately, repairing a table with phpMyAdmin is easy.</p>
<ol>
<li>Log in to your phpMyAdmin or connect to it via your cPanel back-end.</li>
<li>Select the database with the crashed table.</li>
<li>Put a checkmark next to each crashed table.</li>
<li>Select &#8220;Repair table&#8221; from the &#8220;With selected:&#8221; drop down at the bottom of the list.</li>
<li>Let phpMyAdmin do its thing.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/08/30/fix-wordpress-database-table-marked-crashed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL ERROR 1018: Unable to Follow Symlink in Ubuntu</title>
		<link>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/</link>
		<comments>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/#comments</comments>
		<pubDate>Fri, 21 May 2010 17:40:31 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[symlink]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1764</guid>
		<description><![CDATA[I recently had a issue getting MySQL to read a specific database. Each time I tried to manually query a table in the database, I received the following error message: ERROR 1018 (HY000): Can't read dir of './default/' (errno: 13) I&#8217;ve seen this message before as it means that there is a permissions issue. I [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I recently had a issue getting MySQL to read a specific database. Each time I tried to manually query a table in the database, I received the following error message:</p>
<pre>ERROR 1018 (HY000): Can't read dir of './default/' (errno: 13)</pre>
<p>I&#8217;ve seen this message before as it means that there is a permissions issue. I checked the ownerships and permissions, and everything seemed to be in order.</p>
<p>The only thing special about this database is that I have it symlinked to another partition. This has always worked in the past, so I was stumped.</p>
<p>The problem turned out to be that Ubuntu has <a href="http://en.wikipedia.org/wiki/AppArmor">AppArmor</a>. This software sets up rules that prevent software from gaining access to different areas of the file system. In my case, AppArmor was preventing read and write access to the actual location of my database files.</p>
<p>The solution was quite easy: First, I added the path that I wanted MySQL to have access to in the AppArmor configuration file for MySQL. Second, I restarted the apparmor service. Here&#8217;s the technical details:</p>
<ol>
<li>On my system, the configuration file that controls MySQL permissions through AppArmor are located at /etc/apparmor.d/usr.sbin.mysqld. The following shows the contents of the file as it now exists:
<pre># vim:syntax=apparmor
# Last Modified: Tue Jun 19 17:37:30 2007
#include 

/usr/sbin/mysqld {
  #include
  #include
  #include
  #include
  #include 

  capability dac_override,
  capability sys_resource,
  capability setgid,
  capability setuid,

  network tcp,

  /etc/hosts.allow r,
  /etc/hosts.deny r,

  /etc/mysql/*.pem r,
  /etc/mysql/conf.d/ r,
  /etc/mysql/conf.d/* r,
  /etc/mysql/my.cnf r,
  /usr/sbin/mysqld mr,
  /usr/share/mysql/** r,
  /var/log/mysql.log rw,
  /var/log/mysql.err rw,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
  /var/run/mysqld/mysqld.pid w,
  /var/run/mysqld/mysqld.sock w,
  <strong>/home/sites/default/mysql/ rw,
  /home/sites/default/mysql/* rw,</strong>

  /sys/devices/system/cpu/ r,
}</pre>
<p>The two lines in bold show what I added to the configuation. The first line gives read and write access to the directory itself while the second gives read and write access to the files contained in the directory.</li>
<li>After saving the configuration changes, I simply needed to restart the AppArmor daemon. I did this with the following command:
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo service apparmor restart</span>
 * Reloading AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/05/21/mysql-error-1018-unable-to-follow-symlink-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ColorZilla, CSSViewer, and Live HTTP Headers: Updated for Firefox 3.6</title>
		<link>http://chrisjean.com/2010/01/27/colorzilla-cssviewer-and-live-http-headers-updated-for-firefox-3-6/</link>
		<comments>http://chrisjean.com/2010/01/27/colorzilla-cssviewer-and-live-http-headers-updated-for-firefox-3-6/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 20:53:54 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Add-ons]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1756</guid>
		<description><![CDATA[When newer versions of Firefox come out, there are always a few add-ons that fail to update quickly enough. After about a week of waiting, I&#8217;ve become tired of waiting for some of my add-ons to update themselves. These add-ons are ColorZilla (white reports 3.6.* compatibility, but it won&#8217;t install/update on 3.6), CSSViewer, and Live [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>When newer versions of Firefox come out, there are always a few <a href="https://addons.mozilla.org/en-US/firefox" target="_blank">add-ons</a> that fail to update quickly enough. After about a week of waiting, I&#8217;ve become tired of waiting for some of my add-ons to update themselves. These add-ons are <a href="https://addons.mozilla.org/en-US/firefox/addon/271" target="_blank">ColorZilla</a> (white reports 3.6.* compatibility, but it won&#8217;t install/update on 3.6), <a href="https://addons.mozilla.org/en-US/firefox/addon/2104" target="_blank">CSSViewer</a>, and <a href="https://addons.mozilla.org/en-US/firefox/addon/3829" target="_blank">Live HTTP Headers</a>.</p>
<p>Fortunately, updating is a simple matter. Just do the following:</p>
<ul>
<li>Download the xpi file for the add-on</li>
<li>Open up the downloaded xpi file as a zip file</li>
<li>Open the install.rdf file inside the xpi file</li>
<li>Search for the targetApplication section with an id of <code>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</code></li>
<li>Change that section&#8217;s maxVersion to the version number to whatever Firefox version you want to be supported</li>
<li>Update the xpi file with the modified install.rdf file</li>
<li>Install the add-on by dragging the xpi file onto the Firefox window and clicking the Install button (this works for upgrades as well)</li>
</ul>
<p>Here are the modified xpi files for each of the add-ons:</p>
<ul>
<li><a href="http://new.gaarai.com/colorzilla-2.0.2.xpi">ColorZilla</a></li>
<li><a href="http://new.gaarai.com/cssviewer-1.0.3-fx.xpi">CSSViewer</a></li>
<li><a href="http://new.gaarai.com/live-http-headers-0.15-fx.xpi">Live HTTP Headers</a></li>
</ul>
<p>Note: All of these add-ons were updated to work with 3.6.*. Of course, they may not be compatible with future versions of 3.6, so use at your own risk.</p>
<p>Keep in mind that if you manually upgrade an older add-on, you do so at your own risk. I tested these add-ons, and they all work properly with 3.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/01/27/colorzilla-cssviewer-and-live-http-headers-updated-for-firefox-3-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrade to Firefox 3.6 on Ubuntu 9.10</title>
		<link>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/</link>
		<comments>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:00:11 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1743</guid>
		<description><![CDATA[One of my all-time most popular posts was how to upgrade to Firefox 3.5 in Ubuntu 9.04. Now it&#8217;s Firefox 3.6&#8242;s turn to be installed on my system that is now running Ubuntu 9.10. The team working on Firefox have put a ton of effort into this release and, in order to make our browsing [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>One of my all-time most popular posts was how to <a href="http://chrisjean.com/2009/07/01/upgrade-to-firefox-3-5-on-ubuntu-9-04-jaunty-jackalope/" target="_blank">upgrade to Firefox 3.5</a> in Ubuntu 9.04. Now it&#8217;s Firefox 3.6&#8242;s turn to be installed on my system that is now running Ubuntu 9.10.</p>
<p>The team working on Firefox have put a ton of effort into this release and, in order to make our browsing lives safer and faster, rolled a number of features scheduled for 3.7 into this release. Thanks for all the hard work guys.</p>
<p>Read the <a href="http://hacks.mozilla.org/2010/01/firefox-3-6-is-here/" target="_blank">3.6 release announcement</a> for details about what is new with this release.</p>
<p>So now onto the installation. Here are the commands that I ran in terminal to install 3.6.</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">cd /tmp/</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">wget "http://download.mozilla.org/?product=firefox-3.6&amp;os=linux〈=en-US"</span>
--2010-01-21 11:41:08--  http://download.mozilla.org/?product=firefox-3.6&amp;os=linux〈=en-US
Resolving download.mozilla.org... 63.245.209.58
Connecting to download.mozilla.org|63.245.209.58|:80... connected.
...

100%[=============================&gt;] 10,161,471   924K/s   in 11s     

2010-01-21 11:41:20 (899 KB/s) - `firefox-3.6.tar.bz2' saved [10161471/10161471]

<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">tar xvjf firefox-*.bz2</span>
tar: Record size = 8 blocks
firefox/
firefox/update.locale
firefox/plugins/
firefox/plugins/libnullplugin.so
...
firefox/defaults/autoconfig/platform.js
firefox/defaults/autoconfig/prefcalls.js
firefox/libmozjs.so
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo cp -r firefox /usr/lib/firefox-3.6</span>
[sudo] password for chris:
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo mv /usr/bin/firefox /usr/bin/firefox.old</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo ln -s /usr/lib/firefox-3.6/firefox /usr/bin/firefox-3.6</span>
<span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">/tmp</span>]$</span> <span style="color:#FFF;">sudo ln -s /usr/bin/firefox-3.6 /usr/bin/firefox</span></pre>
<p>Simply run each command listed in white in your terminal to upgrade your system with the latest release version of Firefox.</p>
<p>After running these commands, close out Firefox, wait a few seconds to let everything shut down properly, and run Firefox again. If all the steps were executed properly and without error, you should be running 3.6. You can click Help &gt; About Mozilla Firefox to confirm.</p>
<p>Happy browsing.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2010/01/21/upgrade-to-firefox-3-6-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Great Tutorial on Merging with Git</title>
		<link>http://chrisjean.com/2009/11/12/great-tutorial-on-merging-with-git/</link>
		<comments>http://chrisjean.com/2009/11/12/great-tutorial-on-merging-with-git/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 13:00:36 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Merging]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1722</guid>
		<description><![CDATA[One of the functions of Git that I still struggle with is merging. Recently, I found a post that shows a number of very helpful merging examples. If you work with Git and don&#8217;t fully understand merging, I recommend that you check it out. Git merging by example My thanks to Jonathan Rockway on providing [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>One of the functions of Git that I still struggle with is merging. Recently, I found a post that shows a number of very helpful merging examples. If you work with Git and don&#8217;t fully understand merging, I recommend that you check it out.</p>
<p><a href="http://blog.jrock.us/articles/Git%20merging%20by%20example.pod" target="_blank">Git merging by example</a></p>
<p>My thanks to Jonathan Rockway on providing this great guide.</p>
<div class="post-notice">Originally, I wanted to duplicate the content on my site in case the content on the linked to site ceased to exist. Ironically, just days after publishing this, the site has crashed. So, I&#8217;ve recovered the content from the crash and have duplicated it here. The remaining content is from the site I linked to and not my own. If the content stays down for long, I&#8217;ll clean up my duplicate of it.</div>
<p><span id="more-1722"></span><br />
UPDATE (28 Apr 2008): So apparently this article made it to the front page of delicious, reddit, and hacker news. It&#8217;s always the ones I least expect <img src='http://chrisjean.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Anyway, I&#8217;ve updated the branch names to be less confusing, and I&#8217;ve added an explanation of why I say git ci instead of git commit; I have the following section in my .gitconfig file:</p>
<p>[alias]<br />
st = status<br />
di = diff<br />
co = checkout<br />
ci = commit<br />
br = branch<br />
sta = stash</p>
<p>This lets you type git [the left side] and allows git to interpret it as git [the right side]. A very useful feature.</p>
<p>We now bring you the actual article:</p>
<p>I&#8217;ve always liked git&#8217;s merging algorithm, so I thought I&#8217;d show an example where it works exactly like I&#8217;d expect.</p>
<p>Let&#8217;s get started by creating a new git repository and project:</p>
<p>$ mkdir git-test<br />
$ cd git-test<br />
$ git init</p>
<p>Then we&#8217;ll create a file to play with, test.pl:</p>
<p>#!/usr/bin/env perl</p>
<p>print &#8220;Hello, world.\n&#8221;;</p>
<p>__END__</p>
<p>And commit that:</p>
<p>$ git add test.pl<br />
$ git ci -m &#8216;initial import&#8217;<br />
Created initial commit 219c5b3: initial import<br />
1 files changed, 6 insertions(+), 0 deletions(-)<br />
create mode 100644 test.pl</p>
<p>At this point, we want to create a branch so we can refactor this mess without ruining the working code.</p>
<p>$ git co -b refactor<br />
Switched to a new branch &#8220;refactor&#8221;</p>
<p>Now that we&#8217;re on the refactor branch, let&#8217;s sequester the print statement into a subroutine.</p>
<p>#!/usr/bin/env perl</p>
<p>say_hello();</p>
<p>sub say_hello {<br />
print &#8220;Hello, world.\n&#8221;;<br />
}</p>
<p>__END__</p>
<p>And commit:</p>
<p>$ git ci -a -m &#8216;factor print into a subroutine&#8217;;<br />
Created commit 518dec1: factor print into a subroutine<br />
1 files changed, 5 insertions(+), 1 deletions(-)</p>
<p>I have an idea for a new UI feature, so I&#8217;m going to make a branch here, but not switch to it, since I want to add another feature on this refactor branch first.</p>
<p>$ git branch new-ui</p>
<p>While we&#8217;re still on refactor, let&#8217;s get rid of that ugly \n:</p>
<p>#!/usr/bin/env perl<br />
use 5.010;</p>
<p>say_hello();</p>
<p>sub say_hello {<br />
say &#8220;Hello, world.&#8221;;<br />
}</p>
<p>__END__</p>
<p>(Note to the non-perl-users; we added use 5.010 to pull in the new say feature. Unfortunately the program now depends on perl 5.10 instead of perl 5.anything.)</p>
<p>Much cleaner. Commit.</p>
<p>$ git ci -a -m &#8216;use say instead of print&#8217;<br />
Created commit 518dec1: use say instead of print<br />
1 files changed, 2 insertions(+), 1 deletions(-)</p>
<p>OK, with that braindump saved, let&#8217;s go over to the new-ui branch:</p>
<p>$ git co new-ui<br />
Switched to branch &#8220;new-ui&#8221;</p>
<p>Now let&#8217;s add that super cool feature, namely printing &#8220;Hello, world&#8221; three times instead of just once. You think the boss will go for this change before converting all the servers to Perl 5.10, so you add it on this branch that doesn&#8217;t require 5.10.</p>
<p>#!/usr/bin/env perl</p>
<p>say_hello();<br />
say_hello();<br />
say_hello();</p>
<p>sub say_hello {<br />
print &#8220;Hello, world.\n&#8221;;<br />
}</p>
<p>__END__</p>
<p>Let&#8217;s commit that.</p>
<p>$ git ci -a -m &#8216;say hello three times&#8217;<br />
Created commit affad78: say hello three times<br />
1 files changed, 2 insertions(+), 0 deletions(-)</p>
<p>The unfortunate part is that management hasn&#8217;t approved that UI change, and they haven&#8217;t let you upgrade your production server to 5.10 yet. So you switch back to master to work on a task that needs to be done immediately &#8212; adding some documentation.</p>
<p>$ git co master<br />
Switched to branch &#8220;master&#8221;</p>
<p>And then edit the file:</p>
<p>#!/usr/bin/env perl</p>
<p>print &#8220;Hello, world.\n&#8221;;</p>
<p>__END__</p>
<p>=head1 NAME</p>
<p>test.pl &#8211; say hello to the world</p>
<p>=head1 SYNOPSIS</p>
<p>perl test.pl</p>
<p>And commit:</p>
<p>$ git ci -a -m &#8216;add docs&#8217;<br />
Created commit 80d2bba: add docs<br />
1 files changed, 7 insertions(+), 0 deletions(-)</p>
<p>With all that productivity, you feel you&#8217;ve earned a sugary cup of coffee, so you head over to Caribou, buy one, and come back. You check your e-mail and find that the UI team loves your &#8220;say hello 3 times&#8221; change. So, let&#8217;s merge that into master:</p>
<p>$ git pull . new-ui<br />
Auto-merged test.pl<br />
Merge made by recursive.<br />
test.pl |    8 +++++++-<br />
1 files changed, 7 insertions(+), 1 deletions(-)</p>
<p>Your file looks like this now:</p>
<p>#!/usr/bin/env perl</p>
<p>say_hello();<br />
say_hello();<br />
say_hello();</p>
<p>sub say_hello {<br />
print &#8220;Hello, world.\n&#8221;;<br />
}</p>
<p>__END__</p>
<p>=head1 NAME</p>
<p>test.pl &#8211; say hello to the world</p>
<p>=head1 SYNOPSIS</p>
<p>perl test.pl</p>
<p>If you do a git log, you&#8217;ll see that git adds each change you merged in into the history:</p>
<p>commit a6d16af596b2d122f4348ded85ca14a74b6adaae<br />
Merge: 80d2bba&#8230; affad78&#8230;<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:35:16 2008 -0500</p>
<p>Merge branch &#8216;new-ui&#8217;</p>
<p>commit 80d2bba051c525257aa4930b362dbe01d6c280fe<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:34:03 2008 -0500</p>
<p>add docs</p>
<p>commit affad78861d53900199860e60b44fb5c500791f5<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:28:02 2008 -0500</p>
<p>say hello three times</p>
<p>commit 518dec18167d36f6f7813b3affc0e76ad9baf2d9<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:20:52 2008 -0500</p>
<p>factor print into a subroutine</p>
<p>commit 219c5b3a580c0d5d4453e118b7a9c40efb6cd13b<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:15:39 2008 -0500</p>
<p>initial import</p>
<p>Now you&#8217;ve found out that every copy of Perl 5.8 has been destroyed (blame the sunspots), and you&#8217;ll have to upgrade to 5.10. Because of that, you can merge in your 5.10 branch. Lucky break! One thing to lose hair over, though, is that the new-ui branch that you just merged in has some commits in common with the refactor branch you&#8217;re about to merge in. Will git try to apply that change twice? (No.)</p>
<p>Let&#8217;s try it:</p>
<p>$ git pull . refactor<br />
Auto-merged test.pl<br />
Merge made by recursive.<br />
test.pl |    3 ++-<br />
1 files changed, 2 insertions(+), 1 deletions(-)</p>
<p>As expected, it worked perfectly. Here&#8217;s the final file:</p>
<p>#!/usr/bin/env perl<br />
use 5.010;</p>
<p>say_hello();<br />
say_hello();<br />
say_hello();</p>
<p>sub say_hello {<br />
say &#8220;Hello, world.&#8221;;<br />
}</p>
<p>__END__</p>
<p>=head1 NAME</p>
<p>test.pl &#8211; say hello to the world</p>
<p>=head1 SYNOPSIS</p>
<p>perl test.pl</p>
<p>If you look at the log, you&#8217;ll see that git knows exactly what changes were included by the merge:</p>
<p>commit 1d4a7814c29678d8ce69d7e241dcb21c4e5d1b88<br />
Merge: a6d16af&#8230; d35db62&#8230;<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:44:20 2008 -0500</p>
<p>Merge branch &#8216;refactor&#8217;</p>
<p>commit a6d16af596b2d122f4348ded85ca14a74b6adaae<br />
Merge: 80d2bba&#8230; affad78&#8230;<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:35:16 2008 -0500</p>
<p>Merge branch &#8216;new-ui&#8217;</p>
<p>commit 80d2bba051c525257aa4930b362dbe01d6c280fe<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:34:03 2008 -0500</p>
<p>add docs</p>
<p>commit affad78861d53900199860e60b44fb5c500791f5<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:28:02 2008 -0500</p>
<p>say hello three times</p>
<p>commit d35db62f2a628687db8ab2e5759cae35cffb5ab0<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:23:45 2008 -0500</p>
<p>use say instead of print</p>
<p>commit 518dec18167d36f6f7813b3affc0e76ad9baf2d9<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:20:52 2008 -0500</p>
<p>factor print into a subroutine</p>
<p>commit 219c5b3a580c0d5d4453e118b7a9c40efb6cd13b<br />
Author: Jonathan Rockway<br />
Date:   Sun Apr 27 05:15:39 2008 -0500</p>
<p>initial import</p>
<p>Even though you&#8217;ve merged these branches into trunk, you can still work on them:</p>
<p>$ git co new-ui<br />
$ git rebase master</p>
<p>rebase will merge master into the current branch, but it works by deleting your commits, bringing in master&#8217;s commits, and then replaying yours on top. This avoids the useless &#8220;merge branch &#8216;foo&#8217;&#8221; commit, but at the cost of being unable to share your changes with another repository (since the commit ids will change; commit ids are dependant on history, and rebase rewrites history).</p>
<p>The usual use case for rebase is when you&#8217;re working on a feature that takes a few days to write and want to bring in upstream every day. Instead of polluting your feature branch with merges, you can rebase and nobody will ever know that your changes weren&#8217;t originally made against today&#8217;s upstream branch. (If there are conflicts, git will allow you to resolve them for each of your patches, and it will remember how you resolved them in case the same thing comes up when you rebase again tomorrow. See git rerere &#8211;help for details.)</p>
<p>Anyway, after the rebase, our new-ui branch is now up to date with respect to master. If you made some changes here, you could merge them into master without issue.</p>
<p>Let&#8217;s do one more example; we&#8217;ll see how to merge two branches at once. We&#8217;ll switch back to master, and make a doc-refactor branch, since your app really needs more docs.</p>
<p>$ git co master<br />
Switched to branch &#8220;master&#8221;<br />
$ git co -b doc-refactor<br />
Switched to a new branch &#8220;doc-refactor&#8221;</p>
<p>Here, we&#8217;ll add some POD to the end of the file:</p>
<p>__END__</p>
<p>=head1 NAME</p>
<p>test.pl &#8211; say hello to the world</p>
<p>=head1 SYNOPSIS</p>
<p>perl test.pl</p>
<p>=head1 HISTORY</p>
<p>As of version 0.01, C now prints &#8220;Hello, world.&#8221; three<br />
times, for maximum enjoyment.</p>
<p>This isn&#8217;t quite perfect yet, but let&#8217;s commit it.</p>
<p>$ git ci -a -m &#8216;explain the 3x feature&#8217;<br />
Created commit 80920ac: explain the 3x feature<br />
1 files changed, 5 insertions(+), 0 deletions(-)</p>
<p>Meanwhile, a critical bug was just discovered &#8212; a user paused too long while reading the comma in &#8220;Hello, world.&#8221;, so you need to remove it. We&#8217;ll branch off master, since this complicated fix may take a few days of testing to fully implement:</p>
<p>$ git branch comma-bug-fix master<br />
$ git co comma-bug-fix<br />
# fix it<br />
$ git ci -a -m &#8216;fix the comma bug&#8217;<br />
Created commit 053413e: fix the comma bug<br />
1 files changed, 1 insertions(+), 1 deletions(-)</p>
<p>That was easier than expected. Since the bugfix was pretty simple and your docs are done, you&#8217;re ready to share both of those changes with your coworkers by merging them into master:</p>
<p>$ git co master<br />
$ git pull . comma-bug-fix doc-refactor<br />
Trying simple merge with 053413e7fc2935cfe54de74178f493b7965081b3<br />
Trying simple merge with 80920ac16ad72d8714b4e767a09e1f8ce974fe5a<br />
Simple merge did not work, trying automatic merge.<br />
Auto-merging test.pl<br />
Merge made by octopus.<br />
test.pl |    7 ++++++-<br />
1 files changed, 6 insertions(+), 1 deletions(-)</p>
<p>I love the &#8220;Merge made by octopus&#8221; message; I am seriously going to have a t-shirt made that says that. I like it when sea creatures help maintain my code.</p>
<p>Finally, if you don&#8217;t need those branches anymore, you can blow them away:</p>
<p>$ git branch -d refactor new-ui comma-bug-fix doc-refactor<br />
Deleted branch refactor.<br />
Deleted branch new-ui.<br />
Deleted branch comma-bug-fix.<br />
Deleted branch doc-refactor.</p>
<p>Git will only delete branches that are completely merged into the current branch, so you don&#8217;t need to worry about losing data.</p>
<p>In conclusion, git makes non-linear development easy. It&#8217;s smart, so merges Just Work; worrying about branches is not something you need to do anymore. Additionally, if you are the visual type, try running gitk &#8211;all. It will draw an interactive graph of all your merge and branch points, so you can see where your branches are at-a-glance. It&#8217;s awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/12/great-tutorial-on-merging-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox Audio Driver for Windows 7</title>
		<link>http://chrisjean.com/2009/11/12/virtualbox-audio-driver-for-windows-7/</link>
		<comments>http://chrisjean.com/2009/11/12/virtualbox-audio-driver-for-windows-7/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 05:11:20 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1719</guid>
		<description><![CDATA[I recently installed Windows 7 in VirtualBox, and unlike other OSes I&#8217;ve installed in VirtualBox, the sound driver wasn&#8217;t automatically recognized. I found a driver that works with both 32-bit and 64-bit versions. VirtualBox Windows 7 Driver I installed this both before and after installing the Guest Additions, but it didn&#8217;t matter what order the [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I recently installed Windows 7 in VirtualBox, and unlike other OSes I&#8217;ve installed in VirtualBox, the sound driver wasn&#8217;t automatically recognized. I found a driver that works with both 32-bit and 64-bit versions.</p>
<p><a href="http://chrisjean.com/wp-content/uploads/2009/11/6285_Vista_APO.zip">VirtualBox Windows 7 Driver</a></p>
<p>I installed this both before and after installing the Guest Additions, but it didn&#8217;t matter what order the driver and Guest Additions were installed in.</p>
<p>Enjoy. <img src='http://chrisjean.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/12/virtualbox-audio-driver-for-windows-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sony VAIO Laptop BIOS and System Restore</title>
		<link>http://chrisjean.com/2009/11/11/sony-vaio-bios-and-system-restore/</link>
		<comments>http://chrisjean.com/2009/11/11/sony-vaio-bios-and-system-restore/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 04:06:30 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[Sony VAIO]]></category>
		<category><![CDATA[System Restore]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1715</guid>
		<description><![CDATA[Earlier tonight I had to work on a friends new Sony VAIO system. The model is VGN-NS330J, but the information I found seems to apply to all Sony VAIO laptops. Anyways, this machine was seriously messed up, and he just bought it. Since the system doesn&#8217;t ship with disks for recovering the Windows installation, I [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>Earlier tonight I had to work on a friends new Sony VAIO system. The model is VGN-NS330J, but the information I found seems to apply to all Sony VAIO laptops.</p>
<p>Anyways, this machine was seriously messed up, and he just bought it. Since the system doesn&#8217;t ship with disks for recovering the Windows installation, I figured that there had to be a hotkey combination that brought up the appropriate menu. Interestingly, this was put into the F8 Advanced Boot Options screen that is built into Windows.</p>
<p>If you want to recover the system back to factory defaults, reboot the system, wait for the VAIO logo to appear, and then start pressing F8. The Advanced Boot Options screen will appear shortly. Use the arrow keys to highlight the &#8220;Repair Your Computer&#8221; option and press Enter. From here, follow the instructions to accomplish what you want.</p>
<p>I did this, but it seems that even the recovery partition was hosed. This meant that his system was essentially worthless at this point. Fortunately, I had some Vista installation disks that could be used to reinstall the OS with the Windows serial key found on the bottom of the laptop.</p>
<p>When I rebooted with the installation disk, the disk didn&#8217;t boot. Come to find out, the primary boot option was the harddrive, which, frankly, is the worst boot option to be set as the primary boot method since there&#8217;s no way to bypass the hard disk boot without modifying the BIOS. How many computer users would know how to modify the boot priorities in BIOS? A better question: How many computer users even know what the BIOS is?</p>
<p>Unfortunately, Sony decided that having a pretty boot splash screen was more important than providing information on how to access the BIOS. Pressing the usual suspects of Esc and Del did nothing. At least they could have the courtesy of removing the splash screen when I hit a button so that I could see the options, but no.</p>
<p>After much too much searching around, I found out that F2 is the magic key. As soon as you boot, start pressing F2 about once a second until the BIOS screen shows.</p>
<p>I hope this helps you, the random person who found this information, and I hope that system developers see this and realize the following:</p>
<ol>
<li>Here&#8217;s the smart boot order to set up in the BIOS defaults of new systems: optical drive, external media, internal hard drive(s). This way, any bootable media works as expected without requiring users to go through BIOS first.</li>
<li>Sacrificing screens that instruct users on how to use basic functionality of the machine for aesthetics is not the right decision, it simply makes your hardware a pain to use. If you must have the pretty splash screens, have them go away when a key is pressed so that the user can see valuable information, such as keys to access BIOS and the POST information. Having a splash screen that requires a change in the BIOS to make it go away in order to see the information on how to access the BIOS is self-defeating.</li>
<li>Please bring back installation media or make a way for people to easily and cheaply acquire it. It would be fantastic if OEM system manufacturers would offer the ability to download the appropriate installation media directly from the manufacturer website. You could require a registered system complete with the serial information of the system in order to authenticate the download. This way there isn&#8217;t the increased cost of disk inventory and shipping. It would also allow customers to have quick resolution of problems since the customer could go to any location with internet access to quickly and easily get the necessary disk to use for recovery.
<p>This has the added benefit of ending the ridiculous permanent waste of space on computers in order to have a long-term storage of data that may never be used and may be corrupt by the time it is needed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/11/sony-vaio-bios-and-system-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move Gnome Panels to a Different Monitor in Ubuntu</title>
		<link>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/</link>
		<comments>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:37:05 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Dual Monitors]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Panels]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1709</guid>
		<description><![CDATA[My dual monitor setup didn&#8217;t work properly in Ubuntu 9.04, Jaunty Jackalope. Fortunately, it does work properly in 9.10, Karmic Kaola. However, this newfound dual monitor setup has given me a new problem: how do I move my panels to the secondary monitor? My office machine is a laptop. When I get in the office, [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>My dual monitor setup didn&#8217;t work properly in Ubuntu 9.04, Jaunty Jackalope. Fortunately, it does work properly in 9.10, Karmic Kaola. However, this newfound dual monitor setup has given me a new problem: how do I move my panels to the secondary monitor?</p>
<p>My office machine is a laptop. When I get in the office, I hook it up to a 24&#8243; LCD. I&#8217;d like to use this external monitor as the primary, which means that I definitely want to have my panels display on it. However, as much as I tried to drag the panels around or play around with settings, there just didn&#8217;t seem to be a way to get them over there. However, I just figured it out.</p>
<p>By default, panels are set to expand. This means that the panels will span the entire width or height of the section of the window they occupy. If the expand option is disabled, they turn into self-sizing bar that can be dragged to different edges or centered.</p>
<p>Having the expand option disabled also allows you to grab and edge of the panel and drag it to another screen. Once on the screen you want it on, simply re-enable the expand option and you now have the panel on another screen.</p>
<p>Here&#8217;s a step-by-step way of moving a panel to another screen:</p>
<ol>
<li>Right-click the panel you wish to move and select &#8220;Properties&#8221;.</li>
<li>Uncheck the &#8220;Expand&#8221; option under the &#8220;General&#8221; tab.</li>
<li>Grab one of the edges of the panel by clicking on the left or right end (top or bottom end for vertical panels).</li>
<li>Drag the bar to the desired screen and position.</li>
<li>Check the &#8220;Expand&#8221; option in the &#8220;Panel Properties&#8221; window and click &#8220;Close&#8221;.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/03/move-gnome-panels-to-a-different-monitor-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Use PHP Pear with Ubuntu</title>
		<link>http://chrisjean.com/2009/11/02/use-php-pear-with-ubuntu/</link>
		<comments>http://chrisjean.com/2009/11/02/use-php-pear-with-ubuntu/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:16:48 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Karmic Kaola]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1700</guid>
		<description><![CDATA[PEAR is PHP&#8217;s equivalent of Perl&#8217;s CPAN. It offers hundreds of ready-to-use code modules that can make projects go much more quickly than having to hand code everything. However, it never seems like PEAR is easy to get running. Installing the Needed Software In Ubuntu, installing the following packages will quickly get you started with [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p><a href="http://pear.php.net/" target="_blank">PEAR</a> is PHP&#8217;s equivalent of <a href="http://cpan.org/" target="_blank">Perl&#8217;s CPAN</a>. It offers hundreds of ready-to-use code modules that can make projects go much more quickly than having to hand code everything. However, it never seems like PEAR is easy to get running.</p>
<h3>Installing the Needed Software</h3>
<p>In Ubuntu, installing the following packages will quickly get you started with PEAR: php5-cli, php5-dev, and php-pear.</p>
<p>Make sure that you read the next section about problems with using PEAR to install PEAR packages if you are running 9.10, Karmic Kaola.</p>
<p>Here&#8217;s an example of how to quickly install those packages from the terminal.</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo apt-get install php5-cli php5-dev php-pear</span>
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
autoconf autoconf2.13 automake automake1.4 autotools-dev libltdl-dev libssl-dev libtool m4 php5-common shtool zlib1g-dev
Suggested packages:
autobook autoconf-archive gnu-standards autoconf-doc gettext libtool-doc automaken gfortran fortran95-compiler gcj php5-suhosin
The following NEW packages will be installed:
autoconf autoconf2.13 automake automake1.4 autotools-dev libltdl-dev libssl-dev libtool m4 php-pear php5-cli php5-common php5-dev shtool zlib1g-dev
0 upgraded, 15 newly installed, 0 to remove and 5 not upgraded.
Need to get 0B/8,690kB of archives.
After this operation, 27.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package m4.
(Reading database ... 127272 files and directories currently installed.)
Unpacking m4 (from .../archives/m4_1.4.13-2_i386.deb) ...
...</pre>
<p>With these packages, you are ready to roll with PHP and PEAR in Ubuntu.</p>
<h3>Problem with Ubuntu 9.10 Karmic Kaola</h3>
<p>A great thing about PEAR is that you can quickly install packages with a simple command. For example, &#8220;sudo pear install PHP_Parser-0.2.1&#8243; will install the <a href="http://pear.php.net/package/PHP_Parser/" target="_blank">PHP_Parser</a> package. However, this doesn&#8217;t work properly in Ubuntu 9.10, Karmic Kaola.</p>
<p>Output of the standard PEAR install command can be seen below:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo pear install PHP_Parser-0.2.1</span>
downloading PHP_Parser-0.2.1.tgz ...
Starting to download PHP_Parser-0.2.1.tgz (70,782 bytes)
.................done: 70,782 bytes</pre>
<p>While this doesn&#8217;t look wrong, it has actually failed. Rather than installing the package, it has simply downloaded the archive, encountered an unchecked error, and crashed. A successful installation has a message saying that the installation is successful.</p>
<p>This problem can be easily fixed by giving the install command the &#8220;-Z&#8221; option. For example:</p>
<pre class="terminal"><span style="color:#8FED99;">[<span style="color:#BBFF33;">chris@rommie</span> <span style="color:#729FCF;">~</span>]$</span> <span style="color:#FFF;">sudo pear install -Z PHP_Parser-0.2.1</span>
downloading PHP_Parser-0.2.1.tar ...
Starting to download PHP_Parser-0.2.1.tar (Unknown size)
.............................................................................done: 533,504 bytes
install ok: channel://pear.php.net/PHP_Parser-0.2.1</pre>
<p>Notice the &#8220;install ok: &#8230;&#8221; portion of the message. That&#8217;s what you should see at the end of a successful installation.</p>
<p>For more details on this bug, please check out <a href="https://bugs.launchpad.net/ubuntu/+source/php5/+bug/451314" target="_blank">Bug #451314</a> on the Ubuntu bug tracker.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/02/use-php-pear-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Volume not Working in Ubuntu 9.10 Karmic Kaola</title>
		<link>http://chrisjean.com/2009/11/02/fix-volume-not-working-in-ubuntu-9-10-karmic-kaola/</link>
		<comments>http://chrisjean.com/2009/11/02/fix-volume-not-working-in-ubuntu-9-10-karmic-kaola/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:17:37 +0000</pubDate>
		<dc:creator>gaarai</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[Karmic Kaola]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1691</guid>
		<description><![CDATA[I just encountered an odd issue with Ubuntu 9.10, Karmic Kaola. I had music playing in the background, I adjusted the volume, and I noticed that there wasn&#8217;t any change in the volume level. Even maxing out the volume and muting it had no effect. After wondering if the problem was that I went insane, [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>I just encountered an odd issue with Ubuntu 9.10, Karmic Kaola. I had music playing in the background, I adjusted the volume, and I noticed that there wasn&#8217;t any change in the volume level. Even maxing out the volume and muting it had no effect.</p>
<p>After wondering if the problem was that I went insane, I looked in Sound Preferences (right-click the volume icon and select Sound Preferences) and found that &#8220;RV635 Audio device [Radeon HD 3600 Series] Digital Stereo (HDMI)&#8221;  was selected under the device output. This means that Ubuntu was trying to send audio over my HDMI connection rather than through my headphone jacks.</p>
<p>This wasn&#8217;t a problem last night, so it might be due to the fact that my external monitor at the office runs over the HDMI connection, so it automatically switched to the HDMI audio output. In one way, this is nice, in another way, it will frustrate me to no end if it does this every time I&#8217;m at the office. If I&#8217;m right that it automatically switched upon detecting an active HDMI connection, then wouldn&#8217;t it be better to make it easier to provide a notification on where to switch the audio output rather than just switching it and causing confusion?</p>
<p><img class="alignnone size-full wp-image-1693" title="HDMI selected in sound output in Ubuntu Karmic Kaola" src="http://chrisjean.com/wp-content/uploads/2009/11/screenshot_017.png" alt="HDMI selected in sound output in Ubuntu Karmic Kaola" width="544" height="525" /></p>
<p>Switching the option to &#8220;Internal Audio Analog Stereo&#8221; instantly fixed the problem.</p>
<p>Oddly enough, when I manually selected the HDMI output again, it muted the analog output. So, it seems that it may not be a complete switchover or possibly just a bug. I&#8217;ll continue to see how the situation plays out and make a Ubuntu bug report if necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/11/02/fix-volume-not-working-in-ubuntu-9-10-karmic-kaola/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
