<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 <title>Purebreeze</title>
 <link href="http://purebreeze.com/atom.xml" rel="self"/>
 <updated>2013-04-29T23:16:32-07:00</updated>
 <id>http://purebreeze.com/</id>
 <author>
   <name>Levent Ali</name>
   <email>levent@purebreeze.com</email>
 </author>
 
 <entry>
   <id>http://purebreeze.com/2012/06/cosmx-update</id>
   <link href="http://purebreeze.com/2012/06/cosmx-update"/>
   <title>CosmX Update</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;There&amp;#8217;s a new release of CosmX (0.2).&lt;/p&gt;

&lt;p&gt;&lt;a href='https://github.com/levent/CosmX/downloads'&gt;Download the latest version from Github&lt;/a&gt; and never download it manually again!&lt;/p&gt;

&lt;p&gt;&lt;img src='http://f.cl.ly/items/3f3j232A1j1j1l1Z4039/Screen%20Shot%202012-06-27%20at%2009.15.24.png' alt='CosmX Auto-Update' /&gt;&lt;/p&gt;

&lt;p&gt;This release comes with an auto-updater which will unleash more of your machine&amp;#8217;s stats.&lt;/p&gt;

&lt;p&gt;Let me know what else you would like CosmX to track.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2012/06/cosmx</id>
   <link href="http://purebreeze.com/2012/06/cosmx"/>
   <title>CosmX</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;CosmX is a menu bar application for Mac OS X that updates a Cosm feed with your system&amp;#8217;s current CPU usage.&lt;/p&gt;

&lt;p&gt;&lt;img src='http://f.cl.ly/items/0x3l323S440U3v2Z2s3L/Screen%20Shot%202012-06-26%20at%2008.00.31.png' alt='CosmX Installer' /&gt;&lt;/p&gt;

&lt;p&gt;It tracks each virtual core as a separate datastream. All you need to do is provide it a Cosm feed id and an api key.&lt;/p&gt;

&lt;p&gt;That&amp;#8217;s all there is to it!&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s &lt;a href='https://cosm.com/feeds/38997'&gt;one of my feeds&lt;/a&gt; using CosmX.&lt;/p&gt;

&lt;p&gt;&lt;a href='https://github.com/levent/CosmX/downloads'&gt;Download CosmX on Github&lt;/a&gt;&lt;/p&gt;</content>
   <updated>2012-06-21T11:04:04-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="cosm objective-c mac" label="cosm objective-c mac" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2012/05/track-google-latitude-with-cosm</id>
   <link href="http://purebreeze.com/2012/05/track-google-latitude-with-cosm"/>
   <title>Track Google Latitude with Cosm</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;I just wrote a little hack to track your Google Latitude Location.&lt;/p&gt;

&lt;h3 id='enable_your_google_public_location_badge'&gt;Enable your &amp;#8216;Google Public Location Badge&amp;#8217;&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;a href='https://www.google.com/latitude/b/0/apps'&gt;Google Public Location Badge&lt;/a&gt;&lt;br /&gt;&lt;img src='http://f.cl.ly/items/0I1D113E130l1W0m0Y2H/Screen%20Shot%202012-05-25%20at%2016.19.39.png' alt='Enable Latitude' /&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Choose &amp;#8216;Enable and show best available location&amp;#8217; or &amp;#8216;Enable and show city-level only&amp;#8217;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Copy your user id (it&amp;#8217;ll be a number like -77777777777)&lt;br /&gt;&lt;img src='http://f.cl.ly/items/21402N1a3e3Q182T3T0d/Screen%20Shot%202012-05-25%20at%2016.22.47.png' alt='HTML snippet' /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id='set_up_an_automatic_feed_on_cosm'&gt;Set up an automatic feed on Cosm&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign up or login to &lt;a href='https://cosm.com'&gt;Cosm&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;Creating an &lt;a href='http://cosm.com/docs/concepts/automatic_manual.html'&gt;automatic feed&lt;/a&gt; using the following url:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;http://cosm-stalkr.herokuapp.com/location/-7777777777 # replacing your user id&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Stalk me &lt;a href='https://cosm.com/feeds/61048'&gt;on Cosm&lt;/a&gt;&lt;/p&gt;</content>
   <updated>2012-05-25T09:10:27-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="hackday" label="hackday" />
   <updated>2012-05-25T09:10:27-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="cosm" label="cosm" />
   <updated>2012-05-25T09:10:27-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="google latitude" label="google latitude" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2012/01/how-to-hackday</id>
   <link href="http://purebreeze.com/2012/01/how-to-hackday"/>
   <title>How to hackday</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;We used to run internal hackdays at Pachube and found them extremely productive. Come to work on Friday, use the &lt;a href='https://pachube.com/docs'&gt;Pachube API&lt;/a&gt;, make something cool and show it at the end of the day. They were always immensely useful for finding bugs and gaps in our API. In fact a single hackday was often better than weeks of R&amp;amp;D, when it came to improving the core product. For some reason they fizzled out over time but we have brought them back in 2012.&lt;/p&gt;

