<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>GiveGoodWeb</title>
	
	<link>http://www.givegoodweb.com</link>
	<description>Web n' What-Not</description>
	<pubDate>Mon, 21 Sep 2009 22:28:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/GiveGoodWeb" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Using the Shell and Cron to Automate Your MySQL Backups</title>
		<link>http://www.givegoodweb.com/post/101/using-the-shell-and-cron-to-automate-your-mysql-backups</link>
		<comments>http://www.givegoodweb.com/post/101/using-the-shell-and-cron-to-automate-your-mysql-backups#comments</comments>
		<pubDate>Wed, 29 Apr 2009 16:34:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/101/using-the-shell-and-cron-to-automate-your-mysql-backups</guid>
		<description><![CDATA[This article describes a simple shell script that backs up your local MySQL databases. It also goes into how to automate the process so it runs everyday using a cron job. Handy!]]></description>
			<content:encoded><![CDATA[<p>This little shell script has proven to be a handy way to backup my local databases:</p>
<pre>#!/bin/bash<br style="font-size: 16.5px; line-height: 19.5px" /><br style="font-size: 16.5px; line-height: 19.5px" />cd '/folder/to/store/your/backups/'<br style="font-size: 16.5px; line-height: 19.5px" />for x in db-name-a db-name-b db-name-c
do
   mysqldump --user=username --password=pass $x --lock-tables --add-drop-table &gt; $x`date +%u`.sql;
done</pre>
<p>So what&#8217;s up with this little snippet? The first line with the &#8216;cd&#8217; commad, we&#8217;re just <strong>c</strong>hanging into the <strong>d</strong>irectory where all the sql dumps will be stored. I also store this little script in there (backup.sh).</p>
<p>The next line is a basic loop. we list all of the local database names we want to backup, right after the &#8220;for x in&#8221; phrase, separated by a space.  The indented line is what actually dumps, names, and saves the file. On my local development computer, I just pass in the root username and pass, so it will work for each database. Each backup file then follows the &#8220;db-name&#8221; + &#8220;day of week&#8221; naming convention. For example, <em>db-name-a1.sql</em> would be Monday&#8217;s backup, <em>db-name-a2.sql</em> would be Tuesday&#8217;s backup, etc. A week&#8217;s worth of backups is fine for me, though you can customize this to your liking.</p>
<p>And the command line, you can test if this is working like so (assuming you are in the same directory as the file):</p>
<pre>$ sh db-backup.sh</pre>
<h2>Not Working?</h2>
<p>If it&#8217;s not working, a couple things may be happening. You can alter the script with more conditionals to output some general errors, but OS X will actually mail you a detailed copy of the error. Getting at it can be a little cryptic though. At the prompt, type mail:</p>
<pre>$ mail</pre>
<p>If you see a message like <em>&#8220;You have mail in /var/mail/your-username&#8221;</em> then you should check it out. You can use the terminal to check it (<em>man mail</em> to check the manual entry for mail). Or, what I tend to do is just open the entire mail file in my text editor, which is TextMate - using the command line tool:</p>
<pre>$ mate /var/mail/your-username</pre>
<p>Some juicy debugging info may be in there. You can delete everything in the file and save it if  you like. This will get rid of the &#8220;You have mail in&#8230;&#8221; message whenever you start up terminal.</p>
<h3>Automating It</h3>
<p>I have this script run everyday at 3pm - I do that with a <a href="http://en.wikipedia.org/wiki/Cron" title="Wikipedia entry">cron job</a>, using <a href="http://h775982.serverkompetenz.net:9080/abstracture_public/projects-en/cronnix" title="Cronnix home page">Cronnix</a> as a graphical interface:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/04/screen-capture.png" alt="cronnix" width="549" height="299" /></p>
<p>One problem you may have is that your crontab&#8217;s path is not necessarily the same as your user account&#8217;s shell path. For example, if you are seeing an error like &#8220;mysqldump - command not found&#8221; - simply go back to the terminal, and enter &#8220;which mysqldump&#8221;:</p>
<pre>$ which mysqldump</pre>
<p>It will output the full path to this command. Copy that path and paste the full path into your script. So for example, the line following the &#8220;do&#8221; command may look like:</p>
<pre>/Applications/MAMP/Library/bin/mysqldump --user=user --password=pass $x --lock-tables --add-drop-table &gt; $x`date +%u`.sql;</pre>
<p>I use the <a href="http://www.mamp.info" title="MAMP home page">MAMP</a> version of mysql dump, so I need to tell the script exactly what version to use.</p>
<p>From here, I use <strong>SVN</strong> to keep this folder under version control as well, which makes switching from the desktop to the laptop much easier when developing. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/101/using-the-shell-and-cron-to-automate-your-mysql-backups/feed</wfw:commentRss>
		</item>
		<item>
		<title>Drupal Multi-site Configuration on a Dedicated Server</title>
		<link>http://www.givegoodweb.com/post/99/drupal-multi-site-dedicated-server</link>
		<comments>http://www.givegoodweb.com/post/99/drupal-multi-site-dedicated-server#comments</comments>
		<pubDate>Mon, 23 Mar 2009 19:00:51 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/99/drupal-multi-site-configuration-on-dedicated-server</guid>
		<description><![CDATA[So I just figured out how to get Drupal&#8217;s multi-site configuration working on my Rackspace Linux server.
Let&#8217;s say  your Drupal core is located at my-drupal-core.com. Install Drupal there, this will be your master copy.
Within your &#8217;sites&#8217; folder, create a folder for each domain you will want to run off this core installation. Let&#8217;s say [...]]]></description>
			<content:encoded><![CDATA[<p align="left">So I just figured out how to get Drupal&#8217;s multi-site configuration working on my Rackspace Linux server.</p>
<p>Let&#8217;s say  your Drupal core is located at <em>my-drupal-core.com</em>. Install Drupal there, this will be your master copy.</p>
<p>Within your &#8217;sites&#8217; folder, create a folder for each domain you will want to run off this core installation. Let&#8217;s say we&#8217;ll make a Drupal site, based on this core, which will be <em>drupal-slave.com</em>.  So, within your <em>sites</em> folder, create a drupal-slave.com folder. I prefer using a different database for each site. So create the database for the slave site, and then copy the settings.php file from your <em>sites/default</em> folder, alter it for your slave database, and put it into the drupal-slave.com folder. While you&#8217;re in there, create a <em>files</em> folder, you may need to change its permissions to 777.</p>
<p>So, your drupal-slave.com folder should look like this:</p>
<pre>sites
   -- drupal-slave.com [folder]
      -- settings.php
      -- files [folder]
      -- modules [modules specific to this domain]
      -- themes [themes specific to this domain]</pre>
<p>Now, on my server, every domain has a <em>vhost.conf</em> file, located inside a domains <em>conf</em> directory - this is at least how Red Hat does it. If you have a <em>conf </em>folder, but no <em>vhost.conf</em> file, go ahead and create it - you&#8217;ll likely need to login as root to do this.</p>
<p>Now, within your <em>vhost.conf</em> file (for drupal-slave.com, in this scenario), you&#8217;ll need to do something like this (alter for your own needs):</p>
<pre>DocumentRoot /httpd/vhosts/<em>my-drupal-core.com</em>/httpdocs&lt;Directory /httpd/vhosts/<em>my-drupal-core.com</em>/httpdocs&gt;
  php_admin_value open_basedir /tmp:/httpd/vhosts/<em>my-drupal-core.com</em>/httpdocs
  AllowOverride All
&lt;/Directory&gt;</pre>
<p>Then, (gracefully) restart Apache - viola! Works for me at least. By the way, the AllowOverride All is to allow the <em>my-drupal-core.com&#8217;s </em>.htaccess file to work on all slave sites. The /tmp directory allows the slave site to write to the tmp directory for file uploads. Hope this helps someone.</p>
<h2>Security</h2>
<p>Note that with a multi-site setup, you really need to be careful of who can use the PHP filter (preferably, nobody). Reason being you can use PHP to read/output any domain&#8217;s <em>settings.php</em> file and gain access to the database username and password for any domain sharing the Drupal installation, including the master domain. Careful! This alone makes me think I won&#8217;t be using a multisite setup for high profile sites, or any site I&#8217;m not directly managing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/99/drupal-multi-site-dedicated-server/feed</wfw:commentRss>
		</item>
		<item>
		<title>Drupal - Adding Author Name Search to Main Search Results Page</title>
		<link>http://www.givegoodweb.com/post/97/drupal-add-author-to-search</link>
		<comments>http://www.givegoodweb.com/post/97/drupal-add-author-to-search#comments</comments>
		<pubDate>Tue, 17 Mar 2009 13:58:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/97/drupal-add-author-to-search</guid>
		<description><![CDATA[Perhaps you typed an author's name into Drupal's search box, looking for content from that particular author. But for all Drupal knows, you're just looking for content that matches the search phrase you just entered and could care less about who wrote it.]]></description>
			<content:encoded><![CDATA[<p align="left">Perhaps you typed an author&#8217;s name into Drupal&#8217;s search box, looking for content from that particular author. But for all Drupal knows, you&#8217;re just looking for content that matches the search phrase you just entered and could care less about who wrote it.</p>
<h2>What do to?</h2>
<p align="left"><em>Note: This page assumes some familiarity with how Drupal works. </em></p>
<p align="left"> The answer is the following sequence:</p>
<ol>
<li>Alongside the regular data query, query the user database for a username using a LIKE query, and if one is found, grab the user id too (uid).</li>
<li>Perform a search for published content that matches that user id.</li>
<li>Count the total pieces of content found.</li>
<li>Spit out a link on the search result page that says something like, <em>&#8220;Looking for posts written by Joe Author? (# found)&#8221;</em></li>
</ol>
<p align="left">I was hoping I could use the Views module for this, but I couldn&#8217;t figure out how to do a &#8220;LIKE&#8221; query with it. Besides, rather than loading a huge view object, why not to write a couple simple functions to do this? They can be efficient, and still take advantage of Drupal&#8217;s nifty (and secure) database functionality. The finished search page will look something like this:</p>
<p align="left"><img src="http://www.givegoodweb.com/wp-content/uploads/2009/03/include-user-name-search.png" alt="include-user-name-search.png" height="425" width="572" /></p>
<p align="left"><strong>Step 1: Build the query function</strong></p>
<p align="left">First things first - open up your theme&#8217;s <em>template.php</em> file. This is the place we store functions that we want to make available to the theme you are using. We&#8217;re going to add the following function to it - I&#8217;ve commented it pretty heavily:</p>
<pre>
/**
  * This function will search the database for an
  * aurhor's name, if it finds a match, will
  * count how many published stories and forum topics
  * they have
  * @param $name - the user name being searched for
  */
function get_user_content_total($name) {
  // this is the placeholder for the output link we're building
  $output = '';

  // build a user name search query with a string placeholder
  $sql = "SELECT name, uid FROM {users} WHERE name LIKE '%%%s%%'";
  $result = db_query(db_rewrite_sql($sql), $name);

  // build a count query with a digit placeholder for the user_id (uid from last query)
  $sql_count = "SELECT COUNT(node.uid) as count
  FROM {node} WHERE ({node}.status &lt;&gt; 0) AND ({node}.type in ('forum', 'story')) AND ({node}.uid = %d)";

  // iterate over the results
  while ($data = db_fetch_object($result)) {
    $result_count = db_query(db_rewrite_sql($sql_count), $data-&gt;uid);
    $data_count = db_fetch_object($result_count);

    // if we found any stories or forum topics, generate the text and link
    if ($data_count-&gt;count &gt; 0) {
      $link_text = t('» Looking for content written by %author (%count)?', array('%author' =&gt; $data-&gt;name, '%count' =&gt; $data_count-&gt;count));
      $link = l($link_text, 'user/' . $data-&gt;uid . '/recent', array('html' =&gt; TRUE));
      $output .= '&lt;p&gt;' . $link . '&lt;/p&gt;' . "\n";
    }
  }
  return $output;
}</pre>
<p align="left">You might be wondering about my link. Basically, I have a view already setup to fetch content written by a specific user. <a href="http://www.givegoodweb.com/post/95/drupal-get-username-from-uid" title="Getting a name and content from UID">More on that over here</a>. Ok, now we have some data to work with, so on to displaying it.</p>
<p align="left"><strong>Step 2: Override the Search Results Template</strong></p>
<p align="left">The search module has a template file name <em>search-results.tpl.php</em> - we&#8217;re going to override that template file simply by making a file of the same name in our theme&#8217;s directory. So, your theme&#8217;s directory, create a file called <em>search-results.tpl.php</em> and put this into it:</p>
<pre align="left">
&lt;?php
print get_user_content_total(arg(2));
?&gt;
&lt;dl class="search-results &lt;?php print $type; ?&gt;-results"&gt;
  &lt;?php print $search_results; ?&gt;
&lt;/dl&gt;
&lt;?php print $pager; ?&gt;</pre>
<p align="left">Now, the only difference between the search module&#8217;s <em>search-results.tpl.php</em> and ours is that ours calls our function at the top - the rest is exactly the same. And the nice thing about overriding it in this manner is that the next time we upgrade Drupal, our custom template here won&#8217;t get overridden because we&#8217;re not touching any core files.</p>
<p align="left">After you create this file, you&#8217;ll need to visit admin/build/modules, which will rebuild the template files and let Drupal know that we are overriding something.</p>
<p align="left">The last thing you may be asking is what&#8217;s with the <em>arg(2)</em> thing. That is just Drupal&#8217;s way of fetching things from the current URL. When you search with the search module, the URL is something like:</p>
<pre align="left">http://www.your-drupal.com/search/node/search words</pre>
<p align="left">The counting starts at 0, and does not include the domain. So &#8217;search&#8217; is 0, &#8216;node&#8217; is 1, and &#8217;search words&#8217; is 2. Since this URL is always structured this way for a search result page, we can just pull the search query words directly from it, and rely on Drupal&#8217;s database functions to clean them up for safe querying.</p>
<p align="left">This may not be the best way to do this - so I&#8217;m all ears if there&#8217;s a better way, cheers!</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/97/drupal-add-author-to-search/feed</wfw:commentRss>
		</item>
		<item>
		<title>Drupal: Get a Username from a User ID</title>
		<link>http://www.givegoodweb.com/post/95/drupal-get-username-from-uid</link>
		<comments>http://www.givegoodweb.com/post/95/drupal-get-username-from-uid#comments</comments>
		<pubDate>Tue, 17 Feb 2009 23:02:45 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/95/drupal-get-username-from-uid</guid>
		<description><![CDATA[I&#8217;ve been really enjoying working with Drupal - the more I learn about it, the more ideas I get on how to use it. Yet, sometimes it can make a simple thing a bit daunting - like fetching a user&#8217;s name from a user id, without needed to load the entire user object with user_load() [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been really enjoying working with Drupal - the more I learn about it, the more ideas I get on how to use it. Yet, sometimes it can make a simple thing a bit daunting - like fetching a user&#8217;s name from a user id, without needed to load the entire user object with <a href="http://api.drupal.org/api/function/user_load/6" title="user_load api doc">user_load()</a> - which can get expensive.</p>
<p>So, here&#8217;s a handy little function. Just plop it in your template.php file for your theme of choice, and it will be available where you need it on your site (as long as you&#8217;re using that template!):</p>
<pre>function getUserName($id) {
  $sql = "SELECT name FROM {users} WHERE uid = '$id'";
  $result = db_query(db_rewrite_sql($sql));
  $username = db_fetch_object($result);
  return $username-&gt;name;
}</pre>
<p>To use it for output, just do something like:</p>
<pre>&lt;?php print getUserName(1234); ?&gt;</pre>
<h2>Using This With the Views Module</h2>
<p>I often use this with the Views module. For example, I have a View for displaying all content created by a given user. The URL looks something like this:</p>
<p>http://www.some-drupal-site.com/user/1234/recent</p>
<p>The &#8220;1234&#8243; is the user id argument getting passed to the view. The view will then go in and fetch content created by this user id. Oftentimes I want to create a nice header in the View with dynamic output - but Views doesn&#8217;t really allow that sort of thing in the header/footer areas under Basic Settings. So I use this function to get around it. In the view&#8217;s header, I do this to fetch a username:</p>
<pre>&lt;?php
  $view=views_get_current_view();
  $user_name = getUserName($view-&gt;args[0]);
  print '&lt;h1&gt;Content created by  ' . $user_name . '&lt;/h1&gt;';
?&gt;</pre>
<p><em>*Note that to get the PHP input type working, you need to allow the PHP Filter in the modules section, and then select PHP as the input type for this view&#8217;s header.</em></p>
<p>Note that after you click the Update button, the Views module may give you an error message - that&#8217;s OK. It just doesn&#8217;t know what to do with this php code outside of the actual page you&#8217;re going to use it on.Below is a screenshot example.</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/02/user-header-views.png" alt="user-header-views.png" /></p>
<p>Hope this helps someone! And if you know a better way to do this, speak up! Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/95/drupal-get-username-from-uid/feed</wfw:commentRss>
		</item>
		<item>
		<title>Drupal - Encoding Email Addresses to Deter Spam-bots</title>
		<link>http://www.givegoodweb.com/post/91/druapl-encode-email</link>
		<comments>http://www.givegoodweb.com/post/91/druapl-encode-email#comments</comments>
		<pubDate>Mon, 12 Jan 2009 21:15:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/91/druapl-encode-email</guid>
		<description><![CDATA[While working on my latest Drupal project, I really wanted an easy, brainless way for users to create clickable &#8220;mailto:&#8221; links that gave pesky spam-bots a hard time.
Turns out, the Bbcode module does just the trick. Even if you don&#8217;t normally use it, you can add this input filter to your standard HTML filters, and [...]]]></description>
			<content:encoded><![CDATA[<p>While working on my latest Drupal project, I really wanted an easy, brainless way for users to create clickable &#8220;mailto:&#8221; links that gave pesky spam-bots a hard time.</p>
<p>Turns out, the <strong>Bbcode module</strong> does just the trick. Even if you don&#8217;t normally use it, you can add this input filter to your standard HTML filters, and it will work. The first step is to <a href="http://drupal.org/project/bbcode" title="Bbcode Module page">download and install the module</a>.</p>
<p>Next up, enable the module, and add it to your input filters (located at /admin/settings/filters):</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/01/input-filters.png" alt="input-filters.png" height="112" width="502" /></p>
<p>As you can see,  you don&#8217;t even need to assign it any roles. However, the Filtered HTML and Full HTML filters can use it, just set them up like so:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/01/input-filters-shot.jpg" alt="Input Filters" height="288" width="501" /></p>
<p>Next, go in and and <em>configure</em> the Bbcode module to encode email addresses:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/01/bbcode-email.png" alt="bbcode-email.png" /></p>
<p>Now, to use it - just use the standard bbcode to encode any email address:</p>
<p>[email]someone@domain.com[/email]</p>
<p>And when the page is rendered, the underlying HTML will all be JavaScript gobbly-gook, but to the end user, it will be a normal link.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/91/druapl-encode-email/feed</wfw:commentRss>
		</item>
		<item>
		<title>Transferring IMAP email to Google Apps for Your Domain</title>
		<link>http://www.givegoodweb.com/post/88/transferring-imap-email-to-google-apps-for-your-domain</link>
		<comments>http://www.givegoodweb.com/post/88/transferring-imap-email-to-google-apps-for-your-domain#comments</comments>
		<pubDate>Fri, 09 Jan 2009 17:48:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[GAFYD]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/88/transferring-imap-email-to-google-apps-for-your-domain</guid>
		<description><![CDATA[Over the holiday break, I took the plunge and migrated my businesses email service over to Gmail, using Google Apps for Your Domain (GAFYD) Premier Edition for businesses. For $50 per user per year, a 99.9% SAL, 25 gigs of space, extra bad-ass spam filtering, virus protection, backups, etc. I figured why the heck not.
Modifying [...]]]></description>
			<content:encoded><![CDATA[<p>Over the holiday break, I took the plunge and migrated my businesses email service over to Gmail, using <a href="http://www.google.com/apps/intl/en/business/index.html" title="Intro Page">Google Apps for Your Domain</a> (GAFYD) Premier Edition for businesses. For $50 per user per year, a 99.9% SAL, 25 gigs of space, extra bad-ass spam filtering, virus protection, backups, etc. I figured why the heck not.</p>
<p>Modifying the <a href="http://www.google.com/support/a/bin/answer.py?answer=47283&amp;cbid=v6heh6ja1ghx&amp;src=cb&amp;lev=answer" title="Configure some C Names">DNS</a> and <a href="http://www.google.com/support/a/bin/answer.py?hl=en&amp;answer=33352" title="Admin help center">MX records</a> was very easy (note if you use <a href="http://www.google.com/support/a/bin/answer.py?hl=en&amp;answer=77041" title="GAFYD Postini Help">Postini</a>, you will need to use different records) - they provide clear directions on this. However, make sure you <a href="http://www.google.com/support/a/bin/answer.py?hl=en&amp;answer=33786" title="GAFYD SPF info"><strong>install SPF records</strong></a>, this gives Google/Postini permission to send email on behalf of your domain. This will ensure you make it through today&#8217;s highly sensitive spam filters.</p>
<p>The only part of the transfer that made me a little nervous, and gave me a little trouble, was migrating my existing IMAP email over to the GAFYD servers. It&#8217;s really just a matter of knowing what IMAP client your current email server uses, and then entering the correct settings. Google provides a handy tool for doing this, but only supports certain IMAP servers, so check that yours is on the list. As of this writing, the supported IMAP servers are: Microsoft Exchange Server 2003, Cyrus IMAP Server, Courier-IMAP, and Dovecot.</p>
<p>Here are the settings I used:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2009/01/gmail-imap-xfer.jpg" alt="gmail-imap-xfer.jpg" /></p>
<p>143 is the default IMAP port. The thing that was tripping me up was the &#8220;IMAP Path Prefix.&#8221; Is this the path to where the email is stored on the server? A folder prefix name? It seemed no matter what I put in there, the only email folder it could find was &#8220;Inbox&#8221; - none of my subfolders where showing up.</p>
<p>Finally, I just left it blank, and whammo! All my subfolders were found. However, the &#8220;exclude&#8221; option did not work for me, which is fine - I can clean that up later.</p>
<p>After verifying that everything looked OK, I started the transfer. When I got back from lunch, it was finished! Cool.</p>
<h2>Folders to Labels</h2>
<p>This feature didn&#8217;t quite work as I expected it to. All my IMAP folders were indeed correctly labeled, but they were labeled with the full folder path. For example, if I had &#8220;folder-b&#8221; inside &#8220;folder-a&#8221; which was inside my Inbox, the label would be: &#8220;Inbox.folder-a.folder-b&#8221; - which is actually a smart way to do it because it takes into account that 2 folders may have the same name, but be in different locations. After the import, all I had to do was tweak my label names.</p>
<h3>Am I Glad I Did It?</h3>
<p>Absolutely. I love it. Being a huge fan of keyboard shortcuts, I can fly around Gmail like no other email program. And the spam filtering (along with Postini - a GAFYD free add-on), is the best. It just works, even better than Spam Assasin. Postini sends me a daily email with whatever emails it has quarantined, so I don&#8217;t have to constantly log in and check to see if a legitimate message was caught. I also enjoy the full suite of GAFYD apps - in particular the Calendar. And if you&#8217;re on a Mac, you&#8217;ll want to check out <a href="http://mailplaneapp.com/" title="Mail Plane">MailPlane</a> - an excellent way to work in Gmail.</p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/88/transferring-imap-email-to-google-apps-for-your-domain/feed</wfw:commentRss>
		</item>
		<item>
		<title>Use Terminal to Find and Create a Textmate Project</title>
		<link>http://www.givegoodweb.com/post/86/use-terminal-to-find-and-create-a-textmate-project</link>
		<comments>http://www.givegoodweb.com/post/86/use-terminal-to-find-and-create-a-textmate-project#comments</comments>
		<pubDate>Mon, 22 Dec 2008 21:32:21 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[texmate quicksilver]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/86/use-terminal-to-find-and-create-a-textmate-project</guid>
		<description><![CDATA[I&#8217;ve been spending more time than usual using the Terminal, and I like how quick it to get around the file system. Today, while messing with the linux find command, I started to wonder if I could search for a folder, and then open it as a project in TextMate, all with a one line [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending more time than usual using the Terminal, and I like how quick it to get around the file system. Today, while messing with the linux <strong>find</strong> command, I started to wonder if I could search for a folder, and then open it as a project in TextMate, all with a one line command. Turns out you can!</p>
<p align="left">In the following example, my current location is my Desktop, and I&#8217;m looking for a newsletter folder called &#8220;goodie69.&#8221; Assuming it&#8217;s found, open it in TextMate:</p>
<pre>[ ~/Desktop ]$ find . -type d -name 'goodie69' -exec mate {} \;</pre>
<p><em>Note that you need the <a href="http://manual.macromates.com/en/using_textmate_from_terminal.html" title="official documentation on this">TextMate command line tool</a> installed and in your path to do this.</em></p>
<p>So, first I&#8217;m issuing the <em><a href="http://www.oreillynet.com/linux/cmd/cmd.csp?path=f/find" title="examples">find</a></em> command, the single dot specifies start in the directory I&#8217;m currently in, the &#8220;<em>-type d&#8221;</em> means I&#8217;m only looking for <strong>d</strong>irectory names, and then I&#8217;m taking the results and <strong>exec</strong>uting the &#8220;<em>mate&#8221;</em> command. You need to close out the <a href="http://linux.die.net/man/3/exec" title="Man page. Not an easy read.">exec</a> command with the brackets, backslash and semi-colon.</p>
<p>If you use BBEdit, and have the bbedit command line tool installed, you can replace &#8220;mate&#8221; with &#8220;bbedit&#8221;.</p>
<p>You can also specify any directory to start looking in (by default, this command will look in subdirectories). For example, if you have a folder called &#8220;clients&#8221; inside your home folder, and want to look in there for a particular folder, you can do something like this:</p>
<pre>[ ~/Desktop ]$ find ~/clients -type d -name 'goodie69' -exec mate {} \;</pre>
<p>And if you want to search for a file and open it in TextMate:</p>
<pre>[ ~/Desktop ]$ find ~/clients -type f -name 'i-like-muffins.txt' -exec mate {} \;</pre>
<p>Or,  you can <a href="http://vlandham.wordpress.com/2007/09/20/quicksilver-trigger-open-with-textmate/" title="Quicksilver tip!">just use Quicksilver</a> ;)</p>
<p>To do this in Quicksilver - you just start typing the name of the folder, then tab over and select &#8220;open with&#8221; as the next option (or just start typing &#8220;with&#8221;), then tab over start typing &#8220;TextMate&#8221; until TextMate shows up. Then Enter. Whamo. If you don&#8217;t see the &#8220;open with&#8221; option, refer to the article above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/86/use-terminal-to-find-and-create-a-textmate-project/feed</wfw:commentRss>
		</item>
		<item>
		<title>phpMyAdmin: Bypass File Upload Size Limit</title>
		<link>http://www.givegoodweb.com/post/82/phpadmin-upload-restriction</link>
		<comments>http://www.givegoodweb.com/post/82/phpadmin-upload-restriction#comments</comments>
		<pubDate>Tue, 25 Nov 2008 16:57:33 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/82/phpadmin-upload-restriction</guid>
		<description><![CDATA[When you want to import a large SQL query in phpMyAdmin, you can run into problems as the default upload size limit is restricted by whatever it is in the php.ini file - and often, you cannot change this or simply don&#8217;t want to. It tends to default to a measly 2MB.
However, there&#8217;s a feature [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to import a large SQL query in <a href="http://www.phpmyadmin.net" title="www.phpmyadmin.net">phpMyAdmin</a>, you can run into problems as the default upload size limit is restricted by whatever it is in the php.ini file - and often, you cannot change this or simply don&#8217;t want to. It tends to default to a measly 2MB.</p>
<p>However, there&#8217;s a feature that will allow you to FTP your SQL file to an upload directory of your choosing, and then instruct phpMyAdmin to run the query file. Here&#8217;s how you do it.</p>
<ol>
<li>Open up your FTP program, and navigate to the phpmyadmin folder on your server. Inside that folder is a file called <strong>config.inc.php</strong> - open this up in your trusty text editor.</li>
<li>While you&#8217;re still in your FTP program - create a directory inside the phpmyadmin directory called <strong>upload</strong>:<br />
<img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/phpmyadmin-trans.png" alt="phpmyadmin-trans.png" /></li>
<li>Towards the bottom of the config file, you&#8217;ll notice a potential setting for $cfg['UploadDir']. Change it so that it reads the following:<br />
<img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/phpmyadmin-config.png" alt="phpmyadmin-config.png" /><br />
Don&#8217;t forget to add the &#8220;./&#8221; before &#8220;upload&#8221; - this just tells the program to look in the existing directory (phpmyadmin) for a folder called &#8220;upload&#8221; - there&#8217;s no need to change file permissions or anything.</li>
<li>Save it, and then go back to your ftp program, and upload a sql file to that directory.</li>
<li>When you go to the <strong>Import tab</strong> in phpMyAdmin, you&#8217;ll now see a drop-down list of available files within your upload directory. Pick the one you want to run.<br />
<img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/phpmyadmin2.png" alt="phpmyadmin2.png" /></li>
<li>Sit back, have some coffee.</li>
</ol>
<h2>Some Notes</h2>
<ul>
<li>You can compress the file, which will certainly make your FTP upload time shorter. I found that gzip works best for that. Sometimes a zip file would give me an error.</li>
<li>Note that you can still run into trouble if your query is HUGE. If your php execution time and/or timeout settings are not big enough in your php.ini file, executing your query can be problematic. However, you can always chop up your data inserts into numerous files, although that can be a pain. <em>(Or, if you have SSH access, you can execute the query file that way.)</em> I encountered this problem while trying to import a <strong>big Drupal database</strong>. I solved it be emptying (<em>NOT</em> dropping) all the search-related database tables, and then re-indexing the site once all the other data was inserted.</li>
</ul>
<p>That&#8217;s it - I was pleased to discover this feature and hope it helps someone else out too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/82/phpadmin-upload-restriction/feed</wfw:commentRss>
		</item>
		<item>
		<title>Narrowing Your Google Search Results</title>
		<link>http://www.givegoodweb.com/post/77/google-search-tips</link>
		<comments>http://www.givegoodweb.com/post/77/google-search-tips#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:01:01 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/77/google-search-tips</guid>
		<description><![CDATA[Using a few simple tricks, you can help trim down those enormous search results in Google to locate what you are actually looking for.]]></description>
			<content:encoded><![CDATA[<p>There are a few simple tricks that can help you narrow down what you are Googling for. Let&#8217;s just use an example and dive right in.</p>
<p>I&#8217;m looking for a band in Chicago called Sugar Beat. So, I start my search like this:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/search-sweets.png" alt="search-sweets.png" height="355" width="550" /></p>
<p>Hmmm&#8230; Even though I&#8217;m not looking for anything about cooking or food, I do need to trim the fat here.</p>
<p>By placing the words &#8220;sugar beat&#8221; in quotes, I tell Google that I am looking for this <em>phrase</em> - in other words, do <strong>not</strong> show me a page that contains sugar AND/OR beat - only return pages that have the words &#8220;sugar beat&#8221; <em>right next to each other and in that order</em>. Furthermore, let&#8217;s get rid of the word &#8220;sweets&#8221; - we do this by simply ending our query with &#8220;-sweets&#8221; - that&#8217;s a minus sign, and the word sweets (no space in between). This will help disassociate our search from pages related to food/desert:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/search-gb.png" alt="search-gb.png" height="182" width="546" /></p>
<p>This still isn&#8217;t perfect, but I think you&#8217;re getting the idea. One thing I want to point out here is that <strong>Google ignores punctuation</strong> - notice in the above example, that &#8220;&#8230; sugar<strong>.</strong> Beat&#8230;&#8221; turns up. <em>So, if you are writing for search engines and need to use certain keyword phrases, keep in mind that you can use punctuation within your keyword phrase without risk.</em></p>
<p>Also, note that you can subtract more that one word from your query like this:</p>
<pre>"sugar beat" chicago -sweets -cookies</pre>
<p>So, if we can remove words from our queries, can we remove phrases? Yes, just put a phrase in quotes:</p>
<pre>"sugar beat" chicago -"sweet tasty goodies"</pre>
<p>And if we can subtract, surely we can add - right? You betcha - this next query will only return pages that have the phrase <em>&#8220;sugar beat&#8221;</em> along with the word <em>music</em>, but that do not have the word <em>sweets</em>:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/search-plus-minus.png" alt="search-plus-minus.png" height="393" width="550" /></p>
<p>Now we&#8217;re getting closer!  That first site listing looks interesting&#8230; Can I limit a search to just one website? Sure can:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/search-site.png" alt="search-site.png" height="319" width="549" /></p>
<p>By simply finishing our query with <strong>site:www.songkick.com</strong> - we restrict our search to that site.</p>
<p>So, by simply altering our search query in some intuitive ways, you can find what you are looking for faster by either filtering out, or forcibly including, keywords &amp; phrases into your search. I do this so much it&#8217;s become second nature - hope you find it useful too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/77/google-search-tips/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using “Go to Symbol” in a Texmate CSS File</title>
		<link>http://www.givegoodweb.com/post/74/textmate-css-symbols</link>
		<comments>http://www.givegoodweb.com/post/74/textmate-css-symbols#comments</comments>
		<pubDate>Tue, 11 Nov 2008 19:51:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[text-editors]]></category>

		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://www.givegoodweb.com/post/74/textmate-css-symbols</guid>
		<description><![CDATA[CSS files have a tendency to get unruly - I feel like I&#8217;m always scrolling up and down the file, even when I have it nice and organized by section, just to find a section. Sure, sometimes I bring up the Find dialog. Using the keyboard shortcut of Apple+f is handy enough. But when I [...]]]></description>
			<content:encoded><![CDATA[<p align="left">CSS files have a tendency to get unruly - I feel like I&#8217;m always scrolling up and down the file, even when I have it nice and organized by section, just to find a section. Sure, sometimes I bring up the <em>Find</em> dialog. Using the keyboard shortcut of Apple+f is handy enough. But when I started working with Drupal, I found a better way.</p>
<p><a href="http://drupal.org/" title="drupal.org">Drupal</a> uses a style of commenting that I haven&#8217;t used much before, called <a href="http://www.stack.nl/~dimitri/doxygen/" title="more on this">Doxygen</a>:</p>
<pre>/**
 * Your comment text
 */</pre>
<p>I like this quite a bit - not only is it nice and clean looking, but software has an easy time picking up on it (such as for generating documentation). It can be used to comment in both CSS and PHP.</p>
<p>In the following screenshot/example, you can see how <a href="http://macromates.com/" title="textmate home page">Textmate</a> picks up on this, and adds the comment text to the symbol menu in the lower right corner:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/right-oriented.jpg" alt="Symbol menu in Textmate" height="373" width="556" /></p>
<p>So now, not only can I access every CSS rule via this symbol pop-up menu, but I can access my sections as well. For those of us that don&#8217;t like to switch to the mouse, you can bring up the <strong>go to symbol</strong> pop-up box with the <em>Shift+Apple+T</em> keyboard shortcut, then start typing into the <strong>Filter box</strong> what you&#8217;re looking for. In this example I started typing &#8220;right&#8221; and since my <em>Right Oriented Section</em> starts with an asterisk, it jumps right to the top:</p>
<p><img src="http://www.givegoodweb.com/wp-content/uploads/2008/11/go-to-symbol.jpg" alt="Go to symbol" /></p>
<p>Then I just press Enter, and it jumps to that point in the file for me, with the cursor right there too.</p>
<p>Anyways - so there you have it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.givegoodweb.com/post/74/textmate-css-symbols/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
