<?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>nhaskins.com &#187; ssh</title>
	<atom:link href="http://nhaskins.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://nhaskins.com</link>
	<description>web development note book</description>
	<lastBuildDate>Mon, 06 Feb 2012 02:44:00 +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>magic of command line find and replace</title>
		<link>http://nhaskins.com/post/magic-of-command-line-find-and-replace/</link>
		<comments>http://nhaskins.com/post/magic-of-command-line-find-and-replace/#comments</comments>
		<pubDate>Wed, 05 May 2010 13:47:18 +0000</pubDate>
		<dc:creator>Nathan Haskins</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://nhaskins.com/post/magic-of-command-line-find-and-replace/</guid>
		<description><![CDATA[Media temple did a good job of automatically updating a bunch of passwords when they decided to reset all the passwords on our shared gs account. However, I have to manage 90+ website on that server, and a lot of them have custom scripting that requires a database connection. Like most people I store the [...]]]></description>
			<content:encoded><![CDATA[<p>Media temple did a good job of automatically updating a bunch of passwords when they decided to reset all the passwords on our shared gs account.  However, I have to manage 90+ website on that server, and a lot of them have custom scripting that requires a database connection.  Like most people I store the connections in their own file&#8230; which couldn&#8217;t be accounted for in MT&#8217;s sweep.</p>
<p>Not a big deal, I logged into SSH and put SED to work, here&#8217;s the example:</p>
<p>from the doamins/ directory&#8230;.</p>
<pre><code>find ./ -name 'connect.php' -type f -exec sed -i 's/oldpassword/newpassword/g' {} \;</code></pre>
<p>And let that sucker run and do the work, it swapped out all instances of the old password with the new password&#8230; gotta love automation.</p>
<p>resources:<br />
Linux&#8217;s guide to find: <a href="http://linux.about.com/od/commands/l/blcmdl1_find.htm" rel="nofollow">http://linux.about.com/od/commands/l/blcmdl1_find.htm</a><br />
Some helpful examples of SED: </p>
<p><a href="http://www.brunolinux.com/02-The_Terminal/Find_and%20Replace_with_Sed.html" rel="nofollow">http://www.brunolinux.com/02-The_Terminal/Find_and%20Replace_with_Sed.html</a></p>]]></content:encoded>
			<wfw:commentRss>http://nhaskins.com/post/magic-of-command-line-find-and-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