&lt;p&gt;As we are rolling out &lt;a href='http://oauth.net/'&gt;oAuth&lt;/a&gt; soon, I thought having an oAuth themed hackday to kick off the year seemed logical. Others started getting excited about the prospect of the return of hackdays and extended the invitation out to interesting techies passing through London that day.&lt;/p&gt;

&lt;p&gt;Suddenly something changed, as we had inadvertently imposed rules and a certain formality to proceedings. Even though we still managed to debug several issues within our oAuth workflow, the usual level of creativity and fun somewhat died.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;I&amp;#8217;ve had brilliant ideas brewing for weeks but they don&amp;#8217;t fit the theme!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;oAuth sucks!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Who is going to entertain the guests?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Must we form groups to include them?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After thinking about better ways of running them and agreeing with much of &lt;a href='http://programmers.stackexchange.com/a/108383/20931'&gt;this post on stackexchange&lt;/a&gt;, I believe our next internal hackday should follow a few basic guidelines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep it within the team&lt;/li&gt;

&lt;li&gt;Start with everyone in one space at a certain time&lt;/li&gt;

&lt;li&gt;Require no participation or collaboration&lt;/li&gt;

&lt;li&gt;Provide lunch&lt;/li&gt;
&lt;/ul&gt;</content>
   <updated>2012-01-08T00:41:56-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="hackday" label="hackday" />
   <updated>2012-01-08T00:41:56-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="oauth" label="oauth" />
   <updated>2012-01-08T00:41:56-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="pachube" label="pachube" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/09/come-join-pachube</id>
   <link href="http://purebreeze.com/2011/09/come-join-pachube"/>
   <title>Come join Pachube</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;We are hiring and will continue to do so over the next few months.&lt;/p&gt;

&lt;p&gt;As you may or may not know, we were recently &lt;a href='http://blog.pachube.com/2011/07/pachube-just-got-some-rocket-fuel.html'&gt;acquired by LogMeIn&lt;/a&gt;. What this means is that we can finally achieve the targets we’ve been striving to reach.&lt;/p&gt;

&lt;p&gt;The only thing holding us back right now is the size of the team (we are 4 engineers).&lt;/p&gt;

&lt;h3 id='what_have_we_been_working_on'&gt;What have we been working on?&lt;/h3&gt;

&lt;p&gt;&lt;a href='https://pachube.com'&gt;Pachube&lt;/a&gt; is basically an API designed to facilitate the connection of every internet enabled device past, present and future.&lt;/p&gt;

&lt;p&gt;Whether you want to store sensor readings, allow two remote devices to communicate/control each other, aggregate stats from small/large-scale research projects, check if you left the oven on, control traffic light timings based on traffic flow, see the impact of natural phenomena in realtime, study livestock, monitor and control your home, Pachube is the platform that allows all of it to happen.&lt;/p&gt;

&lt;p&gt;However, to fully realise that on a global scale there is a ton of work to be done.&lt;/p&gt;

&lt;p&gt;You can&amp;#8217;t argue that this terribly named world &amp;#8220;The Internet of Things&amp;#8221; is going to be very real very soon. I can guarantee that Pachube are at the forefront and there are few, if any, London based startups that are as exciting and potentially epic as ours is.&lt;/p&gt;

