<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Procbits &#187; Linux</title>
	<atom:link href="http://procbits.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://procbits.com</link>
	<description>source code snippets and other random musings about software</description>
	<lastBuildDate>Wed, 01 Feb 2012 19:41:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='procbits.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Procbits &#187; Linux</title>
		<link>http://procbits.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://procbits.com/osd.xml" title="Procbits" />
	<atom:link rel='hub' href='http://procbits.com/?pushpress=hub'/>
		<item>
		<title>Buzz: A Node.js Command Line Program to Keep Your App Running Indefinitely; Like the Program Forever</title>
		<link>http://procbits.com/2011/11/08/buzz-a-node-js-command-line-program-to-keep-your-app-running-indefinitely-like-the-program-forever/</link>
		<comments>http://procbits.com/2011/11/08/buzz-a-node-js-command-line-program-to-keep-your-app-running-indefinitely-like-the-program-forever/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 20:35:56 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=272</guid>
		<description><![CDATA[Buzz is a command line program that can kill your app routinely and restart it. It&#8217;ll will also restart your app if it dies. It&#8217;s a lot like the other Node.js program Forever. It&#8217;s much simpler than Forever. Approximately 50 lines of CoffeeScript code. It displays your apps output to STDOUT and also displays any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=272&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Buzz is a command line program that can kill your app routinely and restart it.<br />
It&#8217;ll will also restart your app if it dies. It&#8217;s a lot like the other Node.js<br />
program <a href="https://github.com/indexzero/forever">Forever</a>.</p>
<p>It&#8217;s much simpler than Forever. Approximately 50 lines of CoffeeScript code.<br />
It displays your apps output to STDOUT and also displays any of your apps<br />
STDERR output in red.</p>
<p><strong>Usage</strong></p>
<p>Install it via npm:<br />
<code><br />
npm install buzz<br />
</code></p>
<p>Then run:<br />
<code><br />
buzz 240 your_cool_app param1 param2<br />
</code></p>
<p>The first parameter to buzz is the time in seconds that it&#8217;ll be killed and<br />
restarted. So, `your_cool_app` would be killed and restarted after four minutes.</p>
<p>If you don&#8217;t want buzz to kill your app, but you want it to bring it back to<br />
life if it dies, run:<br />
<code><br />
buzz your_cool_app param1 param2<br />
</code></p>
<p>You can test buzz by running his the app `buzz_test`:<br />
<code><br />
buzz_test<br />
</code></p>
<p>`buzz_test` runs the app `smarty_pants` that spews out random facts to you and<br />
taunts you. Occasionally `smarty_pants` will commit suicide, but buzz will<br />
bring him back to life.</p>
<p>`buzz_test` ends up actualy just running the following command:<br />
<code><br />
buzz 10 smarty_pants 2000 0.15<br />
</code></p>
<p>Which will kill smarty pants every 10 seconds and bring him back to life. Also,<br />
every two seconds, smarty pants will spit out a random fact. Approximately, every<br />
13 seconds smarty pants will take his own life, but Buzz will bring him back.</p>
<p><strong>Motivation</strong></p>
<p>I have a command line app that is nasty to debug. It&#8217;s working fine for the first<br />
five minutes or so. Thus, Buzz was born. Instead of fixing the bug, I wanted<br />
to make this. =)</p>
<p>But really, it&#8217;s utility is that it&#8217;s a much simpler Forever.</p>
<p>The name comes from Buzz Lightyear in the movie Toy Story. His popular phrase was: To infinity and beyond!</p>
<p>Do you use Git? If so, checkout <a href="http://gitpilot.com">Gitpilot</a> to make using Git thoughtless.</p>
<p>Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my blog on entrepreneurship: <a href="http://techneur.com">Techneur</a>.</p>
<p>-JP Richardson </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=272&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/11/08/buzz-a-node-js-command-line-program-to-keep-your-app-running-indefinitely-like-the-program-forever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing MongoDB 1.8.1 on Ubuntu 10.04 LTS</title>
		<link>http://procbits.com/2011/05/04/installing-mongodb-1-8-1-on-ubuntu-10-04-lts/</link>
		<comments>http://procbits.com/2011/05/04/installing-mongodb-1-8-1-on-ubuntu-10-04-lts/#comments</comments>
		<pubDate>Thu, 05 May 2011 00:51:29 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=165</guid>
		<description><![CDATA[A lot of this information will seem obvious to a lot of you. But it did require me to perform a few Google searches, so hopefully I can save you the trouble. I provide a script to automate this process: This script is deprecated now. Fortunately 10Gen (the company who makes MongoDB) provides an Apt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=165&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A lot of this information will seem obvious to a lot of you. But it did require me to perform a few Google searches, so hopefully I can save you the trouble.</p>
<p>I provide a script to automate this process:<br />
<a href="https://github.com/jprichardson/mongo_install" title="https://github.com/jprichardson/mongo_install" target="_blank"></a></p>
<p>This script is deprecated now. Fortunately 10Gen (the company who makes MongoDB) provides an Apt repository. Do not use the current MongoDB version in the Ubuntu apt sources. It&#8217;s version 1.6.* </p>
<p>All you need to do:<br />
<code><br />
vim /etc/apt/sources.list<br />
</code></p>
<p>Add the following line:<br />
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen</p>
<p><code><br />
apt-get update<br />
apt-get install mongodb-10gen<br />
</code></p>
<p>By default MongoDB runs in <a href="http://www.mongodb.org/display/DOCS/Security+and+Authentication" target="_blank">trusted mode</a>. This means that it&#8217;s listening on port 27017 for any connection. We want it to only listen on localhost.</p>
<p>Edit the file: /etc/mongodb.conf</p>
<p>Add the following lines:<br />
bind_ip 127.0.0.1<br />
noauth = true      ##### YOU MUST add this line if you use bind_ip</p>
<p>Are you a Git user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>That&#8217;s it. Follow me on Twitter: <a href="http://twitter.com/jprichardson" target="_blank">@jprichardson</a> and read my blog on <a href="http://techneur.com" target="_blank">software entrepreneurship</a>.</p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=165&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/05/04/installing-mongodb-1-8-1-on-ubuntu-10-04-lts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Iterate Over Files in Bash</title>
		<link>http://procbits.com/2010/11/10/iterate-over-files-in-bash/</link>
		<comments>http://procbits.com/2010/11/10/iterate-over-files-in-bash/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 13:00:38 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=100</guid>
		<description><![CDATA[Sometimes you need to whip up a dirty bash script to process through some text. I needed to iterate over my database log files that I wrote about from my last post and then output the result to a new file. I wanted the output files to have a different extension, but I wasn&#8217;t sure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=100&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to whip up a dirty bash script to process through some text. I needed to iterate over my database log files that I wrote about from my <a href="http://procbits.com/2010/11/09/grep-for-two-or-more-expressions/">last post</a> and then output the result to a new file. I wanted the output files to have a different extension, but I wasn&#8217;t sure how to get just the filename from bash, fortunately <a href="http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash">this post helped</a>.</p>
<p><pre class="brush: bash;">
#!/bin/bash

for logfile in *.log
do

fn=${logfile%.*} #cut extension

echo making $fn.data...
egrep '\#\ collect|\:\=' $logfile &gt; $fn.data 

done
</pre></p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>Follow me on Twitter <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my <a href="http://techneur.com">blog on software entrepreneurship</a>.</p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=100&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2010/11/10/iterate-over-files-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Grep for Two or More Expressions</title>
		<link>http://procbits.com/2010/11/09/grep-for-two-or-more-expressions/</link>
		<comments>http://procbits.com/2010/11/09/grep-for-two-or-more-expressions/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 14:09:22 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=97</guid>
		<description><![CDATA[Unfortunately a database of mine crashed. Fortunately, I have log files with the data. I need the timestamp and the data. The lines in the log files look something like this: ####### collect $TIMESTAMP ######### *GARBAGE *GARBAGE *GARBAGE $ID:=$DATASET *GARBAGE It&#8217;s been years since I&#8217;ve done anything more than a simple grep. I wasn&#8217;t even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=97&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Unfortunately a database of mine crashed. Fortunately, I have log files with the data. I need the timestamp and the data.</p>
<p>The lines in the log files look something like this:<br />
<code><br />
####### collect $TIMESTAMP #########<br />
*GARBAGE<br />
*GARBAGE<br />
*GARBAGE<br />
$ID:=$DATASET<br />
*GARBAGE<br />
</code></p>
<p>It&#8217;s been years since I&#8217;ve done anything more than a simple grep. I wasn&#8217;t even sure which <a href="http://www.unix.com/unix-desktop-dummies-questions-answers/39670-difference-grep-egrep-fgrep.html">grep I needed&#8230; egrep? fgrep? grep?</a></p>
<p>I can use this regex for the timestamp line:<br />
<pre class="brush: bash;">\#\ collect</pre></p>
<p>I can use this regex for the dataset line:<br />
<pre class="brush: bash;">\:\=</pre></p>
<p>But how can I put them together? It&#8217;s probably of no surpise that I can use the &#8216;|&#8217; operator like so:<br />
<pre class="brush: bash;">egrep '\#\ collect|\:\=' 2010-09-25.log</pre></p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>That&#8217;s it! Follow me on Twitter <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my <a href="http://techneur.com">blog on entrepreneurship</a>.</p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=97&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2010/11/09/grep-for-two-or-more-expressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Backup a MySQL Database on Ubuntu</title>
		<link>http://procbits.com/2009/04/07/backup-a-mysql-database-on-ubuntu/</link>
		<comments>http://procbits.com/2009/04/07/backup-a-mysql-database-on-ubuntu/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 01:45:26 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=14</guid>
		<description><![CDATA[Backing up a MySQL database is extremely simple. Just simply create a directory as to where you want to store your backups. I typically just dump them in /var/dbbak. You can then run the following command: /usr/bin/mysqldump -u root -p YOUR_DB_NAME &#124; gzip &#62; /root/dbbak/YOUR_DB_NAME_`date +%y_%m_%d`.gz Are you a Git user? Let me help you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=14&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Backing up a MySQL database is extremely simple.  Just simply create a directory as to where you want to store your backups.  I typically just dump them in /var/dbbak.  You can then run the following command:<br />
<code><br />
/usr/bin/mysqldump -u root -p YOUR_DB_NAME | gzip &gt; /root/dbbak/YOUR_DB_NAME_`date +%y_%m_%d`.gz<br />
</code></p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=14&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2009/04/07/backup-a-mysql-database-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying a Rails application on Ubuntu 8.04 LTS with Phusion Passenger and SQL Server 2005</title>
		<link>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/</link>
		<comments>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 05:50:10 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=5</guid>
		<description><![CDATA[This article will provide step by step instructions for preparing and then deploying a Rails application on Ubuntu 8.04 LTS that uses Microsoft SQL Server 2005. Install Ruby sudo apt-get install ruby-full build-essential Install Apache 2 sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev Install Ruby Gems Do not install Ruby Gems from Apt.  This will screw [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=5&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>This article will provide step by step instructions for preparing and then deploying a Rails application on Ubuntu 8.04 LTS that uses Microsoft SQL Server 2005.</p>
<p><strong>Install Ruby</strong><br />
<code>sudo apt-get install ruby-full build-essential</code></p>
<p><strong>Install Apache 2</strong><br />
<code>sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev</code></p>
<p><strong>Install Ruby Gems</strong><br />
Do not install Ruby Gems from Apt.  This will screw up your Gems repository as Apt and Gems will both want to manage it.  Download the latest Gems package from <a href="http://rubyforge.org/" target="_blank">http://rubyforge.org</a>.  At the time of this writing the latest version is 1.3.  Version 1.3 is also the version that I used.<code><br />
wget <a href="http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz" target="_blank">http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz</a><br />
tar xzvf rubygems-1.3.0.tgz<br />
cd rubygems-1.3.0<br />
sudo ruby setup.rb<br />
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem<br />
sudo gem update --system</code></p>
<p><strong>Install Rails</strong><br />
Make sure to install the proper version.  You may need to pass the &#8220;&#8211;version&#8221; flag.<br />
<code>sudo gem install rails</code></p>
<p><strong>Install Phusion Passenger</strong><br />
This allows us to deploy Rails application with as much simplicity as it takes to deploy a PHP application.  This we can avoid using Mongrel/Proxy Balancing/(Apache|Lighttpd|Nginx).<code><br />
sudo gem install passenger<br />
sudo passenger-install-apache2-module</code></p>
<p>Next add the following to your /etc/apache2/apache2.conf file:<br />
<code> LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3<br />
PassengerRuby /usr/bin/ruby1.8</code></p>
<p><strong>Install Ruby/ODBC/SQLServer2005 Compatibility</strong><br />
In /etc/profile add the following:<br />
<code> export ODBCINI=/etc/odbc.ini<br />
export ODBCSYSINI=/etc<br />
export FREETDSCONF=/etc/freetds/freetds.conf</code></p>
<p>Make sure you restart your shell after this!</p>
<p>Now install UnixODBC:<code><br />
sudo apt-get install unixodbc<br />
sudo apt-get install unixodbc-dev<br />
sudo apt-get install tdsodbc<br />
</code></p>
<p>Now install FreeTDS (stable) from source. The FreeTDS in the Apt repository is version 0.63 and will not work with SQL Server 2005. At the time of this writing, the current stable version is 0.82.<code><br />
wget <a href="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz" target="_blank">ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz</a><br />
cd freetds-stable<br />
./configure<br />
make<br />
sudo make install</code></p>
<p>Edit /etc/freetds/freetds.conf and add the following:<code><br />
[YOUR_DB_DEFINITION_NAME]<br />
host = 172.24.40.100<br />
port = 1433<br />
tds version = 8.0<br />
</code></p>
<p>Test it with the following:<code><br />
sqsh -S YOUR_DB_DEFINITION_NAME -U USERNAME -P PASSWORD<br />
</code></p>
<p>Once actually logged in, you can run some SQL and verify the results. Make sure to type “go” after each command and also make sure to “use” the right database.</p>
<p>Now edit /etc/odbc.ini and add the following:<code><br />
[YOUR_DB_DEFINITION_NAME]<br />
Driver          = FreeTDS<br />
Description     = ODBC connection via FreeTDS<br />
Trace           = No<br />
Servername      = YOUR_DB_DEFINITION_NAME<br />
Database        = YOUR_ACTUAL_DB_NAME<br />
</code></p>
<p>Edit /etc/odbcinst.ini and add the following:<code><br />
[FreeTDS]<br />
Description     = TDS driver (Sybase/Microsoft SQL)<br />
Driver          = /usr/lib/odbc/libtdsodbc.so<br />
Setup           = /usr/lib/odbc/libtdsS.so<br />
CPTimeout       =<br />
CPReuse         =<br />
FileUsage       = 1<br />
</code></p>
<p>Now test it….<code><br />
isql YOUR_DB_DEFINITION_NAME USERNAME PASSWORD<br />
</code></p>
<p>Install Ruby ODBC:<code><br />
wget <a href="http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9995.tar.gz" target="_blank">http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9995.tar.gz</a><br />
tar zvxf ruby-odbc-0.9995.tar.gz<br />
cd ruby-odbc-0.9995/<br />
ruby extconf.rb<br />
make<br />
sudo make install<br />
</code></p>
<p>Install ActiveRecord ODBC Adapter<code><br />
sudo gem install activerecord-odbc-adapter<br />
</code></p>
<p>Edit your database.yml in your application and configure it like…<code><br />
development:<br />
adapter: odbc<br />
dsn: YOUR_DB_DEFINITION_NAME<br />
username: USERNAME<br />
password: PASSWORD<br />
</code></p>
<p>Now dump your Rails app in /var/www/yourrailsapp and add a new Apache Virtual Host as seen in the previous post. Configure the virtual host DocumentRoot to point to the public directory in Apache2.  Do not forget to change ownership of your rails app to www-data. (chown -R www-data:www-data yourrailsapp) That’s all there is too it! Now you can deploy a number of Rails apps in Apache with little trouble!</p></div>
<p>Are you a Git user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=5&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache Virtual Hosting</title>
		<link>http://procbits.com/2009/03/10/apache-virtual-hosting/</link>
		<comments>http://procbits.com/2009/03/10/apache-virtual-hosting/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 05:43:55 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=3</guid>
		<description><![CDATA[This is extremely easy to do.  This was done on Ubuntu 8.04.  Replace &#8220;SERVER_IP&#8221; with the IP address of your  server. Edit /etc/apache2/apache2.conf and add the following: NameVirtualHost SERVER_IP:80 Create a new file &#8220;subdomain&#8221; in /etc/apache2/sites-available with the content: &#60;VirtualHost SERVER_IP:80&#62; * ServerName subdomain.yourdomain.com DocumentRoot /var/www/subdomain &#60;Directory “/var/www/subdomain”&#62; ** Order allow,deny Allow from all &#60;/Directory&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=3&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>This is extremely easy to do.  This was done on Ubuntu 8.04.  Replace &#8220;SERVER_IP&#8221; with the IP address of your  server.</p>
<p>Edit /etc/apache2/apache2.conf and add the following:</p>
<blockquote><p>NameVirtualHost SERVER_IP:80</p></blockquote>
<p>Create a new file &#8220;subdomain&#8221; in /etc/apache2/sites-available with the content:</p>
<blockquote><p>&lt;VirtualHost SERVER_IP:80&gt; *</p>
<p>ServerName subdomain.yourdomain.com<br />
DocumentRoot /var/www/subdomain</p>
<p>&lt;Directory “/var/www/subdomain”&gt; **<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</p>
<p>&lt;/VirtualHost&gt;</p></blockquote>
<p>Then run:<br />
<strong><em>a2ensite subdomain</em></strong><br />
<strong><em>/etc/init.d/apache2 restart</em></strong></div>
<p>Are you a Git user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=3&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2009/03/10/apache-virtual-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
	</channel>
</rss>
