<?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>Guillermo Rauch&#039;s Devthought &#187; Tumble</title>
	<atom:link href="http://www.devthought.com/category/tumble/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devthought.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 16:38:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google Chrome and 1Password</title>
		<link>http://www.devthought.com/2010/02/11/google-chrome-and-1password/</link>
		<comments>http://www.devthought.com/2010/02/11/google-chrome-and-1password/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 18:48:01 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1119</guid>
		<description><![CDATA[The new Google Chrome Beta for mac and the alpha 1Password extension work perfectly together!]]></description>
			<content:encoded><![CDATA[<p><img src="http://cld.ly/571csx" /></p>
<p>The new <a href="http://chrome.blogspot.com/2010/02/new-beta-of-google-chrome-for-mac-with.html">Google Chrome Beta</a> for mac and the <a href="http://www.switchersblog.com/2010/01/a-1password-alpha-for-chromium-is-here.html">alpha 1Password extension</a> work perfectly together!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2010/02/11/google-chrome-and-1password/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Inner shadows in CSS3</title>
		<link>http://www.devthought.com/2010/02/04/inner-shadows-in-css3/</link>
		<comments>http://www.devthought.com/2010/02/04/inner-shadows-in-css3/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 04:33:21 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1114</guid>
		<description><![CDATA[-webkit-box-shadow (in Webkit nightly) and -moz-box-shadow support inner shadows with the inset keyword. Both also support multiple shadow declarations separated by commas. Want to achieve the box pictured above? div.box { -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px &#8230; <a href="http://www.devthought.com/2010/02/04/inner-shadows-in-css3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><code class="inline">-webkit-box-shadow</code> (in Webkit nightly) and <code class="inline">-moz-box-shadow</code> support inner shadows with the <code class="inline">inset</code> keyword. Both also support multiple shadow declarations separated by commas.</p>
<p><img src="http://cld.ly/8719st" /></p>
<p>Want to achieve the box pictured above?</p>
<pre class='highlight ' lang="css">
div.box {
   -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
   -moz-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
   -webkit-border-radius: 10px;
   -moz-border-radius: 10px;
   border: 1px solid #fff;
   padding: 6px;
   width: 200px;
   background: #fff;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2010/02/04/inner-shadows-in-css3/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Get ssh-copy-id in Mac OS X</title>
		<link>http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/</link>
		<comments>http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 21:06:19 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1045</guid>
		<description><![CDATA[There&#8217;s a very convenient shell script bundled with some distributions of OpenSSH called ssh-copy-id. It seems not to be the case with Leopard&#8217;s SSH. In order to get it, we can simply check it out of a SVN repository. Execute &#8230; <a href="http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a very convenient shell script bundled with some distributions of OpenSSH called <code class="inline">ssh-copy-id</code>. It seems not to be the case with Leopard&#8217;s SSH.</p>
<p>In order to get it, we can simply check it out of a SVN repository. Execute this two commands:</p>
<pre class='highlight ' lang="bash">
sudo curl "http://www.chiark.greenend.org.uk/ucgi/~cjwatson/cvsweb/openssh/contrib/ssh-copy-id?rev=1.8;content-type=text%2Fplain" -o /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id
</pre>
<p>And you&#8217;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Symfony tip: Watching your logs on mac with Console</title>
		<link>http://www.devthought.com/2009/08/31/symfony-tip-watching-your-logs-on-mac-with-console/</link>
		<comments>http://www.devthought.com/2009/08/31/symfony-tip-watching-your-logs-on-mac-with-console/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 18:06:30 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1033</guid>
		<description><![CDATA[Not a big fan of the Web Developer toolbar? Me either! But I do use the logging system quite a bit. Thankfully, OS X ships with an useful application called Console that comes to the rescue. Open the Console application &#8230; <a href="http://www.devthought.com/2009/08/31/symfony-tip-watching-your-logs-on-mac-with-console/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://devthought.com/wp-content/snaps/frontend_dev.log.png" /><br />
Not a big fan of the Web Developer toolbar? Me either! But I do use the logging system quite a bit. Thankfully, OS X ships with an useful application called <strong>Console</strong> that comes to the rescue.</p>
<ol>
<li>Open the Console application</li>
<li>Go to File > Open and browse to your <code class="inline">frontend_dev.log</code> or desired log file in the symfony logs directory</li>
<li>Click <code class="inline">Show Log List</code> and select your newly opened file to avoid the clutter of the rest of the OS logs</li>
<li>You&#8217;re done! You can now take advantage of features like clearing the view, search, and more <img src='http://www.devthought.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/08/31/symfony-tip-watching-your-logs-on-mac-with-console/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Turn /etc into a version control system repository</title>
		<link>http://www.devthought.com/2009/06/11/turn-etc-into-a-version-control-system-repository/</link>
		<comments>http://www.devthought.com/2009/06/11/turn-etc-into-a-version-control-system-repository/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 07:20:25 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[etc]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1009</guid>
		<description><![CDATA[I just discovered a gem called etckeeper, which I&#8217;m sure will change the way we&#8217;re used to work with server configurations. The official website describes it pretty well: etckeeper is a collection of tools to let /etc be stored in &#8230; <a href="http://www.devthought.com/2009/06/11/turn-etc-into-a-version-control-system-repository/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just discovered a gem called <code class="inline">etckeeper</code>, which I&#8217;m sure will change the way we&#8217;re used to work with server configurations.</p>
<p>The <a href="http://kitenet.net/~joey/code/etckeeper/">official website</a> describes it pretty well:</p>
<blockquote class="quotebox"><div>etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository. It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades.</div>
</blockquote>
<p>All it took me to set it up on my Debian Lenny <a href="http://slicehost.com">slice</a> was:</p>
<pre class='highlight ' lang="bash">
$ aptitude install etckeeper
# aptitude will install Git as the version control system, which is pretty neat!
$ cd /etc/
$ sudo etckeeper init -m "initial commit"
Initialized empty Git repository in /etc/.git/
</pre>
<p>The best part is that it&#8217;ll detect changes made by <code class="inline">apt</code>, commit whatever changes you had made previously, and even enable you to make your own commits, after your manual modifications. Do try it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/06/11/turn-etc-into-a-version-control-system-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix `ereg is deprecated` errors in PHP 5.3</title>
		<link>http://www.devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53/</link>
		<comments>http://www.devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 02:32:51 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[php 5.3]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=1003</guid>
		<description><![CDATA[If you upgraded to PHP 5.3, chances are high you&#8217;re going to run into a few warnings or deprecated function messages. An example is the ereg family of functions, which are gone for good, as they were slower and felt &#8230; <a href="http://www.devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you upgraded to PHP 5.3, chances are high you&#8217;re going to run into a few warnings or <em>deprecated function</em> messages.<br />
An example is the <code class="inline">ereg</code> family of functions, which are gone for good, as they were slower and felt less familiar than the alternative Perl-compatible <code class="inline">preg</code> family.</p>
<p>To migrate <code class="inline">ereg()</code>:</p>
<pre class='highlight ' lang="php">
ereg('\.([^\.]*$)', $this->file_src_name, $extension);
</pre>
<p>becomes</p>
<pre class='highlight ' lang="php">
preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);
</pre>
<p>Notice that I wrapped the pattern (<code class="inline">\.([^\.]*$)</code>) around <code class="inline">/ /</code>, which are RegExp delimiters. If you find yourself escaping <code class="inline">/</code> too much (for an URL for example), you might want to use the <code class="inline">#</code> delimiter instead.</p>
<p>To migrate <code class="inline">ereg_replace()</code>:</p>
<pre class='highlight ' lang="php">
$this->file_dst_name_body = ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body);
</pre>
<p>becomes</p>
<pre class='highlight ' lang="php">
$this->file_dst_name_body = preg_replace('/[^A-Za-z0-9_]/', '', $this->file_dst_name_body);
</pre>
<p>Again, I just added delimiters to the pattern.<br />
If you are using <code class="inline">eregi</code> functions (which are the case-insensitive version of ereg), you&#8217;ll notice there&#8217;re no equivalent pregi functions. This is because this functionality is handled by <em>RegExp modifiers</em>.</p>
<p>Basically, to make the pattern match characters in a case-insensitive way, append <code class="inline">i</code> after the delimiter:</p>
<pre class='highlight ' lang="php">
eregi('\.([^\.]*$)', $this->file_src_name, $extension);
</pre>
<p>becomes</p>
<pre class='highlight ' lang="php">
preg_match('/\.([^\.]*$)/i', $this->file_src_name, $extension);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53/feed/</wfw:commentRss>
		<slash:comments>143</slash:comments>
		</item>
		<item>
		<title>How to change WordPress default emoticons</title>
		<link>http://www.devthought.com/2009/04/22/how-to-change-wordpress-default-emoticons/</link>
		<comments>http://www.devthought.com/2009/04/22/how-to-change-wordpress-default-emoticons/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 17:21:26 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[emoticons]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=889</guid>
		<description><![CDATA[Install the Smilies Themer plugin Activate it. Go to Settings &#62; Smilies Themer and pick a theme pack. If you want to create a custom one, keep reading Create a folder with the name of your theme pack in wp-content/themes/smilies-themer/. &#8230; <a href="http://www.devthought.com/2009/04/22/how-to-change-wordpress-default-emoticons/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<ol>
<li>Install the <a href="http://wordpress.org/extend/plugins/smilies-themer/">Smilies Themer</a> plugin</li>
<li>Activate it.</li>
<li>Go to <em>Settings &gt; Smilies Themer</em> and pick a theme pack. If you want to create a custom one, keep reading</li>
<li>Create a folder with the name of your theme pack in <code class="inline">wp-content/themes/smilies-themer/</code>. In my case I called it <code class="inline">devthought</code></li>
<li>
<p>Place your emoticons in that folder and a file called <code class="inline">package-config.php</code></p>
<p><a class="thumb" href="http://devthought.com/wp-content/uploads/2009/04/art.jpg"><img src="http://devthought.com/wp-content/uploads/2009/04/art-300x195.jpg" alt="art" title="art" width="300" height="195" class="alignright size-medium wp-image-892" /></a>
</li>
<li>
<p>Place a code like this in <code class="inline">package-config.php</code></p>
<pre class='highlight ' lang="php">
<?php

/*
 * Package-Name: Theme name
 * Package-URI: http://yourwebsite.com
 * Package-Description: Your theme description
 * Package-Author: Your name
 * Package-Author-URI: http://yourwebsite.com
 */

$wp_smilies = array(
	'>:o'      => 'angryface.png',
	'>:-O'   => 'angryface.png',
	':-['       => 'blush.png',
	':['         => 'blush.png',
);
// add as many as you want respecting the same format:
// 'emoticon' => 'file.jpg',
</pre>
</li>
<li>Go to Settings and choose your package!</li>
</ol>
<p>Now you&#8217;re done! <img src='http://www.devthought.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  :[ >:o <img src='http://www.devthought.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' />  :X :-/ <img src='http://www.devthought.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  <img src='http://www.devthought.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  o:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/04/22/how-to-change-wordpress-default-emoticons/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Determine if caps lock is on with MooTools</title>
		<link>http://www.devthought.com/2009/04/19/determine-if-caps-lock-is-on-with-mootools/</link>
		<comments>http://www.devthought.com/2009/04/19/determine-if-caps-lock-is-on-with-mootools/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 12:33:53 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=848</guid>
		<description><![CDATA[This is a quick idea I came up with. We extend the Event native like this: Event.implement({ hasCapsLock: function(){ return ((this.code > 64 &#038;&#038; this.code < 91 &#038;&#038; !this.shift) &#124;&#124; (this.code > 96 &#038;&#038; this.code < 123 &#038;&#038; this.shift)); } &#8230; <a href="http://www.devthought.com/2009/04/19/determine-if-caps-lock-is-on-with-mootools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a quick idea I came up with. We extend the Event native like this:</p>
<pre class='highlight ' lang="javascript">
Event.implement({

   hasCapsLock: function(){
      return ((this.code > 64 &#038;&#038; this.code < 91 &#038;&#038; !this.shift)
           || (this.code > 96 &#038;&#038; this.code < 123 &#038;&#038; this.shift));
   }

});
</pre>
<p>And then access the method from a <code class="inline">keypress</code> event:</p>
<pre class='highlight ' lang="javascript">
$('test').addEvent('keypress', function(event){
   if (event.hasCapsLock()){
      // do something
   }
});
</pre>
<p>The only drawback is that it relies on sniffing alphabet characters and whether the shift key was pressed. This means that if the user presses the caps lock key, you won't know it until another character is inserted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/04/19/determine-if-caps-lock-is-on-with-mootools/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Improve your 404 pages with Google</title>
		<link>http://www.devthought.com/2009/04/11/improve-your-404-pages-with-google/</link>
		<comments>http://www.devthought.com/2009/04/11/improve-your-404-pages-with-google/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 08:44:44 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=801</guid>
		<description><![CDATA[Google Webmaster Tools has a very interesting widget to improve the usefulness of your 404 pages with little or no effort. It brings something like &#8220;Did you mean?&#8221; for your URLs, suggests links like pages in a higher hierarchy, and &#8230; <a href="http://www.devthought.com/2009/04/11/improve-your-404-pages-with-google/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.google.com/webmasters/tools/">Google Webmaster Tools</a> has a very interesting <a href="https://www.google.com/webmasters/tools/enhance404">widget</a> to improve the usefulness of your 404 pages with little or no effort. It brings something like &#8220;Did you mean?&#8221; for your URLs, suggests links like pages in a higher hierarchy, and adds a Google Search form.</p>
<p><a class="thumb" href="http://devthought.com/wp-content/uploads/2009/04/picture-11.png"><img src="http://devthought.com/wp-content/uploads/2009/04/picture-11-300x99.png" alt="Google 404 Webmaster Tool" title="Google 404 Webmaster Tool" width="300" height="99" class="alignnone size-medium wp-image-817" /></a></p>
<p>First, include this snippet where you want the suggestions to appear. For WordPress blogs, this is typically the <code class="inline">404.php</code> file in your themes folder ((The full path would be /wp-content/themes/yourtheme/404.php. Create it if it doesn&#8217;t exist)).</p>
<pre class='highlight ' lang="html4strict">
<script>
  var GOOG_FIXURL_LANG = 'en';
  var GOOG_FIXURL_SITE = 'your website url here';
</script>
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</pre>
<p>Optionally, edit its look and feel by extending this base stylesheet. Tip: you can hide, for example, the search box, by adding <code class="inline">display: none</code> to <code class="inline">#goog-wm li.search-goog</code></p>
<pre class='highlight ' lang="html4strict">

    /* Widget content container */
   #goog-wm { }

    /* Heading for "Closest match" */
   #goog-wm h3.closest-match { }

    /* "Closest match" link */
   #goog-wm h3.closest-match a { }

    /* Heading for "Other things" */
   #goog-wm h3.other-things { }

    /* "Other things" list item */
   #goog-wm ul li { }

    /* Site search box */
   #goog-wm li.search-goog { }

    /* Search text input */
   #goog-wm-qt {}

    /* Search button */
   #goog-wm-sb { }
</pre>
<p>Then you&#8217;re done! Check <a href="http://devthought.com/abbout/">mine</a> out (deliberately wrong url) for an example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/04/11/improve-your-404-pages-with-google/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OS X Leopard command line tips and tricks</title>
		<link>http://www.devthought.com/2009/03/26/os-x-leopard-shell-tips-and-tricks/</link>
		<comments>http://www.devthought.com/2009/03/26/os-x-leopard-shell-tips-and-tricks/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 17:49:44 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Tumble]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=621</guid>
		<description><![CDATA[The default shell for Leopard users is Bash. Although many GNU/Linux users are familiar with it, not all Mac users take full advantage of its power. Here are some very useful commands and tips I use routinely. Users and login &#8230; <a href="http://www.devthought.com/2009/03/26/os-x-leopard-shell-tips-and-tricks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The default shell for Leopard users is <a href="http://en.wikipedia.org/wiki/Bash">Bash</a>. Although many GNU/Linux users are familiar with it, not all Mac users take full advantage of its power. Here are some very useful commands and tips I use routinely.</p>
<h3>Users and login</h3>
<p><strong>Use the root superuser</strong></p>
<pre class='highlight ' lang="bash">sudo su -</pre>
<p><strong>Alter login variables (such as $PATH, $EDITOR)</strong></p>
<pre class='highlight ' lang="bash">nano ~/.profile</pre>
<p><strong>Other available shells</strong></p>
<ul>
<li>/bin/ksh</li>
<li>/bin/tcsh</li>
<li>/bin/csh</li>
<li>/bin/zsh</li>
</ul>
<h3>Files management</h3>
<p><strong>Output the contents of a file</strong></p>
<pre class='highlight ' lang="bash">cat /some/thing</pre>
<p><strong>Get 20 lines from the end of a file</strong></p>
<pre class='highlight ' lang="bash">tail -n 20 /some/thing</pre>
<p><strong>Get the first 20 lines of a file</strong></p>
<pre class='highlight ' lang="bash">head -n 20 /some/thing</pre>
<p><strong>Create an empty file</strong></p>
<pre class='highlight ' lang="bash">touch /some/thing</pre>
<p><strong>Redirect the output of a command to a file (overwrites)</strong></p>
<pre class='highlight ' lang="bash">command > /some/thing</pre>
<p><strong>Redirect the output of a command to a file (appends)</strong></p>
<pre class='highlight ' lang="bash">command >> /some/thing</pre>
<p><strong>Append the timestamp to a file</strong></p>
<pre class='highlight ' lang="bash">touch /backups/backup_`date +%s`.txt</pre>
<p><strong>Change to the last directory you were in</strong></p>
<pre class='highlight ' lang="bash">
cd /var
cd /etc
cd - # will take you to /var
</pre>
<p><strong>List file size in human-readable units</strong></p>
<pre class='highlight ' lang="bash">
ls -lh /dir/or/file
</pre>
<p><strong>Available editors</strong></p>
<ul>
<li>/usr/bin/vi</li>
<li>/usr/bin/vim</li>
<li>/usr/bin/nano</li>
</ul>
<h3>Applications and processes</h3>
<p><strong>Run a process in the background</strong></p>
<pre class='highlight ' lang="bash">command &#038;</pre>
<p><strong>List running processes</strong></p>
<pre class='highlight ' lang="bash">ps ax</pre>
<p>The first column will be the PID</p>
<p><strong>Kill a process by pid</strong></p>
<pre class='highlight ' lang="bash">kill -9
<pid></pre>
<p><strong>Kill a process or processes by name (e.g: the Dock)</strong></p>
<pre class='highlight ' lang="bash">killall Dock</pre>
<p><strong>Open an application (Mac-only)</strong></p>
<pre class='highlight ' lang="bash">open /Applications/iTunes.app/</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/03/26/os-x-leopard-shell-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