&lt;h3 id='how_can_you_help'&gt;How can you help?&lt;/h3&gt;

&lt;p&gt;We have massive amounts of work to do on the API but we also need to put a tremendous amount of effort onto our web front. We need to create a compelling experience for developers, manufacturers and most importantly anyone else familiar with a browser. We need new ideas and to implement existing ideas in order to shape the IoT at this crucial time in the industry.&lt;/p&gt;

&lt;p&gt;Basically we need to &lt;strong&gt;scale the fuck up&lt;/strong&gt; and &lt;strong&gt;reach the fuck out&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you are interested, think you can help, want to disrupt the future of the internet and are primarily a nice person, we want to hear from you.&lt;/p&gt;

&lt;h3 id='here_are_a_handful_of_our_challenges_interspersed_with_buzzwords'&gt;Here are a handful of our challenges interspersed with buzzwords:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Storing massive amounts of time-series data&lt;/li&gt;

&lt;li&gt;Analysing massive amounts of time-series data&lt;/li&gt;

&lt;li&gt;Handling many many thousands of writes and reads every second&lt;/li&gt;

&lt;li&gt;Making Pachube powered hardware&lt;/li&gt;

&lt;li&gt;Designing social network sites and features&lt;/li&gt;

&lt;li&gt;UX&lt;/li&gt;

&lt;li&gt;Client side programming&lt;/li&gt;

&lt;li&gt;Functional programming&lt;/li&gt;

&lt;li&gt;Developing highly scalable socket / websocket servers (EventMachine / Node.js / Aleph)&lt;/li&gt;

&lt;li&gt;SQL (PostgreSQL)&lt;/li&gt;

&lt;li&gt;NoSQL (HBase / Cassandra / not-MongoDB)&lt;/li&gt;

&lt;li&gt;Continuous integration / automated deployment&lt;/li&gt;

&lt;li&gt;Coding Ruby&lt;/li&gt;

&lt;li&gt;Writing Pachube libraries in JavaScript&lt;/li&gt;

&lt;li&gt;Writing Pachube libraries in all languages&lt;/li&gt;

&lt;li&gt;Building interactive documentation for software developers and hardware makers&lt;/li&gt;

&lt;li&gt;Writing mobile applications for iPhone and Android&lt;/li&gt;

&lt;li&gt;Writing standards for the IoT&lt;/li&gt;

&lt;li&gt;Communicating/educating on the potential of an IoT&lt;/li&gt;

&lt;li&gt;Defining the IoT&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We want front-end developers, software developers and &lt;em&gt;the&lt;/em&gt; devops master now.&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id='questions_interested'&gt;Questions? Interested?&lt;/h3&gt;

&lt;p&gt;Email me or find me on Twitter!&lt;/p&gt;

&lt;h3 id='proof_that_we_are_actually_hiring'&gt;Proof that we are actually hiring&lt;/h3&gt;

&lt;p&gt;&lt;a href='http://community.pachube.com/jobs'&gt;http://community.pachube.com/jobs&lt;/a&gt;&lt;/p&gt;</content>
   <updated>2011-09-06T14:52:44-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="pachube" label="pachube" />
   <updated>2011-09-06T14:52:44-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="iot" label="iot" />
   <updated>2011-09-06T14:52:44-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="ruby" label="ruby" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/04/ruba-and-serge-s-wedding</id>
   <link href="http://purebreeze.com/2011/04/ruba-and-serge-s-wedding"/>
   <title>Ruba and Serge's Wedding</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p class='with-image'&gt;&lt;a href='http://leventali.com/photos/serge-und-niki' title='Serge und Niki'&gt;&lt;img src='http://c1773952.r52.cf0.rackcdn.com/uploads/photo/image/55/medium_5596416480_ebd4e39a94_o.jpg' height='531' alt='Serge und Niki' width='800' /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Disclaimer: That&amp;#8217;s Serge on the left and Niki on the right. Not Serge and Ruba.&lt;/p&gt;</content>
   <updated>2011-04-06T23:53:41-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="photography" label="photography" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/04/pachube-devices-served</id>
   <link href="http://purebreeze.com/2011/04/pachube-devices-served"/>
   <title>Pachube Devices Served</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;Here at &lt;a href='http://www.pachube.com'&gt;Pachube&lt;/a&gt; we&amp;#8217;re great for devices but not so much for people. Whilst our API is a good fit for sensors, Arduino&amp;#8217;s and the like our website is not an enthralling place to be.&lt;/p&gt;

