<?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>benwatts.ca &#187; bash</title>
	<atom:link href="http://www.benwatts.ca/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benwatts.ca</link>
	<description>The crazy ramblings of designer/web developer Ben Watts.</description>
	<lastBuildDate>Sat, 02 Jan 2010 22:31:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Updating Slice Software</title>
		<link>http://www.benwatts.ca/2008/06/07/updating-slice-software/</link>
		<comments>http://www.benwatts.ca/2008/06/07/updating-slice-software/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 13:21:39 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://seaturtle.rainiscold.ca/?p=54</guid>
		<description><![CDATA[This is one of those things that I don&#8217;t do often enough to commit to memory, so for future reference: sudo aptitude update; #updates source repositories sudo aptitude safe-upgrade; sudo aptitude full-upgrade; #tada!]]></description>
			<content:encoded><![CDATA[<p>This is one of those things that I don&#8217;t do often enough to commit to memory, so for future reference:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">sudo</span> <span class="kw2">aptitude</span> update; <span class="co0">#updates source repositories</span><br />
<span class="kw2">sudo</span> <span class="kw2">aptitude</span> safe-upgrade;<br />
<span class="kw2">sudo</span> <span class="kw2">aptitude</span> full-upgrade;<br />
<span class="co0">#tada!</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benwatts.ca/2008/06/07/updating-slice-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing MySQL DBs via command line</title>
		<link>http://www.benwatts.ca/2008/04/26/importing-mysql-dbs-via-command-line/</link>
		<comments>http://www.benwatts.ca/2008/04/26/importing-mysql-dbs-via-command-line/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 21:27:15 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Back-end]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://www.rainiscold.ca/seaturtle/?p=11</guid>
		<description><![CDATA[Okay, so wow. I had a pretty obese database I wanted to move from one server to this one (my Slicehost acct) and PHPMyAdmin just couldn&#8217;t handle an 11MB table or something; I was even breaking it down so that it only had to import one table at a time, to no avail. So naturally [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so wow. I had a pretty obese database I wanted to move from one server to this one (my Slicehost acct) and PHPMyAdmin just couldn&#8217;t handle an 11MB table or something; I was even breaking it down so that it only had to import one table at a time, to no avail.</p>
<p>So naturally this seemed like something that could be done from the command line with ease. Heh.</p>
<p>First, I uploaded the exported version of my gzipped database to the root of my home directory.</p>
<pre lang="bash">
gunzip mydb.sql.gz #unzip the database
mysql -u username -p newdbname < ~/mydb.sql
</pre>
<p>That's it. Seriously.<br />
One thing to note is that I already had '</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">newdbname</div></div>
<p>' created. But otherwise it was extremely straightforward (after I spent at least an hour figuring it out :P).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benwatts.ca/2008/04/26/importing-mysql-dbs-via-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-Update SVN Bash Script</title>
		<link>http://www.benwatts.ca/2008/04/26/charizard-bash-script/</link>
		<comments>http://www.benwatts.ca/2008/04/26/charizard-bash-script/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 19:00:09 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Back-end]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[time-saver]]></category>

		<guid isPermaLink="false">http://www.rainiscold.ca/seaturtle/?p=10</guid>
		<description><![CDATA[I&#8217;ve got at least 4 installs of WordPress on my server and I have them all checked out from WordPress&#8217; SVN repository because uploading WordPress files whenever there is an update is incredibly annoying. I know this means I may be using unstable and unreliable code and all that, but so far I haven&#8217;t had [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got at least 4 installs of WordPress on my server and I have them all checked out from WordPress&#8217; SVN repository because uploading WordPress files whenever there is an update is incredibly annoying.</p>
<p>I know this means I may be using unstable and unreliable code and all that, but so far I haven&#8217;t had much of an issue. Worst case scenario I have to do a server rollback or something.</p>
<p>But anyway, having something like 4 SVN WordPress Installs it&#8217;s become apparent that I need an easier solution to running svn update on all the directories.<br />
SO I MADE A BASH SCRIPT.</p>
<h4> The Script</h4>
<pre lang="bash">
#!/bin/bash
# Updates all of my wordpress installations at once ...

echo '--Updating benwatts.ca';
cd ~/benwatts.ca
svn update

#[..] repeat for the other installs

echo "Done and done.";
</pre>
<h4>Storing the Script</h4>
<p>Then I created a bin folder in my user folder</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mkdir ~/bin</div></div>
<p>and moved it there</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mv ~/updatewordpress ~/bin/updatewordpress</div></div>
<p>.</p>
<h4>Using it</h4>
<p>Unfortunately, to use it you have to specify the path (so &#8230;</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">cd ~/bin; ./updatewordpress</div></div>
<p>). That kind of sucks. Not a whole lot &#8230; but I wanted to be a bit adventurous and make it so that I just have to type &#8216;updatewordpress&#8217; and it&#8217;ll go ahead and do it. As it turns out, at least in my version of linux it already searches ~/bin for shell scripts &#8230; so all I had to do was log out and log back in again and now the command is there &#8230; NICE!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benwatts.ca/2008/04/26/charizard-bash-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bash File Manipulation/Navigation</title>
		<link>http://www.benwatts.ca/2008/04/10/bash-file-manipulationnavigation/</link>
		<comments>http://www.benwatts.ca/2008/04/10/bash-file-manipulationnavigation/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 00:28:19 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.rainiscold.ca/seaturtle/?p=4</guid>
		<description><![CDATA[ls &#91;-la&#93; &#8216;list&#8217; &#8230; lists the contents of the directory you&#8217;re in. The [-l] flag adds detailed info about the files/folders in the directory. The [-a] flag shows hidden files. cd &#91;name of folder to open&#93; &#8216;change directory&#8217; &#8230; the main way you navigate the filesystem. mkdir &#91;name&#93; &#8216;make directory&#8217; rm &#91;-r&#93; &#91;name&#93; &#8216;remove&#8217; &#8230; [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">ls</span> <span class="br0">&#91;</span>-la<span class="br0">&#93;</span></div></div>
<p>&#8216;list&#8217; &#8230; lists the contents of the directory you&#8217;re in. The [-l] flag adds detailed info about the files/folders in the directory. The [-a] flag shows hidden files.</li>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw3">cd</span> <span class="br0">&#91;</span>name of folder to open<span class="br0">&#93;</span></div></div>
<p>&#8216;change directory&#8217; &#8230; the main way you navigate the filesystem.</li>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">mkdir</span> <span class="br0">&#91;</span>name<span class="br0">&#93;</span></div></div>
<p>&#8216;make directory&#8217;</li>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">rm</span> <span class="br0">&#91;</span>-r<span class="br0">&#93;</span> <span class="br0">&#91;</span>name<span class="br0">&#93;</span></div></div>
<p>&#8216;remove&#8217; &#8230; deletes a file. to delete a directory you need the [-r] flag. It recursively deletes the directory and all sub-directories.</li>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">mv</span> <span class="br0">&#91;</span><span class="kw3">source</span><span class="br0">&#93;</span> <span class="br0">&#91;</span>destination<span class="br0">&#93;</span></div></div>
<p>&#8216;move&#8217; AND rename. It can move a file/directory and at the same time rename it.</li>
<li>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:540px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">ln</span> <span class="br0">&#91;</span>-s<span class="br0">&#93;</span> <span class="br0">&#91;</span><span class="kw3">source</span><span class="br0">&#93;</span> <span class="br0">&#91;</span>name of <span class="kw2">link</span><span class="br0">&#93;</span></div></div>
<p>&#8216;link&#8217;. Creates a shortcut to a file or folder in the directory you&#8217;re in. Can prevent a lot of extra typing. <strong>Always use the -s flag</strong>. It keeps the links symbolic. I don&#8217;t know what that means &#8230; but it&#8217;s the only way you can create a shortcut to a folder.</li>
<li>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">du -sh [directoryname]</div></div>
<p>Calculates the size of a directory. -s = summary, -h = human readable.</li>
<li>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:540px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">df -h</div></div>
<p>Calcualtes disk usage. -h = human readable.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benwatts.ca/2008/04/10/bash-file-manipulationnavigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
