<?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>Cory O&#039;Daniel - These are just words &#187; sysadmin</title>
	<atom:link href="http://coryodaniel.com/index.php/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Thu, 17 Nov 2011 21:18:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lower ACL Permissions on Amazon S3 items with ruby</title>
		<link>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 01:10:21 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=473</guid>
		<description><![CDATA[I recently had to change a bunch of permissions on some items on S3. Unfortunately the items were mixed in with items that I didn't want to change the permissions on and the file names are all kinda jumbled, so I couldn't pinpoint what I needed to change by eyeballing the file names. 
So I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to change a bunch of permissions on some items on S3. Unfortunately the items were mixed in with items that I didn't want to change the permissions on and the file names are all kinda jumbled, so I couldn't pinpoint what I needed to change by eyeballing the file names. </p>
<p>So I wrote a little ruby method to go in and change something given a key and bucket name.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'aws/s3'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Base</span>.<span style="color:#9900CC;">establish_connection</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
  <span style="color:#ff3333; font-weight:bold;">:access_key_id</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;YOUR_ACCESS_KEY&quot;</span>,
  <span style="color:#ff3333; font-weight:bold;">:secret_access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;YOUR_SECRET_KEY&quot;</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">AWS::S3</span>
<span style="color:#9966CC; font-weight:bold;">def</span> s3_set_public_read<span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Processing: #{key}&quot;</span>  
&nbsp;
  policy = S3Object.<span style="color:#9900CC;">acl</span><span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket<span style="color:#006600; font-weight:bold;">&#41;</span>
  policy.<span style="color:#9900CC;">grants</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#6666ff; font-weight:bold;">ACL::Grant</span>.<span style="color:#9900CC;">grant</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:public_read</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  policy.<span style="color:#9900CC;">grants</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#6666ff; font-weight:bold;">ACL::Grant</span>.<span style="color:#9900CC;">grant</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:public_read_acp</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  S3Object.<span style="color:#9900CC;">acl</span><span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket, policy<span style="color:#006600; font-weight:bold;">&#41;</span>      
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Now I can just run a loop of ActiveRecord objects around that method and convert them all to public read.</p>
<p>If you want a GUI tool for managing S3 stuff, I totally recommend <a href="http://s3hub.com/">S3Hub</a>. Its a really sexy tool for managing S3.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby+http://bit.ly/aF9nC6" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;t=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL on Mac OSX w/ Ports</title>
		<link>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:08:31 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=470</guid>
		<description><![CDATA[So, I originally installed MySQL on my new MacBook using the DMG as was alluded to in a previous post..
I rebooted my laptop the other day and for some reason all of my tables (InnoDB) where corrupted... I couldn't get them to repair. All the *.frm files were present. Even when I did a 'show [...]]]></description>
			<content:encoded><![CDATA[<p>So, I originally installed MySQL on my new MacBook using the DMG as was alluded to in a <a href="http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/">previous post.</a>.</p>
<p>I rebooted my laptop the other day and for some reason all of my tables (InnoDB) where corrupted... I couldn't get them to repair. All the *.frm files were present. Even when I did a 'show tables' they would show up, but whenever I issued any DML mysql responded saying the table did not exist.</p>
<p>So I decided to wipe out my MySQL install, because it just seemed funky. I decided to go the ports route, and I'm so used to the doing the bastardized old way of installing it</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> mysql5 +server +devel</pre></td></tr></table></div>

<p>Then proceeding to do about 5000 things to get it to start at boot time and have a *.sock file in the right place.</p>
<p>Then I came across <a href="http://stackoverflow.com/questions/1081231/macports-doesnt-install-org-macports-mysql5-plist-with-mysql5-server">this post</a> while looking for a LaunchD file for MySQL. A comment by Mike Richards points out that there is a hip new (working) way of installing mysql with ports:</p>
<blockquote><p>
The mysql5 +server package variant in MacPorts is obsolete, and is superseded by the mysql5-server package, which you install in addition to mysql5. This allows you to build it after the fact, instead of re-compiling the entire mysql5 package with +server.</p>
<p>I'd suggest to just remove your old mysql5 +server, and install using the following.</p>
<p>sudo port install mysql5-server<br />
That'll build both the required mysql5 and mysql5-server packages for you, and you'll have the mysql5 plist file in /Library/LaunchDaemons. Also note that you no longer need to symlink your mysqld.sock to /tmp/mysql.sock.
</p></blockquote>
<p>Thanks Mike!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> mysql5-server</pre></td></tr></table></div>

<p>And who would of thunk it? It 'just works' (as a side note, the binary name is mysql5 incase you don't think it works when you type 'mysql').</p>
<p>Make sure you read all the output from Port. You'll need to load the LaunchD file in launchctl and either manually start MySQL the first time or just reboot and have OSX do it for you.</p>
<p>Yay. I can do some work now. </p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+MySQL+on+Mac+OSX+w%2F+Ports+http://bit.ly/d7owK3" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;t=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stick this in your bash</title>
		<link>http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 04:23:50 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=449</guid>
		<description><![CDATA[This isn't a tutorial or anything. Its merely just me dropping all my bash scripts/prompt stuff here so maybe I'll get some comments/tips on cool stuff to add, and so that I can always rip it if I'm on a remote computer.
My pride and joy is that bash prompt. So much info. Its a pretty [...]]]></description>
			<content:encoded><![CDATA[<p>This isn't a tutorial or anything. Its merely just me dropping all my bash scripts/prompt stuff here so maybe I'll get some comments/tips on cool stuff to add, and so that I can always rip it if I'm on a remote computer.</p>
<p>My pride and joy is that bash prompt. So much info. Its a pretty cool bash prompt if I do say so myself (toot toot) <img src='http://coryodaniel.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
Username@Host<br />
List of IP Addresses<br />
Number of files in the directory<br />
Current Path<br />
History Command Number<br />
Git Branch (if a git repo)<br />
<a href="http://coryodaniel.com/wp-content/uploads/2010/02/bashprompt.jpg"><img src="http://coryodaniel.com/wp-content/uploads/2010/02/bashprompt.jpg" alt="Nerd-ass prompt" title="bashprompt" width="581" height="497" class="aligncenter size-full wp-image-452" /></a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.bash_login</span>
<span style="color: #666666; font-style: italic;"># Shell Options</span>
<span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> checkwinsize
<span style="color: #7a0874; font-weight: bold;">shopt</span> <span style="color: #660033;">-s</span> cdspell
&nbsp;
<span style="color: #666666; font-style: italic;"># Exports</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EDITOR</span>=<span style="color: #ff0000;">&quot;mate -w&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">VISUAL</span>=<span style="color: #ff0000;">&quot;mate -w&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTFILESIZE</span>=<span style="color: #000000;">3000</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoredups
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">DISPLAY</span>=:<span style="color: #000000;">0.0</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GEM_PATH</span>=<span style="color: #ff0000;">&quot;/Library/Ruby/Gems/1.8/gems&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=~<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin:~<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>flex_sdk_3<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># include functions, aliases &amp; bashrc</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.functions <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  . ~<span style="color: #000000; font-weight: bold;">/</span>.functions;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.aliases <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  . ~<span style="color: #000000; font-weight: bold;">/</span>.aliases;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  . ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_prompt <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  . ~<span style="color: #000000; font-weight: bold;">/</span>.bash_prompt;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  .  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">complete</span> <span style="color: #660033;">-C</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_completion.d<span style="color: #000000; font-weight: bold;">/</span>rake <span style="color: #660033;">-o</span> default rake
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">date</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fortune <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fortune <span style="color: #660033;">-s</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.bash_prompt</span>
<span style="color: #666666; font-style: italic;"># Define a few Color's</span>
<span style="color: #007800;">BLACK</span>=<span style="color: #ff0000;">'\[\e[0;30m\]'</span>
<span style="color: #007800;">BLUE</span>=<span style="color: #ff0000;">'\[\e[0;34m\]'</span>
<span style="color: #007800;">GREEN</span>=<span style="color: #ff0000;">'\[\e[0;32m\]'</span>
<span style="color: #007800;">CYAN</span>=<span style="color: #ff0000;">'\[\e[0;36m\]'</span>
<span style="color: #007800;">RED</span>=<span style="color: #ff0000;">'\[\e[0;31m\]'</span>
<span style="color: #007800;">PURPLE</span>=<span style="color: #ff0000;">'\[\e[0;35m\]'</span>
<span style="color: #007800;">BROWN</span>=<span style="color: #ff0000;">'\[\e[0;33m\]'</span>
<span style="color: #007800;">LIGHTGRAY</span>=<span style="color: #ff0000;">'\[\e[0;37m\]'</span>
<span style="color: #007800;">DARKGRAY</span>=<span style="color: #ff0000;">'\[\e[1;30m\]'</span>
<span style="color: #007800;">LIGHTBLUE</span>=<span style="color: #ff0000;">'\[\e[1;34m\]'</span>
<span style="color: #007800;">LIGHTGREEN</span>=<span style="color: #ff0000;">'\[\e[1;32m\]'</span>
<span style="color: #007800;">LIGHTCYAN</span>=<span style="color: #ff0000;">'\[\e[1;36m\]'</span>
<span style="color: #007800;">LIGHTRED</span>=<span style="color: #ff0000;">'\[\e[1;31m\]'</span>
<span style="color: #007800;">LIGHTPURPLE</span>=<span style="color: #ff0000;">'\[\e[1;35m\]'</span>
<span style="color: #007800;">YELLOW</span>=<span style="color: #ff0000;">'\[\e[1;33m\]'</span>
<span style="color: #007800;">WHITE</span>=<span style="color: #ff0000;">'\[\e[0;37m\]'</span>
<span style="color: #007800;">NC</span>=<span style="color: #ff0000;">'\[\e[0m\]'</span>              <span style="color: #666666; font-style: italic;"># No Color</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> drpmpt <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #007800;">first_prompt_line</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WHITE</span>(<span style="color: #007800;">$CYAN</span>\u@\h<span style="color: #007800;">$WHITE</span>)-(<span style="color: #007800;">$CYAN</span><span style="color: #007800;">$(ip)</span><span style="color: #007800;">$WHITE</span>)-&gt;&quot;</span>
  <span style="color: #007800;">second_prompt_line</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WHITE</span>(<span style="color: #007800;">$CYAN</span><span style="color: #007800;">$(ls -1|wc -l|tr -d &quot;[:blank:]&quot;)</span> files<span style="color: #007800;">$WHITE</span>)-(<span style="color: #007800;">$CYAN</span>\w<span style="color: #007800;">$WHITE</span>)-&gt;&quot;</span>
  <span style="color: #007800;">third_prompt_line</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WHITE</span>(<span style="color: #007800;">$GREEN</span>!\!<span style="color: #007800;">$WHITE</span>)<span style="color: #007800;">$GREEN</span><span style="color: #007800;">$(parse_git_branch)</span><span style="color: #007800;">$WHITE</span>&quot;</span>
  <span style="color: #007800;">working_prompt</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$first_prompt_line</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #007800;">$second_prompt_line</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #007800;">$third_prompt_line</span>&gt; <span style="color: #007800;">$NC</span>&quot;</span>
&nbsp;
  <span style="color: #007800;">PS1</span>=<span style="color: #007800;">$working_prompt</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">PROMPT_COMMAND</span>=drpmpt</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.aliases</span>
<span style="color: #666666; font-style: italic;"># TO BYPASS AN ALIAS DO THE ORIGINAL COMMAND W \, ie \ls</span>
<span style="color: #666666; font-style: italic;"># Aliases</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">pastie</span>=<span style="color: #ff0000;">'sake pastie:clip'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> ..=<span style="color: #ff0000;">'cd ..'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">igem</span>=<span style="color: #ff0000;">'sudo gem install --no-rdoc --no-ri'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">c</span>=<span style="color: #ff0000;">'clear'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">dsrm</span>=<span style="color: #ff0000;">&quot;find . -type f -name .DS_Store -print0 | xargs -0 rm&quot;</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">gcpp</span>=<span style="color: #ff0000;">'dsrm; git commit .; git pull; git push'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">sha1sum</span>=<span style="color: #ff0000;">'openssl sha1'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lgem</span>=<span style="color: #ff0000;">'gem install --no-rdoc --no-ri -i ./gems --ignore-dependencies'</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">start_wowza</span>=<span style="color: #ff0000;">'/Library/WowzaMediaServerPro/bin/startup.sh'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">stop_wowza</span>=<span style="color: #ff0000;">'/Library/WowzaMediaServerPro/bin/shutdown.sh'</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">hist</span>=<span style="color: #ff0000;">'history | grep $1'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">ps</span></span>=<span style="color: #ff0000;">'ps aux'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">home</span>=<span style="color: #ff0000;">'cd ~'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">utgz</span>=<span style="color: #ff0000;">'tar -zxvf'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">tgz</span>=<span style="color: #ff0000;">'tar -zcvf'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">mnts</span>=<span style="color: #ff0000;">'df -h'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Alias to multiple ls commands</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">la</span>=<span style="color: #ff0000;">'ls -Al'</span>               <span style="color: #666666; font-style: italic;"># show hidden files</span>
<span style="color: #666666; font-style: italic;">#alias ls='ls -aF ' # add colors and file type extensions</span>
<span style="color: #666666; font-style: italic;">#alias lx='ls -lXB'              # sort by extension</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lk</span>=<span style="color: #ff0000;">'ls -lSr'</span>              <span style="color: #666666; font-style: italic;"># sort by size</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lc</span>=<span style="color: #ff0000;">'ls -lcr'</span>          <span style="color: #666666; font-style: italic;"># sort by change time</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lu</span>=<span style="color: #ff0000;">'ls -lur'</span>          <span style="color: #666666; font-style: italic;"># sort by access time</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lr</span>=<span style="color: #ff0000;">'ls -lR'</span>               <span style="color: #666666; font-style: italic;"># recursive ls</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lt</span>=<span style="color: #ff0000;">'ls -ltr'</span>              <span style="color: #666666; font-style: italic;"># sort by date</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">lm</span>=<span style="color: #ff0000;">'ls -al |more'</span>         <span style="color: #666666; font-style: italic;"># pipe through 'more'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Alias chmod commands</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">mx</span>=<span style="color: #ff0000;">'chmod a+x'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> 000=<span style="color: #ff0000;">'chmod 000'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #000000;">644</span>=<span style="color: #ff0000;">'chmod 644'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #000000;">755</span>=<span style="color: #ff0000;">'chmod 755'</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.functions</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Parse git branch</span>
parse_git_branch<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  git branch <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^[^*]/d'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/* \(.*\)/ [\1]/'</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Get assigned ip address</span>
ip<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #007800;">OS</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$OS</span> <span style="color: #000000; font-weight: bold;">in</span>
   Linux<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">IP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span>  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'inet addr:'</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'127.0.0.1'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -d: <span style="color: #660033;">-f2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1}'</span><span style="color: #000000; font-weight: bold;">`;;</span>
   FreeBSD<span style="color: #000000; font-weight: bold;">|</span>OpenBSD<span style="color: #000000; font-weight: bold;">|</span>Darwin<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">IP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span>  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'inet.[0-9]'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'127.0.0.1'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2}'</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">;;</span>
   SunOS<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">IP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> inet <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'127.0.0.1'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2} '</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">;;</span>
   <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">IP</span>=<span style="color: #ff0000;">&quot;Unknown&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Remove new lines and trailing whitespace.</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$IP</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ printf &quot;%s | &quot;, $0 }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ sub(/(\ \|\ )$/, &quot;&quot;); print}'</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Determine if an app is running</span>
list<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #660033;">-m</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> $<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
&nbsp;
git_prompt_ip<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GIT_PROMPT_IP</span>=$<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p align="left"><a class="tt" href="http://twitter.com/home/?status=Stick+this+in+your+bash+http://bit.ly/bRj5LR" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/&amp;title=Stick+this+in+your+bash" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/&amp;t=Stick+this+in+your+bash" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/&amp;title=Stick+this+in+your+bash" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/&amp;title=Stick+this+in+your+bash" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/08/stick-this-in-your-bash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building curb on Snow Leopard</title>
		<link>http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/</link>
		<comments>http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 23:32:07 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[curb]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=422</guid>
		<description><![CDATA[Had some issues building curb on Snow Leopard today.
It was resulting in something like:

1
2
3
4
5
6
7
In file included from /opt/local/include/curl/curl.h:44,
                 from curb.h:12,
                 from curb.c:8:
/opt/local/include/curl/curlrules.h:144: error: [...]]]></description>
			<content:encoded><![CDATA[<p>Had some issues building <a href="http://curb.rubyforge.org/">curb</a> on Snow Leopard today.</p>
<p>It was resulting in something like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">In <span style="color: #c20cb9; font-weight: bold;">file</span> included from <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>curl<span style="color: #000000; font-weight: bold;">/</span>curl.h:<span style="color: #000000;">44</span>,
                 from curb.h:<span style="color: #000000;">12</span>,
                 from curb.c:<span style="color: #000000;">8</span>:
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>curl<span style="color: #000000; font-weight: bold;">/</span>curlrules.h:<span style="color: #000000;">144</span>: error: <span style="color: #c20cb9; font-weight: bold;">size</span> of array ‘__curl_rule_01__’ is negative
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>curl<span style="color: #000000; font-weight: bold;">/</span>curlrules.h:<span style="color: #000000;">154</span>: error: <span style="color: #c20cb9; font-weight: bold;">size</span> of array ‘__curl_rule_02__’ is negative
lipo: can<span style="color: #ff0000;">'t open input file: /var/folders/wX/wX64Cb+PGjG-EXuklO+I+k+++TI/-Tmp-//ccKIrqTY.out (No such file or directory)
make: *** [curb.o] Error 1</span></pre></td></tr></table></div>

<p>It's a quick fix and your on your way to curling stuff...</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> zlib +universal;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port upgrade <span style="color: #660033;">--enforce-variants</span> openssl +universal;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> curl +universal;</pre></td></tr></table></div>

<p>Then build curb however you were building it before.</p>
<p>Yay, I can scrub other peoples sites now!</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Building+curb+on+Snow+Leopard+http://bit.ly/54pEP5" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/&amp;title=Building+curb+on+Snow+Leopard" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/&amp;t=Building+curb+on+Snow+Leopard" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/&amp;title=Building+curb+on+Snow+Leopard" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/&amp;title=Building+curb+on+Snow+Leopard" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/01/20/building-curb-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing MySQL from DMG on Mac (and the few commands to make it work on the command line)</title>
		<link>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/</link>
		<comments>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 22:30:08 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[quickfix]]></category>
		<category><![CDATA[stupid human tricks]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=419</guid>
		<description><![CDATA[When you install mysql from the DMG on Mac OS X, it leaves a few things missing.  Mysql binaries are missing from the path, and the sock file is being looked for in the wrong place by default.
Here is a quick fix:

1
2
3
echo &#34;export PATH=/usr/local/mysql/bin:\$PATH&#34; &#62;&#62; ~/.bash_login;
sudo mkdir -p /opt/local/var/run/mysql5;
sudo ln -s /tmp/mysql.sock /opt/local/var/run/mysql5/mysqld.sock;

Yay, now [...]]]></description>
			<content:encoded><![CDATA[<p>When you install mysql from the DMG on Mac OS X, it leaves a few things missing.  Mysql binaries are missing from the path, and the sock file is being looked for in the wrong place by default.</p>
<p>Here is a quick fix:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;export PATH=/usr/local/mysql/bin:<span style="color: #000099; font-weight: bold;">\$</span>PATH&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_login;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysql5;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.sock <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysql5<span style="color: #000000; font-weight: bold;">/</span>mysqld.sock;</pre></td></tr></table></div>

<p>Yay, now you can rock out with your bad self.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29+http://bit.ly/60q6PR" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;t=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