&lt;p&gt;We&amp;#8217;re putting a tremendous effort into changing this around and once we&amp;#8217;re ready it&amp;#8217;s going to open up Pachube&amp;#8217;s possibilities for everyone.&lt;/p&gt;

&lt;p&gt;Many of our recent discussions have revolved around how we open up the wealth of data contained within Pachube, and make it more accessible whilst engaging our users.&lt;/p&gt;

&lt;p&gt;However behind that static façade there really is a tremendous amount going on thanks to the multitude of devices and sensors plugged into us.&lt;/p&gt;

&lt;p&gt;For this week&amp;#8217;s hackday I built a realtime counter that just shows how much information is coming into our system at any moment. It&amp;#8217;s using our Socket Server.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://purebreeze.com/pachube_devices_served'&gt;Pachube Devices Served&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The counter only includes public feeds and each update could include any number of individual datastream updates, so the figures are rather conservative.&lt;/em&gt;&lt;/p&gt;</content>
   <updated>2011-04-01T09:49:28-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="pachube" label="pachube" />
   <updated>2011-04-01T09:49:28-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="ruby" label="ruby" />
   <updated>2011-04-01T09:49:28-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="websockets" label="websockets" />
   <updated>2011-04-01T09:49:28-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="eventmachine" label="eventmachine" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/03/adding-realtime-push-updates-to-agileista-using-juggernaut</id>
   <link href="http://purebreeze.com/2011/03/adding-realtime-push-updates-to-agileista-using-juggernaut"/>
   <title>Adding realtime push updates to Agileista using Juggernaut</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;I built &lt;a href='http://app.agileista.com'&gt;Agileista&lt;/a&gt; years ago. We use it at &lt;a href='http://pachube.com'&gt;Pachube&lt;/a&gt; to manage our backlog and iterations. For some time I&amp;#8217;ve been meaning to add realtime updates to the task board.&lt;/p&gt;

&lt;p&gt;Using the standard pub/sub model I wanted it to work as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User makes an update&lt;/li&gt;

&lt;li&gt;Rails publishes changes to the task board&amp;#8217;s subscriber channel&lt;/li&gt;

&lt;li&gt;Current subscribers instantly receive in their browser&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We built a socket server at work that follows this pattern using EventMachine and RabbitMQ. This time around I wanted to use &lt;a href='http://redis.io'&gt;Redis&lt;/a&gt; and &lt;a href='http://nodejs.org/'&gt;Node.js&lt;/a&gt;. Well this is what Alex MacCaw&amp;#8217;s rewrite of &lt;a href='http://github.com/maccman/juggernaut'&gt;Juggernaut&lt;/a&gt; does. It provides a Ruby interface for publishing messages to Redis. It leverages &lt;a href='http://socket.io'&gt;Socket.IO&lt;/a&gt; which selects the transport mechanism your browser supports (WebSockets, Flash, AJAX long polling etc.). You connect to the Node.js server via JavaScript and you publish messages via Ruby.&lt;/p&gt;

&lt;p&gt;Follow the Juggernaut README and you&amp;#8217;ll be up and running in minutes. I installed Node.js and Redis via homebrew on OS X during development. Here are the steps I took to get that running in production&amp;#8230;&lt;/p&gt;

&lt;h3 id='production_setup_tutorial'&gt;Production setup tutorial:&lt;/h3&gt;

&lt;p&gt;Most of this is one off server configuration. Only a few lines of code were required to modify Agileista, thanks to Juggernaut.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m running Ubuntu 10.04.&lt;/p&gt;

