<?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>Culmination.org &#187; console</title>
	<atom:link href="http://www.culmination.org/tag/console/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.culmination.org</link>
	<description>You are what you&#039;ve become.</description>
	<lastBuildDate>Sun, 22 Jan 2012 20:29:21 +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>Why won&#039;t airport auto join my network?</title>
		<link>http://www.culmination.org/2008/04/why-wont-airport-auto-join-my-network/</link>
		<comments>http://www.culmination.org/2008/04/why-wont-airport-auto-join-my-network/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 00:53:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Stuff]]></category>
		<category><![CDATA[airport]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[autojoin]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[joint]]></category>
		<category><![CDATA[keychain]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[network preferences]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[system keychain]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[wireless networking]]></category>

		<guid isPermaLink="false">http://www.culmination.org/?p=297</guid>
		<description><![CDATA[If you have a mac and use wireless to connect, you might expect that it will automatically join your wireless network after you tell it to &#8220;remember this network&#8221;. I know on my old powerbook it did, and on my girlfriend&#8217;s macbook it auto-joins too. So I started wondering why my macbook pro just wouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a mac and use wireless to connect, you might expect that it will automatically join your wireless network after you tell it to &#8220;remember this network&#8221;. I know on my old powerbook it did, and on my girlfriend&#8217;s macbook it auto-joins too. So I started wondering why my macbook pro just wouldn&#8217;t do it. I searched the keychain and found my network in the login keychain, so I thought something really bizarre was going on. When I checked console (the console app in /Applications/Utilities) it said my network wasn&#8217;t in the system keychain!</p>
<p>To make a long story short (as my mother would say), I found a solution here: <a href="http://discussions.apple.com/thread.jspa?messageID=6757490">http://discussions.apple.com/thread.jspa?messageID=6757490</a></p>
<p>It turns out that when I moved System Preferences to /Applications/Utilities it broke my mac&#8217;s ability to add networks to the system keychain! I moved it back to /Applications, deleted the network from my network preferences and keychain and then joined the network again. This time the network was added to the system keychain and all is well!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.culmination.org/2008/04/why-wont-airport-auto-join-my-network/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sed on Mac OS X 10.5 Leopard</title>
		<link>http://www.culmination.org/2008/02/sed-on-mac-os-x-105-leopard/</link>
		<comments>http://www.culmination.org/2008/02/sed-on-mac-os-x-105-leopard/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 00:55:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Stuff]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://www.culmination.org/2008/02/10/sed-on-mac-os-x-105-leopard/</guid>
		<description><![CDATA[Imagine you&#8217;re a PHP developer that uses OS X. You&#8217;re given 50+ php files that all have a line that needs to be changed. 50 files, one change? Hmmm sounds like maybe I could use automator to do this! Well I don&#8217;t know how to use automator Luckily, I&#8217;m a unix geek, and even more [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you&#8217;re a PHP developer that uses OS X. You&#8217;re given 50+ php files that all have a line that needs to be changed. 50 files, one change? Hmmm sounds like maybe I could use automator to do this! Well I don&#8217;t know how to use automator <img src='http://www.culmination.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Luckily, I&#8217;m a unix geek, and even more luckily, OS X has a fairly strong unix back end and a great terminal emulator. So how does that help? Well if you&#8217;re a unix geek you know that this sort of problem just screams &#8220;SED! use SED! this is what SED IS FOR!&#8221; And it&#8217;s true. This is where sed is great.</p>
<p>Say you want to change this line:</p>
<pre> $config_file = $_SERVER['DOCUMENT_ROOT']."/dev/config.php";</pre>
<p>To this:</p>
<pre> $config_file = "dev/config.php";</pre>
<p>As a matter of fact&#8230; wait a minute! I don&#8217;t want to just change that line&#8230; no I want to be able to show what I&#8217;ve changed, so that the next person who looks at this can see what it used to say. In this instance it&#8217;s also important to show the work I&#8217;ve done because I&#8217;m making changes to someone else&#8217;s work. So what I want to do is comment out the line and then add a new line with my change underneath. Sounds a bit more complicated right? Well it&#8217;s not really &#8211; unless you&#8217;re using OS X (you&#8217;ll see why in a minute *sigh*).  The goal is to end up with this:</p>
<pre> //$config_file = $_SERVER['DOCUMENT_ROOT']."/dev/config.php";
 $config_file = "dev/config.php";</pre>
<p>On the linux machine I keep around the office the command to perform this change on the all php files in the current directory looks like this ( I had to split the line to fit on the site):</p>
<pre>sed -i .bak "s/^\$config_file = \</pre>
<pre>\$_SERVER\['DOCUMENT_ROOT'\]\.\"\/dev\/config\.php\"\;/\/\/\</pre>
<pre>\$config_file = \$_SERVER\['DOCUMENT_ROOT'\]\.\"\/dev\/config\.php\"\;\</pre>
<pre>\n\$config_file = \"dev\/config\.php\"\;/g" *.php</pre>
<p>The breakdown of the above command is as follows:</p>
<p><em>sed</em>  | the sed command</p>
<p><em>-i .bak</em> | the -i option means do this change &#8220;in place&#8221; and copy the original file to originalname.bak</p>
<p><em>&#8220;</em> | we use the double quote here to start the sed command because there are single quotes in the command</p>
<p><em>s/^\$config_file =<br />
\$_SERVER\['DOCUMENT_ROOT'\]\.\&#8221;\/dev\/config\.php\&#8221;\;/\/\/\$config_file<br />
= \$_SERVER\['DOCUMENT_ROOT'\]\.\&#8221;\/dev\/config\.php\&#8221;\;\n\$config_file = \&#8221;dev\/config\.php\&#8221;\;/g</em>  | this is the magic of sed. it looks for the line we want to change, adds // to the beginning of it, adds a new line after it, and then adds the text that we want after the new line. Amazing isn&#8217;t it?</p>
<p><em>&#8220;</em> | the command ends with the double quote</p>
<p>and, finally:</p>
<p><em>*.php</em> | represents all of the files that end in .php in the current directory.</p>
<p>Now if you thought that was a mess, check out how that command needs to look in order to work on OS X (10.5.1, possibly other versions)</p>
<pre>sed -i .bak "s/^\$config_file = \
\$_SERVER\['DOCUMENT_ROOT'\]\.\"\/dev\/config\.php\"\;/\/\/\
\$config_file = \$_SERVER\['DOCUMENT_ROOT'\]\.\"\/dev\/config\.php\"\;\
\\"$'\n'"\
\$config_file = \"dev\/config\.php\"\;/g" index.php</pre>
<p>The crazy part here is the need to use <em>\\&#8221;$&#8217;\n&#8217;&#8221;\</em></p>
<p>What that represents is an escaped version of the literal newline character. With the version of sed currently in OS X, that is the only way (that I could find) to add a newline character with sed. Now you know too.</p>
<p>So that concludes this edition of mac unix geekery&#8230; until next time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.culmination.org/2008/02/sed-on-mac-os-x-105-leopard/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

