<?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>Carbon Silk &#187; git</title>
	<atom:link href="http://www.carbonsilk.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonsilk.com</link>
	<description>Developing Ideas by James Broad</description>
	<lastBuildDate>Sun, 20 Mar 2011 00:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Automated deployment of node.js apps</title>
		<link>http://www.carbonsilk.com/node/deploying-nodejs-apps/</link>
		<comments>http://www.carbonsilk.com/node/deploying-nodejs-apps/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 00:28:11 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[node]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[npm]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[upstart]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=9919</guid>
		<description><![CDATA[This article has a simple aim to improve the process of developing and deploying node.js web applications. The Continuous Integration folks will refer to what I am covering as an aptly named Automated Deployment. As you explore this guide you will learn: How to run a node.js script using Upstart. How to manage Jenkins (was [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm5.static.flickr.com/4038/4302501803_957d51a01a.jpg" alt="Delivering the goods" /></p>
<p class="clear">This article has a simple aim to improve the process of developing and deploying <a href="http://nodejs.org/">node.js</a> web applications. The Continuous Integration folks will refer to what I am covering as an aptly named <a href="http://en.wikipedia.org/wiki/Continuous_integration#Automate_deployment">Automated Deployment</a>. As you explore this guide you will learn:</p>
<ul>
<li>How to run a node.js script using Upstart.</li>
<li>How to manage Jenkins (was Hudson) with Git.</li>
<li>How to make and use Makefiles.</li>
</ul>
<p>Lets crack on&#8230;</p>
<p>I have detailed an environment scheme below which works well for me. You are free to assign your machine names what you please but following this guide will be easiest if you follow my conventions.</p>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>Description</th>
<th>Operating System</th>
</tr>
</thead>
<tr>
<td><em class="localhost">localhost</em></td>
<td>Your machine you develop from</td>
<td>Mac / Windows / Linux</td>
</tr>
<tr class="odd">
<td><em class="ci-app">ci.app</em></td>
<td>Jenkins and Git Server</td>
<td>Ubuntu</td>
</tr>
<tr>
<td><em class="int-app">int.app</em></td>
<td>node.js application server</td>
<td>Ubuntu</td>
</tr>
</table>
<h3>Getting a working node.js app and environment</h3>
<p>You will need to have an environment to run your app in. To save on resources I prefer using virtual machines hosted on my <em class="localhost">localhost</em>. This also means you are not tied to a network in order to develop (great for coding on the train/in a coffee shop).</p>
<p>You can run node.js apps on your <em class="localhost">localhost</em> but for this article we are just focusing the deployment process to an integration server (<em class="int-app">int.app</em>).</p>
<p>The correct development flow for a node.js app should be that you test on <em class="localhost">localhost</em>, then checkin when you are happy with your changes. The checkin will then trigger a build and automatically get built to <em class="int-app">int.app</em>. We will be in this sweet spot by the end of this article.</p>
<h4>Setting up your virtual machines</h4>
<p>It is fairly straightforward (and free) to get a Linux virtual machine up and running these days. Following the steps on <a href="https://help.ubuntu.com/community/VirtualBox">https://help.ubuntu.com/community/VirtualBox</a> should be a good starting point.<br />
I suggest you set up one machine (<em class="int-app">int.app</em>) first with a barebones configuration and clone it to create <em class="ci-app">ci.app</em>, changing the hostname (<code>sudo hostname newhostname</code>) and getting a new IP address <code>sudo dhclient</code> on the cloned machine.</p>
<h4>Configuring <em class="int-app">int.app</em></h4>
<p>Our initial development centric dependencies are <a href="http://git-scm.com/">Git</a>, <a href="http://nodejs.org/">node.js</a>, <a href="http://expressjs.com/">Express</a> and <a href="http://npmjs.org/">NPM</a>.</p>
<p>Login to <em class="int-app">int.app</em></p>
<pre>
ssh int.app
</pre>
<p>Install Git</p>
<pre>
apt-get install git git-core
</pre>
<p>Install node.js</p>
<pre>
cd /tmp/
git clone https://github.com/joyent/node.git
cd node
./configure
make
make install
</pre>
<p>Install NPM</p>
<pre>
apt-get install curl
curl http://npmjs.org/install.sh | sudo sh
</pre>
<p>Install Express</p>
<pre>
npm install express
</pre>
<p>Now you have everything you need to get a node.js app up and running. Let&#8217;s create our demo app.</p>
<pre>
mkdir -p /data/apps/hello_world
</pre>
<p>Add these contents to <code>/data/apps/hello_world/app.js</code>.</p>
<pre>
var express = require('express')
  , app = express.createServer()

app.get('/', function(req, res){
  res.send([
      '&lt;h1&gt;Hello World&lt;/h1&gt;'
  ].join('\n'));
});

app.listen(3000);
console.log('Express app started on port 3000');
</pre>
<h4>Run your node.js app</h4>
<pre>
node /data/apps/hello_world/app.js
</pre>
<h4>Getting and using the IP address of <em class="int-app">int.app</em></h4>
<p>SSH into <em class="int-app">int.app</em> and run:</p>
<pre>
ifconfig -a
</pre>
<ol>
<li>Grab the IP address from &#8216;inet addr&#8217;. This should look something like: <code>192.188.0.23</code>.</li>
<li>Add this to your <code>/etc/hosts</code> file on your <em class="localhost">localhost</em> like: <code>192.188.0.23 int.app</code></li>
</ol>
<h4>Testing the app</h4>
<p>Now let&#8217;s test if everything is running ok. Open up <a href="http://int.app:3000/">http://int.app:3000/</a>. With any luck you should be seeing the text &#8220;Hello World&#8221;.</p>
<h3>Getting a build process working</h3>
<p>We will be using Git as our source control management tool (<a href="http://en.wikipedia.org/wiki/Source_Code_Management">VCS</a>). Have a read of Joel Spolsky&#8217;s <a href="http://www.joelonsoftware.com/items/2010/03/17.html">distributed VCS post</a> to understand why we are using Git over something like <a href="http://subversion.tigris.org/"><abbr title="Subversion">SVN</abbr></a>.</p>
<h4>Setting up a Git server on <em class="ci-app">ci.app</em></h4>
<p>Git works in a de-centralised way but we need to have a central Git repository that we and other developers can push their changes to and other tools like Jenkins can pull updates from.</p>
<p>On <em class="ci-app">ci.app</em> run:</p>
<pre>
useradd git
su git
sudo mkdir -p /data/git/hello_world.git
sudo chown git -R /data/git/hello_world.git
cd /data/git/hello_world.git
git --bare init
curl http://utsl.gen.nz/git/post-update > /data/git/hello_world.git/hooks/post-update
exit
</pre>
<p>On <em class="localhost">localhost</em> you can now run:</p>
<pre>
git clone ssh://ci.app/data/git/hello_world.git ~/hello_world
cd hello_world
git remote add origin ssh://git@ci.app/data/git/hello_world.git
</pre>
<p>Now you have an empty directory on your local machine where you can develop from. Let&#8217;s add <code>app.js</code> we made earlier to this repository.</p>
<p>Add these contents to <code> ~/hello_world/app.js</code></p>
<pre>
var express = require('express')
  , app = express.createServer()

app.get('/', function(req, res){
  res.send([
      '&lt;h1&gt;Hello World&lt;/h1&gt;'
  ].join('\n'));
});

app.listen(3000);
console.log('Express app started on port 3000');
</pre>
<p>Now lets check it in.</p>
<pre>
git add --all
git commit -m 'Initial checkin' app.js
</pre>
<p>Let&#8217;s push it to our remote Git server</p>
<pre>
git push origin master
</pre>
<h4>Moving the app automatically</h4>
<p>We are going to use <a href="http://www.gnu.org/software/make/">make</a> as a tool to bundle commands. We will use Make to move the application from the Git repository to the <code>/data/apps/hello_world</code> directory.</p>
<p>On <em class="localhost">localhost</em>, add these contents to <code>~/hello_world/Makefile</code></p>
<pre>
install :
	sudo mkdir -p /data/apps/hello_world
	sudo cp ./app.js /data/apps/hello_world/
</pre>
<p>Check this file in and push changes:</p>
<pre>
git add --all
git commit -m 'adding build steps'
git push origin master
</pre>
<p>Now you could run this command and have the app put in the correct location for you:</p>
<pre>
make install
</pre>
<h3>Automating the build</h3>
<p>Jenkins is a very useful tool in the process of <a href="http://en.wikipedia.org/wiki/Continuous_integration">Continuous Integration</a>. At the most basic level Jenkins is a tool to allow you to schedule things to happen based on timings or events such as a code checkin.</p>
<h4>Installing Jenkins</h4>
<p>Let&#8217;s install Jenkins on <em class="ci-app">ci.app</em>.</p>
<pre>
apt-get install jenkins
</pre>
<p>Once installed you should be able to load Jenkins in your browser: at <a href="http://ci.app:8080/">http://ci.app:8080/</a>.</p>
<h4>Adding a new job to Jenkins</h4>
<p>Here you can add a &#8216;job&#8217; by:</p>
<ol>
<li>Selecting &#8216;<a href="http://ci.app:8080/view/All/newJob">New Job</a>&#8216;.</li>
<li>Call the Job name &#8220;Hello World&#8221;.</li>
<li>Select the option &#8216;Build a free-style software project&#8217;.</li>
<li>Save</li>
</ol>
<p>Once created you will be met with a page with a bunch of inputs. We will come back to that in a moment but first we need to add Git support to Jenkins. </p>
<h4>Adding Git support to Jenkins</h4>
<ol>
<li>Go to <a href="http://ci.app:8080/pluginManager/available">http://ci.app:8080/pluginManager/available</a>.</li>
<li>Click on the enable Git Plugin checkbox.</li>
<li>Click install at the bottom of the page.</li>
<li>Return back to your job configuration page (<a href="http://ci.app:8080/job/Hello%20World/configure">http://ci.app:8080/job/Hello World/configure</a>)</li>
<li>Select the Git option under the Source Code Management section.</li>
<li>Add this url into the url field: <code>ssh://git@localhost/data/git/hello_world.git</code></li>
<li>Select the Poll SCM checkbox under Build Triggers and enter: <code>* * * * *</code> (This will make Jenkins check every minute for changes to source files.)</li>
<li>Save the configuration</li>
<li>Click &#8216;build now&#8217; to check everything is working ok.</li>
</ol>
<p>As it stands, the Jenkins job is not being all that useful but we will discover it&#8217;s power later on.</p>
<h3>Deploying your app using Upstart</h3>
<p>Node.js scripts need to be run as daemons for hosting websites, which can make the deployment process a bit fiddly. We can use tools like <a href="http://upstart.ubuntu.com/">Upstart</a> to run and manage node.js scripts.</p>
<h4>Install Upstart</h4>
<pre>
apt-get install upstart
</pre>
<h4>Adding Upstart app configuration</h4>
<p>On <em class="localhost">localhost</em>, add these contents to <code>~/hello_world/hello_world.conf</code></p>
<pre>
#!upstart
description "node.js hello world app server"
author      "James Broad"

start on startup
stop on shutdown

script
    export HOME="/root"

    exec /usr/local/bin/node /data/apps/hello_world/app.js 2>&#038;1 >> /var/log/node.log
end script
</pre>
<p>We will be putting this file into <code>/etc/event.d/hello_world</code> on <em class="int-app">int.app</em> later on. Once in that location you can run <code>sudo start hello_world</code></p>
<h3>Continuously deploying your app</h3>
<p>Now that Jenkins is set up to keep an eye on our files, we can issue it some commands to deploy and run the app.js application.</p>
<p>Let&#8217;s return to <em class="localhost">localhost</em> and add a deployment step to Makefile. This will copy the files needed to install and run our application.<br />
Add these contents to <code>~/hello_world/Makefile</code></p>
<pre>
app_dir = /data/apps/hello_world
temp_install_dir = /tmp/hello_world
deployment_hostname = int.app

install :
	sudo mkdir -p $(app_dir)
	sudo cp ./app.js $(app_dir)/app.js
	sudo cp ./hello_world.conf /etc/event.d/hello_world

deploy :
	# Get rid of old temp installs
	ssh $(deployment_hostname) sudo rm -rf $(temp_install_dir)
	# Copy files over to remote machine
	rsync -r . $(deployment_hostname):$(temp_install_dir)
	# Install our app to the right location
	ssh $(deployment_hostname) cd $(temp_install_dir)\; make install
	ssh $(deployment_hostname) cd $(temp_install_dir)\; make start_app

start_app :
	sudo start  --no-wait -q hello_world
</pre>
<p>Check in and push your changes.</p>
<pre>
git add --all
git commit -m 'adding deployment steps'
git push origin master
</pre>
<h4>Handling environment permissions</h4>
<p>On <em class="int-app">int.app</em> you will NEED to set up your SSH Keys to allow passwordless ssh access and add paswordless sudo rights for the user jenkins so it can carry out tasks that require sudo such as service restarting.</p>
<h4>Passwordless SSH access</h4>
<p>To set up passwordless SSH access for Jenkins, log into <em class="ci-app">ci.app</em> as the user jenkins <code>ssh jenkins@ci.app</code>. Run and complete the prompts:</p>
<pre>
ssh-keygen
</pre>
<p>Copy the output of <code>~/.ssh/id_dsa.pub</code> or <code>~/.ssh/id_rsa.pub</code> (depending on what option you chose) to the file <code>~/.ssh/authorized_keys</code> on <em class="int-app">int.app</em>.</p>
<p>Now SSH to <em class="int-app">int.app</em> and add the jenkins user <code>adduser jenkins</code>, this will be needed for when Jenkins is installing stuff onto <em class="int-app">int.app</em>.</p>
<p>Now we need to log into <em class="ci-app">ci.app</em> as user jenkins to be able to accept the SSH Keys:</p>
<pre>
ssh jenkins@ci.app
ssh jenkins@int.app
exit
exit
</pre>
<h4>Passwordless sudo rights</h4>
<p>For enabling passwordless sudo rights to the jenkins user you will need to run: <code>sudo visudo</code> and append the file with the contents:</p>
<pre>
# Allow Jenkins to run certain commands as sudo without password
jenkins ALL = NOPASSWD: /bin/mkdir, /bin/rm, /bin/cp, /sbin/start, /sbin/stop
</pre>
<h4>Adding shell script stages to Jenkins</h4>
<p>Go to your hello world configuration panel (<a href="http://ci.app:8080/job/Hello%20World">http://ci.app:8080/job/Hello World</a>) and choose &#8216;add build step&#8217; under the Build section.</p>
<ol>
<li>Select &#8216;Execute shell&#8217; and add this line: <code>make deploy</code>.</li>
<li>Save the settings.</li>
<li>Run a build.</li>
</ol>
<p>If everything went according to plan you should be able to load <a href="http://int.app:3000">http://int.app:3000</a> and see the text &#8216;Hello World&#8217;.</p>
<h3>Verifying deployments</h3>
<p>Instead of us having to check the app is running every time a build happens, we can get Jenkins to do that for us by checking a url returns 200 response code.</p>
<p>Lets add a new Freestyle job in Jenkins and call it &#8220;Hello World Monitor&#8221;. Leave everything blank but click the checkbox for Monitor Site and add the url <code>http://int.app:3000/</code>.</p>
<p>We can now return back to our <a href="http://ci.app:8080/job/Hello%20World/configure">Hello World job</a> and check the Build other projects checkbox. Then add <code>Hello World Monitor</code> (it will auto-suggest). Save this configuration and run a build.</p>
<h3>Finally</h3>
<p>If you have made it this far, thanks for reading, hopefully everything went well?</p>
<p>If everything went well, you are in a good place to start adding more Continuous Integration elements such as unit tests, JSLinting and many other automated steps.</p>
<p>There are a number of things I didn&#8217;t go into much depth on such as the node.js app itself, there are plenty of articles out there about how to do this. A good resource worth checking out is <a href="http://howtonode.org/">http://howtonode.org</a>.</p>
<p>Feel free to get in touch if you need any help but be warned I have a busy day job so I may take time to respond.</p>
<p>Image courtesy of <a href="http://www.flickr.com/photos/kulor/4302501803/">Me</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/node/deploying-nodejs-apps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Amber &#8211; Mac Terminal theme</title>
		<link>http://www.carbonsilk.com/development/amber-mac-terminal-theme/</link>
		<comments>http://www.carbonsilk.com/development/amber-mac-terminal-theme/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 00:46:50 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=195</guid>
		<description><![CDATA[I created a terminal theme with a retro look of soft amber tones. I find this really nice to work with and have been using for a couple of months now. Download or fork it on Github. To use: download the amber.terminal file to your computer, open up Terminal.app, go to the preferences, settings tab, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-196" title="amber theme screenshot" src="https://github.com/kulor/Amber-Theme/blob/dbde5f573913e5c2282c94ed405943357cc32061/amber.jpg?raw=true" alt="amber theme screenshot" width="529" height="367" /></p>
<p class="clear">I created a terminal theme with a retro look of soft amber tones. I find this really nice to work with and have been using for a couple of months now. Download or fork it on <a href="http://github.com/kulor/Amber-Theme/tree/master">Github</a>.</p>
<p>To use: download the <a href="http://github.com/kulor/Amber-Theme/blob/dbde5f573913e5c2282c94ed405943357cc32061/amber.terminal">amber.terminal</a> file to your computer, open up Terminal.app, go to the preferences, settings tab, then under the list of themes, click on the settings button and click import, now choose the amber.terminal file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/amber-mac-terminal-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using YQL with PHP</title>
		<link>http://www.carbonsilk.com/development/using-yql-with-php/</link>
		<comments>http://www.carbonsilk.com/development/using-yql-with-php/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 23:18:35 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=70</guid>
		<description><![CDATA[After presenting on PHP, OAuth and Web Services (4th February 2009) it became apparent that the main killer technology was YQL. YQL for those unfamiliar with the acronym is Yahoo Query Language, a SQL like syntax that will let you query a whole host of data sources as if it were a database table. Is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yql/"><img src="http://l.yimg.com/a/i/us/pps/yql128.gif" alt="YQL Logo" /></a>After presenting on <a href="http://www.slideshare.net/kulor/php-oauth-web-services-and-yql">PHP, OAuth and Web Services</a> (4th February 2009) it became apparent that the main killer technology was <a href="http://developer.yahoo.com/yql/"><acronym title="Yahoo Query Language">YQL</acronym></a>. YQL for those unfamiliar with the acronym is Yahoo Query Language, a <acronym title="Simple Query Language">SQL</acronym> like syntax that will let you query a whole host of data sources as if it were a database table.</p>
<p>Is YQL relevant to you? Well if you do any work with web services then definitely, it allows you to pull in multiple data sources, sort, transform, query your data points, to name but a few selling points. It will still be relevant to you if you are familiar with the SQL syntax, as it is actually really fun to play with <a href="http://developer.yahoo.com/yql/console/">using the console</a>, especially if you take the provided example queries as a jump off point to tinker with. To demonstrate how easy we can make things, take a look at this <a href="http://carbonsilk.com/yql_php/yql/search_yahoo/yql">example of a search query</a> using <a href="http://github.com/kulor/yql_php/blob/da559e966663a519f436d0aa9944212582806b98/system/application/controllers/yql.php#L65">this code</a>.</p>
<p>YQL is now becoming even more powerful with a feature called &#8216;Open Tables&#8217; which in essence instructs YQL on how to construct a web service URL. The power of this is that it enables you to interject values from other web service calls via sub selects. Some examples of Open Table definitions and <a href="http://github.com/spullara/yql-tables/blob/dea6b29ff0cd01e06fbaf84b821abf6783138b52/alltables.env">example queries</a> are being constructed at <a href="http://github.com/spullara/yql-tables/">github.com/spullara/yql-tables</a>.</p>
<p>During my talk I demonstrated a lot of the PHP code used to consume the results of the YQL calls which can be found over on <a href="http://github.com/kulor/yql_php/tree/master">my GitHub repository</a> or you can browse my example scripts at <a href="http://carbonsilk.com/yql_php/">http://carbonsilk.com/yql_php/</a>.</p>
<p>To make development in PHP straightforward I used CodeIgniter for it&#8217;s MVC strengths and ease of installation. The beauty of using the framework with YQL and OAuth libraries doing the hard work behind the scenes is that you can write a few simple lines like the following to retrieve instant results:</p>
<pre name="code" class="php">
// Controller method to allow us to access http://someurl.tld/yql_php/search_wikipedia/
function search_wikipedia($term = 'open')
{
    echo '&lt;pre&gt;';
    $yql_query = 'select * from xml where
            url="http://en.wikipedia.org/w/api.php?action=opensearch&amp;search=' . $term . '&amp;format=xml"
            and itemPath = "SearchSuggestion.Section.Item"';
    print_r($this-&gt;yql_lib-&gt;query($yql_query));
}</pre>
<p>The above code is the same query as could be found if you <a href="http://developer.yahoo.com/yql/console/?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fen.wikipedia.org%2Fw%2Fapi.php%3Faction%3Dopensearch%26search%3Dyahoo%26format%3Dxml%22%20and%20itemPath%20%3D%20%22SearchSuggestion.Section.Item%22">view in the provided console</a> or view in my final project <a href="http://carbonsilk.com/yql_php/yql/search_wikipedia/open">Search Wikipedia through YQL</a>.</p>
<p>All I can say from doing this talk and looking deep into YQL is that there is a huge potential at our disposal here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/using-yql-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Panoramic &#8211; open source web template</title>
		<link>http://www.carbonsilk.com/development/panoramic-web-template/</link>
		<comments>http://www.carbonsilk.com/development/panoramic-web-template/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 18:55:16 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[panoramic]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=45</guid>
		<description><![CDATA[View the template It&#8217;s been a while since releasing an open source web template, the last one being Mighty, added back in January of 2007. Mighty was a template created to allow others to take a basic design and allow them to modify most aspects of the template with relative ease (given some CSS understanding). [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Panoramic template design by James Broad, on Flickr" href="http://www.flickr.com/photos/kulor/3089399053/"><img src="http://farm4.static.flickr.com/3252/3089399053_db33e5f9f6.jpg" alt="Panoramic template design" /></a></p>
<p class="clear"><a href="http://www.carbonsilk.com/sandbox/panoramic/index.html">View the template</a></p>
<p>It&#8217;s been a while since releasing an open source web template, the last one being <a href="http://www.oswd.org/design/information/id/3210/">Mighty</a>, added back in January of 2007. Mighty was a template created to allow others to take a basic design and allow them to modify most aspects of the template with relative ease (given some CSS understanding).</p>
<p>Time moved on and the itch arose again to create another open source web template. This time its called Panoramic. Panoramic is the name of the family business and this template design stemmed from a mock for the company I had created some time ago that never got released.</p>
<p><a href="http://github.com/">GitHub</a> seemed the best hosting location for an open source web template, owing to its fantastic interface and functionality and thus Panoramic lives there: <a href="http://github.com/kulor/panoramic/tree/master">http://github.com/kulor/panoramic/tree/master.</a></p>
<p>Having the template hosted on a <a href="http://en.wikipedia.org/wiki/Revision_Control_System">Revision Control System</a> such as GitHub, has many advantages, the main one being that others can contribute to the code and or fork to a version that suits them. Additionally, users downloading the code can always rest assured they are getting the latest code and can see what has changed over time.</p>
<p>If you do use the Panoramic template, please add a comment to this page stating where it is in use, so others can gain inspiration for it&#8217;s uses.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/panoramic-web-template/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to monitor your site status</title>
		<link>http://www.carbonsilk.com/development/monitor-your-site-status/</link>
		<comments>http://www.carbonsilk.com/development/monitor-your-site-status/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 17:36:26 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[siteup]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=44</guid>
		<description><![CDATA[If you are running and administering your own website, the chances are that your reputation relies on you having a stable site, or at least one that your users can reach. The problem is; how often do you check your site is up and running or how you expect it to look? Probably not often. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/petecarr/475437514/"><img src="http://farm1.static.flickr.com/219/475437514_1565355424_m.jpg" alt="Traffic Lights" /></a>If you are running and administering your own website, the chances are that your reputation relies on you having a stable site, or at least one that your users can reach. The problem is; how often do you check your site is up and running or how you expect it to look? Probably not often.</p>
<p class="clear">I have produced a simple script that will let you check your sites are up and running.</p>
<p>The PHP script is hosted on GitHub at <a href="http://github.com/kulor/siteup/tree/master">http://github.com/kulor/siteup/tree/master</a>. You can see the output at <a href="http://carbonsilk.com/sandbox/siteup/">http://carbonsilk.com/sandbox/siteup/</a></p>
<p>To get this script running, you will need to change some of the defaults found in <a href="http://github.com/kulor/siteup/tree/master/index.php">index.php</a> and place both the files in a web accessible directory on your server</p>
<h3>Automating the script</h3>
<p>The best application of this script would be to deploy on your server (<strong>not on the server you are checking is up</strong>) and run on a <a href="http://en.wikipedia.org/wiki/Cron">crontab</a> at a fairly liberal interval (2 hours) to save server overload. To do this:</p>
<p>On your command line:<br />
<code>$ crontab -e</code></p>
<p>This will take you into an editor window. Enter the line below <strong>replacing {$path} with the location of your script</strong><br />
<code>0       */2     *     *     *   php -q /{$path}/siteup/index.php</code></p>
<p>Now you will receive an email if any of your programmed domains are down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/monitor-your-site-status/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