&lt;p&gt;Install Redis&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz&lt;/span&gt;
&lt;span class='go'&gt;tar xzvf redis-2.2.2.tar.gz&lt;/span&gt;
&lt;span class='go'&gt;cd redis-2.2.2&lt;/span&gt;
&lt;span class='go'&gt;make&lt;/span&gt;
&lt;span class='go'&gt;sudo make install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Install Node.js&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;wget http://nodejs.org/dist/node-v0.4.2.tar.gz&lt;/span&gt;
&lt;span class='go'&gt;tar xzvf node-v0.4.2.tar.gz&lt;/span&gt;
&lt;span class='go'&gt;cd node-v0.4.2&lt;/span&gt;
&lt;span class='go'&gt;make&lt;/span&gt;
&lt;span class='go'&gt;sudo make install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Configure the Redis Server via Upstart&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='c'&gt;# /etc/init/redis-server.conf&lt;/span&gt;
description &lt;span class='s2'&gt;&amp;quot;redis server&amp;quot;&lt;/span&gt;

start on runlevel &lt;span class='o'&gt;[&lt;/span&gt;23&lt;span class='o'&gt;]&lt;/span&gt;
stop on shutdown

&lt;span class='nb'&gt;exec &lt;/span&gt;sudo -u rails /path/to/redis-server /path/to/redis.conf

respawn

post-start script
    &lt;span class='c'&gt;# Make a .pid file for monit&lt;/span&gt;
    &lt;span class='nv'&gt;PID&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='sb'&gt;`&lt;/span&gt;status redis-server |egrep -oi &lt;span class='s1'&gt;&amp;#39;([0-9]+)$&amp;#39;&lt;/span&gt; |head -n1&lt;span class='sb'&gt;`&lt;/span&gt;
    &lt;span class='nb'&gt;echo&lt;/span&gt; &lt;span class='nv'&gt;$PID&lt;/span&gt; &amp;gt; /var/run/redis-server.pid
end script

post-stop script
   &lt;span class='c'&gt;# Remove the .pid file used by monit&lt;/span&gt;
   rm -f /var/run/redis-server.pid
end script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Start the Redis server&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;sudo start redis-server&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Configure the Juggernaut server via Upstart&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='c'&gt;# /etc/init/juggernaut.conf&lt;/span&gt;
description &lt;span class='s2'&gt;&amp;quot;node.js server&amp;quot;&lt;/span&gt;
author      &lt;span class='s2'&gt;&amp;quot;lebreeze&amp;quot;&lt;/span&gt;

start on runlevel &lt;span class='o'&gt;[&lt;/span&gt;23&lt;span class='o'&gt;]&lt;/span&gt;
stop on shutdown

script
    &lt;span class='c'&gt;# We found $HOME is needed. Without it, we ran into problems&lt;/span&gt;
    &lt;span class='nb'&gt;export &lt;/span&gt;&lt;span class='nv'&gt;HOME&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;/home/rails&amp;quot;&lt;/span&gt;
    &lt;span class='nb'&gt;cd&lt;/span&gt; /u/apps/juggernaut/current
    &lt;span class='nb'&gt;exec &lt;/span&gt;sudo -u rails node server.js &amp;gt;&amp;gt; /var/log/node.log
end script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Start the Juggernaut server&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='console'&gt;&lt;span class='go'&gt;sudo start juggernaut&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Publish messages onto Redis from your Ruby app&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='c1'&gt;# TaskBoardController&lt;/span&gt;
&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;update&lt;/span&gt;
  &lt;span class='n'&gt;do_stuff_with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='vi'&gt;@task&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
  &lt;span class='no'&gt;Juggernaut&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;publish&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;task_board_&lt;/span&gt;&lt;span class='si'&gt;#{&lt;/span&gt;&lt;span class='vi'&gt;@task_board&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;id&lt;/span&gt;&lt;span class='si'&gt;}&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='vi'&gt;@task&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;as_json&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='k'&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Include the necessary JavaScript files in the view&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='nt'&gt;&amp;lt;script &lt;/span&gt;&lt;span class='na'&gt;src=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;/javascripts/json.js?1300034527&amp;quot;&lt;/span&gt; &lt;span class='na'&gt;type=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class='nt'&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 
