<?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>The Tech Tutorial</title>
	<atom:link href="http://www.the-tech-tutorial.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.the-tech-tutorial.com</link>
	<description>Just a blog of free technology tutorials</description>
	<lastBuildDate>Tue, 04 Dec 2012 15:43:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to safely kill rails WEBrick server running in daemon mode</title>
		<link>http://www.the-tech-tutorial.com/?p=1964</link>
		<comments>http://www.the-tech-tutorial.com/?p=1964#comments</comments>
		<pubDate>Tue, 04 Dec 2012 15:43:13 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Fix It]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[dont shutdown]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[no shutdown]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[Stop WEBrick]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WEBrick]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1964</guid>
		<description><![CDATA[Ruby on rails and the WEBrick Daemon are great for testing however there are times when you start a WEBrick server in daemon mode and later find you need to stop this without restarting the box. This can sometimes be troublesome, especially if you accidently kill a live server. In this tutorial I’ll go through [...]]]></description>
				<content:encoded><![CDATA[<p><span><span><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png"><img class="alignleft size-full wp-image-1851" title="rails" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png" alt="" width="87" height="111" /></a>Ruby</span> on <span>rails</span></span> and the <span><span>WEBrick</span> <span>Daemon</span><span> are great for testing however there are times when you start a <span><span>WEBrick</span> <span>server</span></span> in <span><span>daemon</span> mode</span> and later find you need to <span>stop</span> this <span>without <span>restarting</span></span> the box. This can sometimes be troublesome, especially if you accidently kill a live server. In this tutorial I’ll go through ensuring you <span>kill</span> the correct process.<span id="more-1964"></span></span></span><br />
<center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br />
First we need to find the <a href="http://en.wikipedia.org/wiki/Process_identifier"><span>PID</span></a> of the <span><span>WEBrick</span> <span>Daemon</span></span> in order to <span>stop</span> it, to do this we&#8217;ll <span><span>find the PID</span> that has port <span>3000</span></span> bound to it:</p>
<pre>sudo netstat -lp | grep 3000</pre>
<p>This should give an output like this: <em>Note: if you started your <span><span>WEBrick</span> server</span> under a different port just change the <span>3000</span> in this command to the <span>port</span> you used.</em></p>
<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2012/12/tech1.jpg"><img class="aligncenter size-full wp-image-1965" title="tech1" src="http://www.the-tech-tutorial.com/wp-content/uploads/2012/12/tech1.jpg" alt="" width="644" height="31" /></a></p>
<p>This output tell you that <span>PID</span> (in my instance) that&#8217;s running the <span>WEBrick</span> server is 22673, this will be different for you server so please note down the PID <em>(its the number before /ruby)</em>. Now we just need to kill this process to do this we use the following command <em>(substitute [PID] for the PID you noted in the previous step)</em>:<br />
<center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<pre>sudo kill -9 [PID]</pre>
<p>Now the <span><span><span>WEBrick</span> <span>server</span><span> will <span>stop</span></span> and you didn’t have to <span>restart</span> the machine.</span></span></p>
<p>&nbsp;</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1964"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+safely+kill+rails+WEBrick+server+running+in+daemon+mode&amp;link=http://www.the-tech-tutorial.com/?p=1964&amp;notes=Ruby%20on%20rails%20and%20the%20WEBrick%20Daemon%20are%20great%20for%20testing%20however%20there%20are%20times%20when%20you%20start%20a%20WEBrick%20server%20in%20daemon%20mode%20and%20later%20find%20you%20need%20to%20stop%20this%20without%20restarting%20the%20box.%20This%20can%20sometimes%20be%20troublesome%2C%20especially%20if%20you%20accidently%20kill%20a%20live%20server.%20In%20this%20tutorial%20I%E2%80%99&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1964</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby On Rails, dynamic table&#8217;s &amp; add button using nested_attributes</title>
		<link>http://www.the-tech-tutorial.com/?p=1939</link>
		<comments>http://www.the-tech-tutorial.com/?p=1939#comments</comments>
		<pubDate>Wed, 26 Sep 2012 13:37:53 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1939</guid>
		<description><![CDATA[So here’s the problem, you want to create several items that belong to one item, normally you would just the the has_many and belongs_to (OneToMany) relation in rails. Using this model you create the primary model (such as purchase order) then create several sub items (such as item) and attach them to the primary model. [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2012/09/Top.png"><img class="alignleft  wp-image-1942" title="Top" src="http://www.the-tech-tutorial.com/wp-content/uploads/2012/09/Top.png" alt="" width="140" height="89" /></a>So here’s the problem, you want to create several items that belong to one item, normally you would just the the has_many and belongs_to (OneToMany) relation in rails. Using this model you create the primary model (such as purchase order) then create several sub items (such as item) and attach them to the primary model. The problem with this is its time consuming and does not always make sense to do things this way, take the Purchase order and Items scenario, it makes much more sense to create the Purchase order and assciated Items in the same form. This is possible in rails uing nested_attributes.</p>
<p style="text-align: left;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2012/09/Items.jpg"><img class="aligncenter size-full wp-image-1941" title="Items" src="http://www.the-tech-tutorial.com/wp-content/uploads/2012/09/Items.jpg" alt="" width="450" height="195" /></a></p>
<p><span id="more-1939"></span></p>
<p style="text-align: left;">For this tutorial I&#8217;m going to be adding the sub-model Items to the Primary model Purchase Order, this will allow the Purchase order to have several items attached to it. To start with I created a simple Purchase order scaffold</p>
<pre class="brush:ruby">
Rails generate scaffold PurchaseOrder name:string
</pre>
<p>Now we need to add create the Items model:</p>
<pre class="brush:ruby">
Rails generate scaffold Item part_no:string description:string qty:string price:string
</pre>
<p>After we have created both models its time for the nested_attributes asscoitain, this will allow us to creat several items at the same time and the purchase order, to do this edit your Purchase order model to look like this:</p>
<p><strong>&#8220;app/models/purchase.rb&#8221;</strong></p>
<pre class="brush:ruby">
class Purchase < ActiveRecord::Base
  has_many :items
  
  accepts_nested_attributes_for :items, :allow_destroy => true
end
</pre>
<p>Now we need to edit the controller to manage the nested_attributes and dynamic table, add the folowing code the the new, create and update actions in the Purchase controller<br />
<center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br />
<strong>&#8220;app/controllers/purchases_controller.rb&#8221;</strong></p>
<pre class="brush:ruby">
def new
@purchase = Purchase.new</code>

@purchase.items.build

respond_to do |format|
format.html # new.html.erb
format.json { render json: @purchase }
end
end

def create
@purchase = Purchase.new(params[:purchase])

if params[:add_item]=="Add item"
@purchase.items.build
render :action =&gt; 'edit'
else
respond_to do |format|
if @purchase.update_attributes(params[:purchase])
format.html { redirect_to @purchase, notice: 'Purchase was successfully updated.' }
format.json { head <img src='http://www.the-tech-tutorial.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> k }
else
format.html { render action: "edit" }
format.json { render json: @purchase.errors, status: :unprocessable_entity }
end
end

def update
@purchase = Purchase.find(params[:id])
if params[:add_item]=="Add item"
@purchase.items.build
render :action =&gt; 'edit'
else
respond_to do |format|
if @purchase.update_attributes(params[:purchase])
format.html { redirect_to @purchase, notice: 'Purchase was successfully updated.' }
format.json { head <img src='http://www.the-tech-tutorial.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> k }
else
format.html { render action: "edit" }
format.json { render json: @purchase.errors, status: :unprocessable_entity }
end
end
end
end
</pre>
<p>Now add the following to the form view:</p>
<p><strong>&#8220;app/views/purchases/_form.html.erb&#8221;</strong></p>
<pre class="brush:ruby">
       <%= f.fields_for :items do |builder| %>
        <tr>
        <td><%= f.text_field :part_no, :style=>"width:70px;", :disabled=>@disabled %></td>
        <td><%= f.text_field :description, :disabled=>@disabled %></td>
        <td><%= f.text_field :quantity, :style=>"width:30px;", :disabled=>@disabled %></td>
        <td><%= f.text_field :price,:style=>"width:50px;", :disabled=>@disabled %></td>
        </tr>
     <% end %>
</pre>
<p>No restart your application and navigate to your Purchases model and create a new item <em>(http://127.0.0.1:3000/purchases/new)</em>, now you will see your form with a dynamic sub from where you can create severl of the sub model, i.e. Items. </p>
<p>If you have an any problems or comments please leave them below</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1939"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Ruby+On+Rails%2C+dynamic+table%27s+%26+add+button+using+nested_attributes&amp;link=http://www.the-tech-tutorial.com/?p=1939&amp;notes=So%20here%E2%80%99s%20the%20problem%2C%20you%20want%20to%20create%20several%20items%20that%20belong%20to%20one%20item%2C%20normally%20you%20would%20just%20the%20the%20has_many%20and%20belongs_to%20%28OneToMany%29%20relation%20in%20rails.%20Using%20this%20model%20you%20create%20the%20primary%20model%20%28such%20as%20purchase%20order%29%20then%20create%20several%20sub%20items%20%28such%20as%20item%29%20and%20attach%20the&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1939</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adprep &amp; Adprep32 Download</title>
		<link>http://www.the-tech-tutorial.com/?p=1922</link>
		<comments>http://www.the-tech-tutorial.com/?p=1922#comments</comments>
		<pubDate>Mon, 03 Sep 2012 08:54:58 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1922</guid>
		<description><![CDATA[Adprep.exe and Adprep32.exe is a tool found on the Windows Server 2008 installation disc, it is a tool that performs operations that must be completed in an existing Active Directory environment before you can add a new domain controller. You must run this tool if you are: Adding a new domain controller that runs a version [...]]]></description>
				<content:encoded><![CDATA[<p><span><span>Adprep</span>.exe</span> and <span><span>Adprep32</span>.exe</span> is a tool found on the <span><span>Windows</span> <span>Server</span></span> <span>2008</span> installation disc, it is a tool that performs operations that must be completed in an existing Active Directory environment before you can add a new domain controller. You must run this tool if you are:<span id="more-1922"></span></p>
<ul>
<li>Adding a new domain controller that runs a version of Windows Server that is later then the current domain controller</li>
<li>Before you upgrade your existing domain controller to a later version of Windows Server</li>
</ul>
<p>What does <span>adprep</span> do:</p>
<ul>
<li>Updates the Active Directory schema</li>
<li>Updates security descriptors</li>
<li>Modifies the  access control lists (ACLs) on Active Directory objects and on files in the SYSVOL shared folder</li>
<li>Creates new objects, as needed</li>
<li>Creates new containers, as needed</li>
</ul>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: right; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>You can find Adprep on your <span>Windows Server</span> 2008 <span>CD</span> in the \support\adprep\ or \sources\adprep, however if your like and you ordered you server with <span>no CD</span>&#8216;s or if you have <span>lost</span> your <span>CD</span>&#8216;s you made find it hard to get this tool, as far as I can tell there are no direct <span>download</span> links for the files (other then this page) and the alternative is to <span>download</span> the trail <span>CD</span>&#8216;s and copy the file from there. This is exactly what I had to do however I would of much preferred to simply <span>download</span> the files so I&#8217;m adding a link to them on this page, both these files were extracted from the trial <span>CD</span> on the 3rd September 2012 so they should be up to date.</p>
<h2><span>Download</span>s:</h2>
<p><a title="https://s3-eu-west-1.amazonaws.com/tyleruk2000-prog/adprep.exe" href="https://s3-eu-west-1.amazonaws.com/tyleruk2000-prog/adprep.exe">adprep.exe</a></p>
<p><a title="https://s3-eu-west-1.amazonaws.com/tyleruk2000-prog/adprep32.exe" href="https://s3-eu-west-1.amazonaws.com/tyleruk2000-prog/adprep32.exe">adprep32.exe</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1922"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Adprep+%26+Adprep32+Download&amp;link=http://www.the-tech-tutorial.com/?p=1922&amp;notes=Adprep.exe%20and%20Adprep32.exe%20is%20a%20tool%20found%20on%20the%20Windows%20Server%C2%A02008%20installation%20disc%2C%20it%20is%20a%20tool%20that%20performs%20operations%20that%20must%20be%20completed%20in%20an%20existing%20Active%20Directory%20environment%20before%20you%20can%20add%20a%20new%20domain%20controller.%20You%20must%20run%20this%20tool%20if%20you%20are%3A%0D%0A%0D%0A%09Adding%20a%20new%20domain%20c&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1922</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ruby on Rails Ubuntu 12.04 using RVM and Ruby 1.9.3</title>
		<link>http://www.the-tech-tutorial.com/?p=1868</link>
		<comments>http://www.the-tech-tutorial.com/?p=1868#comments</comments>
		<pubDate>Mon, 21 Nov 2011 13:06:13 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Fix It]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Rails 3.1]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby 1.9.2]]></category>
		<category><![CDATA[RVM]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Setup]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 11.10]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1868</guid>
		<description><![CDATA[Ruby Rails is a Web application framework created in 2004 intended as a rapid development web framework that runs the Ruby programing language. The latest version of the Ruby is &#8216;Ruby 1.9.2&#8216; and was realised in August 2011, it brings many new features and bug fixeses. The most signifiant changes are Block local variables, An [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png"><img class="alignleft size-full wp-image-1851" title="rails" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png" alt="" width="87" height="111" /></a><span><span>Ruby</span> <span>Rails</span></span> is a Web application framework created in 2004 intended as a rapid development web framework that runs the <span>Ruby</span> programing language. The latest version of the <span>Ruby</span> is &#8216;<span>Ruby 1.9.2</span>&#8216; and was realised in <span>August 2011</span>, it brings many new features and bug fixeses. The most signifiant changes are <a href="http://en.wikipedia.org/wiki/Local_variable" target="_blank">Block local variables</a>, An additional <a href="http://en.wikipedia.org/wiki/Anonymous_function" target="_blank">lambda</a> syntax, Per-string <a href="http://en.wikipedia.org/wiki/Character_encoding" target="_blank">character encodings</a> are supported and a new New socket API (<a href="http://en.wikipedia.org/wiki/IPv6" target="_blank">IPv6</a> support). You can find a great walkthrough of all the new features at <a href="http://rubyinside.com/19walkthrough/" target="_blank">Ruby Inside</a>. coinciding with the release of <span><span>Ruby</span> 1.9</span> is the <span>Rails 3.1</span> framework which requires <span>Ruby 1.8.7</span> or higher. <span><span>Ruby</span>on<span>Rails</span> 3.1</span> brings many new features, most notably: jQuery as default, HTTP Streaming, a new assets pipeline powered by <a href="https://github.com/sstephenson/sprockets/" target="_blank">Sprockets 2.0</a>. So this is all good stuff and I’m sure you want to be working with the latest version of Ruby and RubyonRails, especially if you setting up a new server.<span id="more-1868"></span></p>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: left; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>Well if your using Ubuntu you can setup <span>Ruby</span> and <span><span>Ruby</span>on<span>Rails</span></span> quickly using the supplied repository’s, a good tutorial for this can be <a href="http://www.the-tech-tutorial.com/?p=1801" target="_blank">found here</a>. However this is not recommended as the <span>Ubuntu</span> repositories are often out of date and if you install ruby or <span>rails</span> via the repository’s it can be pain to <span>upgrade</span>. So in this guide we are going to go through <span>installing <span>RVM</span></span> (this allows you to <span>install</span>, <span>change</span> and <span>upgrade</span> the installed <span>Ruby</span> version), <span>Ruby</span> <span>1.9.2</span></span> and <span><span>Rails</span> <span>3.1</span></span>. This Guide has been tested on <span>Ubuntu 11.10</span> however it should work on all versions of <span>Ubuntu</span> later then <span>Ubuntu 9.04</span>.</p>
<p>First of all you&#8217;ll need to install some packages that <span>Ruby</span>, <span>RVM</span> and <span><span>Ruby</span>On<span>Rails</span></span> will require later, the easiest way to do this is using the repositories so go to your terminal and type:</p>
<pre>sudo apt-get update
sudo apt-get install build-essential git-core curl libmysqlclient18 nodejs</pre>
<p>Now let’s install the latest version of <span>RVM</span> using <span>curl</span>:</p>
<pre>sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
umask g+w
source /etc/profile.d/rvm.sh 
</pre>
<p>Now you'll need to ask <span>RVM</span> if it needs any more programs and if so you'll need to install them to do this type:</p>
<pre>rvm requirements</pre>
<p>Two things could happen here if you see the following message saying you need to install '<span>rvm</span>', ignore this it and restart your terminal, this should fix the problem.</p>
<pre><span><span>The program <span>'rvm'</span> is currently <span>not <span>install</span>ed</span></span>.  You can install it by typing:
<span>sudo apt-get install ruby-rvm</span></span></pre>
<p>You should see something that looks like this <strong>after you restart your terminal</strong>:<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rvm_req.jpg"><img src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rvm_req.jpg" alt="" title="rvm_req" width="641" height="355" class="aligncenter size-full wp-image-1885" /></a></p>
<p>This tells you which packages you need to install using <span>apt-get</span>, just copy and paste the apt-get section under "# For <span>Ruby</span>" and run using the sudo command, this should look something like this:</p>
<pre>
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
</pre>
<p>Now you just need to give the user account access to the rvm files, you do this with the following command substituting [user] for the user you wish to use</p>
<pre>
sudo chown -R [user]:[user] /usr/local/rvm
</pre>
<p>Before completing this step I would recomend restarting your console otherwise you may run into problems. Once you have installed all these packages its time to install <span>Ruby 1.9.3</span> herself. The following command will install <span>Ruby 1.9.3</span> using the <span>rmv</span> package. However this can take a few minutes <em>(15 in my case)</em> to install so I recommend getting a drink, or my favourite, a pizza <img src='http://www.the-tech-tutorial.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' />  .</p>
<pre>rvm install 1.9.3</pre>
<p>Once <span>ruby</span> is installed you should set <span><span>Ruby</span> <span>1.9.3</span></span> as your <span><span><span>default</span> <span>Ruby</span></span> version</span>, to do this enter:</p>
<pre>
source "/usr/local/rvm/scripts/rvm"
rvm --default use 1.9.3
</pre>
<p>You can test that <span>Ruby</span> is installed correctly and running at version <span>1.9.2</span> by typing</p>
<pre>ruby -v</pre>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: right; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>This should output something like "ruby 1.9.2p290.." showing you that <span>version 1.9.2p290</span> is installed and is now the default <span>Ruby</span> version. </p>
<p>The nice thing about <span>RVM</span> is you can use it to install any version of <span>Ruby</span> and switch between the versions your have installed, to do this just enter "rvm install [Version Number]" then "rvm --default use [Version Number", you can then use "rvm --default use" to change to any installed version.</p>
<p>Now that you have the latest version of ruby installed I’m sure you want to get the <span><span>latest version of <span><span>Rails</span> install</span></span>ed</span>, at the time of writing this tutorial that’s <span>Rails 3.1</span>. To install <span>Rails</span> we can use <span>GEM</span> which is installed along with <span>RVM</span> and <span>Ruby</span>, to install the latest version of <span>Rails</span> just type, <em>(this can take also take a while)</em>:</p>
<pre>gem install rails</pre>
<p>And that’s it you have now installed <span><span>RVM</span>, <span>Ruby 1.9.2</span> and <span>Rails 3.1</span> on <span>Ubuntu 11.10</span></span> configured to use <span>sqlite3<span>, you can now setup your new <span><span>Rails</span> package</span> with </p>
<pre>rails new [project name]</pre>
<p>Just as a final note, If you want to <span>use MySQL</span> instead of <span>sqlite3</span> you&#8217;ll need to enter the following</p>
<pre>
sudo apt-get install mysql-server
gem install <span>mysql2</span>
rails new [project name] -d mysql
</pre>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1868"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Installing+Ruby+on+Rails+Ubuntu+12.04+using+RVM+and+Ruby+1.9.3&amp;link=http://www.the-tech-tutorial.com/?p=1868&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework%20that%20runs%20the%20Ruby%20programing%20language.%20The%20latest%20version%20of%20the%20Ruby%20is%20%27Ruby%201.9.2%27%20and%20was%20realised%20in%20August%202011%2C%20it%20brings%20many%20new%20features%20and%20bug%20fixeses.%20The%20most%20signifiant%20changes%20are&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1868</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Install Ruby on Rails Ubuntu Server 11.10</title>
		<link>http://www.the-tech-tutorial.com/?p=1801</link>
		<comments>http://www.the-tech-tutorial.com/?p=1801#comments</comments>
		<pubDate>Fri, 11 Nov 2011 09:56:48 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Fix It]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Basic]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[installing mysql2]]></category>
		<category><![CDATA[installing sqlite3]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu 11.04]]></category>
		<category><![CDATA[ubutnu 11.10]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1801</guid>
		<description><![CDATA[Ruby Rails is a Web application framework created in 2004 intended as a rapid development web framework. It was intended to emphasize Convention over Configuration (CoC) meaning the developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png"><img src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/rails.png" alt="" title="rails" width="87" height="111" class="alignleft size-full wp-image-1851" /></a><span>Ruby Rails</span> is a <span><span><span>Web</span> application</span> framework</span> created in 2004 intended as a <span>rapid development</span> <span>web framework</span>. It was intended to emphasize <span>Convention over Configuration</span> (CoC) meaning the developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table &#8220;products sold&#8221;, that the developer needs to write code regarding these names. It has also been designed around the &#8220;Don&#8217;t repeat yourself&#8221; principle. Both of these ways of thinking allow you, with <span>Ruby Rails<span>, to create excellent, <span>dynamic websites</span> very quickly. So to get started we need to setup a <span><span><span>Ruby</span> Rails</span> <span>development server</span></span> on <span>Ubuntu</span> (<span>Ubuntu 11.04</span>, <span>Ubuntu 11.10</span>)<span id="more-1801"></span></p>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: right; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>In this <span>tutorial</span> we are going to go through an install of <span><span><span>Ruby Rails</span> on Ubuntu</span> 11.10</span> using <span>Ruby 1.8</span>. This will work on previous Ubuntu versions however Ubuntu 11.10 is the version I tested this walk-through. </p>
<p>Before we go anywhere we need to install and setup a <span>MySQL</span> server as <span>Ruby Rails</span> requires a database to function correctly, to do this open your terminal and type:</p>
<pre>sudo apt-get install mysql-server</pre>
<p>when prompted enter the root password for your database server, remember this as you&#8217;ll need it later.</p>
<p>Once your <span><span>MySQL</span> database</span> is installed we need to install the <span>Ruby</span> language. The <span>Ruby</span> language is the programing that <span>Ruby Rails</span> runs on. <span>Ruby</span> itself was designed before <span>Ruby Rails</span> as a dynamic, reflective, general-purpose object-oriented programming language. It was inspired by Perl with Smalltalk-like features. I strongly recommend you learn to make a few programs in ruby before moving onto working work ruby rails, a great free e-book to teach you <span>Ruby</span> can be <a href="http://ruby-doc.org/docs/ProgrammingRuby/">found here</a>. There are also a few other programs that are needed to run <span>Ruby Rails</span>, these will all be installed in this step so it may take a while:</p>
<pre>sudo apt-get install ruby ruby-full libzlib-ruby rvm rdoc irb make sqlite3 libmysql-ruby libmysqlclient-dev nodejs</pre>
<p>Now we need to install <span>Gem</span>, this is a little like &#8220;Apt-get&#8221; or &#8220;Aptitude&#8221; however it’s designed just to download modules for <span>Ruby</span> &#038; <span>Ruby Rails</span>. Personly I&#8217;ve had problems when <span>installing <span>Gem</span></span> on <span>Ubuntu</span> using <span>apt-get</span> so for this tutoiral we&#8217;ll install using the <span>Ruby</span> file downloaded frm the <span>rubyonrails</span>.org website. </p>
<pre>
cd ~
wget http://rubyforge.org/frs/download.php/75475/rubygems-1.8.11.tgz
tar -xf rubygems-1.8.11.tgz
cd rubygems-1.8.11
sudo ruby setup.rb
</pre>
<p>Once gem is installed we need to use it to download a few packages (or <span>Gems</span>),</p>
<pre>
sudo gem1.8 install mysql2 -v '0.3.10'
</pre>
<p>Once this is downloaded and installed by <span>Gem</span> its time to download and install <span>Rails</span> itself. Installing Rails from <span>Gem</span> can take a while and on my install it always appears to <span>hang</span> for a while. If this happens to you don’t worry it is doing its job, just wait a few more minutes.</p>
<pre>sudo gem1.8 install rails</pre>
<p>Now its time to <span>setup</span> a new site, the following step will create the site new_<span>rails</span>, feel free to change this to what you like for the remainder of this tutorial,</p>
<pre>rails new new_rails -d mysql </pre>
<p>Once this completed your ready to setup your database, todo this open your mysql client with</p>
<pre>mysql -u root -p</pre>
<p>and create the database for youe app (here we use [APPNAME]_development, you should subsituite your app name in the APPNAME section)</p>
<pre>CREATE DATABASE new_rails_development;</pre>
<p>Now you can exit your mysql client with the &#8220;Exit&#8221; command. Now you&#8217;ll need to enter your <span><span><span>MySQL</span> database</span> password</span> into the rails config. You do this by editing a config file saved in the config directory of your new site,</p>
<pre>nano ~/new_rails/config/database.yml</pre>
<p>Once you have this file open you&#8217;ll need to fill in the password fields with your database password, you only need to do this for the password field (i.e the development DB). </p>
<p>Now its time to start your Ruby Rails Server,</p>
<pre>cd new_rails
sudo rails server</pre>
<p>you should see something that looks like this:<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/ServStarted.jpg"><img class="aligncenter size-full wp-image-1818" title="ServStarted" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/ServStarted.jpg" alt="" width="505" height="378" /></a></p>
<p>Now that your <span>server</span> is running go to your <span>web</span> browser and enter the address</p>
<pre>http://[YOUR IP]:3000/</pre>
<p><center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br />
If your development server is setup correclty then you should see the folowing window:<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/Running.jpg"><img class="aligncenter size-full wp-image-1819" title="Running" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/Running.jpg" alt="" width="500" height="366" /></a><br />
If you see this screen then you’ve setup your Ruby Rails development server on Ubuntu 11.04. There are many more steps required in building a website using ruby rails, these are all out of the scope of this tutorial, however you can find a great starting <a href=" http://guides.rubyonrails.org/getting_started.html">guide here</a>, just scroll down to Step 4 to start where we have left off.</p>
<p>If you have any problems or comments please feel free to leave them in the comments section and I&#8217;ll try and get back to you asap. </p>
<p>When I was setting up this tutorial I ran into several problems with <span>Ubuntu</span> and <span>Ruby Rails</span>, these were the following error messages:</p>
<pre><span><span><span>An error</span> occured</span> while <span>installing mysql2</span> (0.3.10)</span>
<span>An<span> <span>error</span> occured</span></span> while <span>installing sqlite3</span> (1.3.4)</pre>
<p>If have tried installing <span>Ruby Rails on Ubuntu</span> then start again following the above steps in order and you won’t have these problems. However if cant be botherd to install <span><span>Ruby</span> On <span>Rails</span></span> again then running the following commands should fix the problem:</p>
<pre>
sudo apt-get install ruby ruby-full libzlib-ruby rdoc irb make sqlite3 libmysql-ruby libmysqlclient-dev nodejs
rails new new_rails -d mysql</pre>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1801"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=How+To+Install+Ruby+on+Rails+Ubuntu+Server+11.10&amp;link=http://www.the-tech-tutorial.com/?p=1801&amp;notes=Ruby%20Rails%20is%20a%20Web%20application%20framework%20created%20in%202004%20intended%20as%20a%20rapid%20development%20web%20framework.%20It%20was%20intended%20to%20emphasize%20Convention%20over%20Configuration%20%28CoC%29%20meaning%20the%20developer%20only%20needs%20to%20specify%20unconventional%20aspects%20of%20the%20application.%20For%20example%2C%20if%20there%20is%20a%20class%20Sale%20in%20th&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1801</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to mass/bulk delete all unapproved comments from wordpress</title>
		<link>http://www.the-tech-tutorial.com/?p=1761</link>
		<comments>http://www.the-tech-tutorial.com/?p=1761#comments</comments>
		<pubDate>Thu, 03 Nov 2011 11:18:21 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Fix It]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[Short]]></category>
		<category><![CDATA[bulk delete]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[delete all]]></category>
		<category><![CDATA[delete all comments]]></category>
		<category><![CDATA[mass delete]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[unaproved]]></category>
		<category><![CDATA[unaproved comments]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1761</guid>
		<description><![CDATA[Do you have the problem of hundreds of comments building up on your WordPress site, we&#8217;ll the best solution is to check it regularly and delete the unwanted comments, just leaving the appropriate ones. However what happens if you go on holiday for a week and don’t check your blog, or if your forget to [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/slef_destruct.jpg"><img src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/11/slef_destruct.jpg" alt="" title="slef_destruct" width="186" height="122" class="alignleft size-full wp-image-1791" /></a>Do you have the problem of <span>hundreds</span> of <span>comments building up</span> on your <span><span>WordPress</span> site</span>, we&#8217;ll the best solution is to check it regularly and <span>delete</span> the unwanted comments, just leaving the appropriate ones. However what happens if you go on holiday for a week and don’t check your blog, or if your forget to look at your comments for a few day (i.e. lost weekend down the pub) well you&#8217;ll probably find <span>several <span>hundred <span>comments</span></span></span> have built up in this time. Now you can <span>delete</span> these <span>comments manually</span> but this is time consuming. To make your life easier I’m going to go through some simple ways of <span><span><span>deleting</span> <span>all</span></span> <span>unapproved <span><span>comments</span></span></span></span> while <strong><span>not</strong> using phpMyAdmin</span> (as every other tutorial I’ve seen does use phpMyAdmin).<span id="more-1761"></span></p>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: right; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>Just a quick warning before we start this method is pretty brutal, <strong>it is not a spam filter</strong> and these methods will <span><span>delete <strong>all</span></strong> your comments</span> weaver they are spam or not, so I only recommend using it when you have let your comments get out of hand and really don’t have time to go through manually, otherwise you might as well just disable <span>comments</span> in your <span>WordPress</span> settings.</p>
<p>I said at the beginning this tutorial is for those who <span>don’t have phpMyAdmin</span>, well as I’m nice I’ve included a quick video for the phpMyAdmin method at the bottom of the page. However <span>if you don’t have phpMyAdmin</span> installed there are a few other way you can <span><span>delete all</span> your <span>unapproved comments</span></span>. The easiest way is to have shell access to your box, if you don’t know just skip to the next step. All you need to do is access the box and run one <span>MySQL statement</span>, this can be done as follows:</p>
<pre>mysql -u [USERNAME] -p -e "DELETE FROM wordpress.wp_comments WHERE comment_approved=0;" wordpress</pre>
<p>And thats it <span><span>all your unappoved comments</span> will be <span>delted</span></span> saving your many hours of manualy <span>deleting comments</span>.</p>
<p><strong>NEXT STEP</strong>: If you don’t have access to your shell and you <span>don’t have phpMyAdmin</span> installed there is another way to do this, you create a simple PHP page that <span><span>delete</span>s all comments</span> and access it form your <span>web browser</span>. This should only really be used as a last resort as it will create a page <strong>that anyone can access</strong> that once opened will <span>delete all your unread comments</span>. This is fine to-do so long as your delete/restrict the page after you&#8217;ve finished. So let’s get started first open Notepad or some other html editor and create a page with the following code while adding your own username, password, and database name:<br />
<center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<pre class="brush:php">&lt;?php

//Warning this page will delete all your WordPress comments once opened and can accessed by anyone so you should delete or restrict once used!

//Please replace the following with your details

$usrName="[REPLACE WITH YOUR USERNAME]";
$usrPass="[REPLACE WITH YOUR PASSWORD]";
$usrDB="[REPLACE WITH YOUR DATABASE NAME]";

$con = mysql_connect("localhost",$usrName,$usrPass);
if (!$con)
{
	die('Could not connect: Please check your usrName &amp; usrPass settings');
}

mysql_select_db($usrDB, $con);

$result = mysql_query("DELETE FROM wp_comments WHERE comment_approved=0;");
if (!$result)
{
	die('Could not delete: Please check your usrDB setting');
}
else
{
	echo 'All unapproved comments now deleted';
}

?&gt;</pre>
<p>Now you&#8217;ll need to save this page to something like wp-coment-remove.php then upload it to your site via your normal file transfer method (either ftp or via a http file uploader) once you have done this all you&#8217;ll need to do is access the page, so for this site I would go to the page http://www.the-tech-tutorial.com/wp-coment-remove.php , just substitute the-tech-tutorial for your sites address. Now that you have run this page, <span>all your unapproved comments will be gone</span>, hooray. Just remember that this page is a security risk because anyone can access it so either restrict is access once you’re done or delete the page.</p>
<p>As I promised here is the YouTube video showing <span>how to</span> do this <span>with phpMyAdmin</span>:<br />
<center><iframe width="420" height="315" src="http://www.youtube.com/embed/QCA4loQi7yM" frameborder="0" allowfullscreen></iframe></center></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1761"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=How+to+mass%2Fbulk+delete+all+unapproved+comments+from+wordpress&amp;link=http://www.the-tech-tutorial.com/?p=1761&amp;notes=Do%20you%20have%20the%20problem%20of%20hundreds%20of%20comments%20building%20up%20on%20your%20Wordpress%20site%2C%20we%27ll%20the%20best%20solution%20is%20to%20check%20it%20regularly%20and%20delete%20the%20unwanted%20comments%2C%20just%20leaving%20the%20appropriate%20ones.%20However%20what%20happens%20if%20you%20go%20on%20holiday%20for%20a%20week%20and%20don%E2%80%99t%20check%20your%20blog%2C%20or%20if%20your%20forge&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1761</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable potentially unsafe attachments in outlook</title>
		<link>http://www.the-tech-tutorial.com/?p=1739</link>
		<comments>http://www.the-tech-tutorial.com/?p=1739#comments</comments>
		<pubDate>Wed, 31 Aug 2011 09:51:10 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Fix It]]></category>
		<category><![CDATA[Short]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1739</guid>
		<description><![CDATA[Ahh the &#8220;Outlook blocked access to the following potentially unsafe attachments&#8221; message, one of the most annoying things you can see when you in a hurry to get an attachment. However there is a good reason that attachments are disabled in outlook, some attachments can potentially be unsafe, as the warning says. But so long [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/outlook_exe_top.jpg"><img class="aligncenter size-full wp-image-1743" title="outlook_exe_top" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/outlook_exe_top.jpg" alt="" width="407" height="36" /></a>Ahh the &#8220;<span><span><span>Outlook</span> <span>blocked access</span></span> to the following <span>potentially unsafe <span>attachments</span></span></span>&#8221; message, one of the most annoying things you can see when you in a hurry to get an <span>attachment</span>. However there is a good reason that <span><span>attachments</span> are disabled</span> in <span>outlook</span>, some <span><span>attachment</span>s</span> can <span><span>potentially</span> be <span>unsafe</span></span>, as the <span>warning</span> says. But so long as you know were an <span>attachment</span> is from and you know the risks why <span><span>can&#8217;t <span>you enable</span><span> these</span>, after all you did pay for your computer and Office so you should be able to do what you want, right? Well in outlooks default setting there is no way to <span>enable unsafe attachments</span>, however there is a setting in the registry to <span><span>enable</span> them</span>:<span id="more-1739"></span></p>
<p>Just before I begin I want to remind you that there is a <strong>GOOD RESON</strong> why <span>outlook</span> blocks certain types of files and that for <span>security</span>. However when there is a file I <span>need to <span>open</span></span> and I know it <strong>IS SAFE</strong> I go through these steps to <span>enable</span> it then <span>disable</span> the after I’ve <span>download the file</span>. So let’s start:<br />
<strong><br />
Windows 95 &#8211; XP:</strong></p>
<pre>Start &gt; Run &gt; Type <em>regedi</em>t &gt; Click Ok

Navigate through the tree on the left panel to:

+HKEY_CURRENT_USER
++Software
+++Microsoft
++++Office
+++++14.0(or your version of office (14.0 for Office 2010))
++++++Outlook
+++++++Security

Once found Right Click on the Right Hand panel and select
New&gt;String Value &gt; Name it <em>Level1Remove</em>

Now double click on the new string, add <em>exe</em> in the Value Data field to enable .exe files.

Once this is complete restart outlook to save the changes.</pre>
<p><center><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-2094089617852812"; /* 2011 Bottom */ google_ad_slot = "5825267234"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></center><br />
<strong>Windows Vistsa &#8211; 7</strong></p>
<pre>Start &gt; Type <em>regedit</em> in the search bar &gt; click Registry Editor in the programs window

Navigate through the tree on the left panel to:

+HKEY_CURRENT_USER
++Software
+++Microsoft
++++Office
+++++Outlook
++++++Security

Once found Right Click on the Right Hand panel and select
New&gt;String Value &gt; Name it <em>Level1Remove</em>

Now double click on the new string, add <em>exe</em> in the Value Data field to enable .exe files.

Once this is complete restart outlook to save the changes.</pre>
<div style="width: 350px; height: 330px; background-image: url('http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png'); display: block; float: right; padding: 20px 25px 0px 30px;"><script type="text/javascript">// <![CDATA[
 google_ad_client = "pub-2094089617852812"; /* 2011 In Text Box */ google_ad_slot = "1777411765"; google_ad_width = 336; google_ad_height = 280;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></div>
<p>You can add multiple allowed types by editing this new Registry Entry like so:<br />
exe;mdb;vbs</p>
<p>Please remember you should only allow dangerous file types <strong>temporarily</strong>. Once you have the file you need you disable the file type by removing the value of the new Registry Value.</p>
<p>Please feel free to add any comments or questions, thanks.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1739"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Enable+potentially+unsafe+attachments+in+outlook&amp;link=http://www.the-tech-tutorial.com/?p=1739&amp;notes=Ahh%20the%20%22Outlook%20blocked%20access%20to%20the%20following%20potentially%20unsafe%20attachments%22%20message%2C%20one%20of%20the%20most%20annoying%20things%20you%20can%20see%20when%20you%20in%20a%20hurry%20to%20get%20an%20attachment.%20However%20there%20is%20a%20good%20reason%20that%20attachments%20are%20disabled%20in%20outlook%2C%20some%20attachments%20can%20potentially%20be%20unsafe%2C%20as%20the%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1739</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Wesbites For iPhones</title>
		<link>http://www.the-tech-tutorial.com/?p=1631</link>
		<comments>http://www.the-tech-tutorial.com/?p=1631#comments</comments>
		<pubDate>Wed, 10 Aug 2011 09:41:52 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[code example]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[res]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1631</guid>
		<description><![CDATA[So I’ve been developing a few websites mainly to be viewed on iPhones and iPods and this has raised several issues. Obviously you have to develop for mobile browsers such as safari which runs on iPhones or iPods and develop accordingly for this browser and the unique screen resolutions used on mobile devices. In this [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/IPhone_4_in_hand.jpg"><img class="alignleft size-full wp-image-1714" title="The iPhone 4" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/IPhone_4_in_hand.jpg" alt="" width="86" height="70" /></a>So I’ve been developing a few websites mainly to be viewed on <span>iPhones</span> and <span>iPods</span> and this has raised several issues. Obviously you have to develop for mobile browsers such as safari which runs on <span><span>iPhone</span>s</span> or <span><span>iPod</span>s</span> and <span>develop</span> accordingly for this <span>browser</span> and the unique <span>screen resolutions</span> used on <span>mobile devices</span>. In this article I’m going to look at, what I feel, are the most <span>important <span><span>code</span> snippets</span></span> you&#8217;ll need to get started <span>developing for <span><span>iPhone</span>s</span> or <span><span>iPod</span>s</span></span>.<span id="more-1631"></span></p>
<h1></h1>
<h1>Detect <span>iPhone</span>s</h1>
<p>First off we need to be able to detect <span>iPhone</span>s in order to develop for them, after all we don’t want to develop solely for <span><span>iPhone</span>s</span> so we need know when an <span>iPhone</span> is viewing the page to make the relevant adjustments.</p>
<h4>PHP</h4>
<p><span>To <span><span>detect iPhone</span>s in PHP</span></span> use the folowing code:</p>
<pre class="brush:php">if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) {
    //TODO: Enter your iPhone/iPod code here
}</pre>
<h4>JavaScript</h4>
<p><span>To <span><span>detect iPhone</span>s in JavaScript</span></span> use the folowing code:</p>
<pre class="brush:js">if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
   //TODO: Enter your iPhone/iPod code here
}</pre>
<p><em><strong>Source:</strong> <a href="http://davidwalsh.name/detect-iphone" target="_blank">http://davidwalsh.name/detect-iphone</a></em></p>
<h1></h1>
<h1><span>Define Viewport for <span>iPhone</span></span></h1>
<p>This is an important feature to include in all your <span><span><span>iPhone</span> or <span>iPod</span> enabled page</span>s</span>, without this your page will open as if its <span>zoomed out</span>, trust me its annoying. To stop this from happening you need to include <em>width=device-width </em>to tell safari that the website is the same width as the <span><span>iPhone</span> Screen</span>, to do this simply include this meta tag in your pages header:</p>
<pre class="brush:xml">&lt;meta name="viewport" content="width=device-width;&gt;</pre>
<p>if you are developing and iPhone only page you can also restrict the user from scaling the page and messing up your nice layout, to do this set the initial-scale &amp; maximum-scale values to 1.0:</p>
<pre class="brush:xml">&lt;meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"&gt;</pre>
<p><em><strong>Source: </strong></em><a href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/" target="_blank">engageinteractive.co.uk/../tutorial-building-a-website-for-the-iphone/</a></p>
<p><center><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-2094089617852812"; /* 2011 Bottom */ google_ad_slot = "5825267234"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></center></p>
<h1></h1>
<h1><span>Adding an <span><span>iPhone</span> home screen icon</span></span></h1>
<p>When someone adds a <span>webpage</span> to their <span>home screen on the <span>iPhone</span></span> then a new <span>icon</span> is generated so that the user can quickly access the page. We can choose what that <span>icon</span> is by setting <em>rel=&#8221;apple-touch-icon&#8221;</em> to the desired <span>icon</span>. First you need to design a relevant <span>icon</span>, it needs to be in .PNG format and <span>57px by 57px</span>. As for the code simply add this to your header replacing the link with the link to your icon file:</p>
<pre class="brush:xml">&lt;rel="apple-touch-icon" href="images/template/engage.png"/&gt;</pre>
<p><em><strong>Source: </strong></em><a href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/" target="_blank">engageinteractive.co.uk/../tutorial-building-a-website-for-the-iphone/</a></p>
<h1></h1>
<h1>Common iPhone page layout</h1>
<p>Most pages developed for <span>iPhones</span> have a single column structure with a floating width that contains three main sections, the header, content and footer. This layout is used by many websites including Flickr, here is a breakdown of the <span>iPhone</span> Flickr page:</p>
<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/ip2.gif"><img class="aligncenter size-full wp-image-1668" title="ip2" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/ip2.gif" alt="" width="417" height="339" /></a></p>
<p><strong></strong><em><strong>Source: </strong></em><a href="http://woorkup.com/2010/01/10/best-practices-to-develop-perfect-websites-for-iphone-and-mobile-devices/" target="_blank">woorkup.com/&#8230;/best-practices-to-develop-perfect-websites-for-iphone-and-mobile-devices/</a></p>
<p>A simple example of how to <span>code</span> this <span>simple <span>layout</span></span> can be seen below, note we never set a relative width in the CSS, this this may stop the page from filling the iPhones screen:</p>
<h6>CSS:</h6>
<pre class="brush:css">#header{
	background:#0CF;
}
#content{
	background:#CCC;
	height:200px;
}
#footer{
	background:#0CF;
}</pre>
<h6>HTML:</h6>
<pre class="brush:xml">&lt;body&gt;
&lt;div id="header"&gt;
	&lt;center&gt;Header&lt;/center&gt;
&lt;/div&gt;
&lt;div id="content"&gt;
	&lt;center&gt;Content&lt;/center&gt;
&lt;/div&gt;
&lt;div id="footer"&gt;
	&lt;center&gt;Footer&lt;/center&gt;
&lt;/div&gt;
&lt;/body&gt;</pre>
<h1></h1>
<h1>Common iPhone page NavBar</h1>
<p>Most <span><span>iPhone</span> <span>pages</span></span> have a header that often contains a logo and a navigation bar. A navigation bar is an important part of any page, without it the users will be stuck on one page, and we don’t want that. Here is a good example of a navigation bar to use in your iPhone page headers:</p>
<h6>EXAMPLE :</h6>
<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Nav_Head_iphone.jpg"><img class="aligncenter size-full wp-image-1677" title="Nav_Head_iphone" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Nav_Head_iphone.jpg" alt="" width="404" height="62" /></a></p>
<h6>CSS:</h6>
<pre class="brush:css">#header{
	height:25px;
}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0}
ol,ul{list-style:none}
#nav{position:relative;line-height:14px}
#nav_main{height:30px;color:#111}
#nav_main li{float:left;width:25%;margin:2px 0 0 -1px;background:#f3f3f3;border:1px solid #e3e3e3;border-width:0 0 1px 1px;text-align:center}
#nav_main li.first{border-left:none}
#nav_main li.selected{z-index:10;margin-top:0;margin-left:-2px;background:#fff;border-width:1px;border-bottom:1px solid #fff;font-weight:bold}
#nav_main li.last.selected{border-right:none}
#nav_main li a{display:block;padding:6px 0 7px}
#nav_main li.selected a{padding-top:7px;color:#000}</pre>
<h6>HTML:</h6>
<pre class="brush:xml">&lt;div id="header"&gt;
     &lt;div id="logo"&gt;
         &lt;img src="" width="100" height="30" alt="LOGO"&gt;
     &lt;/div&gt;
     &lt;div id="nav"&gt;
        &lt;ul id="nav_main"&gt;
            &lt;li id="activity-tab"&gt;&lt;a href="/activity/" &gt;Activity&lt;/a&gt;&lt;/li&gt;
            &lt;li id="you-tab"&gt;&lt;a href="/photos/tyleruk2000/" &gt;You&lt;/a&gt;&lt;/li&gt;
            &lt;li id="contacts-tab"&gt;&lt;a href="/people/" &gt;Contacts&lt;/a&gt;&lt;/li&gt;
            &lt;li id="more-tab"&gt;&lt;a href="/more"&gt;More&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;    
&lt;/div&gt;</pre>
<h1></h1>
<h1><span>Starter <span><span>iPhone Page</span></span> Template</span></h1>
<p>This is a very <span>simple <span>template</span></span> I put together to <span>get you <span>started creating iPhone websites</span></span>, it has a logo in the header, a <span>simple Navigation bar</span> and a simple footer:</p>
<h6>EXAMPLE :</h6>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo_temp.png"><img class="aligncenter size-full wp-image-1702" title="photo_temp" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo_temp.png" alt="" width="230" height="346" /></a></p>
<h6>CODE:</h6>
<p><center><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-2094089617852812"; /* 2011 Bottom */ google_ad_slot = "5825267234"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></center></p>
<pre class="brush:xml">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;iPhoneStartTemplate&lt;/title&gt;

&lt;style&gt;
div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0}
ol,ul{list-style:none}
#nav{position:relative;line-height:14px;}
#nav_main{height:30px;color:#111}
#nav_main li{float:left;width:25%;margin:2px 0 0 -1px;background:#f3f3f3;border:1px solid #e3e3e3;border-width:0 0 1px 1px;text-align:center}
#nav_main li.first{border-left:none}
#nav_main li.selected{z-index:10;margin-top:0;margin-left:-2px;background:#fff;border-width:1px;border-bottom:1px solid #fff;font-weight:bold}
#nav_main li.last.selected{border-right:none}
#nav_main li a{display:block;padding:6px 0 7px}
#nav_main li.selected a{padding-top:7px;color:#000}
#header{background:#f3f3f3;}
#content{background:#f7f7f7;border-width:1px;border-bottom:1px solid #fff;}
#footer{background:#f3f3f3;border-width:1px;border-top:1px solid #DDD;font-size:x-small;height:31px;}
#logo.footer{float:left;}
#footer_nav{float:right;font-size:x-small; margin-top:8px; margin-right:5px;}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;!----------------------START OF HEADER----------------------&gt;
&lt;div id="header" class="toolbar"&gt;
	&lt;div id="logo"&gt;
        &lt;img src="" width="100" height="30" alt="LOGO"&gt;
    &lt;/div&gt;
	&lt;div id="nav"&gt;
		&lt;ul id="nav_main"&gt;
			&lt;li class="first"&gt;&lt;a href="/activity/" &gt;Activity&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href="/photos/" &gt;You&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href="/people/" &gt;Contacts&lt;/a&gt;&lt;/li&gt;
			&lt;li class="last"&gt;&lt;a href="/more"&gt;More&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;!----------------------START OF MAIN CONTENT----------------------&gt;
&lt;div id="content"&gt;
  &lt;p&gt;Ve da aspetta deserta purezza porpora. Ci ricomincia emergevano mi inebriarti persuadere riprodurre trascinato. Cosi nevi far sul qui dita ella. Rote vero mani un pare me teco. Ferro ma ci su volto da umile. Sapro prima prime tue getti manca mia. Ardi sara dara sul tele tra meco. &lt;/p&gt;
&lt;/div&gt;
&lt;!----------------------START OF FOOTER----------------------&gt;
&lt;div id="footer"&gt;
    &lt;div id="logo" class="footer"&gt;&lt;img src="" width="100" height="30" alt="LOGO"&gt;&lt;/div&gt;
    &lt;div id="footer_nav"&gt;&lt;span style="text-align:right"&gt;&lt;a href="/activity/"&gt;HOME&lt;/a&gt; | &lt;a href="/photos/"&gt;TOP&lt;/a&gt; | &lt;a href="/people/"&gt;PRINT&lt;/a&gt; | &lt;a href="/forum/"&gt;FORUM&lt;/a&gt; | &lt;a href="/about/"&gt;ABOUT&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<h1><span>Screen Resolution</span></h1>
<p>This is important to know as if you’re using pictures or static dimensions you don’t want your content to spill over the edge of the screen. This isn’t so much of a problem if your content is rather high as users are used to scrolling up and down however if you include wide content you start messing with the zoom level and the page may not display as you originally as you thought. Another difficulty is that there are two types of iPhone resolution, that of the iPhone and the iPhone 4 so make sure you test your sites on both resolutions, they are:</p>
<p><strong>iPhone:</strong> 320&#215;480</p>
<p><strong>iPhone 4:</strong> 640&#215;960</p>
<h1><span>Inspiration</span></h1>
<p>Here I have included my favourite <span><span><span>websites</span> optimized</span> for the iPhone</span>, though this isn’t realy a tip for <span><span><span>developing websites</span> for iPhone<span>s</span> its always <span>helpful</span> to look at other sites to see if you can learn something from how they do it. Notice none of these sites (apart from flicker) don&#8217;t use a lot of images, this is to make much cleaner and user friendly on the small screens and a lot quicker to load over the relatively slow internet connection that <span>iphones</span> have:</span></span></p>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo1.png"><img class="aligncenter size-full wp-image-1685" title="photo1" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo1.png" alt="" width="384" height="576" /></a></p>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo2.png"><img class="aligncenter size-full wp-image-1686" title="photo2" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo2.png" alt="" width="384" height="576" /></a></p>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo3.png"><img class="aligncenter size-full wp-image-1687" title="photo3" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo3.png" alt="" width="384" height="576" /></a></p>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo4.png"><img class="aligncenter size-full wp-image-1691" title="photo4" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo4.png" alt="" width="384" height="576" /></a><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo4.png"><br />
</a></p>
<p style="text-align: center;"><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo5.png"><img class="aligncenter size-full wp-image-1684" title="photo5" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/photo5.png" alt="" width="384" height="576" /></a></p>
<p>I hope you find this information helpful, if you have any comments or questions please leave a comment.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1631"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Developing+Wesbites+For+iPhones&amp;link=http://www.the-tech-tutorial.com/?p=1631&amp;notes=So%20I%E2%80%99ve%20been%20developing%20a%20few%20websites%20mainly%20to%20be%20viewed%20on%20iPhones%20and%20iPods%20and%20this%20has%20raised%20several%20issues.%20Obviously%20you%20have%20to%20develop%20for%20mobile%20browsers%20such%20as%20safari%20which%20runs%20on%20iPhones%20or%20iPods%20and%20develop%20accordingly%20for%20this%20browser%20and%20the%20unique%20screen%20resolutions%20used%20on%20mob&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1631</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install and Configure a Ubuntu 11.04 Snort-MySQL Honeypot</title>
		<link>http://www.the-tech-tutorial.com/?p=1578</link>
		<comments>http://www.the-tech-tutorial.com/?p=1578#comments</comments>
		<pubDate>Tue, 09 Aug 2011 13:05:39 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Basic]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[honeypot]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network intrusion prevention]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[screen shorts]]></category>
		<category><![CDATA[Setup]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[Tutoiral]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu 11.04]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1578</guid>
		<description><![CDATA[An Intrusion Detection system is like a burglar alarm for your computer. It monitors you network and system activities for malicious activities or policy violations and reports to some kind of management station. This is great as it lets you know who were when &#38; how people are trying to break into your network and [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2010/09/snort.jpg"><img class="alignleft size-full wp-image-864" title="snort" src="http://www.the-tech-tutorial.com/wp-content/uploads/2010/09/snort.jpg" alt="" width="174" height="95" /></a>An <span><span>Intrusion Detection</span> system</span> is like a burglar alarm for your computer. It monitors you network and system activities for malicious activities or policy violations and reports to some kind of <span>management station</span>. This is great as it lets you know who were when &amp; how people are trying to break into your network and knowing this is half the battle. You may be thinking that this isn’t enough and you want to block all hacks from happening, well most <span>IDS</span> systems include some “<span><span>Network Intrusion</span> Prevention</span>” features. However the main concern should be closing up vulnerabilities rather than blocking someone already trying to hack your systems, after all it’s a bit late if they are already in your system, and this way you may accedently block innocent users.<br />
<span id="more-1578"></span><br />
Another common use of an <span><span>Intrusion Detection</span> system</span> is to use it as a <span>honeypot</span>. In Wikipedia’s words a <span>honeypot</span> is &#8220;In computer terminology, a <strong><span>honeypot</span></strong> is a <a title="Trap (tactic)" href="http://en.wikipedia.org/wiki/Trap_%28tactic%29">trap</a> set to detect, deflect, or in some manner counteract attempts at unauthorized use of <a title="Information systems" href="http://en.wikipedia.org/wiki/Information_systems">information systems</a>.&#8221;. Basically if you trying to find some <span>hackers</span> address or an active <span>botnet</span> then installing a <span>honeypot</span> on a popular webserver is a good way to go about this.</p>
<div style="width:350px; height:330px;background-image: url(http://www.the-tech-tutorial.com/wp-content/uploads/2011/03/add_back1.png); display: block; float: left; padding: 20px 25px 0px 30px;">
<script type="text/javascript"><!--
google_ad_client = "pub-2094089617852812";
/* 2011 In Text Box */
google_ad_slot = "1777411765";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>So what the best <span>IDS</span>, well <a href="http://infoworld.com/" target="_blank">infoworld.com</a> said that the <a href="http://www.infoworld.com/d/open-source/greatest-open-source-software-all-time-776?source=fssr" target="_blank">The <span>greatest open source software of all time</span></a> was <a title="Snort Homepage" href="http://www.snort.org/" target="_blank">Snort</a>, and if it’s the <span><span>best</span> open source software of all time</span>, you can sure as hell bet it’s the <span>best</span> <span>open source <span>IDS</span></span>. <span>Snort</span> contains a full featured <span>IDS</span> as well as receiving regular updates to its rules library as well as great <span><span>Network <span>Intrusion</span> Prevention</span></span> features. So let’s discuss how to install this and get it reporting to a <span><span>MySQL</span> <span>database</span></span>.</p>
<p>In this tutorial we are going to be setting up a <span><span>snort</span> server</span> to run and <span>monitor a single machine</span>, this is great for <span>protecting your webserver</span> or creating a <span>honeypot</span>. However if you want an <span>IDS</span> to monitor your entire network this solution won&#8217;t work, you&#8217;ll need to buy a switch with a monitoring port (most manages switches) so that a copy of all the data sent across the network is mirrored to your snort server, if you do have this function turn it on and follow this tutorial as normal.</p>
<p>So let’s get started, first we need to install some base packages, mainly <span>LAMP</span> <em>(<span>Linux</span>, <span>Apache</span>, <span>MySQL</span> &#038; PHP)</em> so type into your terminal:</p>
<pre>sudo tasksel install lamp-server</pre>
<p>During this install you&#8217;ll be asked for a password to set for the root account on your new <span>MySQL server</span>, be sure to remember this as you&#8217;ll need it later.</p>
<p>Now we just need some tools to test the server later:</p>
<pre>sudo apt-get install nmap
sudo apt-get install nbtscan</pre>
<p>Just becuase its good practice remember to update your package lists:</p>
<pre>sudo apt-get update</pre>
<p>Now we&#8217;ve got that out of the way we can install <span>snort</span>:</p>
<pre>sudo apt-get install snort-mysql</pre>
<p>now you should see this widow, this is where you choose what range the snort server will <span>monitor</span>, if your just installing this on one machine enter the machines IP address followed by /32, if it’s a whole network use /24 at the end, for example:</p>
<p><strong><span>Single Machine</span>:</strong> 192.168.0.1/32<br />
<strong><span>Whole <span>Network</span></span>:</strong> 192.168.0.0/24 <em><small>(remember this will need a monitoring port)</small></em></p>
<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_1-090811.jpg"><img class="aligncenter size-full wp-image-1582" title="Snort_ubuntu_tut_1-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_1-090811.jpg" alt="" width="512" height="308" /></a></p>
<p>Next we are told we need a <span>database</span> to continue, don’t worry we installed this earlier, just press ok <em><small>(Tab to select)</small></em><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_2-090811.jpg"><img class="aligncenter size-full wp-image-1588" title="Snort_ubuntu_tut_2-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_2-090811.jpg" alt="" width="511" height="307" /></a></p>
<p>Now we are asked if we want a <span><span>database</span> setup</span>, click yes.<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_3-090811.jpg"><img class="aligncenter size-full wp-image-1589" title="Snort_ubuntu_tut_3-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_3-090811.jpg" alt="" width="506" height="140" /></a></p>
<p>Now we see the final config window, just click ok.<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_4-090811.jpg"><img class="aligncenter size-full wp-image-1592" title="Snort_ubuntu_tut_4-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_4-090811.jpg" alt="" width="512" height="305" /></a></p>
<p>If you read the last window you see that we need to configure the <span>database</span>, this isn’t to hard just type:</p>
<pre>mysql -u root -p</pre>
<p>whitch will open the MySQL console window, in this type:</p>
<pre>create <span>database</span> <span>snort</span>;</pre>
<p>followed by</p>
<pre>quit</pre>
<p>Now we need to add some tables to the <span>database</span> we just created:</p>
<pre>cd /usr/share/doc/snort-mysql
zcat create_mysql.gz | mysql -u root -p snort</pre>
<p>Once that’s done we need to re-configure snort with the updated database, so type:</p>
<pre>sudo dpkg-reconfigure -plow snort-mysql</pre>
<p>This is the first screen you&#8217;ll see, unless you know otherwise select boot<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_5-090811.jpg"><img class="aligncenter size-full wp-image-1593" title="Snort_ubuntu_tut_5-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_5-090811.jpg" alt="" width="512" height="207" /></a></p>
<p>Now we choose the <span>network</span> interface to <span>listen</span> on, unless you know otherwise leave this to its default value<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_6-090811.jpg"><img class="aligncenter size-full wp-image-1594" title="Snort_ubuntu_tut_6-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_6-090811.jpg" alt="" width="512" height="128" /></a></p>
<p>Here we renter our <span>network</span> selection, just leave as is and click ok<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_1-090811.jpg"><img class="aligncenter size-full wp-image-1582" title="Snort_ubuntu_tut_1-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_1-090811.jpg" alt="" width="512" height="308" /></a></p>
<p>Here you choose whether you want to run snort in <span>promiscuous mode</span> or not. Even through i said that you can’t monitor over hosts (without a monitoring port) this is where you can, sort of, in promiscuous mode snort will monitor broadcasted events, personally I set this to no to reduce overhead but it’s up to you.<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_8-090811.jpg"><img class="aligncenter size-full wp-image-1596" title="Snort_ubuntu_tut_8-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_8-090811.jpg" alt="" width="508" height="180" /></a></p>
<p>Just leave this blank<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_9-090811.jpg"><img class="aligncenter size-full wp-image-1581" title="Snort_ubuntu_tut_9-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_9-090811.jpg" alt="" width="512" height="156" /></a></p>
<p>Again this one is up to you, personally I like the <span>daily <span>email reports</span></span> but if you don’t want the hassle select no.<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_10-090811.jpg"><img class="aligncenter size-full wp-image-1583" title="Snort_ubuntu_tut_10-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_10-090811.jpg" alt="" width="511" height="179" /></a></p>
<p>Since we have gone to the effort of setting up our <span>database</span> we might as well use it, select yes.<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_11-090811.jpg"><img class="aligncenter size-full wp-image-1584" title="Snort_ubuntu_tut_11-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_11-090811.jpg" alt="" width="510" height="136" /></a></p>
<p>Enter 127.0.0.1 <em><small>If you want to use another <span>database</span> server here is where you would enter its address, however setting this up is out of the scope of this email.</small></em><br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_12-090811.jpg"><img class="aligncenter size-full wp-image-1585" title="Snort_ubuntu_tut_12-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_12-090811.jpg" alt="" width="509" height="169" /></a></p>
<p>Here enter the database name, which should be sort<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_13-090811.jpg"><img class="aligncenter size-full wp-image-1586" title="Snort_ubuntu_tut_13-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_13-090811.jpg" alt="" width="510" height="167" /></a></p>
<p>For this tutorial we haven’t added any additional users so I’ve just used root, however this is bad practice, I recommend you add a dedicated snort user to you MySQL database, a good tutorial of that can be found <a href="http://dev.mysql.com/doc/refman/5.1/en/adding-users.html">here</a><br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_14-090811.jpg"><img class="aligncenter size-full wp-image-1587" title="Snort_ubuntu_tut_14-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_14-090811.jpg" alt="" width="511" height="168" /></a></p>
<p>Now enter the password for the user you selected in the previous step.<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_15-090811.jpg"><img class="aligncenter size-full wp-image-1590" title="Snort_ubuntu_tut_15-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_15-090811.jpg" alt="" width="509" height="158" /></a></p>
<p>Now you have finished configuring snort, just click ok.<br />
<a href="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_16-090811.jpg"><img class="aligncenter size-full wp-image-1591" title="Snort_ubuntu_tut_16-090811" src="http://www.the-tech-tutorial.com/wp-content/uploads/2011/08/Snort_ubuntu_tut_16-090811.jpg" alt="" width="508" height="275" /></a></p>
<p>To start snort you need to confirm you have setup your database by typing:</p>
<pre>sudo rm /etc/snort/db-pending-config</pre>
<p>and start the Snort server<br />
<center><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2094089617852812";
/* 2011 Bottom */
google_ad_slot = "5825267234";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<pre>sudo /etc/init.d/snort status</pre>
<p>Now if you want to see what attempted hacks have taken place simply type</p>
<pre>echo "select * from signature;" | mysql -u root -p snort</pre>
<p>this will show what attack signatures have been called.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1578"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Install+and+Configure+a+Ubuntu+11.04+Snort-MySQL+Honeypot&amp;link=http://www.the-tech-tutorial.com/?p=1578&amp;notes=An%20Intrusion%20Detection%20system%20is%20like%20a%20burglar%20alarm%20for%20your%20computer.%20It%20monitors%20you%20network%20and%20system%20activities%20for%20malicious%20activities%20or%20policy%20violations%20and%20reports%20to%20some%20kind%20of%20management%20station.%20This%20is%20great%20as%20it%20lets%20you%20know%20who%20were%20when%20%26amp%3B%20how%20people%20are%20trying%20to%20break%20in&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1578</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple C++ IRC Bot Template</title>
		<link>http://www.the-tech-tutorial.com/?p=1716</link>
		<comments>http://www.the-tech-tutorial.com/?p=1716#comments</comments>
		<pubDate>Sun, 07 Aug 2011 21:39:05 +0000</pubDate>
		<dc:creator>Tyler Allen</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[c plus plus]]></category>
		<category><![CDATA[C Plus Plus IRC Bot Source]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[IRC Bot]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Starter]]></category>
		<category><![CDATA[Template]]></category>

		<guid isPermaLink="false">http://www.the-tech-tutorial.com/?p=1716</guid>
		<description><![CDATA[I searched the Internet, for quit a while, and I couldn’t find the source for a simple IRC bot in C plus plus, so I decided to write one using a TCP Stream Socket in C++. It works by setting up a simple TCP Socket to a IRC server on port 6667. The IRC Bot [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.the-tech-tutorial.com/wp-content/uploads/2010/08/IRC-Vect_fin.jpg"><img class="alignleft size-full wp-image-725" title="IRC Vect_fin" src="http://www.the-tech-tutorial.com/wp-content/uploads/2010/08/IRC-Vect_fin.jpg" alt="IRC Funny Cartoon" width="89" height="90" /></a>I searched the Internet, for quit a while, and I couldn’t find the <span>source</span> for a <span>simple <span>IRC bot</span></span> in <span><span>C</span> plus plus</span>, so I decided to write one using a <span>TCP Stream Socket</span> in <span>C++</span>. It works by setting up a simple <span>TCP Socket</span> to a <span>IRC server</span> on port 6667. The <span>IRC Bot</span> then assigns a NICK to the connection and connects to a <span>IRC Channel</span>. From here you can code you own <span>commands</span> and replies. I originally developed this to <span>monitor <span><span>IRC</span> channel</span>s</span>, however I came across a problem, PING. IRC servers periodically <span>ping</span> all clients to see if they are connected, so I added some more <span>code to reply to these ping</span>’s so that the <span>bot</span> stays connected. <span id="more-1716"></span></p>
<p>Like I said this is only a base for a <span><span>IRC Bot</span> written in <span>C Plus Plus</span></span>, at the moment all it can do is reply to ping’s and reply to commands, however with a little bit of time you could create a full featured <span><span>IRC bot</span> in C++</span> from this <span>code</span>, so here it is:</p>
<p><center><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-2094089617852812"; /* 2011 Bottom */ google_ad_slot = "5825267234"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></center><br />
<a href="http://www.the-tech-tutorial.com/wp-content/files/irc-bot.tar">DOWNLOAD SOURCE</a></p>
<h6>USAGE:</h6>
<pre class="brush:cpp">int main()
{
	IrcBot bot = IrcBot("NICK testBOT\r\n","USER guest tolmoon tolsun :Ronnie Reagan\r\n");
	bot.start();

  return 0;

}</pre>
<h6>HEADER:</h6>
<pre class="brush:cpp">/*
 * IrcBot.h
 *
 *  Created on: 15 Jul 2011
 *      Author: Tyler Allen
 */

#ifndef IRCBOT_H_
#define IRCBOT_H_

class IrcBot
{
public:
	IrcBot(char * _nick, char * _usr);
	virtual ~IrcBot();

	bool setup;

	void start();
	bool charSearch(char *toSearch, char *searchFor);

private:
	char *port;
	int s; //the socket descriptor

	char *nick;
	char *usr;

	bool isConnected(char *buf);
	char * timeNow();
	bool sendData(char *msg);
	void sendPong(char *buf);
	void msgHandel(char *buf);
};

#endif /* IRCBOT_H_ */</pre>
<h6>CPP File</h6>
<pre class="brush:cpp">/*
 * IrcBot.cpp
 *
 *  Created on: 15 Jul 2011
 *      Author: Tyler Allen
 */

#include "IrcBot.h"
#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
#include &lt;errno.h&gt;
#include &lt;string.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;netdb.h&gt;
#include &lt;arpa/inet.h&gt;
#include &lt;sys/wait.h&gt;
#include &lt;signal.h&gt;
#include &lt;time.h&gt;

using namespace std;

#define MAXDATASIZE 100

IrcBot::IrcBot(char * _nick, char * _usr)
{
	nick = _nick;
	usr = _usr;
}

IrcBot::~IrcBot()
{
	close (s);
}

void IrcBot::start()
{
	struct addrinfo hints, *servinfo;

	//Setup run with no errors
	setup = true;

	port = "6667";

	//Ensure that servinfo is clear
	memset(&amp;hints, 0, sizeof hints); // make sure the struct is empty

	//setup hints
	hints.ai_family = AF_UNSPEC; // don't care IPv4 or IPv6
	hints.ai_socktype = SOCK_STREAM; // TCP stream sockets

	//Setup the structs if error print why
	int res;
	if ((res = getaddrinfo("irc.ubuntu.com",port,&amp;hints,&amp;servinfo)) != 0)
	{
		setup = false;
		fprintf(stderr,"getaddrinfo: %s\n", gai_strerror(res));
	}

	//setup the socket
	if ((s = socket(servinfo-&gt;ai_family,servinfo-&gt;ai_socktype,servinfo-&gt;ai_protocol)) == -1)
	{
		perror("client: socket");
	}

	//Connect
	if (connect(s,servinfo-&gt;ai_addr, servinfo-&gt;ai_addrlen) == -1)
	{
		close (s);
		perror("Client Connect");
	}

	//We dont need this anymore
	freeaddrinfo(servinfo);

	//Recv some data
	int numbytes;
	char buf[MAXDATASIZE];

	int count = 0;
	while (1)
	{
		//declars
		count++;

		switch (count) {
			case 3:
					//after 3 recives send data to server (as per IRC protacol)
					sendData(nick);
					sendData(usr);
				break;
			case 4:
					//Join a channel after we connect, this time we choose beaker
				sendData("JOIN #ubuntu\r\n");
			default:
				break;
		}

		//Recv &amp; print Data
		numbytes = recv(s,buf,MAXDATASIZE-1,0);
		buf[numbytes]='\0';
		cout &lt;&lt; buf;
		//buf is the data that is recived

		//Pass buf to the message handeler
		msgHandel(buf);

		//If Ping Recived
		/*
		 * must reply to ping overwise connection will be closed
		 * see http://www.irchelp.org/irchelp/rfc/chapter4.html
		 */
		if (charSearch(buf,"PING"))
		{
			sendPong(buf);
		}

		//break if connection closed
		if (numbytes==0)
		{
			cout &lt;&lt; "----------------------CONNECTION CLOSED---------------------------"&lt;&lt; endl;
			cout &lt;&lt; timeNow() &lt;&lt; endl;

			break;
		}
	}
}

bool IrcBot::charSearch(char *toSearch, char *searchFor)
{
	int len = strlen(toSearch);
	int forLen = strlen(searchFor); // The length of the searchfor field

	//Search through each char in toSearch
	for (int i = 0; i &lt; len;i++)
	{
		//If the active char is equil to the first search item then search toSearch
		if (searchFor[0] == toSearch[i])
		{
			bool found = true;
			//search the char array for search field
			for (int x = 1; x &lt; forLen; x++)
			{
				if (toSearch[i+x]!=searchFor[x])
				{
					found = false;
				}
			}

			//if found return true;
			if (found == true)
				return true;
		}
	}

	return 0;
}

bool IrcBot::isConnected(char *buf)
{//returns true if "/MOTD" is found in the input strin
	//If we find /MOTD then its ok join a channel
	if (charSearch(buf,"/MOTD") == true)
		return true;
	else
		return false;
}

char * IrcBot::timeNow()
{//returns the current date and time
	time_t rawtime;
	struct tm * timeinfo;

	time ( &amp;rawtime );
	timeinfo = localtime ( &amp;rawtime );

	return asctime (timeinfo);
}

bool IrcBot::sendData(char *msg)
{//Send some data
	//Send some data
	int len = strlen(msg);
	int bytes_sent = send(s,msg,len,0);

	if (bytes_sent == 0)
		return false;
	else
		return true;
}

void IrcBot::sendPong(char *buf)
{
	//Get the reply address
	//loop through bug and find the location of PING
	//Search through each char in toSearch

	char * toSearch = "PING ";

	for (int i = 0; i &lt; strlen(buf);i++)
		{
			//If the active char is equil to the first search item then search toSearch
			if (buf[i] == toSearch[0])
			{
				bool found = true;
				//search the char array for search field
				for (int x = 1; x &lt; 4; x++)
				{
					if (buf[i+x]!=toSearch[x])
					{
						found = false;
					}
				}

				//if found return true;
				if (found == true)
				{
					int count = 0;
					//Count the chars
					for (int x = (i+strlen(toSearch)); x &lt; strlen(buf);x++)
					{
						count++;
					}

					//Create the new char array
					char returnHost[count + 5];
					returnHost[0]='P';
					returnHost[1]='O';
					returnHost[2]='N';
					returnHost[3]='G';
					returnHost[4]=' ';

					count = 0;
					//set the hostname data
					for (int x = (i+strlen(toSearch)); x &lt; strlen(buf);x++)
					{
						returnHost[count+5]=buf[x];
						count++;
					}

					//send the pong
					if (sendData(returnHost))
					{
						cout &lt;&lt; timeNow() &lt;&lt;"  Ping Pong" &lt;&lt; endl;
					}

					return;
				}
			}
		}

}

void IrcBot::msgHandel(char * buf)
{
	/*
	 * TODO: add you code to respod to commands here
	 * the example below replys to the command hi scooby
	 */
	if (charSearch(buf,"hi scooby"))
	{
		sendData("PRIVMSG #ubuntu :hi, hows it going\r\n");
	}

}</pre>
<p><a href="http://www.the-tech-tutorial.com/wp-content/files/irc-bot.tar">DOWNLOAD SOURCE</a></p>
<p><center><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-2094089617852812"; /* 2011 Bottom */ google_ad_slot = "5825267234"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></center></p>
<h6>NOTES</h6>
<p>To change the server you wish the <span>IRC bot</span> to connect to change “irc.ubuntu.com” to the desired server at line 57.</p>
<p>You can change which channel you the <span>IRC bot</span> to connect to by changing “#ubuntu” at line 97 to the desired channel, I know there are better ways then hard coding thease commands however I was rushed for time and just trying to create a simple base for a <span>IRC bot</span>, not a full featured bot.</p>
<p>The msgHandel() function at line 256 is where you&#8217;ll add your <span>message <span>handling code</span></span>, at the moment the bot will reply to any <span>command</span> with the words “hi scooby” in it with the reply “Hi, hows it going”. To add more simply copy the if statement at line 262 and substitute the “hi scooby” for the command. Then change “hi, hows it going” to the required reply. Remember that all messages sent must finish with “\r\n” otherwise the server will wait for more commands.</p>
<p>For more information on the messages used in the IRC Protocol goto <a href="http://www.irchelp.org/irchelp/rfc/chapter4.html">http://www.irchelp.org/irchelp/rfc/chapter4.html</a>.</p>
<p>Please remember that <span>IRC Bots</span> are banned by many <span>IRC</span> Servers so be careful not to get banned, if you want to test on your own <span>IRC</span> server I have a tutorial on how to setup your own IRC Server <a href="http://www.the-tech-tutorial.com/?p=709">here</a>. I haven&#8217;t tested this bot on a server setup following this tutorial so please comment if you have any difficulty here, thanks. I hope this comes in useful, and I apologize for the spelling mistakes in my comment&#8217;s I’m just too lazy to go through them all and correct.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="standard" count="" href="http://www.the-tech-tutorial.com/?p=1716"></g:plusone></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=&amp;tags=&amp;ctype=" rel="nofollow" class="external" title=""></a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Simple+C%2B%2B+IRC+Bot+Template+&amp;link=http://www.the-tech-tutorial.com/?p=1716&amp;notes=I%20searched%20the%20Internet%2C%20for%20quit%20a%20while%2C%20and%20I%20couldn%E2%80%99t%20find%20the%20source%20for%20a%20simple%20IRC%20bot%20in%20C%20plus%20plus%2C%20so%20I%20decided%20to%20write%20one%20using%20a%20TCP%20Stream%20Socket%20in%20C%2B%2B.%20It%20works%20by%20setting%20up%20a%20simple%20TCP%20Socket%20to%20a%20IRC%20server%20on%20port%206667.%20The%20IRC%20Bot%20then%20assigns%20a%20NICK%20to%20the%20connection%20and%20&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="https://shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.the-tech-tutorial.com/?feed=rss2&#038;p=1716</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
