<?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>programming with passion &#187; Ubuntu</title>
	<atom:link href="http://www.jasonrowland.com/category/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonrowland.com</link>
	<description>Learning Mac, Ruby, iPhone, BlackBerry, Android, WinMobile</description>
	<lastBuildDate>Fri, 30 Jul 2010 21:01:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bare Ubuntu configuration for Ruby on Rails</title>
		<link>http://www.jasonrowland.com/2009/12/bare-ubuntu-configuration-for-ruby-on-rails/</link>
		<comments>http://www.jasonrowland.com/2009/12/bare-ubuntu-configuration-for-ruby-on-rails/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:01:18 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jasonrowland.com/?p=185</guid>
		<description><![CDATA[General
Install Ubuntu 9.1 server using the Bare Server option
The first thing I like to do is add my account to the /etc/sudoers file.  This just guarantees that I can always use sudo, even if I mistakenly mess up my group assignment.
sudo visudo
#  /etc/sudoers
root   ALL=(ALL) ALL
user ALL=(ALL) ALL
user should be replaced with [...]]]></description>
			<content:encoded><![CDATA[<h2>General</h2>
<p>Install Ubuntu 9.1 server using the Bare Server option</p>
<p>The first thing I like to do is add my account to the /etc/sudoers file.  This just guarantees that I can always use sudo, even if I mistakenly mess up my group assignment.</p>
<pre>sudo visudo</pre>
<pre>#  /etc/sudoers
root   ALL=(ALL) ALL
user ALL=(ALL) ALL</pre>
<p>user should be replaced with the account you use to administer the box.  I like to do this because one time I messed up my group assignment on the only account that was able to admin the box.</p>
<pre>alias sudo='sudo -E'</pre>
<p>The reason we have that alias nonsense in there is because Ubuntu compiles the sudo command with the &#8211;with-secure-path option.  We want to pass our current path into the command.  The alias command is explained <a href="http://www.linfo.org/alias.html">here</a>.  I&#8217;m sure there are some security vulnerabilities with muti-user systems doing it this way, but I&#8217;m the only guy so no need to figure it out right now.</p>
<p>Next, update the apt-get configuration and then upgrade to make sure the latest packages are installed.</p>
<pre>sudo apt-get update
sudo apt-get upgrade -y</pre>
<p><a href="/2009/12/configuring-ubuntu-for-a-static-ip-address/">Configure the server for static IP address</a>.</p>
<h2>SSH</h2>
<p><a href="/2009/12/using-ssh-on-mac-to-access-ubuntu-server-9-10/">Configure SSH</a>.</p>
<h2>Ruby</h2>
<p>As I write this, the latest version of Ruby for apt-get is 1.8.7 patchlevel 174.</p>
<pre>sudo apt-get install build-essential libssl-dev libreadline-dev rake -y
sudo apt-get install ruby rdoc ri rubygems libopenssl-ruby ruby-dev -y</pre>
<div>I like to create a current symbolic link that links to the current gem so I can easily upgrade and not have to redo all my paths.</div>
<pre>ln -s /var/lib/gems/1.8 /var/lib/gems/current</pre>
<p>Now, <a href="http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x237.html">source the file</a> you just created.  Sourcing a file uses the contents of the file as if you typed them at the command prompt.  You just type a period followed by a space and then the filename.</p>
<pre>. /etc/profile.d/gems.sh</pre>
<p>You will notice that we did not install Rails.  This is intentional.  We will use</p>
<pre>rake rails:freeze:gems</pre>
<p>to freeze a known version of rails into our applications.</p>
<h2>MySQL</h2>
<pre>sudo apt-get install mysql-server libmysqlclient-dev
sudo gem install mysql</pre>
<p><strong>Apache</strong></p>
<p>We will install Apache2 as well as <a href="http://www.modrails.com/">Passenger</a> (mod_rails or mod_rack).</p>
<pre>sudo apt-get install apache2 libapr1-dev apache2-prefork-dev -y
sudo gem install passenger</pre>
<pre>sudo /var/lib/gems/current/bin/passenger-install-apache2-module</pre>
<pre><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 19px;font-size: 13px">After you run this, you will see instructions to add some lines to your Apache configuration file.  Mine looked like this:</span></pre>
<pre>LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.8
PassengerRuby /usr/bin/ruby1.8
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so   PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.8   PassengerRuby /usr/bin/ruby1.8</pre>
<p>Just copy this to it&#8217;s own file in the conf.d directory of apache2.</p>
<pre>sudo vi /etc/apache2/conf.d/passenger.conf</pre>
<h2>GIT</h2>
<p><a href="http://www.jasonrowland.com/2009/12/creating-a-remote-git-repository/">Install and configure GIT on the server and the client.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonrowland.com/2009/12/bare-ubuntu-configuration-for-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Ubuntu for a static IP address</title>
		<link>http://www.jasonrowland.com/2009/12/configuring-ubuntu-for-a-static-ip-address/</link>
		<comments>http://www.jasonrowland.com/2009/12/configuring-ubuntu-for-a-static-ip-address/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 00:09:36 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jasonrowland.com/?p=181</guid>
		<description><![CDATA[The next thing we need to do is to set the network with your static IP addresses.  First, edit the /etc/network/interfaces to include the following.
#   /etc/network/interfaces
 auto eth0
 iface eth0 inet static
 address xxx.xxx.xxx.xxx
 gateway xxx.xxx.xxx.xxx
 netmask xxx.xxx.xxx.xxx
This assumes you want the ethernet card on eth0 configured.  After this, we need to [...]]]></description>
			<content:encoded><![CDATA[<p>The next thing we need to do is to set the network with your static IP addresses.  First, edit the /etc/network/interfaces to include the following.</p>
<pre>#   /etc/network/interfaces
 auto eth0
 iface eth0 inet static
 address xxx.xxx.xxx.xxx
 gateway xxx.xxx.xxx.xxx
 netmask xxx.xxx.xxx.xxx</pre>
<p>This assumes you want the ethernet card on eth0 configured.  After this, we need to configure the primary and secondary DNS servers</p>
<pre>#   /etc/resolve.conf
 nameserver xxx.xxx.xxx.xxx
 nameserver xxx.xxx.xxx.xxx</pre>
<p>After these are set, you need to restart the networking</p>
<pre>sudo /etc/init.d/networking restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonrowland.com/2009/12/configuring-ubuntu-for-a-static-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SSH on Mac to access Ubuntu server 9.10</title>
		<link>http://www.jasonrowland.com/2009/12/using-ssh-on-mac-to-access-ubuntu-server-9-10/</link>
		<comments>http://www.jasonrowland.com/2009/12/using-ssh-on-mac-to-access-ubuntu-server-9-10/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 00:09:17 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jasonrowland.com/?p=176</guid>
		<description><![CDATA[First, make sure you can SSH to your server.  If you need to install ssh on the Ubuntu server, use:
sudo apt-get install ssh
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
If you are wondering what the touch does, it just creates an empty file if it doesn&#8217;t exist.  That way i don&#8217;t have to write two [...]]]></description>
			<content:encoded><![CDATA[<p>First, make sure you can SSH to your server.  If you need to install ssh on the Ubuntu server, use:</p>
<pre>sudo apt-get install ssh
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh</pre>
<p>If you are wondering what the touch does, it just creates an empty file if it doesn&#8217;t exist.  That way i don&#8217;t have to write two sets of instructions based on whether you&#8217;ve ever had SSH configured before.  Next we are going to generate our keys and upload them to the server</p>
<pre>ssh-keygen -t rsa
scp user@server.com:~/.ssh/authorized_keys ~/.ssh
cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys user@server.com:.ssh/</pre>
<p>What we are doing is copying the existing authorized_keys file to our local mac to add our key and then uploading it back.  We should now be able to login to our server using our new keys.</p>
<pre>ssh user@server.com</pre>
<p>The Mac will now prompt you for the password you used to create your ssh key.  Add it to your keychain.  From this point forward, you will no longer be prompted with your password.  Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonrowland.com/2009/12/using-ssh-on-mac-to-access-ubuntu-server-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a remote GIT repository</title>
		<link>http://www.jasonrowland.com/2009/12/creating-a-remote-git-repository/</link>
		<comments>http://www.jasonrowland.com/2009/12/creating-a-remote-git-repository/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 03:38:22 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jasonrowland.com/?p=174</guid>
		<description><![CDATA[Clean, readable code is one of my highest goals when writing code.  I&#8217;m always thinking about the next guy, even when the next guy is just me, several months from now.   Nothing is worse than going into spagetti code and not knowing what the heck is going on.  Because of this, I like to refactor [...]]]></description>
			<content:encoded><![CDATA[<p>Clean, readable code is one of my highest goals when writing code.  I&#8217;m always thinking about the next guy, even when the next guy is just me, several months from now.   Nothing is worse than going into spagetti code and not knowing what the heck is going on.  Because of this, I like to refactor my code A LOT.  When you are using source control, you never get yourself into situations that you can&#8217;t get out of.  It&#8217;s also nice to go back and see how the code has evolved over time, to see why certain files were changed.  Because of all these benefits, I use source control even on my own tiny projects where I&#8217;m the only developer.</p>
<p>I have used visual source safe when I first got started and like all vss users, quickly moved away from it.  I&#8217;ve spent most of my career using perforce for work.  I tried out Subversion a long time ago, but I got tired of my database getting corrupted and having to drop to the command line to repair it.  I used a very early version of subversion and I hear that it is MUCH better now.  Anyway, I used perforce for my personal stuff because the first two clients were free.  Since I&#8217;m learning everything else, why not throw in GIT too.  It&#8217;s gotten a lot of press so I want to see what the fuss is all about.  Here is how I installed my first GIT repository on my ubuntu server.</p>
<p>ssh to the remote box and type the following commands:</p>
<pre>sudo apt-get install git-core
sudo mkdir /var/git
sudo mkdir /var/git/snowcaptech.git
sudo chown jason /var/git/snowcaptech.git
sudo chmod 775 /var/git/snowcaptech.git
cd /var/git/snowcaptech.git
git init --bare --shared=group</pre>
<p>What we are doing is creating an empty directory in the /var/git folder where I like to keep all my git repositories.  We are then changing the owner to me and setting permissions for me to write and everyone else to be able to read.  The git init &#8211;bare creates a repository without a working copy.</p>
<p>then to add a project from your local client to the remote repository, you would first tell GIT about your project by going to the directory of your project and from a command prompt typing:</p>
<pre>git init
git add .
git commit -m "initial checkin"</pre>
<p>This initializes your repository and commits it to your local GIT repository.  This is all you need to do to have a working source control system for just yourself.</p>
<p>I like to make my source available on a server so I can access it from anywhere on the planet.  I never need to do this, but it is cool to be able to do this.  In order to &#8220;push&#8221; your local GIT repository to the remote repository, you have to tell your local repository about the remote.  Sorry if that was confusing.  Read it a few times. <img src='http://www.jasonrowland.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>git remote add origin jason@dev.snowtech.com:/var/git/snowcaptech.git
git push origin master</pre>
<p>As long as your settings are all correct, your repository should now be at the remote repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonrowland.com/2009/12/creating-a-remote-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