&lt;span class='nt'&gt;&amp;lt;script &lt;/span&gt;&lt;span class='na'&gt;src=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;/javascripts/socket_io.js?1300034527&amp;quot;&lt;/span&gt; &lt;span class='na'&gt;type=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class='nt'&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 
&lt;span class='nt'&gt;&amp;lt;script &lt;/span&gt;&lt;span class='na'&gt;src=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;/javascripts/juggernaut.js?1300034527&amp;quot;&lt;/span&gt; &lt;span class='na'&gt;type=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class='nt'&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Connect to the server&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;log&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;data&lt;/span&gt;&lt;span class='p'&gt;){&lt;/span&gt;
  &lt;span class='c1'&gt;// notify&lt;/span&gt;
&lt;span class='p'&gt;};&lt;/span&gt;

&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;update&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;data&lt;/span&gt;&lt;span class='p'&gt;){&lt;/span&gt;
  &lt;span class='c1'&gt;// update the taskboard&lt;/span&gt;
&lt;span class='p'&gt;};&lt;/span&gt;

&lt;span class='kd'&gt;var&lt;/span&gt; &lt;span class='nx'&gt;jug&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='nx'&gt;Juggernaut&lt;/span&gt;&lt;span class='p'&gt;({&lt;/span&gt;&lt;span class='nx'&gt;secure&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;https:&amp;#39;&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='nb'&gt;document&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;location&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;protocol&lt;/span&gt;&lt;span class='p'&gt;)});&lt;/span&gt;

&lt;span class='nx'&gt;jug&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;connect&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(){&lt;/span&gt; &lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Connected&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;});&lt;/span&gt;
&lt;span class='nx'&gt;jug&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;disconnect&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(){&lt;/span&gt; &lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Disconnected&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;});&lt;/span&gt;
&lt;span class='nx'&gt;jug&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;on&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;reconnect&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(){&lt;/span&gt; &lt;span class='nx'&gt;log&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;Reconnecting&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;});&lt;/span&gt;

&lt;span class='nx'&gt;jug&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;subscribe&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s2'&gt;&amp;quot;task_board_NN&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kd'&gt;function&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;data&lt;/span&gt;&lt;span class='p'&gt;){&lt;/span&gt;
  &lt;span class='nx'&gt;update&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nx'&gt;data&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
&lt;span class='p'&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Monitor Redis and Juggernaut server via monit (extra credit)&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;sudo vim /etc/monit/monitrc

&lt;span class='c'&gt;# monitrc&lt;/span&gt;
check process redis with pidfile /var/run/redis-server.pid
  start &lt;span class='nv'&gt;program&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;/sbin/start redis-server&amp;quot;&lt;/span&gt;
  stop &lt;span class='nv'&gt;program&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;/sbin/stop redis-server&amp;quot;&lt;/span&gt;
  &lt;span class='k'&gt;if &lt;/span&gt;failed host 127.0.0.1 port 6379 &lt;span class='k'&gt;then &lt;/span&gt;restart
  &lt;span class='k'&gt;if &lt;/span&gt;5 restarts within 5 cycles &lt;span class='k'&gt;then &lt;/span&gt;timeout

check host nodejs with address 127.0.0.1
  start &lt;span class='nv'&gt;program&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;/sbin/start juggernaut&amp;quot;&lt;/span&gt;
  stop &lt;span class='nv'&gt;program&lt;/span&gt;  &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;/sbin/stop juggernaut&amp;quot;&lt;/span&gt;
  &lt;span class='k'&gt;if &lt;/span&gt;failed port 8080 protocol HTTP
    request /
    with timeout 10 seconds
    &lt;span class='k'&gt;then &lt;/span&gt;restart
&lt;span class='c'&gt;# end monitrc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content>
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="node.js" label="node.js" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="ruby" label="ruby" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="juggernaut" label="juggernaut" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="rails" label="rails" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="monit" label="monit" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="redis" label="redis" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="rabbitmq" label="rabbitmq" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="eventmachine" label="eventmachine" />
   <updated>2011-03-13T10:59:56-07:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="ubuntu" label="ubuntu" />
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/03/global-internet-of-things-day</id>
   <link href="http://purebreeze.com/2011/03/global-internet-of-things-day"/>
   <title>Global Internet of Things Day</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;April 9 2011 is Global Internet of Things Day.&lt;/p&gt;

&lt;p&gt;Stay tuned as we will be hosting a mega-hack-a-thon in London.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <id>http://purebreeze.com/2011/01/pachube-hackday-I</id>
   <link href="http://purebreeze.com/2011/01/pachube-hackday-I"/>
   <title>Pachube hack day I: Arduino and Pachube</title>
   <author>
     <name>Levent Ali</name>
     <email>levent@purebreeze.com</email>
   </author>
   <content type="html">&lt;p&gt;This year at Connected Environments we have dedicated Fridays as &amp;#8216;hack-days&amp;#8217;. The rules are fairly simple: &amp;#8220;build something using Pachube and eat food&amp;#8221;. During the first one I decided to play with an &lt;a href='http://www.arduino.cc/'&gt;Arduino&lt;/a&gt; as I had never touched one in my life. I also had no idea what a circuit was.&lt;/p&gt;

&lt;p&gt;After a quick download and install of &lt;a href='http://arduino.cc/en/Main/Software'&gt;the Arduino IDE&lt;/a&gt; (plus the USB driver for OS X), Neill gave me an introduction to circuits, resistors and resistive sensors. We also drew fake electronic symbols and probed our surroundings with multimeters.&lt;/p&gt;

&lt;p&gt;Playing around with some of the sample projects in the IDE quickly shows how easy it is to program the Arduino and what an incredible platform it really is. We soon built a crude circuit that modified an LED&amp;#8217;s intensity based on the ambient light reading.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://c0972802.cdn.cloudfiles.rackspacecloud.com/hack_day_i/basic_circuit.jpg' title='Light sensor circuit'&gt;See a picture of one of our innovative designs&lt;/a&gt;&lt;/p&gt;

&lt;h3 id='time_to_talk_to_pachube'&gt;Time to talk to Pachube&lt;/h3&gt;

&lt;p&gt;The idea was to register an account on &lt;a href='http://pachube.com'&gt;pachube.com&lt;/a&gt;, create a new feed and have the Arduino send the light sensor reading directly to Pachube using our api key.&lt;/p&gt;

&lt;p&gt;To my surprise and slight embarassment, I discovered that the Arduino IDE comes with sample code for connecting an Arduino with an ethernet shield to Pachube. In fact the example code does &lt;em&gt;everything&lt;/em&gt; required.&lt;/p&gt;

&lt;p&gt;&lt;img src='http://f.cl.ly/items/2c1S013N2f360B1p0F20/Screen%20shot%202011-01-14%20at%2014.25.23.png' alt='Pachube Client' /&gt;&lt;/p&gt;

&lt;p&gt;As my sensor reading was being made over analog 0, the only modifications made to my script were to enter the feed id, my api key, plus the mac address and ip address of the ethernet shield.&lt;/p&gt;
&lt;script src='https://gist.github.com/800447.js?file=ArduinoPachubeClient.pde'&gt;

&lt;/script&gt;
&lt;p&gt;&lt;em&gt;Note: a couple of things threw me: the sample ip address is 192.169 instead of 192.168 and Pachube&amp;#8217;s ip address has changed to 173.203.98.29 (even though we&amp;#8217;ve kept the old one). We&amp;#8217;ll try and get this updated in a future releases of the Arduino IDE.&lt;/em&gt;&lt;/p&gt;

&lt;h3 id='in_conclusion'&gt;In conclusion&lt;/h3&gt;

&lt;p&gt;Attach a battery and a weatherproof enclosure and you have the beginnings of an internet enabled weather station.&lt;/p&gt;</content>
   <updated>2011-01-26T09:11:17-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="pachube" label="pachube" />
   <updated>2011-01-26T09:11:17-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="ruby" label="ruby" />
   <updated>2011-01-26T09:11:17-08:00</updated>
   <category scheme="http://purebreeze.com/tags/" term="arduino" label="arduino" />
 </entry>
 
</feed>
